@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
153 lines (152 loc) • 5.16 kB
JavaScript
import { jsxs as o, jsx as e } from "react/jsx-runtime";
import { useIntl as l, FormattedMessage as n } from "react-intl";
import p from "../../components/builder/label.js";
import d from "../../components/builder/description.js";
import f from "../../components/builder/tooltip.js";
import "react";
import "../../context.js";
import { Tabs as u, TabList as h, Tab as c, TabPanel as i } from "../../components/formio/tabs.js";
import "clsx";
import { useErrorChecker as b } from "../../utils/errors.js";
/* empty css */
import "@floating-ui/react";
/* empty css */
import "formik";
import "@formio/vanilla-text-mask";
import "formiojs";
import "lodash";
/* empty css */
import "react-select";
import "dompurify";
import "../../components/formio/datagrid.js";
import { LABELS as a } from "../../components/builder/messages.js";
import g, { useDeriveComponentKey as y } from "../../components/builder/key.js";
import T from "../../components/builder/multiple.js";
import E from "../../components/builder/hidden.js";
import F from "../../components/builder/clear-on-hide.js";
import C from "../../components/builder/is-sensitive-data.js";
import M from "../../components/builder/presentation-config.js";
import "@ckeditor/ckeditor5-react";
import "../../components/CKEditor.js";
/* empty css */
import S from "../../components/builder/simple-conditional.js";
import w from "../../components/builder/validate/required.js";
import "react-use";
import v, { useManageValidatorsTranslations as x } from "../../components/builder/validate/i18n.js";
import D from "../../components/builder/validate/soft-required.js";
import "../../components/builder/prefill/identifierRole.js";
import { ComponentTranslations as I } from "../../components/builder/i18n.js";
import { Basic as L, Advanced as R, Validation as V, Registration as q, Translations as P } from "../../components/builder/tabs.js";
import "@open-formulieren/monaco-json-editor";
import "../../components/builder/values/values-src.js";
/* empty css */
import K from "./file-tab.js";
import O from "./registration-tab.js";
const j = () => {
const t = l(), [s, m] = y(), {
hasAnyError: r
} = b();
return x(["required"]), /* @__PURE__ */ o(u, { children: [
/* @__PURE__ */ o(h, { children: [
/* @__PURE__ */ e(L, { hasErrors: r("label", "key", "description", "tooltip", "showInSummary", "showInEmail", "showInPDF", "multiple", "hidden", "clearOnHide", "isSensitiveData") }),
/* @__PURE__ */ e(R, { hasErrors: r("conditional") }),
/* @__PURE__ */ e(V, { hasErrors: r("validate") }),
/* @__PURE__ */ e(c, { hasErrors: r("file", "useConfigFiletypes", "of", "fileMaxSize", "maxNumberOfFiles"), children: /* @__PURE__ */ e(n, { id: "UxTJsK", defaultMessage: [{
type: 0,
value: "File"
}] }) }),
/* @__PURE__ */ e(q, { hasErrors: r("registration") }),
/* @__PURE__ */ e(P, { hasErrors: r("openForms.translations") })
] }),
/* @__PURE__ */ o(i, { children: [
/* @__PURE__ */ e(p, {}),
/* @__PURE__ */ e(g, { isManuallySetRef: s, generatedValue: m }),
/* @__PURE__ */ e(d, {}),
/* @__PURE__ */ e(f, {}),
/* @__PURE__ */ e(M, {}),
/* @__PURE__ */ e(T, { updateDefaultValue: !1 }),
/* @__PURE__ */ e(E, {}),
/* @__PURE__ */ e(F, {}),
/* @__PURE__ */ e(C, {})
] }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(S, {}) }),
/* @__PURE__ */ o(i, { children: [
/* @__PURE__ */ e(w, {}),
/* @__PURE__ */ e(D, {}),
/* @__PURE__ */ e(v, {})
] }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(K, {}) }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(O, {}) }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(I, { propertyLabels: {
label: t.formatMessage(a.label),
description: t.formatMessage(a.description),
tooltip: t.formatMessage(a.tooltip)
} }) })
] });
};
j.defaultValues = {
// basic tab
label: "",
key: "",
description: "",
tooltip: "",
showInSummary: !0,
showInEmail: !1,
showInPDF: !0,
multiple: !1,
hidden: !1,
clearOnHide: !0,
isSensitiveData: !0,
// Advanced tab
conditional: {
show: void 0,
when: "",
eq: ""
},
// Validation tab
validate: {
required: !1
},
translatedErrors: {},
openForms: {
softRequired: !1,
translations: {}
},
// file tab
file: {
name: "",
type: [],
allowedTypesLabels: []
},
filePattern: "*",
useConfigFiletypes: !0,
of: {
image: {
resize: {
apply: !1,
width: 2e3,
height: 2e3
}
}
},
fileMaxSize: "10MB",
maxNumberOfFiles: null,
// registration tab
registration: {
bronorganisatie: "",
docVertrouwelijkheidaanduiding: "",
titel: "",
documentType: {
catalogue: {
domain: "",
rsin: ""
},
description: ""
},
// deprecated
informatieobjecttype: ""
}
};
export {
j as default
};