@applica-software-guru/react-admin 1.1.101 → 1.1.103
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/components/AuthWrapper.d.ts +3 -1
- package/dist/components/AuthWrapper.d.ts.map +1 -1
- package/dist/components/ra-pages/ActivatePage.d.ts +1 -1
- package/dist/components/ra-pages/ActivatePage.d.ts.map +1 -1
- package/dist/components/ra-pages/LoginPage.d.ts +1 -1
- package/dist/components/ra-pages/LoginPage.d.ts.map +1 -1
- package/dist/components/ra-pages/RecoverPage.d.ts +1 -1
- package/dist/components/ra-pages/RecoverPage.d.ts.map +1 -1
- package/dist/components/ra-pages/RegisterPage.d.ts +1 -1
- package/dist/components/ra-pages/RegisterPage.d.ts.map +1 -1
- package/dist/components/ra-pages/types.d.ts +4 -0
- package/dist/components/ra-pages/types.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +64 -63
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +1 -1
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AuthWrapper.jsx +4 -3
- package/src/components/ra-pages/ActivatePage.tsx +2 -2
- package/src/components/ra-pages/LoginPage.tsx +2 -2
- package/src/components/ra-pages/RecoverPage.tsx +2 -2
- package/src/components/ra-pages/RegisterPage.tsx +2 -2
- package/src/components/ra-pages/types.ts +4 -0
package/dist/react-admin.es.js
CHANGED
|
@@ -26160,8 +26160,8 @@ const Wb = () => {
|
|
|
26160
26160
|
Ub.propTypes = {
|
|
26161
26161
|
children: c.node
|
|
26162
26162
|
};
|
|
26163
|
-
const Xs = ({ version: e, name: t,
|
|
26164
|
-
we.isValidElement(
|
|
26163
|
+
const Xs = ({ version: e, name: t, copy: n, children: r, background: i = Wb }) => /* @__PURE__ */ Z(ke, { sx: { minHeight: "100vh" }, children: [
|
|
26164
|
+
we.isValidElement(i) ? i : we.createElement(i),
|
|
26165
26165
|
/* @__PURE__ */ Z(
|
|
26166
26166
|
ve,
|
|
26167
26167
|
{
|
|
@@ -26183,10 +26183,10 @@ const Xs = ({ version: e, name: t, children: n, background: r = Wb }) => /* @__P
|
|
|
26183
26183
|
justifyContent: "center",
|
|
26184
26184
|
alignItems: "center",
|
|
26185
26185
|
sx: { minHeight: { xs: "calc(100vh - 210px)", sm: "calc(100vh - 134px)", md: "calc(100vh - 112px)" } },
|
|
26186
|
-
children: /* @__PURE__ */ C(ve, { item: !0, children: /* @__PURE__ */ C(Ub, { children:
|
|
26186
|
+
children: /* @__PURE__ */ C(ve, { item: !0, children: /* @__PURE__ */ C(Ub, { children: r }) })
|
|
26187
26187
|
}
|
|
26188
26188
|
),
|
|
26189
|
-
/* @__PURE__ */ C(ve, { item: !0, sx: { pb: 1 }, children: /* @__PURE__ */ C(Lu, { name: t, version: e }) })
|
|
26189
|
+
/* @__PURE__ */ C(ve, { item: !0, sx: { pb: 1 }, children: /* @__PURE__ */ C(Lu, { name: t, copy: n, version: e }) })
|
|
26190
26190
|
] })
|
|
26191
26191
|
]
|
|
26192
26192
|
}
|
|
@@ -26196,24 +26196,25 @@ Xs.propTypes = {
|
|
|
26196
26196
|
children: c.node,
|
|
26197
26197
|
version: c.string,
|
|
26198
26198
|
name: c.string,
|
|
26199
|
+
copy: c.string,
|
|
26199
26200
|
background: c.oneOfType([c.node, c.func, c.object])
|
|
26200
26201
|
};
|
|
26201
|
-
const _Y = ({ name: e,
|
|
26202
|
-
const
|
|
26202
|
+
const _Y = ({ name: e, copy: t, version: n, background: r }) => {
|
|
26203
|
+
const i = or(), s = Fs(), l = da(), u = tg(), { token: A } = xS();
|
|
26203
26204
|
return ft(() => {
|
|
26204
|
-
if (typeof
|
|
26205
|
+
if (typeof s.activate != "function")
|
|
26205
26206
|
throw new Error("The authProvider used for the ActivatePage must define an activate() method");
|
|
26206
|
-
|
|
26207
|
-
|
|
26208
|
-
}).catch((
|
|
26209
|
-
|
|
26207
|
+
s.activate(A).then(() => {
|
|
26208
|
+
l("ra.auth.activate_success", { type: "info" }), wt.delay(() => u("/login"), 1e3);
|
|
26209
|
+
}).catch((f) => {
|
|
26210
|
+
l(f, { type: "error" }), wt.delay(() => u("/login"), 1e3);
|
|
26210
26211
|
});
|
|
26211
|
-
}, [
|
|
26212
|
+
}, [A]), /* @__PURE__ */ C(Xs, { name: e, copy: t, version: n, background: r, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
|
|
26212
26213
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Jt, { direction: "row", justifyContent: "space-between", alignItems: "baseline", sx: { mb: { xs: -0.5, sm: 0.5 } }, children: [
|
|
26213
|
-
/* @__PURE__ */ C(Ie, { variant: "h3", children:
|
|
26214
|
-
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children:
|
|
26214
|
+
/* @__PURE__ */ C(Ie, { variant: "h3", children: i("ra.auth.activate") }),
|
|
26215
|
+
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: i("ra.auth.back_to_login") })
|
|
26215
26216
|
] }) }),
|
|
26216
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children:
|
|
26217
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: i("ra.auth.activate_pending") })
|
|
26217
26218
|
] }) });
|
|
26218
26219
|
};
|
|
26219
26220
|
_Y.propTypes = {
|
|
@@ -26221,42 +26222,42 @@ _Y.propTypes = {
|
|
|
26221
26222
|
version: c.string.isRequired,
|
|
26222
26223
|
background: c.node
|
|
26223
26224
|
};
|
|
26224
|
-
const Sp = ({ version: e, name: t,
|
|
26225
|
-
const [
|
|
26225
|
+
const Sp = ({ version: e, name: t, copy: n, enablePasswordRecover: r, enableRegistration: i, redirectTo: s, background: l }) => {
|
|
26226
|
+
const [u, A] = XS(!1), f = ZS(), g = or(), h = da(), p = eO(), m = tg();
|
|
26226
26227
|
ft(() => {
|
|
26227
|
-
|
|
26228
|
-
|
|
26228
|
+
p({}, !1).then(() => {
|
|
26229
|
+
m("/");
|
|
26229
26230
|
}).catch(() => {
|
|
26230
26231
|
});
|
|
26231
|
-
}, [
|
|
26232
|
-
const
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
}).catch((
|
|
26236
|
-
|
|
26237
|
-
typeof
|
|
26232
|
+
}, [p, m]);
|
|
26233
|
+
const I = (B) => {
|
|
26234
|
+
A(!0), f(B, s).then(() => {
|
|
26235
|
+
A(!1);
|
|
26236
|
+
}).catch((y) => {
|
|
26237
|
+
A(!1), h(
|
|
26238
|
+
typeof y == "string" ? y : typeof y > "u" || !y.message ? "ra.auth.sign_in_error" : y.message,
|
|
26238
26239
|
{
|
|
26239
26240
|
type: "error",
|
|
26240
26241
|
messageArgs: {
|
|
26241
|
-
_: typeof
|
|
26242
|
+
_: typeof y == "string" ? y : y && y.message ? y.message : void 0
|
|
26242
26243
|
}
|
|
26243
26244
|
}
|
|
26244
26245
|
);
|
|
26245
26246
|
});
|
|
26246
26247
|
};
|
|
26247
|
-
return /* @__PURE__ */ C(Xs, { name: t, version: e, background:
|
|
26248
|
+
return /* @__PURE__ */ C(Xs, { name: t, version: e, copy: n, background: l, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
|
|
26248
26249
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Jt, { direction: "row", justifyContent: "space-between", alignItems: "baseline", sx: { mb: { xs: -0.5, sm: 0.5 } }, children: [
|
|
26249
26250
|
/* @__PURE__ */ C(Ie, { variant: "h3", children: "Login" }),
|
|
26250
|
-
|
|
26251
|
+
i && /* @__PURE__ */ C(Ie, { component: In, to: "/register", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: g("ra.auth.register") })
|
|
26251
26252
|
] }) }),
|
|
26252
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(tO, { onSubmit:
|
|
26253
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(tO, { onSubmit: I, children: [
|
|
26253
26254
|
/* @__PURE__ */ Z(ve, { container: !0, children: [
|
|
26254
26255
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 2 }, children: /* @__PURE__ */ C(
|
|
26255
26256
|
Cr,
|
|
26256
26257
|
{
|
|
26257
26258
|
autoFocus: !0,
|
|
26258
26259
|
source: "username",
|
|
26259
|
-
label:
|
|
26260
|
+
label: g("ra.auth.username"),
|
|
26260
26261
|
autoComplete: "username",
|
|
26261
26262
|
validate: bo(),
|
|
26262
26263
|
placeholder: "user@company.name",
|
|
@@ -26267,17 +26268,17 @@ const Sp = ({ version: e, name: t, enablePasswordRecover: n, enableRegistration:
|
|
|
26267
26268
|
Cr,
|
|
26268
26269
|
{
|
|
26269
26270
|
source: "password",
|
|
26270
|
-
label:
|
|
26271
|
+
label: g("ra.auth.password"),
|
|
26271
26272
|
type: "password",
|
|
26272
26273
|
autoComplete: "current-password",
|
|
26273
26274
|
validate: bo(),
|
|
26274
|
-
placeholder:
|
|
26275
|
+
placeholder: g("ra.auth.password_placeholder"),
|
|
26275
26276
|
fullWidth: !0
|
|
26276
26277
|
}
|
|
26277
26278
|
) })
|
|
26278
26279
|
] }),
|
|
26279
|
-
|
|
26280
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled:
|
|
26280
|
+
r && /* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(Jt, { direction: "row", justifyContent: "flex-end", alignItems: "flex-end", spacing: 2, children: /* @__PURE__ */ C(aS, { variant: "h6", component: In, to: "/recover", color: "text.primary", children: g("ra.auth.forgot_password") }) }) }),
|
|
26281
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled: u, fullWidth: !0, children: u ? /* @__PURE__ */ C(Zi, { size: 19, thickness: 3 }) : g("ra.auth.sign_in") }) })
|
|
26281
26282
|
] }) })
|
|
26282
26283
|
] }) });
|
|
26283
26284
|
};
|
|
@@ -26293,24 +26294,24 @@ Sp.defaultProps = {
|
|
|
26293
26294
|
enableRegister: !1,
|
|
26294
26295
|
background: /* @__PURE__ */ C(Wb, {})
|
|
26295
26296
|
};
|
|
26296
|
-
const qY = ({ name: e,
|
|
26297
|
-
const [
|
|
26298
|
-
|
|
26299
|
-
const
|
|
26300
|
-
|
|
26301
|
-
}).catch((
|
|
26302
|
-
|
|
26303
|
-
}).finally(() =>
|
|
26297
|
+
const qY = ({ name: e, copy: t, version: n, background: r }) => {
|
|
26298
|
+
const [i, s] = Ze(!1), l = or(), u = ig(), A = da(), f = Fs(), g = ({ email: h }) => {
|
|
26299
|
+
s(!0), f.recover(h).then((p) => {
|
|
26300
|
+
const m = `ra.auth.recover_${p.responseCode}`, I = p.responseCode === "ok" ? "info" : "error";
|
|
26301
|
+
A(m, { type: I }), u("/login");
|
|
26302
|
+
}).catch((p) => {
|
|
26303
|
+
A(p, { type: "error" });
|
|
26304
|
+
}).finally(() => s(!1));
|
|
26304
26305
|
};
|
|
26305
|
-
return /* @__PURE__ */ C(Xs, { name: e,
|
|
26306
|
+
return /* @__PURE__ */ C(Xs, { name: e, copy: t, version: n, background: r, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
|
|
26306
26307
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Jt, { direction: "row", justifyContent: "space-between", alignItems: "baseline", sx: { mb: { xs: -0.5, sm: 0.5 } }, children: [
|
|
26307
|
-
/* @__PURE__ */ C(Ie, { variant: "h3", children:
|
|
26308
|
-
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children:
|
|
26308
|
+
/* @__PURE__ */ C(Ie, { variant: "h3", children: l("ra.auth.recover.title") }),
|
|
26309
|
+
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: l("ra.auth.back_to_login") })
|
|
26309
26310
|
] }) }),
|
|
26310
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Rs, { onSubmit:
|
|
26311
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Rs, { onSubmit: g, children: [
|
|
26311
26312
|
/* @__PURE__ */ C(ve, { container: !0, children: /* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 1 }, children: /* @__PURE__ */ C(Cr, { source: "email", validate: [bo(), OI()] }) }) }),
|
|
26312
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1, mb: 1 }, children: /* @__PURE__ */ C(Ie, { variant: "caption", children:
|
|
26313
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled:
|
|
26313
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1, mb: 1 }, children: /* @__PURE__ */ C(Ie, { variant: "caption", children: l("ra.auth.recover.inbox_help") }) }),
|
|
26314
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled: i, fullWidth: !0, children: i ? /* @__PURE__ */ C(Zi, { size: 19, thickness: 3 }) : l("ra.auth.recover") }) })
|
|
26314
26315
|
] }) })
|
|
26315
26316
|
] }) });
|
|
26316
26317
|
};
|
|
@@ -26319,27 +26320,27 @@ qY.propTypes = {
|
|
|
26319
26320
|
version: c.string.isRequired,
|
|
26320
26321
|
background: c.node
|
|
26321
26322
|
};
|
|
26322
|
-
const JY = ({ name: e,
|
|
26323
|
-
const [
|
|
26324
|
-
|
|
26325
|
-
const
|
|
26326
|
-
|
|
26327
|
-
}).catch((
|
|
26328
|
-
|
|
26329
|
-
}).finally(() =>
|
|
26323
|
+
const JY = ({ name: e, copy: t, version: n }) => {
|
|
26324
|
+
const [r, i] = Ze(!1), s = or(), l = ig(), u = da(), A = Fs(), f = (g) => {
|
|
26325
|
+
i(!0), A.register(g).then((h) => {
|
|
26326
|
+
const p = `ra.auth.register_${h.responseCode}`, m = h.responseCode === "ok" ? "info" : "error";
|
|
26327
|
+
u(p, { type: m }), l("/login");
|
|
26328
|
+
}).catch((h) => {
|
|
26329
|
+
u(h, { type: "error" });
|
|
26330
|
+
}).finally(() => i(!1));
|
|
26330
26331
|
};
|
|
26331
|
-
return /* @__PURE__ */ C(Xs, { name: e,
|
|
26332
|
+
return /* @__PURE__ */ C(Xs, { name: e, copy: t, version: n, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
|
|
26332
26333
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Jt, { direction: "row", justifyContent: "space-between", alignItems: "baseline", sx: { mb: { xs: -0.5, sm: 0.5 } }, children: [
|
|
26333
|
-
/* @__PURE__ */ C(Ie, { variant: "h3", children:
|
|
26334
|
-
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children:
|
|
26334
|
+
/* @__PURE__ */ C(Ie, { variant: "h3", children: s("ra.auth.register.title") }),
|
|
26335
|
+
/* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: s("ra.auth.already_have_account") })
|
|
26335
26336
|
] }) }),
|
|
26336
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Rs, { onSubmit:
|
|
26337
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, children: /* @__PURE__ */ Z(Rs, { onSubmit: f, children: [
|
|
26337
26338
|
/* @__PURE__ */ Z(ve, { container: !0, children: [
|
|
26338
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 1 }, children: /* @__PURE__ */ C(Cr, { source: "name", label:
|
|
26339
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 1 }, children: /* @__PURE__ */ C(Cr, { source: "name", label: s("ra.register.name"), validate: bo() }) }),
|
|
26339
26340
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 1 }, children: /* @__PURE__ */ C(Cr, { source: "email", type: "email", validate: [bo(), OI()] }) }),
|
|
26340
26341
|
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mb: 1 }, children: /* @__PURE__ */ C(Cr, { source: "password", type: "password", validate: bo() }) })
|
|
26341
26342
|
] }),
|
|
26342
|
-
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled:
|
|
26343
|
+
/* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled: r, fullWidth: !0, children: r ? /* @__PURE__ */ C(Zi, { size: 19, thickness: 3 }) : s("ra.auth.create_account") }) })
|
|
26343
26344
|
] }) })
|
|
26344
26345
|
] }) });
|
|
26345
26346
|
};
|