UNPKG

vue-formique

Version:

A Vue wrapper around the Formique form library.

66 lines (65 loc) 1.86 kB
import { ref as l, onMounted as n, openBlock as a, createElementBlock as i, createElementVNode as u } from "vue"; import m from "formique"; const d = (e, r) => { const t = e.__vccOpts || e; for (const [o, s] of r) t[o] = s; return t; }, c = { setup() { const e = l([ ["text", "name", "Name", { required: !0 }, {}], ["text", "surname", "Surname", { required: !0 }], ["email", "email", "Email", { required: !0 }, {}], ["singleSelect", "title", "Title", { required: !0 }, { dependents: ["status"] }, [ { value: "mr", label: "Mr" }, { value: "ms", label: "Ms" }, { value: "mrs", label: "mrs" }, { value: "dr", label: "Dr" }, { value: "prof", label: "Prof" } ]], [ "singleSelect", "status", "Status", { required: !0 }, { dependsOn: "title", condition: (o) => o === "prof" }, [ { value: "full professor", label: "Full Professor" }, { value: "associate professor", label: "Associate Professor" } ] ], ["submit", "submit", "Submit", {}, { style: "width: 100%;" }] ]), r = l({ method: "post", //action: 'submit.js', id: "myForm", class: "form", style: "width: 100%; font-size: 14px;" }), t = l({ requiredFieldIndicator: !0, framework: "vue", placeholders: !0, theme: "dark-blue", submitOnPage: !0 }); return n(() => { new m(e.value, r.value, t.value); }), {}; } }; function f(e, r, t, o, s, v) { return a(), i("div", null, r[0] || (r[0] = [ u("h1", null, "Form Title Here", -1), u("div", { id: "formique" }, null, -1) ])); } const p = /* @__PURE__ */ d(c, [["render", f]]), F = { install(e) { e.component("VueFormique", p); } }; export { p as FormiqueComponent, F as VueFormique };