@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
47 lines (46 loc) • 1.75 kB
JavaScript
import { jsxs as a, jsx as e } from "react/jsx-runtime";
import { JSONEditor as d } from "@open-formulieren/monaco-json-editor";
import { useFormikContext as l } from "formik";
import { useContext as f } from "react";
import { FormattedMessage as t } from "react-intl";
import "../../formio/tabs.js";
import u from "../../formio/component.js";
import c from "../../formio/description.js";
import "@floating-ui/react";
import "../../formio/textfield.js";
import "clsx";
import "../../formio/datefield.js";
import "../../formio/datetimefield.js";
import "../../formio/timefield.js";
/* empty css */
import "react-select";
import "dompurify";
import "../../formio/textarea.js";
import "../../formio/datagrid.js";
/* empty css */
import { BuilderContext as x } from "../../../context.js";
const o = "openForms.itemsExpression", D = () => {
const {
getFieldProps: r,
setFieldValue: i
} = l(), {
value: s = {
var: "var"
}
} = r(o), m = f(x), p = `editform-${o}`;
return /* @__PURE__ */ a(u, { type: "textarea", field: o, required: !0, htmlId: p, label: /* @__PURE__ */ e(t, { id: "C48xJT", defaultMessage: [{
type: 0,
value: "Items expression"
}] }), children: [
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(d, { wrapperProps: {
className: "json-editor json-editor--compact"
}, value: s, onChange: (n) => i(o, n), showLines: !1, theme: m.theme }) }),
/* @__PURE__ */ e(c, { text: /* @__PURE__ */ e(t, { id: "fe3wyn", defaultMessage: [{
type: 0,
value: "A JSON logic expression returning a variable (of array type) whose items should be used as the options for this component."
}] }) })
] });
};
export {
D as ItemsExpression
};