@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
95 lines (94 loc) • 3.39 kB
JavaScript
import { jsxs as t, jsx as e } from "react/jsx-runtime";
import { useIntl as m, FormattedMessage as n } from "react-intl";
import l from "../../components/builder/label.js";
import { Tabs as p, TabList as d, TabPanel as i } from "../../components/formio/tabs.js";
import "clsx";
import { useErrorChecker as f } from "../../utils/errors.js";
/* empty css */
import "@floating-ui/react";
import "react";
/* empty css */
import "formik";
import "../../context.js";
import "@formio/vanilla-text-mask";
import "formiojs";
import c from "../../components/formio/checkbox.js";
import "lodash";
/* empty css */
import "react-select";
import "dompurify";
import "../../components/formio/datagrid.js";
import { LABELS as h } from "../../components/builder/messages.js";
import u from "../../components/builder/tooltip.js";
import b, { useDeriveComponentKey as y } from "../../components/builder/key.js";
import H from "../../components/builder/hidden.js";
import g from "../../components/builder/clear-on-hide.js";
import "@ckeditor/ckeditor5-react";
import "../../components/CKEditor.js";
/* empty css */
import C from "../../components/builder/simple-conditional.js";
import "react-use";
import "../../components/builder/prefill/identifierRole.js";
import { ComponentTranslations as T } from "../../components/builder/i18n.js";
import { Basic as E, Advanced as L, Translations as M } from "../../components/builder/tabs.js";
import "@open-formulieren/monaco-json-editor";
import "../../components/builder/values/values-src.js";
/* empty css */
const v = () => {
const a = m(), [o, s] = y(), {
hasAnyError: r
} = f();
return /* @__PURE__ */ t(p, { children: [
/* @__PURE__ */ t(d, { children: [
/* @__PURE__ */ e(E, { hasErrors: r("label", "key", "tooltip", "hidden", "clearOnHide", "hideHeader") }),
/* @__PURE__ */ e(L, { hasErrors: r("conditional") }),
/* @__PURE__ */ e(M, { hasErrors: r("openForms.translations") })
] }),
/* @__PURE__ */ t(i, { children: [
/* @__PURE__ */ e(l, {}),
/* @__PURE__ */ e(b, { isManuallySetRef: o, generatedValue: s }),
/* @__PURE__ */ e(u, {}),
/* @__PURE__ */ e(H, {}),
/* @__PURE__ */ e(g, {}),
/* @__PURE__ */ e(k, {})
] }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(C, {}) }),
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(T, { propertyLabels: {
label: a.formatMessage(h.label)
// FIXME: should be translatable in the type
// tooltip: intl.formatMessage(LABELS.tooltip),
} }) })
] });
};
v.defaultValues = {
components: [],
// basic tab
label: "",
key: "",
tooltip: "",
hidden: !1,
clearOnHide: !0,
hideHeader: !1,
// Advanced tab
conditional: {
show: void 0,
when: "",
eq: ""
}
};
const k = () => {
const o = m().formatMessage({
id: "unjdIB",
defaultMessage: [{
type: 0,
value: "Do not display the configured label and top line as the header in the fieldset."
}]
});
return /* @__PURE__ */ e(c, { name: "hideHeader", label: /* @__PURE__ */ e(n, { id: "2Lg8Vc", defaultMessage: [{
type: 0,
value: "Hide fieldset header"
}] }), tooltip: o });
};
export {
v as default
};