@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
141 lines (140 loc) • 5.31 kB
JavaScript
import { jsxs as o, jsx as r } from "react/jsx-runtime";
import { useFormikContext as p } from "formik";
import { useContext as f } from "react";
import { useIntl as m, FormattedMessage as d } from "react-intl";
import u 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 y, TabPanel as e } from "../../components/formio/tabs.js";
import "clsx";
import { useErrorChecker as E } from "../../utils/errors.js";
/* empty css */
import "@floating-ui/react";
/* empty css */
import { TextFieldMultiple as T } from "../../components/formio/textfield.js";
import "lodash";
/* empty css */
import "react-select";
import "dompurify";
import "../../components/formio/datagrid.js";
import { LABELS as a } from "../../components/builder/messages.js";
import C, { useDeriveComponentKey as M } from "../../components/builder/key.js";
import v from "../../components/builder/multiple.js";
import S from "../../components/builder/hidden.js";
import V from "../../components/builder/clear-on-hide.js";
import w from "../../components/builder/is-sensitive-data.js";
import x from "../../components/builder/readonly.js";
import D from "../../components/builder/presentation-config.js";
import "formiojs";
import "@ckeditor/ckeditor5-react";
import "../../components/CKEditor.js";
/* empty css */
import F from "../../components/builder/simple-conditional.js";
import I from "../../components/builder/validate/required.js";
import P from "../../components/builder/validate/validator-select.js";
import R, { useManageValidatorsTranslations as L } from "../../components/builder/validate/i18n.js";
import k from "../../components/builder/registration/registration-attribute.js";
import { PrefillConfiguration as q } from "../../components/builder/prefill/index.js";
import { ComponentTranslations as A } from "../../components/builder/i18n.js";
import { Basic as H, Advanced as K, Validation as O, Registration as B, Prefill as j, Translations as J } from "../../components/builder/tabs.js";
import "@open-formulieren/monaco-json-editor";
import "react-use";
import "../../components/builder/values/values-src.js";
/* empty css */
const z = () => {
const i = m(), [l, s] = M(), {
values: n
} = p(), {
hasAnyError: t
} = E();
return L(["required"]), /* @__PURE__ */ o(g, { children: [
/* @__PURE__ */ o(y, { children: [
/* @__PURE__ */ r(H, { hasErrors: t("label", "key", "description", "tooltip", "showInSummary", "showInEmail", "showInPDF", "multiple", "hidden", "clearOnHide", "isSensitiveData", "defaultValue", "disabled") }),
/* @__PURE__ */ r(K, { hasErrors: t("conditional") }),
/* @__PURE__ */ r(O, { hasErrors: t("validate") }),
/* @__PURE__ */ r(B, { hasErrors: t("registration") }),
/* @__PURE__ */ r(j, { hasErrors: t("prefill") }),
/* @__PURE__ */ r(J, { hasErrors: t("openForms.translations") })
] }),
/* @__PURE__ */ o(e, { children: [
/* @__PURE__ */ r(u, {}),
/* @__PURE__ */ r(C, { isManuallySetRef: l, generatedValue: s }),
/* @__PURE__ */ r(c, {}),
/* @__PURE__ */ r(h, {}),
/* @__PURE__ */ r(D, {}),
/* @__PURE__ */ r(v, {}),
/* @__PURE__ */ r(S, {}),
/* @__PURE__ */ r(V, {}),
/* @__PURE__ */ r(w, {}),
/* @__PURE__ */ r(G, { multiple: !!n.multiple }),
/* @__PURE__ */ r(x, {})
] }),
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(F, {}) }),
/* @__PURE__ */ o(e, { children: [
/* @__PURE__ */ r(I, {}),
/* @__PURE__ */ r(P, {}),
/* @__PURE__ */ r(R, {})
] }),
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(k, {}) }),
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(q, {}) }),
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(A, { propertyLabels: {
label: i.formatMessage(a.label),
description: i.formatMessage(a.description),
tooltip: i.formatMessage(a.tooltip)
} }) })
] });
};
z.defaultValues = {
// basic tab
label: "",
key: "",
description: "",
tooltip: "",
showInSummary: !0,
showInEmail: !1,
showInPDF: !0,
multiple: !1,
hidden: !1,
clearOnHide: !0,
isSensitiveData: !0,
defaultValue: "",
disabled: !1,
// Advanced tab
conditional: {
show: void 0,
when: "",
eq: ""
},
// Validation tab
validate: {
required: !1,
plugins: []
},
translatedErrors: {},
registration: {
attribute: ""
},
prefill: {
plugin: "",
attribute: "",
identifierRole: "main"
}
};
const G = ({
multiple: i
}) => {
const l = m(), {
formType: s
} = f(b), n = l.formatMessage({
id: "FffJxu",
defaultMessage: [{
type: 0,
value: "This will be the initial value for this field before user interaction."
}]
});
return s === "appointment" ? null : /* @__PURE__ */ r(T, { name: "defaultValue", label: /* @__PURE__ */ r(d, { ...a.defaultValue }), tooltip: n, multiple: i, inputMask: "999999999" });
};
export {
z as default
};