kodama-ui
Version:
Kodama UI is a Vue 3 component library that provides a set of components & funcionality to build your application.
86 lines (85 loc) • 2.86 kB
JavaScript
import { defineComponent as g, inject as b, ref as k, reactive as h, computed as x, resolveComponent as s, openBlock as V, createBlock as $, withCtx as d, createElementVNode as o, withModifiers as F, createVNode as a, createTextVNode as m } from "vue";
import { u as y, e as E, r as w } from "./index-3aaa06c4.mjs";
import { _ as B } from "./main-ac44fa27.mjs";
const C = g({
name: "ForgotPassword",
setup() {
const e = b("$auth"), t = k(!1), n = h({
email: ""
}), r = y({
email: { email: E, required: w }
}, n), l = x(() => !r.value.$invalid);
return {
loading: t,
state: n,
v$: r,
isValidForm: l,
submitForgot: async () => {
l.value && (t.value = !0, e.forgot(n.email).finally(() => {
t.value = !1;
}));
}
};
}
});
const M = { class: "p-1 sm:p-5 select-none" }, N = /* @__PURE__ */ o("div", { class: "text-center mb-10" }, [
/* @__PURE__ */ o("h1", { class: "mb-3 sm:text-2xl text-xl uppercase font-bold" }, " ¿Olvidaste tu clave? ")
], -1), j = { class: "mb-4" }, q = { class: "fv-plugins-message-container" }, A = { class: "fv-help-block" }, O = { class: "text-center" };
function P(e, t, n, u, r, l) {
const c = s("k-input"), _ = s("ErrorMessage"), p = s("k-button"), f = s("router-link"), v = s("k-card");
return V(), $(v, { id: "k-forgot" }, {
default: d(() => [
o("div", M, [
N,
o("form", {
onSubmit: t[1] || (t[1] = F((...i) => e.submitForgot && e.submitForgot(...i), ["prevent"]))
}, [
o("div", j, [
a(c, {
modelValue: e.state.email,
"onUpdate:modelValue": t[0] || (t[0] = (i) => e.state.email = i),
type: "email",
placeholder: "jhon@doe.com",
label: "Email",
tabindex: "1",
errors: e.v$.email.$silentErrors
}, null, 8, ["modelValue", "errors"]),
o("div", q, [
o("div", A, [
a(_, { name: "email" })
])
])
]),
o("div", O, [
a(p, {
loading: e.loading,
icon: "right-from-bracket",
class: "w-full mb-4",
disabled: !e.isValidForm,
type: "submit"
}, {
default: d(() => [
m(" Acceder ")
]),
_: 1
}, 8, ["loading", "disabled"]),
a(f, {
to: { name: "login" },
class: "text-sm text-gray-400"
}, {
default: d(() => [
m(" Ya me acuerdo de mi clave ")
]),
_: 1
})
])
], 32)
])
]),
_: 1
});
}
const Y = /* @__PURE__ */ B(C, [["render", P]]);
export {
Y as default
};