UNPKG

@agendize/vue-settings

Version:
92 lines (91 loc) 4.36 kB
import { defineComponent as R, ref as u, onMounted as L, watch as M, openBlock as b, createBlock as V, unref as e, withCtx as m, createVNode as o, withDirectives as S, vShow as w, createCommentVNode as N } from "vue"; import { StructuredLayout as T, StructuredSection as x, FieldToggle as y, Mandatory as f, FieldSelect as U, StructuredDivider as k, FieldInput as B } from "@agendize/design-system"; import { u as F } from "./vendor.26bbd9f1.js"; const E = /* @__PURE__ */ R({ __name: "ConferenceAdvancedParameter", props: { conference: {} }, emits: ["hasChange", "valid"], setup(h, { expose: I, emit: C }) { const i = h, { t } = F(), v = C, g = []; for (let a = 1; a <= 10; a++) g.push({ value: a + "", label: t("settings.conferences.details.advanced.fields.additional-seats.values", { n: a }, a) }); const p = u([]), s = u(!1), d = u(["1"]), r = u(!1), c = u(""); p.value.push(s, d, r, c); function A() { let a = i.conference; return a.registrationRules = { allowAdditionalSeats: s.value, numberOfAdditionalSeats: +d.value[0], waitingList: r.value }, a.externalId = c.value, a; } return L(() => { var a, l; i.conference.registrationRules && (s.value = (a = i.conference.registrationRules.allowAdditionalSeats) != null ? a : !1, i.conference.registrationRules.numberOfAdditionalSeats !== 0 && (d.value = [i.conference.registrationRules.numberOfAdditionalSeats + ""]), r.value = i.conference.registrationRules.waitingList || !1), c.value = (l = i.conference.externalId) != null ? l : "", p.value.forEach((n) => { M(n, () => { v("hasChange"), v("valid", !0); }, { deep: !0 }); }); }), I({ getConferenceBeforeSave: A }), (a, l) => (b(), V(e(T), null, { column1: m(() => [ o(e(x), { title: { label: e(t)("settings.conferences.details.advanced.section.options.label") }, gap: 4 }, { content: m(() => [ S(o(e(y), { id: "conference-multiple-participant", label: e(t)("settings.conferences.details.advanced.fields.multiple.label"), mandatory: e(f).ignore, modelValue: s.value, "onUpdate:modelValue": l[0] || (l[0] = (n) => s.value = n) }, null, 8, ["label", "mandatory", "modelValue"]), [ [w, !1] ]), s.value ? S((b(), V(e(U), { key: 0, id: "conference-additional-seat", label: e(t)("settings.conferences.details.advanced.fields.additional-seats.label"), values: g, mandatory: e(f).ignore, modelValue: d.value, "onUpdate:modelValue": l[1] || (l[1] = (n) => d.value = n), clearable: !1 }, null, 8, ["label", "mandatory", "modelValue"])), [ [w, !1] ]) : N("", !0), o(e(k)), o(e(y), { id: "conference-waiting-list", label: e(t)("settings.conferences.details.advanced.fields.waiting-list.label"), helperMessage: e(t)("settings.conferences.details.advanced.fields.waiting-list.helper"), mandatory: e(f).ignore, modelValue: r.value, "onUpdate:modelValue": l[2] || (l[2] = (n) => r.value = n) }, null, 8, ["label", "helperMessage", "mandatory", "modelValue"]) ]), _: 1 }, 8, ["title"]), o(e(x), { title: { label: e(t)("settings.conferences.details.advanced.section.externalId.label") }, gap: 2, subTitle: { label: e(t)("settings.conferences.details.advanced.section.externalId.subTitle") } }, { content: m(() => [ o(e(B), { id: "conference-external-id", label: e(t)("settings.conferences.details.advanced.fields.externalId.label"), placeholder: e(t)("settings.conferences.details.advanced.fields.externalId.placeholder"), mandatory: e(f).ignore, modelValue: c.value, "onUpdate:modelValue": l[3] || (l[3] = (n) => c.value = n) }, null, 8, ["label", "placeholder", "mandatory", "modelValue"]) ]), _: 1 }, 8, ["title", "subTitle"]) ]), _: 1 })); } }); export { E as default };