@aeria-ui/ui 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,83 +0,0 @@
1
- import { defineComponent as k, resolveDirective as V, openBlock as o, createElementBlock as r, Fragment as v, createElementVNode as c, createCommentVNode as s, withDirectives as C, unref as e, createTextVNode as l, createVNode as p, withCtx as g, createBlock as T, toDisplayString as b } from "vue";
2
- import { STORAGE_NAMESPACE as x } from "@aeria-ui/web";
3
- import { useStore as f } from "@aeria-ui/state-management";
4
- import { useRouter as w } from "vue-router";
5
- import { isRight as E } from "@aeriajs/common";
6
- import { A as S, a as _ } from "./index-0298408f.js";
7
- import "@aeria-ui/i18n";
8
- import "maska";
9
- const A = { style: { "text-align": "center" } }, N = ["innerHTML"], B = { key: 1 }, L = /* @__PURE__ */ c("span", null, "Não possui uma conta?", -1), R = { style: { width: "100%", display: "flex", "flex-direction": "column", gap: "1rem" } }, I = /* @__PURE__ */ k({
10
- __name: "signin",
11
- setup(D) {
12
- const a = w(), t = f("user"), d = f("meta"), u = () => {
13
- const { next: n } = a.currentRoute.value.query;
14
- a.push(n && localStorage.getItem(`${x}:auth:next`) === n ? n : "/dashboard/");
15
- }, h = async () => {
16
- const n = await t.$actions.authenticate(t.credentials);
17
- E(n) && u();
18
- };
19
- return (n, i) => {
20
- const y = V("clickable");
21
- return o(), r(v, null, [
22
- c("div", A, [
23
- n.instanceVars.signinText ? (o(), r("h1", {
24
- key: 0,
25
- style: { "font-size": "2.4rem", "margin-bottom": ".8rem" },
26
- innerHTML: n.instanceVars.signinText
27
- }, null, 8, N)) : s("", !0),
28
- n.instanceVars.signupForm ? (o(), r("div", B, [
29
- L,
30
- C((o(), r("span", {
31
- style: { color: "#2d96fa" },
32
- onClick: i[0] || (i[0] = (m) => e(a).push("/user/signup"))
33
- }, [
34
- l(" Criar uma conta ")
35
- ])), [
36
- [y]
37
- ])
38
- ])) : s("", !0)
39
- ]),
40
- p(S, {
41
- modelValue: e(t).credentials,
42
- "onUpdate:modelValue": i[1] || (i[1] = (m) => e(t).credentials = m),
43
- form: {
44
- email: {
45
- type: "string",
46
- icon: "user"
47
- },
48
- password: {
49
- type: "string",
50
- icon: "lock",
51
- inputType: "password"
52
- }
53
- }
54
- }, null, 8, ["modelValue"]),
55
- c("div", R, [
56
- p(_, {
57
- loading: e(t).loading.authenticate,
58
- disabled: !e(t).credentials.email || !e(t).credentials.password,
59
- onClick: h
60
- }, {
61
- default: g(() => [
62
- l(" Entrar ")
63
- ]),
64
- _: 1
65
- }, 8, ["loading", "disabled"]),
66
- e(t).currentUser._id && !e(d).isLoading ? (o(), T(_, {
67
- key: 0,
68
- disabled: e(t).loading.authenticate || e(d).isLoading,
69
- onClick: u
70
- }, {
71
- default: g(() => [
72
- l(" Continuar como " + b(e(t).currentUser.name), 1)
73
- ]),
74
- _: 1
75
- }, 8, ["disabled"])) : s("", !0)
76
- ])
77
- ], 64);
78
- };
79
- }
80
- });
81
- export {
82
- I as default
83
- };
@@ -1,112 +0,0 @@
1
- import { defineComponent as h, withAsyncContext as x, ref as c, resolveDirective as y, openBlock as v, createElementBlock as C, Fragment as A, createElementVNode as m, withDirectives as $, createBlock as E, unref as _, withCtx as t, createTextVNode as d, createVNode as s, mergeProps as B, withModifiers as U } from "vue";
2
- import { useRouter as D } from "vue-router";
3
- import { useStore as V } from "@aeria-ui/state-management";
4
- import { isLeft as M, unwrapEither as N } from "@aeriajs/common";
5
- import { b as S, A as q, _ as F, c as P, a as I } from "./index-0298408f.js";
6
- import "@aeria-ui/i18n";
7
- import "@aeria-ui/web";
8
- import "maska";
9
- const L = /* @__PURE__ */ m("h1", null, "Criar conta", -1), R = { style: { display: "flex", "flex-direction": "column", "align-items": "start", gap: "2rem" } }, W = /* @__PURE__ */ h({
10
- __name: "signup",
11
- async setup(T) {
12
- let p, f;
13
- const w = D(), i = V("user"), r = V("meta");
14
- r.descriptions.user || ([p, f] = x(() => r.$actions.describe({
15
- collections: ["user"],
16
- roles: !0
17
- })), await p, f());
18
- const n = c(!1), l = c({}), a = c({
19
- password: "",
20
- confirmation: ""
21
- }), b = async () => {
22
- i.item.password = a.value.password;
23
- const u = await i.$functions.createAccount({
24
- ...l.value,
25
- password: a.value.password
26
- });
27
- if (M(u)) {
28
- const e = N(u);
29
- await r.$actions.spawnModal({
30
- title: "Erro",
31
- body: e
32
- });
33
- return;
34
- }
35
- await r.$actions.spawnModal({
36
- title: "Conta registrada",
37
- body: "Verifique o link de confirmação no seu email"
38
- }), w.push({
39
- path: "/user/signin"
40
- });
41
- };
42
- return (u, e) => {
43
- const k = y("clickable");
44
- return v(), C(A, null, [
45
- m("div", null, [
46
- L,
47
- $((v(), E(S, {
48
- icon: "arrow-left",
49
- onClick: e[0] || (e[0] = (o) => _(w).push({ path: "/user/signin" }))
50
- }, {
51
- default: t(() => [
52
- d(" Efetuar login ")
53
- ]),
54
- _: 1
55
- })), [
56
- [k]
57
- ])
58
- ]),
59
- s(q, B({
60
- modelValue: l.value,
61
- "onUpdate:modelValue": e[3] || (e[3] = (o) => l.value = o)
62
- }, {
63
- collection: "user",
64
- form: _(i).$actions.useProperties([
65
- "name",
66
- "email",
67
- "phone"
68
- ])
69
- }), {
70
- after: t(() => [
71
- s(F, {
72
- modelValue: a.value,
73
- "onUpdate:modelValue": e[2] || (e[2] = (o) => a.value = o)
74
- }, {
75
- default: t(({ passwordError: o }) => [
76
- m("div", R, [
77
- s(P, {
78
- modelValue: n.value,
79
- "onUpdate:modelValue": e[1] || (e[1] = (g) => n.value = g),
80
- property: {
81
- type: "boolean",
82
- element: "checkbox"
83
- }
84
- }, {
85
- default: t(() => [
86
- d(" Declaro que li e aceito os termos de uso ")
87
- ]),
88
- _: 1
89
- }, 8, ["modelValue"])
90
- ]),
91
- s(I, {
92
- disabled: !!o || !n.value,
93
- onClick: U(b, ["prevent"])
94
- }, {
95
- default: t(() => [
96
- d(" Criar conta ")
97
- ]),
98
- _: 2
99
- }, 1032, ["disabled"])
100
- ]),
101
- _: 1
102
- }, 8, ["modelValue"])
103
- ]),
104
- _: 1
105
- }, 16, ["modelValue"])
106
- ], 64);
107
- };
108
- }
109
- });
110
- export {
111
- W as default
112
- };