@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
121 lines (120 loc) • 3.86 kB
JavaScript
import { jsxs as r, Fragment as d, jsx as e } from "react/jsx-runtime";
import { useIntl as l, FormattedMessage as o } from "react-intl";
import "../../../components/formio/tabs.js";
import "clsx";
import "formik";
/* empty css */
import "@floating-ui/react";
import "react";
/* empty css */
import { TextFieldMultiple as m } from "../../../components/formio/textfield.js";
import "../../../context.js";
import "lodash";
/* empty css */
import n from "../../../components/formio/select.js";
import { NumberField as i } from "../../../components/formio/number.js";
import "../../../components/formio/datagrid.js";
const p = ({
name: t
}) => {
const s = l(), a = s.formatMessage({
id: "mMn7K3",
defaultMessage: [{
type: 0,
value: "Specify whether to add or subtract a time delta to/from the variable."
}]
});
return /* @__PURE__ */ e(n, { name: t, label: /* @__PURE__ */ e(o, { id: "xI6md8", defaultMessage: [{
type: 0,
value: "Add/subtract duration"
}] }), tooltip: a, options: [{
value: "add",
label: s.formatMessage({
id: "W0AAhq",
defaultMessage: [{
type: 0,
value: "Add"
}]
})
}, {
value: "subtract",
label: s.formatMessage({
id: "9lk1eS",
defaultMessage: [{
type: 0,
value: "Subtract"
}]
})
}] });
}, c = ({
name: t
}) => {
const a = l().formatMessage({
id: "bvY9oJ",
defaultMessage: [{
type: 0,
value: "Provide the key of a static, component, or user defined variable."
}]
});
return /* @__PURE__ */ e(m, { name: t, label: /* @__PURE__ */ e(o, { id: "EkVNqG", defaultMessage: [{
type: 0,
value: "Variable"
}] }), tooltip: a, spellCheck: !1 });
}, u = ({
name: t
}) => {
const a = l().formatMessage({
id: "PhXIai",
defaultMessage: [{
type: 0,
value: "Number of years. Empty values are ignored."
}]
});
return /* @__PURE__ */ e(i, { name: t, label: /* @__PURE__ */ e(o, { id: "7b9pD8", defaultMessage: [{
type: 0,
value: "Years"
}] }), tooltip: a, step: 1, min: 0 });
}, f = ({
name: t
}) => {
const a = l().formatMessage({
id: "5XOrxo",
defaultMessage: [{
type: 0,
value: "Number of months. Empty values are ignored."
}]
});
return /* @__PURE__ */ e(i, { name: t, label: /* @__PURE__ */ e(o, { id: "0gbtNe", defaultMessage: [{
type: 0,
value: "Months"
}] }), tooltip: a, step: 1, min: 0 });
}, v = ({
name: t
}) => {
const a = l().formatMessage({
id: "cQvPLh",
defaultMessage: [{
type: 0,
value: "Number of days. Empty values are ignored."
}]
});
return /* @__PURE__ */ e(i, { name: t, label: /* @__PURE__ */ e(o, { id: "4DkoO5", defaultMessage: [{
type: 0,
value: "Days"
}] }), tooltip: a, step: 1, min: 0 });
}, O = ({
constraint: t
}) => /* @__PURE__ */ r(d, { children: [
/* @__PURE__ */ r("div", { className: "row", children: [
/* @__PURE__ */ e("div", { className: "col-md-6 col-xs-12", children: /* @__PURE__ */ e(p, { name: `openForms.${t}.operator` }) }),
/* @__PURE__ */ e("div", { className: "col-md-6 col-xs-12", children: /* @__PURE__ */ e(c, { name: `openForms.${t}.variable` }) })
] }),
/* @__PURE__ */ r("div", { className: "row", children: [
/* @__PURE__ */ e("div", { className: "col-md-4 col-xs-12", children: /* @__PURE__ */ e(u, { name: `openForms.${t}.delta.years` }) }),
/* @__PURE__ */ e("div", { className: "col-md-4 col-xs-12", children: /* @__PURE__ */ e(f, { name: `openForms.${t}.delta.months` }) }),
/* @__PURE__ */ e("div", { className: "col-md-4 col-xs-12", children: /* @__PURE__ */ e(v, { name: `openForms.${t}.delta.days` }) })
] })
] });
export {
O as default
};