@orbe-agro/client-core 5.3.132 → 5.3.133
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.
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js +10 -11
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js.map +1 -1
- package/dist/@types/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.d.ts.map +1 -1
- package/dist/base/utils/logo.js +5 -5
- package/dist/base/utils/logo.js.map +1 -1
- package/lib/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.tsx +15 -19
- package/lib/base/utils/logo.ts +1 -1
- package/package.json +1 -1
|
@@ -14,24 +14,23 @@ import x from "../../../../components/ui/Button/Button.js";
|
|
|
14
14
|
const z = a.object({
|
|
15
15
|
email: a.string().email().min(5)
|
|
16
16
|
}), L = (s) => {
|
|
17
|
-
const [
|
|
17
|
+
const [e, r] = F(!1), { className: n, setMessage: l, setEmailSent: c, emailSent: p, children: d } = s, {
|
|
18
18
|
handleSubmit: f,
|
|
19
19
|
formState: { errors: m },
|
|
20
20
|
control: u
|
|
21
21
|
} = b({
|
|
22
22
|
resolver: w(z)
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */ o("div", { className: n, children: p ? /* @__PURE__ */ o(v, { children: d }) : /* @__PURE__ */ h(y, { onSubmit: f(async (
|
|
25
|
-
const { email: g } =
|
|
24
|
+
return /* @__PURE__ */ o("div", { className: n, children: p ? /* @__PURE__ */ o(v, { children: d }) : /* @__PURE__ */ h(y, { onSubmit: f(async (t) => {
|
|
25
|
+
const { email: g } = t;
|
|
26
26
|
r(!0);
|
|
27
27
|
try {
|
|
28
|
-
await S({ email: g })
|
|
29
|
-
} catch (
|
|
28
|
+
await S({ email: g }), r(!1), c?.(!0);
|
|
29
|
+
} catch (i) {
|
|
30
30
|
l?.(
|
|
31
|
-
typeof
|
|
31
|
+
typeof i == "string" ? i : "Erro ao enviar email."
|
|
32
32
|
), r(!1);
|
|
33
33
|
}
|
|
34
|
-
r(!1);
|
|
35
34
|
}), children: [
|
|
36
35
|
/* @__PURE__ */ o(
|
|
37
36
|
P,
|
|
@@ -44,13 +43,13 @@ const z = a.object({
|
|
|
44
43
|
{
|
|
45
44
|
name: "email",
|
|
46
45
|
control: u,
|
|
47
|
-
render: ({ field:
|
|
46
|
+
render: ({ field: t }) => /* @__PURE__ */ o(
|
|
48
47
|
j,
|
|
49
48
|
{
|
|
50
49
|
type: "email",
|
|
51
50
|
placeholder: "Email",
|
|
52
51
|
autoComplete: "off",
|
|
53
|
-
...
|
|
52
|
+
...t
|
|
54
53
|
}
|
|
55
54
|
)
|
|
56
55
|
}
|
|
@@ -61,11 +60,11 @@ const z = a.object({
|
|
|
61
60
|
x,
|
|
62
61
|
{
|
|
63
62
|
block: !0,
|
|
64
|
-
loading:
|
|
63
|
+
loading: e,
|
|
65
64
|
variant: "solid",
|
|
66
65
|
type: "submit",
|
|
67
66
|
className: "mt-5",
|
|
68
|
-
children:
|
|
67
|
+
children: e ? "Enviando..." : "Enviar"
|
|
69
68
|
}
|
|
70
69
|
)
|
|
71
70
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForgotPasswordForm.js","sources":["../../../../../../lib/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.tsx"],"sourcesContent":["import { useState } from 'react'\nimport Input from '@/components/ui/Input'\nimport Button from '@/components/ui/Button'\nimport { FormItem, Form } from '@/components/ui/Form'\nimport { apiForgotPassword } from '@/services/AuthService'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport type { ZodType } from 'zod'\nimport type { CommonProps } from '@/@types/common'\n\ninterface ForgotPasswordFormProps extends CommonProps {\n emailSent: boolean\n setEmailSent?: (compplete: boolean) => void\n setMessage?: (message: string) => void\n}\n\ntype ForgotPasswordFormSchema = {\n email: string\n}\n\nconst validationSchema: ZodType<ForgotPasswordFormSchema> = z.object({\n email: z.string().email().min(5),\n})\n\nconst ForgotPasswordForm = (props: ForgotPasswordFormProps) => {\n const [isSubmitting, setSubmitting] = useState<boolean>(false)\n\n const { className, setMessage, setEmailSent, emailSent, children } = props\n\n const {\n handleSubmit,\n formState: { errors },\n control,\n } = useForm<ForgotPasswordFormSchema>({\n resolver: zodResolver(validationSchema),\n })\n\n const onForgotPassword = async (values: ForgotPasswordFormSchema) => {\n
|
|
1
|
+
{"version":3,"file":"ForgotPasswordForm.js","sources":["../../../../../../lib/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.tsx"],"sourcesContent":["import { useState } from 'react'\nimport Input from '@/components/ui/Input'\nimport Button from '@/components/ui/Button'\nimport { FormItem, Form } from '@/components/ui/Form'\nimport { apiForgotPassword } from '@/services/AuthService'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport type { ZodType } from 'zod'\nimport type { CommonProps } from '@/@types/common'\n\ninterface ForgotPasswordFormProps extends CommonProps {\n emailSent: boolean\n setEmailSent?: (compplete: boolean) => void\n setMessage?: (message: string) => void\n}\n\ntype ForgotPasswordFormSchema = {\n email: string\n}\n\nconst validationSchema: ZodType<ForgotPasswordFormSchema> = z.object({\n email: z.string().email().min(5),\n})\n\nconst ForgotPasswordForm = (props: ForgotPasswordFormProps) => {\n const [isSubmitting, setSubmitting] = useState<boolean>(false)\n\n const { className, setMessage, setEmailSent, emailSent, children } = props\n\n const {\n handleSubmit,\n formState: { errors },\n control,\n } = useForm<ForgotPasswordFormSchema>({\n resolver: zodResolver(validationSchema),\n })\n\n const onForgotPassword = async (values: ForgotPasswordFormSchema) => {\n const { email } = values\n \n setSubmitting(true)\n \n try {\n await apiForgotPassword({ email })\n setSubmitting(false)\n setEmailSent?.(true)\n } catch (errors) {\n setMessage?.(\n typeof errors === 'string' ? errors : 'Erro ao enviar email.',\n )\n setSubmitting(false)\n }\n }\n\n return (\n <div className={className}>\n {!emailSent ? (\n <Form onSubmit={handleSubmit(onForgotPassword)}>\n <FormItem\n label=\"Email\"\n invalid={Boolean(errors.email)}\n errorMessage={errors.email?.message}\n >\n <Controller\n name=\"email\"\n control={control}\n render={({ field }) => (\n <Input\n type=\"email\"\n placeholder=\"Email\"\n autoComplete=\"off\"\n {...field}\n />\n )}\n />\n </FormItem>\n <Button\n block\n loading={isSubmitting}\n variant=\"solid\"\n type=\"submit\"\n className=\"mt-5\"\n >\n {isSubmitting ? 'Enviando...' : 'Enviar'}\n </Button>\n </Form>\n ) : (\n <>{children}</>\n )}\n </div>\n )\n}\n\nexport default ForgotPasswordForm\n"],"names":["validationSchema","z","ForgotPasswordForm","props","isSubmitting","setSubmitting","useState","className","setMessage","setEmailSent","emailSent","children","handleSubmit","errors","control","useForm","zodResolver","jsx","Fragment","Form","values","email","apiForgotPassword","FormItem","Controller","field","Input","Button"],"mappings":";;;;;;;;;;;;;AAqBA,MAAMA,IAAsDC,EAAE,OAAO;AAAA,EACjE,OAAOA,EAAE,OAAA,EAAS,MAAA,EAAQ,IAAI,CAAC;AACnC,CAAC,GAEKC,IAAqB,CAACC,MAAmC;AAC3D,QAAM,CAACC,GAAcC,CAAa,IAAIC,EAAkB,EAAK,GAEvD,EAAE,WAAAC,GAAW,YAAAC,GAAY,cAAAC,GAAc,WAAAC,GAAW,UAAAC,MAAaR,GAE/D;AAAA,IACF,cAAAS;AAAA,IACA,WAAW,EAAE,QAAAC,EAAA;AAAA,IACb,SAAAC;AAAA,EAAA,IACAC,EAAkC;AAAA,IAClC,UAAUC,EAAYhB,CAAgB;AAAA,EAAA,CACzC;AAmBD,SACI,gBAAAiB,EAAC,OAAA,EAAI,WAAAV,GACA,UAACG,IA+BE,gBAAAO,EAAAC,GAAA,EAAG,UAAAP,EAAA,CAAS,sBA9BXQ,GAAA,EAAK,UAAUP,EApBH,OAAOQ,MAAqC;AAC9D,UAAM,EAAE,OAAAC,MAAUD;AAElB,IAAAf,EAAc,EAAI;AAElB,QAAI;AACA,YAAMiB,EAAkB,EAAE,OAAAD,GAAO,GACjChB,EAAc,EAAK,GACnBI,IAAe,EAAI;AAAA,IACvB,SAASI,GAAQ;AACb,MAAAL;AAAA,QACI,OAAOK,KAAW,WAAWA,IAAS;AAAA,MAAA,GAE1CR,EAAc,EAAK;AAAA,IACvB;AAAA,EACJ,CAKsD,GACzC,UAAA;AAAA,IAAA,gBAAAY;AAAA,MAACM;AAAA,MAAA;AAAA,QACG,OAAM;AAAA,QACN,SAAS,EAAQV,EAAO;AAAA,QACxB,cAAcA,EAAO,OAAO;AAAA,QAE5B,UAAA,gBAAAI;AAAA,UAACO;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,SAAAV;AAAA,YACA,QAAQ,CAAC,EAAE,OAAAW,EAAA,MACP,gBAAAR;AAAA,cAACS;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,cAAa;AAAA,gBACZ,GAAGD;AAAA,cAAA;AAAA,YAAA;AAAA,UACR;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,IAEJ,gBAAAR;AAAA,MAACU;AAAA,MAAA;AAAA,QACG,OAAK;AAAA,QACL,SAASvB;AAAA,QACT,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAET,cAAe,gBAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,EACpC,EAAA,CACJ,EAEY,CAEpB;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,UAAU,uBAAwB,SAAQ,WAAW;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAUD,QAAA,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,UAAU,uBAAwB,SAAQ,WAAW;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAUD,QAAA,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAmEzD,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
package/dist/base/utils/logo.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
const t = o ? "-min" : "-full-h", n = e === "dark" ? "-white" : "";
|
|
4
|
-
return `${
|
|
1
|
+
import r from "../../@ecme/configs/app.config.js";
|
|
2
|
+
function i(o, e) {
|
|
3
|
+
const t = o ? "-min" : "-full-h", n = e === "dark" ? "-white" : "-gray";
|
|
4
|
+
return `${r.orgName}-logo${t}${n}.svg`;
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
i as getLogoFilename
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=logo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.js","sources":["../../../lib/base/utils/logo.ts"],"sourcesContent":["import appConfig from '@/configs/app.config'\n\nexport function getLogoFilename(isCollapsed: boolean, mode: 'dark' | 'light') {\n const suffix = isCollapsed ? '-min' : '-full-h'\n const theme = mode === 'dark' ? '-white' : ''\n return `${appConfig.orgName}-logo${suffix}${theme}.svg`\n}\n"],"names":["getLogoFilename","isCollapsed","mode","suffix","theme","appConfig"],"mappings":";AAEO,SAASA,EAAgBC,GAAsBC,GAAwB;AAC1E,QAAMC,IAASF,IAAc,SAAS,WAChCG,IAAQF,MAAS,SAAS,WAAW;AAC3C,SAAO,GAAGG,EAAU,OAAO,QAAQF,CAAM,GAAGC,CAAK;AACrD;"}
|
|
1
|
+
{"version":3,"file":"logo.js","sources":["../../../lib/base/utils/logo.ts"],"sourcesContent":["import appConfig from '@/configs/app.config'\n\nexport function getLogoFilename(isCollapsed: boolean, mode: 'dark' | 'light') {\n const suffix = isCollapsed ? '-min' : '-full-h'\n const theme = mode === 'dark' ? '-white' : '-gray'\n return `${appConfig.orgName}-logo${suffix}${theme}.svg`\n}\n"],"names":["getLogoFilename","isCollapsed","mode","suffix","theme","appConfig"],"mappings":";AAEO,SAASA,EAAgBC,GAAsBC,GAAwB;AAC1E,QAAMC,IAASF,IAAc,SAAS,WAChCG,IAAQF,MAAS,SAAS,WAAW;AAC3C,SAAO,GAAGG,EAAU,OAAO,QAAQF,CAAM,GAAGC,CAAK;AACrD;"}
|
|
@@ -37,25 +37,21 @@ const ForgotPasswordForm = (props: ForgotPasswordFormProps) => {
|
|
|
37
37
|
})
|
|
38
38
|
|
|
39
39
|
const onForgotPassword = async (values: ForgotPasswordFormSchema) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
setSubmitting(false)
|
|
58
|
-
}
|
|
40
|
+
const { email } = values
|
|
41
|
+
|
|
42
|
+
setSubmitting(true)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
await apiForgotPassword({ email })
|
|
46
|
+
setSubmitting(false)
|
|
47
|
+
setEmailSent?.(true)
|
|
48
|
+
} catch (errors) {
|
|
49
|
+
setMessage?.(
|
|
50
|
+
typeof errors === 'string' ? errors : 'Erro ao enviar email.',
|
|
51
|
+
)
|
|
52
|
+
setSubmitting(false)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
59
55
|
|
|
60
56
|
return (
|
|
61
57
|
<div className={className}>
|
package/lib/base/utils/logo.ts
CHANGED
|
@@ -2,6 +2,6 @@ import appConfig from '@/configs/app.config'
|
|
|
2
2
|
|
|
3
3
|
export function getLogoFilename(isCollapsed: boolean, mode: 'dark' | 'light') {
|
|
4
4
|
const suffix = isCollapsed ? '-min' : '-full-h'
|
|
5
|
-
const theme = mode === 'dark' ? '-white' : ''
|
|
5
|
+
const theme = mode === 'dark' ? '-white' : '-gray'
|
|
6
6
|
return `${appConfig.orgName}-logo${suffix}${theme}.svg`
|
|
7
7
|
}
|
package/package.json
CHANGED