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

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
  ] })
@@ -29406,10 +29413,10 @@ const ef = {
29406
29413
  r(I.currentTarget);
29407
29414
  }, a = () => {
29408
29415
  r(null);
29409
- }, s = Ys((I) => I.breakpoints.down("md")), c = !!n, A = c ? "simple-popover" : void 0, { filterValues: d, resource: f, selectedIds: p = [], onUnselectItems: h } = Ep(e), m = D.useCallback(() => {
29410
- h(), r(null);
29411
- }, [h, r]);
29412
- return /* @__PURE__ */ C(Mv, { in: p !== void 0 && p.length > 0, children: /* @__PURE__ */ ee(
29416
+ }, s = Ys((I) => I.breakpoints.down("md")), { filterValues: c, resource: A, selectedIds: d = [], onUnselectItems: f } = Ep(e), p = !!n && d !== void 0 && d.length > 0, h = p ? "simple-popover" : void 0, m = D.useCallback(() => {
29417
+ f(), r(null);
29418
+ }, [f, r]);
29419
+ return /* @__PURE__ */ C(Mv, { in: d !== void 0 && d.length > 0, children: /* @__PURE__ */ ee(
29413
29420
  Le,
29414
29421
  {
29415
29422
  sx: {
@@ -29418,12 +29425,12 @@ const ef = {
29418
29425
  right: "16px"
29419
29426
  },
29420
29427
  children: [
29421
- /* @__PURE__ */ C(Hv, { color: "primary", "aria-label": "manage", onClick: o, children: p == null ? void 0 : p.length }),
29428
+ /* @__PURE__ */ C(Hv, { color: "primary", "aria-label": "manage", onClick: o, children: d == null ? void 0 : d.length }),
29422
29429
  /* @__PURE__ */ C(
29423
29430
  Ip,
29424
29431
  {
29425
- id: A,
29426
- open: c,
29432
+ id: h,
29433
+ open: p,
29427
29434
  anchorEl: n,
29428
29435
  onClose: a,
29429
29436
  anchorOrigin: {
@@ -29441,9 +29448,9 @@ const ef = {
29441
29448
  D.Children.map(t, (I) => {
29442
29449
  var B;
29443
29450
  return /* @__PURE__ */ C(mu, { sx: ef, children: D.isValidElement(I) ? D.cloneElement(I, {
29444
- filterValues: d,
29445
- resource: f,
29446
- selectedIds: p,
29451
+ filterValues: c,
29452
+ resource: A,
29453
+ selectedIds: d,
29447
29454
  sx: rv,
29448
29455
  ...(B = I.props) != null && B.popover ? { closePopover: a } : {}
29449
29456
  }) : null });