@dashadmin/dash-admin 1.0.0 → 1.3.16

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,15 +1,15 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { Box as n, Alert as x, Button as y, Grid as m, IconButton as S, TextField as I } from "@mui/material";
3
- import { useState as a, useEffect as R } from "react";
4
- import { useRedirect as k, useNotify as E } from "react-admin";
5
- import { b as j, c as A, F as B } from "./index-U84xs0Dc.js";
2
+ import { Box as n, Alert as g, Button as x, Grid as m, IconButton as N, TextField as S } from "@mui/material";
3
+ import { useState as a, useEffect as I } from "react";
4
+ import { useRedirect as R, useNotify as k } from "react-admin";
5
+ import { b as E, c as j, F as A } from "./index-gfebuoyf.js";
6
6
  import "react-redux";
7
7
  import "@dashadmin/dash-admin-state";
8
8
  import "@mui/icons-material/MenuOpen";
9
9
  import "@dashadmin/dash-auth";
10
10
  import "react-router-dom";
11
11
  import "@mui/icons-material/NavigateNext";
12
- import F from "@mui/icons-material/Home";
12
+ import B from "@mui/icons-material/Home";
13
13
  import "@dashadmin/dash-constants";
14
14
  import "react-toastify";
15
15
  import "@dashadmin/dash-dialog";
@@ -19,32 +19,31 @@ import "@dashadmin/dash-auto-admin";
19
19
  import "react-router";
20
20
  import "@mui/icons-material/NotificationsActive";
21
21
  import "react-custom-scrollbars-2";
22
- import { dashStorage as H } from "@dashadmin/dash-utils";
22
+ import { dashStorage as F } from "@dashadmin/dash-utils";
23
23
  import "@mui/x-date-pickers";
24
24
  import "@mui/x-date-pickers/AdapterDayjs";
