@aeria-ui/ui 0.0.144 → 0.0.146

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,6 +1,6 @@
1
1
  import { defineComponent as i, watch as c, openBlock as r, createBlock as l } from "vue";
2
2
  import { getGlobalStateManager as a, useStore as s } from "@aeria-ui/state-management";
3
- import { e as d } from "./index-CF7DaiUd.js";
3
+ import { e as d } from "./index-Cvpf_fcw.js";
4
4
  const _ = /* @__PURE__ */ i({
5
5
  __name: "[id]",
6
6
  props: {
@@ -0,0 +1,136 @@
1
+ import { defineComponent as A, inject as R, ref as M, onMounted as b, openBlock as c, createElementBlock as p, unref as s, createElementVNode as y, toDisplayString as n, createVNode as l, withCtx as m, withModifiers as C, createTextVNode as g } from "vue";
2
+ import { INSTANCE_VARS_SYMBOL as U } from "@aeria-ui/core";
3
+ import { useStore as $ } from "@aeria-ui/state-management";
4
+ import { useRouter as x } from "vue-router";
5
+ import { t as i } from "@aeria-ui/i18n";
6
+ import { A as E, _ as I, a as v } from "./index-Cvpf_fcw.js";
7
+ const N = { key: 0 }, T = {
8
+ key: 0,
9
+ style: { display: "grid", gap: "1rem" }
10
+ }, q = {
11
+ key: 1,
12
+ style: { display: "grid", gap: "1rem" }
13
+ }, B = {
14
+ key: 1,
15
+ style: { display: "grid", gap: "1rem" }
16
+ }, z = /* @__PURE__ */ A({
17
+ __name: "activation",
18
+ setup(O) {
19
+ const a = x(), u = $("user"), d = $("meta"), f = R(U), h = a.currentRoute.value.query.step || "success", _ = a.currentRoute.value.query.u, w = a.currentRoute.value.query.t, o = M({
20
+ name: "",
21
+ email: "",
22
+ active: !1,
23
+ password: "",
24
+ confirmation: ""
25
+ });
26
+ b(async () => {
27
+ u.$actions.signout(), await V();
28
+ });
29
+ const k = () => {
30
+ if (typeof f < "u") {
31
+ const { next: e } = a.currentRoute.value.query;
32
+ if (typeof e == "string" && f.allowedRedirectionUris && f.allowedRedirectionUris.includes(e)) {
33
+ e.startsWith("/") ? a.push(e) : location.href = e;
34
+ return;
35
+ }
36
+ }
37
+ a.push("/user/signin");
38
+ }, V = async () => {
39
+ const { error: e, result: t } = await u.$functions.getInfo({
40
+ userId: _,
41
+ token: w
42
+ });
43
+ if (e) {
44
+ d.$actions.spawnModal({
45
+ title: `Error! ${e.httpStatus}`,
46
+ body: e.code
47
+ });
48
+ return;
49
+ }
50
+ if (t.active) {
51
+ d.$actions.spawnModal({
52
+ title: "Attention!",
53
+ body: "User Already Activated"
54
+ });
55
+ return;
56
+ }
57
+ o.value.name = t.name, o.value.email = t.email;
58
+ }, S = async () => {
59
+ const { error: e } = await u.$actions.custom("activate", {
60
+ password: o.value.password,
61
+ userId: _,
62
+ token: w
63
+ });
64
+ if (e) {
65
+ d.$actions.spawnModal({
66
+ title: `Error! ${e.httpStatus}`,
67
+ body: e.code
68
+ });
69
+ return;
70
+ }
71
+ u.credentials.email = o.value.email, d.$actions.spawnModal({
72
+ title: "Success!",
73
+ body: "Your account was successfully activated! Try loggin with your email and password."
74
+ }), k();
75
+ };
76
+ return (e, t) => o.value.email !== "" ? (c(), p("div", N, [
77
+ s(h) === "password" ? (c(), p("div", T, [
78
+ y("h1", null, n(s(i)("register_password")), 1),
79
+ l(E, {
80
+ modelValue: o.value,
81
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => o.value = r),
82
+ form: {
83
+ name: {
84
+ type: "string",
85
+ readOnly: !0
86
+ },
87
+ email: {
88
+ type: "string",
89
+ readOnly: !0
90
+ }
91
+ }
92
+ }, null, 8, ["modelValue"]),
93
+ l(I, {
94
+ modelValue: o.value,
95
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => o.value = r)
96
+ }, {
97
+ default: m(({ passwordError: r }) => [
98
+ l(v, {
99
+ disabled: !!r,
100
+ onClick: C(S, ["prevent"])
101
+ }, {
102
+ default: m(() => [
103
+ g(n(s(i)("register_password")), 1)
104
+ ]),
105
+ _: 2
106
+ }, 1032, ["disabled"])
107
+ ]),
108
+ _: 1
109
+ }, 8, ["modelValue"])
110
+ ])) : (c(), p("div", q, [
111
+ y("h1", null, n(s(i)("successfully_activated_account")), 1),
112
+ l(v, {
113
+ onClick: t[2] || (t[2] = (r) => s(a).push("/user/signin"))
114
+ }, {
115
+ default: m(() => [
116
+ g(n(s(i)("go_to_login_page")), 1)
117
+ ]),
118
+ _: 1
119
+ })
120
+ ]))
121
+ ])) : (c(), p("div", B, [
122
+ y("h1", null, n(s(i)("invalid_link")), 1),
123
+ l(v, {
124
+ onClick: t[3] || (t[3] = (r) => s(a).push("/user/signin"))
125
+ }, {
126
+ default: m(() => [
127
+ g(n(s(i)("go_to_login_page")), 1)
128
+ ]),
129
+ _: 1
130
+ })
131
+ ]));
132
+ }
133
+ });
134
+ export {
135
+ z as default
136
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as o, openBlock as t, createBlock as r, createSlots as n, withCtx as c, renderSlot as l, createCommentVNode as i } from "vue";
2
- import { d as m } from "./index-CF7DaiUd.js";
2
+ import { d as m } from "./index-Cvpf_fcw.js";
3
3
  const u = /* @__PURE__ */ o({
4
4
  __name: "index",
5
5
  props: {