@applica-software-guru/react-admin 1.3.172 → 1.3.173

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.
@@ -18408,41 +18408,48 @@ WQ.propTypes = {
18408
18408
  ping: u.string,
18409
18409
  rel: u.string
18410
18410
  };
18411
- const UQ = ({ entityId: e, property: t, disabled: n, userResource: r = "entities/user", ...o }) => {
18412
- const [a, s] = je(null), c = on(o), A = rp(), d = Zn(), f = Pe(
18413
- async (m) => {
18414
- m.preventDefault(), m.stopPropagation();
18415
- const I = ht.get(c, o == null ? void 0 : o.source), B = d.replace("entities/", ""), v = await A.getFile(
18416
- `/attachments/${B}/${e || (c == null ? void 0 : c.id)}/${t || (o == null ? void 0 : o.source)}/${(I == null ? void 0 : I.id) || (c == null ? void 0 : c.id)}`
18417
- ), T = document.createElement("a");
18418
- T.href = v, T.download = ht.get(c, (o == null ? void 0 : o.title) || (o == null ? void 0 : o.source)), T.click();
18411
+ const UQ = ({
18412
+ entityId: e,
18413
+ property: t,
18414
+ disabled: n,
18415
+ showUser: r = !1,
18416
+ userResource: o = "entities/user",
18417
+ ...a
18418
+ }) => {
18419
+ const [s, c] = je(null), A = on(a), d = rp(), f = Zn(), p = Pe(
18420
+ async (I) => {
18421
+ I.preventDefault(), I.stopPropagation();
18422
+ const B = ht.get(A, a == null ? void 0 : a.source), v = f.replace("entities/", ""), T = await d.getFile(
18423
+ `/attachments/${v}/${e || (A == null ? void 0 : A.id)}/${t || (a == null ? void 0 : a.source)}/${(B == null ? void 0 : B.id) || (A == null ? void 0 : A.id)}`
18424
+ ), P = document.createElement("a");
18425
+ P.href = T, P.download = ht.get(A, (a == null ? void 0 : a.title) || (a == null ? void 0 : a.source)), P.click();
18419
18426
  },
18420
- [A, c, e, d, t, o == null ? void 0 : o.source, o == null ? void 0 : o.title]
18421
- ), p = Ze(
18427
+ [d, A, e, f, t, a == null ? void 0 : a.source, a == null ? void 0 : a.title]
18428
+ ), h = Ze(
18422
18429
  () => ({
18423
- ...c,
18424
- [o == null ? void 0 : o.source]: (c == null ? void 0 : c.src) || ht.get(c, o == null ? void 0 : o.source),
18425
- [o == null ? void 0 : o.title]: (c == null ? void 0 : c.title) || ht.get(c, (o == null ? void 0 : o.title) || (o == null ? void 0 : o.source))
18430
+ ...A,
18431
+ [a == null ? void 0 : a.source]: (A == null ? void 0 : A.src) || ht.get(A, a == null ? void 0 : a.source),
18432
+ [a == null ? void 0 : a.title]: (A == null ? void 0 : A.title) || ht.get(A, (a == null ? void 0 : a.title) || (a == null ? void 0 : a.source))
18426
18433
  }),
18427
- [c, o == null ? void 0 : o.source, o == null ? void 0 : o.title]
18428
- ), h = Dr();
18434
+ [A, a == null ? void 0 : a.source, a == null ? void 0 : a.title]
18435
+ ), m = Dr();
18429
18436
  return Re(() => {
18430
- !c || !(c != null && c.userId) || A.getOne(r, { id: c == null ? void 0 : c.userId }).then(({ data: m }) => s(m)).catch(() => s(null));
18431
- }, [c, A, r]), /* @__PURE__ */ C(
18437
+ !A || !(A != null && A.userId) || r === !1 || d.getOne(o, { id: A == null ? void 0 : A.userId }).then(({ data: I }) => c(I)).catch(() => c(null));
18438
+ }, [A, d, o]), /* @__PURE__ */ C(
18432
18439
  WQ,
18433
18440
  {
18434
- ...o,
18441
+ ...a,
18435
18442
  disabled: n,
18436
- record: p,
18437
- onClick: f,
18443
+ record: h,
18444
+ onClick: p,
18438
18445
  title: /* @__PURE__ */ ee(Le, { sx: { cursor: "pointer" }, children: [
18439
- /* @__PURE__ */ C(me, { variant: "subtitle1", children: ht.get(p, (o == null ? void 0 : o.title) || (o == null ? void 0 : o.source)) }),
18446
+ /* @__PURE__ */ C(me, { variant: "subtitle1", children: ht.get(h, (a == null ? void 0 : a.title) || (a == null ? void 0 : a.source)) }),
18440
18447
  /* @__PURE__ */ ee(me, { variant: "caption", color: "secondary", children: [
18441
- ht.get(p, "sizeDescription"),
18442
- a && " | ",
18443
- a && h("ra.attachment.info", {
18444
- user: a == null ? void 0 : a.name,
18445
- created: Bo(p == null ? void 0 : p.createdAt).format("DD/MM/YYYY HH:mm")
18448
+ ht.get(h, "sizeDescription"),
18449
+ r && s && " | ",
18450
+ r && s && m("ra.attachment.info", {
18451
+ user: s == null ? void 0 : s.name,
18452
+ created: Bo(h == null ? void 0 : h.createdAt).format("DD/MM/YYYY HH:mm")
18446
18453
  })
18447
18454
  ] })
18448
18455
  ] })