25
- const ae = ({}) => {
26
- const [l, b] = a(""), [c, p] = a(!1), [d, u] = a(""), [v, C] = a(!1), { axios: w } = j(), h = k(), f = E(), N = async (s) => {
27
- var g;
25
+ const ie = ({}) => {
26
+ const [l, y] = a(""), [c, p] = a(!1), [d, u] = a(""), [b, v] = a(!1), { axios: C } = E(), h = R(), f = k(), w = async (s) => {
28
27
  s.preventDefault(), u(""), p(!0);
29
28
  try {
30
- const { data: r } = await w.post("password/email", {
29
+ const { data: r } = await C.post("password/email", {
31
30
  email: l
32
31
  });
33
- C(!0), f(r.message, { type: "success" });
32
+ v(!0), f(r.message, { type: "success" });
34
33
  } catch (r) {
35
34
  let i = "Ha ocurrido un error";
36
- if ((g = r == null ? void 0 : r.response) != null && g.data) {
35
+ if (r?.response?.data) {
37
36
  const t = r.response.data;
38
37
  t.errors && t.errors.email && t.errors.email.length > 0 ? i = t.errors.email[0] : t.message && (i = t.message);
39
- } else r != null && r.message && (i = r.message);
38
+ } else r?.message && (i = r.message);
40
39
  u(i), f(i, { type: "warning" });
41
40
  } finally {
42
41
  p(!1);
43
42
  }
44
43
  };
45
- return R(() => {
46
- H.clear(), A();
47
- }, []), /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
44
+ return I(() => {
45
+ F.clear(), j();
46
+ }, []), /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
48
47
  n,
49
48
  {
50
49
  sx: {
@@ -64,7 +63,7 @@ const ae = ({}) => {
64
63
  maxWidth: 420,
65
64
  mx: "auto"
66
65
  },
67
- children: v ? /* @__PURE__ */ o(
66
+ children: b ? /* @__PURE__ */ o(
68
67
  n,
69
68
  {
70
69
  sx: {
@@ -84,9 +83,9 @@ const ae = ({}) => {
84
83
  },
85
84
  children: [
86
85
  /* @__PURE__ */ e("h1", { className: "dash-app-login-form-title", style: { margin: 0 }, children: "Recuperar Contraseña" }),
87
- /* @__PURE__ */ e(x, { severity: "success", sx: { mt: 2, mb: 2 }, children: "Si el correo existe en nuestro sistema, recibirás un enlace para restablecer tu contraseña." }),
86
+ /* @__PURE__ */ e(g, { severity: "success", sx: { mt: 2, mb: 2 }, children: "Si el correo existe en nuestro sistema, recibirás un enlace para restablecer tu contraseña." }),
88
87
  /* @__PURE__ */ e(
89
- y,
88
+ x,
90
89
  {
91
90
  variant: "contained",
92
91
  color: "primary",
@@ -97,22 +96,22 @@ const ae = ({}) => {
97
96
  )
98
97
  ]
99
98
  }
100
- ) : /* @__PURE__ */ o("form", { onSubmit: N, className: "dash-app-login-form", children: [
99
+ ) : /* @__PURE__ */ o("form", { onSubmit: w, className: "dash-app-login-form", children: [
101
100
  /* @__PURE__ */ o(m, { container: !0, sx: { mb: 4, mt: 2 }, spacing: 2, alignItems: "center", children: [
102
101
  /* @__PURE__ */ e(m, { item: !0, xs: 2, children: /* @__PURE__ */ e(
103
- S,
102
+ N,
104
103
  {
105
104
  color: "primary",
106
105
  size: "large",
107
106
  onClick: () => h("/"),
108
- children: /* @__PURE__ */ e(F, {})
107
+ children: /* @__PURE__ */ e(B, {})
109
108
  }
110
109
  ) }),
111
110
  /* @__PURE__ */ e(m, { item: !0, xs: 10, children: /* @__PURE__ */ e("h1", { className: "dash-app-login-form-title", style: { margin: 0 }, children: "Recuperar Contraseña" }) })
112
111
  ] }),
113
- d && /* @__PURE__ */ e(x, { severity: "error", sx: { mb: 2 }, children: d }),
112
+ d && /* @__PURE__ */ e(g, { severity: "error", sx: { mb: 2 }, children: d }),
114
113
  /* @__PURE__ */ e("div", { className: "dash-app-form-item", children: /* @__PURE__ */ e(
115
- I,
114
+ S,
116
115
  {
117
116
  fullWidth: !0,
118
117
  variant: "outlined",
@@ -121,7 +120,7 @@ const ae = ({}) => {
121
120
  required: !0,
122
121
  value: l,
123
122
  inputProps: { type: "email" },
124
- onChange: (s) => b(s.target.value),
123
+ onChange: (s) => y(s.target.value),
125
124
  className: "dash-app-form-item-input",
126
125
  autoComplete: "username",
127
126
  name: "email",
@@ -130,7 +129,7 @@ const ae = ({}) => {
130
129
  }
131
130
  ) }),
132
131
  /* @__PURE__ */ e("div", { className: "dash-app-form-item mt-1", children: /* @__PURE__ */ e(
133
- y,
132
+ x,
134
133
  {
135
134
  type: "submit",
136
135
  variant: "contained",
@@ -146,5 +145,5 @@ const ae = ({}) => {
146
145
  ) });
147
146
  };
148
147
  export {
149
- ae as default
148
+ ie as default
150
149
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as g } from "react/jsx-runtime";
2
2
  import { useState as m, useEffect as h } from "react";
3
3
  import { useSearchParams as v, useNavigate as x } from "react-router-dom";
4
- import { b as y, F as b } from "./index-U84xs0Dc.js";
4
+ import { b as y, F as b } from "./index-gfebuoyf.js";
5
5
  import { Box as k, CircularProgress as C, Typography as P } from "@mui/material";
6
6
  import { getEnv as T } from "@dashadmin/dash-constants/src/DASHAdminSystemConstants";
7
7
  import "react-redux";