UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

160 lines (159 loc) 6.07 kB
import { jsxs as c, Fragment as v, jsx as e } from "react/jsx-runtime"; import { useContext as g } from "react"; import { useIntl as r, FormattedMessage as o } from "react-intl"; import { useAsync as f } from "react-use"; import "../../components/formio/tabs.js"; import "clsx"; import "formik"; /* empty css */ import "@floating-ui/react"; /* empty css */ import { TextFieldMultiple as l } from "../../components/formio/textfield.js"; import { BuilderContext as m } from "../../context.js"; import d from "../../components/formio/panel.js"; import h from "../../components/formio/select.js"; import "dompurify"; import "../../components/formio/datagrid.js"; const M = (a) => { const s = a.map((t) => ({ groupLabel: [t.backendLabel, t.catalogueLabel].filter(Boolean).join(" > "), value: t.url, label: t.description })).reduce((t, n) => { const { groupLabel: p, value: y, label: b } = n; return t[p] || (t[p] = []), t[p].push({ value: y, label: b }), t; }, {}); return Object.entries(s).map(([t, n]) => ({ label: t, options: n })); }, T = () => { const a = r(), { getDocumentTypes: i } = g(m), { value: s, loading: u, error: t } = f(async () => await i(), []); if (t) throw t; const n = a.formatMessage({ id: "5y8Yt4", defaultMessage: [{ type: 0, value: "Save the attachment in the Documents API with this InformatieObjectType. If unspecified, the registration plugin defaults are used." }] }); return /* @__PURE__ */ e(h, { name: "registration.informatieobjecttype", label: /* @__PURE__ */ e(o, { id: "fY/8xt", defaultMessage: [{ type: 0, value: "Information object type" }] }), tooltip: n, isLoading: u, isClearable: !0, options: M(s || []) }); }, I = () => { const a = r(); return /* @__PURE__ */ c(d, { title: /* @__PURE__ */ e(o, { id: "3leP68", defaultMessage: [{ type: 0, value: "Document type" }] }), tooltip: a.formatMessage({ id: "2KY/BC", defaultMessage: [{ type: 0, value: "Specify the document type to use for the file uploads when sending them to the Documents API. The direct URL references are replaced with references to the catalogue and document type description." }] }), children: [ /* @__PURE__ */ e("div", { className: "alert alert-info", children: /* @__PURE__ */ e(o, { id: "wqhr+0", defaultMessage: [{ type: 0, value: "Specify either none or all three of the fields below to configure the document type to use." }] }) }), /* @__PURE__ */ e(l, { name: "registration.documentType.catalogue.domain", label: /* @__PURE__ */ e(o, { id: "bh2ky5", defaultMessage: [{ type: 0, value: "Catalogus domain" }] }), tooltip: /* @__PURE__ */ e(o, { id: "/xFb1n", defaultMessage: [{ type: 0, value: "The 'domein' attribute for the Catalogus resource in the Catalogi API." }] }) }), /* @__PURE__ */ e(l, { name: "registration.documentType.catalogue.rsin", label: /* @__PURE__ */ e(o, { id: "c770ER", defaultMessage: [{ type: 0, value: "Catalogus RSIN" }] }), tooltip: /* @__PURE__ */ e(o, { id: "1andg+", defaultMessage: [{ type: 0, value: "The 'rsin' attribute for the Catalogus resource in the Catalogi API." }] }) }), /* @__PURE__ */ e(l, { name: "registration.documentType.description", label: /* @__PURE__ */ e(o, { id: "J1zTQz", defaultMessage: [{ type: 0, value: "Document type description" }] }), tooltip: /* @__PURE__ */ e(o, { id: "uOtaSP", defaultMessage: [{ type: 0, value: "The document type will be retrieved in the specified catalogue. The version will automatically be selected based on the submission completion timestamp. When used with ZGW APIs, ensure that the document type belongs to the specified case type!" }] }) }), /* @__PURE__ */ e(d, { title: /* @__PURE__ */ e(o, { id: "hAc9vQ", defaultMessage: [{ type: 0, value: "Legacy" }] }), tooltip: a.formatMessage({ id: "oiB6Kg", defaultMessage: [{ type: 0, value: "The direct URL configuration is scheduled for removal. If both the URL and the fields above are configured, the new configuration is used." }] }), collapsible: !0, initialCollapsed: !0, children: /* @__PURE__ */ e(T, {}) }) ] }); }, C = () => { const i = r().formatMessage({ id: "yQUV3M", defaultMessage: [{ type: 0, value: "RSIN of the organization which creates the ENKELVOUDIGINFORMATIEOBJECT." }] }); return /* @__PURE__ */ e(l, { name: "registration.bronorganisatie", label: /* @__PURE__ */ e(o, { id: "nW5g1S", defaultMessage: [{ type: 0, value: "Bronorganisatie" }] }), tooltip: i, inputMode: "numeric" }); }, L = () => { const a = r(), { getConfidentialityLevels: i } = g(m), { value: s, loading: u, error: t } = f(async () => await i(), []); if (t) throw t; const n = a.formatMessage({ id: "vlY36U", defaultMessage: [{ type: 0, value: "Indication of the level to which extent the INFORMATIEOBJECT is meant to be public." }] }); return /* @__PURE__ */ e(h, { name: "registration.docVertrouwelijkheidaanduiding", label: /* @__PURE__ */ e(o, { id: "6XG2pL", defaultMessage: [{ type: 0, value: "Confidentiality level" }] }), tooltip: n, isLoading: u, isClearable: !0, options: s, valueProperty: "value" }); }, w = () => { const i = r().formatMessage({ id: "2mgmOj", defaultMessage: [{ type: 0, value: "The title for the document that is related to the case." }] }); return /* @__PURE__ */ e(l, { name: "registration.titel", label: /* @__PURE__ */ e(o, { id: "SEu4I2", defaultMessage: [{ type: 0, value: "Title" }] }), tooltip: i }); }, k = () => /* @__PURE__ */ c(v, { children: [ /* @__PURE__ */ e(I, {}), /* @__PURE__ */ e(C, {}), /* @__PURE__ */ e(L, {}), /* @__PURE__ */ e(w, {}) ] }); export { k as default };