@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
254 lines (253 loc) • 8.7 kB
JavaScript
import { jsxs as a, jsx as e } from "react/jsx-runtime";
import { defineMessage as l, useIntl as r, FormattedMessage as i } from "react-intl";
import c from "../../components/builder/label.js";
import v from "../../components/builder/description.js";
import M from "../../components/builder/tooltip.js";
import "react";
import "../../context.js";
import { Tabs as y, TabList as R, Tab as w, TabPanel as s } from "../../components/formio/tabs.js";
import "clsx";
import { useErrorChecker as A } from "../../utils/errors.js";
/* empty css */
import "@floating-ui/react";
/* empty css */
import { TextFieldMultiple as p } from "../../components/formio/textfield.js";
import d from "../../components/formio/checkbox.js";
import "formik";
import L from "../../components/formio/panel.js";
import "react-select";
import "dompurify";
import "../../components/formio/datagrid.js";
import { LABELS as n } from "../../components/builder/messages.js";
import E, { useDeriveComponentKey as T } from "../../components/builder/key.js";
import x from "../../components/builder/hidden.js";
import C from "../../components/builder/clear-on-hide.js";
import S from "../../components/builder/is-sensitive-data.js";
import "formiojs";
import "@ckeditor/ckeditor5-react";
import "../../components/CKEditor.js";
/* empty css */
import "react-use";
import "../addressNL/edit.js";
import "../validation.js";
/* empty css */
import "../bsn/edit.js";
import "../checkbox/edit.js";
import "../children/edit.js";
import "../columns/edit.js";
import "zod";
/* empty css */
import "../content/edit.js";
import "../cosignV1/edit.js";
import "../cosignV2/edit.js";
import "../cosignV2/edit-validation.js";
import "../currency/edit.js";
import "../currency/edit-validation.js";
import "../customerProfile/edit.js";
import "../customerProfile/edit-validation.js";
import "../customerProfile/preview.js";
import "../date/edit.js";
import "../date/edit-validation.js";
import "../datetime/edit.js";
import "../datetime/edit-validation.js";
/* empty css */
import "../email/edit.js";
import "../email/edit-validation.js";
/* empty css */
import "../fieldset/edit.js";
import "../file/edit.js";
import "../file/edit-validation.js";
import "../iban/edit.js";
import "../iban/edit-validation.js";
import "../licenseplate/edit.js";
import "../licenseplate/edit-validation.js";
import "proj4leaflet";
import "../map/edit.js";
import "@open-formulieren/leaflet-tools/lib/tiles.js";
import "@open-formulieren/leaflet-tools";
import "react-leaflet";
import "react-leaflet-draw";
/* empty css */
import "../npFamilyMembers/edit.js";
import "../number/edit.js";
import "../number/edit-validation.js";
import "../partners/edit.js";
import "../phonenumber/edit.js";
import "../postcode/edit.js";
import "../postcode/edit-validation.js";
import "../radio/edit.js";
import "../select/edit.js";
import "../selectboxes/edit.js";
import "../signature/edit.js";
import "lodash";
import "react-signature-canvas";
import "../softRequiredErrors/edit.js";
import "../textarea/edit.js";
import "../textarea/edit-validation.js";
import "../textfield/edit.js";
import "../time/edit.js";
import D from "../../components/builder/validate/required.js";
import H from "../../components/builder/validate/maxlength.js";
import "../../components/builder/prefill/identifierRole.js";
import { ComponentTranslations as O } from "../../components/builder/i18n.js";
import { Basic as B, Validation as V, Translations as _ } from "../../components/builder/tabs.js";
import "@open-formulieren/monaco-json-editor";
import "../../components/builder/values/values-src.js";
/* empty css */
const u = l({
id: "ehP4dQ",
defaultMessage: [{
type: 0,
value: "Group label"
}]
}), f = l({
id: "rkJLBr",
defaultMessage: [{
type: 0,
value: "'Add another' text"
}]
}), h = l({
id: "eUowhH",
defaultMessage: [{
type: 0,
value: "'Save row' text"
}]
}), b = l({
id: "AyOwJl",
defaultMessage: [{
type: 0,
value: "'Remove row' text"
}]
}), k = () => {
const t = r(), [o, g] = T(), {
hasAnyError: m
} = A();
return /* @__PURE__ */ a(y, { children: [
/* @__PURE__ */ a(R, { children: [
/* @__PURE__ */ e(B, { hasErrors: m("label", "key", "groupLabel", "description", "tooltip", "hidden", "clearOnHide", "isSensitiveData", "hideLabel") }),
/* @__PURE__ */ e(w, { hasErrors: m("disableAddingRemovingRows", "addAnother", "saveRow", "removeRow"), children: /* @__PURE__ */ e(i, { id: "d3V6A+", defaultMessage: [{
type: 0,
value: "Display"
}] }) }),
/* @__PURE__ */ e(V, { hasErrors: m("validate") }),
/* @__PURE__ */ e(_, { hasErrors: m("openForms.translations") })
] }),
/* @__PURE__ */ a(s, { children: [
/* @__PURE__ */ e(c, {}),
/* @__PURE__ */ e(E, { isManuallySetRef: o, generatedValue: g }),
/* @__PURE__ */ e(v, {}),
/* @__PURE__ */ e(M, {}),
/* @__PURE__ */ e(I, {}),
/* @__PURE__ */ e(x, {}),
/* @__PURE__ */ e(C, {}),
/* @__PURE__ */ e(S, {}),
/* @__PURE__ */ e(K, {})
] }),
/* @__PURE__ */ a(s, { children: [
/* @__PURE__ */ e(P, {}),
/* @__PURE__ */ a(L, { collapsible: !0, initialCollapsed: !0, title: /* @__PURE__ */ e(i, { id: "E/biiX", defaultMessage: [{
type: 0,
value: "Button labels"
}] }), children: [
/* @__PURE__ */ e(F, {}),
/* @__PURE__ */ e(W, {}),
/* @__PURE__ */ e(G, {})
] })
] }),
/* @__PURE__ */ a(s, { children: [
/* @__PURE__ */ e(D, {}),
/* @__PURE__ */ e(H, {})
] }),
/* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(O, { propertyLabels: {
label: t.formatMessage(n.label),
description: t.formatMessage(n.description),
tooltip: t.formatMessage(n.tooltip),
groupLabel: t.formatMessage(u),
addAnother: t.formatMessage(f),
saveRow: t.formatMessage(h),
removeRow: t.formatMessage(b)
} }) })
] });
};
k.defaultValues = {
components: [],
// basic tab
label: "",
key: "",
groupLabel: "Item",
description: "",
tooltip: "",
hidden: !1,
clearOnHide: !0,
isSensitiveData: !1,
hideLabel: !1,
// display tab
disableAddingRemovingRows: !1,
addAnother: "",
saveRow: "",
removeRow: "Cancel"
};
const I = () => {
const o = r().formatMessage({
id: "VhCwEK",
defaultMessage: [{
type: 0,
value: "The label that will be shown above each repeating group in the summary page, the submission report and the confirmation email. The index of the item will be added next to it, i.e. if you enter 'Item' it will be displayed as 'Item 1', 'Item 2', ..."
}]
});
return /* @__PURE__ */ e(p, { name: "groupLabel", label: /* @__PURE__ */ e(i, { ...u }), tooltip: o });
}, K = () => {
const o = r().formatMessage({
id: "fagx6e",
defaultMessage: [{
type: 0,
value: "Hide the title/label of this component in the form."
}]
});
return /* @__PURE__ */ e(d, { name: "hideLabel", label: /* @__PURE__ */ e(i, { id: "dWWO3N", defaultMessage: [{
type: 0,
value: "Hide label"
}] }), tooltip: o });
}, P = () => {
const o = r().formatMessage({
id: "AMqUHx",
defaultMessage: [{
type: 0,
value: "Check if you want to hide/disable the 'Add Another' and 'Remove row' buttons."
}]
});
return /* @__PURE__ */ e(d, { name: "disableAddingRemovingRows", label: /* @__PURE__ */ e(i, { id: "MTdKuN", defaultMessage: [{
type: 0,
value: "Disable adding or removing groups"
}] }), tooltip: o });
}, F = () => {
const o = r().formatMessage({
id: "o83CBr",
defaultMessage: [{
type: 0,
value: "Set the text of the 'Add Another' button."
}]
});
return /* @__PURE__ */ e(p, { name: "addAnother", label: /* @__PURE__ */ e(i, { ...f }), tooltip: o });
}, W = () => {
const o = r().formatMessage({
id: "/stTVr",
defaultMessage: [{
type: 0,
value: "Set the text of the 'Save row' button."
}]
});
return /* @__PURE__ */ e(p, { name: "saveRow", label: /* @__PURE__ */ e(i, { ...h }), tooltip: o });
}, G = () => {
const o = r().formatMessage({
id: "gCQtSJ",
defaultMessage: [{
type: 0,
value: "Set the text of the 'Remove row' button."
}]
});
return /* @__PURE__ */ e(p, { name: "removeRow", label: /* @__PURE__ */ e(i, { ...b }), tooltip: o });
};
export {
k as default
};