@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.
@@ -26160,8 +26160,8 @@ const Wb = () => {
26160
26160
  Ub.propTypes = {
26161
26161
  children: c.node
26162
26162
  };
26163
- const Xs = ({ version: e, name: t, children: n, background: r = Wb }) => /* @__PURE__ */ Z(ke, { sx: { minHeight: "100vh" }, children: [
26164
- we.isValidElement(r) ? r : we.createElement(r),
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: n }) })
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, version: t, background: n }) => {
26202
- const r = or(), i = Fs(), s = da(), l = tg(), { token: u } = xS();
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 i.activate != "function")
26205
+ if (typeof s.activate != "function")
26205
26206
  throw new Error("The authProvider used for the ActivatePage must define an activate() method");
26206
- i.activate(u).then(() => {
26207
- s("ra.auth.activate_success", { type: "info" }), wt.delay(() => l("/login"), 1e3);
26208
- }).catch((A) => {
26209
- s(A, { type: "error" }), wt.delay(() => l("/login"), 1e3);
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
- }, [u]), /* @__PURE__ */ C(Xs, { name: e, version: t, background: n, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
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: r("ra.auth.activate") }),
26214
- /* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: r("ra.auth.back_to_login") })
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: r("ra.auth.activate_pending") })
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, enablePasswordRecover: n, enableRegistration: r, redirectTo: i, background: s }) => {
26225
- const [l, u] = XS(!1), A = ZS(), f = or(), g = da(), h = eO(), p = tg();
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
- h({}, !1).then(() => {
26228
- p("/");
26228
+ p({}, !1).then(() => {
26229
+ m("/");
26229
26230
  }).catch(() => {
26230
26231
  });
26231
- }, [h, p]);
26232
- const m = (I) => {
26233
- u(!0), A(I, i).then(() => {
26234
- u(!1);
26235
- }).catch((B) => {
26236
- u(!1), g(
26237
- typeof B == "string" ? B : typeof B > "u" || !B.message ? "ra.auth.sign_in_error" : B.message,
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 B == "string" ? B : B && B.message ? B.message : void 0
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: s, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
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
- r && /* @__PURE__ */ C(Ie, { component: In, to: "/register", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: f("ra.auth.register") })
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: m, children: [
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: f("ra.auth.username"),
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: f("ra.auth.password"),
26271
+ label: g("ra.auth.password"),
26271
26272
  type: "password",
26272
26273
  autoComplete: "current-password",
26273
26274
  validate: bo(),
26274
- placeholder: f("ra.auth.password_placeholder"),
26275
+ placeholder: g("ra.auth.password_placeholder"),
26275
26276
  fullWidth: !0
26276
26277
  }
26277
26278
  ) })
26278
26279
  ] }),
26279
- n && /* @__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: f("ra.auth.forgot_password") }) }) }),
26280
- /* @__PURE__ */ C(ve, { item: !0, xs: 12, sx: { mt: 1 }, children: /* @__PURE__ */ C(su, { variant: "contained", type: "submit", color: "primary", disabled: l, fullWidth: !0, children: l ? /* @__PURE__ */ C(Zi, { size: 19, thickness: 3 }) : f("ra.auth.sign_in") }) })
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, version: t, background: n }) => {
26297
- const [r, i] = Ze(!1), s = or(), l = ig(), u = da(), A = Fs(), f = ({ email: g }) => {
26298
- i(!0), A.recover(g).then((h) => {
26299
- const p = `ra.auth.recover_${h.responseCode}`, m = h.responseCode === "ok" ? "info" : "error";
26300
- u(p, { type: m }), l("/login");
26301
- }).catch((h) => {
26302
- u(h, { type: "error" });
26303
- }).finally(() => i(!1));
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, version: t, background: n, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
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: s("ra.auth.recover.title") }),
26308
- /* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: s("ra.auth.back_to_login") })
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: f, children: [
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: s("ra.auth.recover.inbox_help") }) }),
26313
- /* @__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.recover") }) })
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, version: t }) => {
26323
- const [n, r] = Ze(!1), i = or(), s = ig(), l = da(), u = Fs(), A = (f) => {
26324
- r(!0), u.register(f).then((g) => {
26325
- const h = `ra.auth.register_${g.responseCode}`, p = g.responseCode === "ok" ? "info" : "error";
26326
- l(h, { type: p }), s("/login");
26327
- }).catch((g) => {
26328
- l(g, { type: "error" });
26329
- }).finally(() => r(!1));
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, version: t, children: /* @__PURE__ */ Z(ve, { container: !0, spacing: 3, children: [
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: i("ra.auth.register.title") }),
26334
- /* @__PURE__ */ C(Ie, { component: In, to: "/login", variant: "body1", sx: { textDecoration: "none" }, color: "primary", children: i("ra.auth.already_have_account") })
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: A, children: [
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: i("ra.register.name"), validate: bo() }) }),
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: n, fullWidth: !0, children: n ? /* @__PURE__ */ C(Zi, { size: 19, thickness: 3 }) : i("ra.auth.create_account") }) })
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
  };