@applica-software-guru/react-admin 1.5.256 → 1.5.257
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/ra-fields/AttachmentField.d.ts +6 -1
- package/dist/components/ra-fields/AttachmentField.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +2 -2
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +28 -27
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +2 -2
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-fields/AttachmentField.tsx +8 -2
package/dist/react-admin.es.js
CHANGED
|
@@ -6492,7 +6492,7 @@ process.env.NODE_ENV !== "production" && (J2.propTypes = {
|
|
|
6492
6492
|
styles: x.oneOfType([x.array, x.string, x.object, x.func])
|
|
6493
6493
|
});
|
|
6494
6494
|
/**
|
|
6495
|
-
* @mui/styled-engine v5.16.
|
|
6495
|
+
* @mui/styled-engine v5.16.6
|
|
6496
6496
|
*
|
|
6497
6497
|
* @license MIT
|
|
6498
6498
|
* This source code is licensed under the MIT license found in the
|
|
@@ -23633,42 +23633,43 @@ function kne({
|
|
|
23633
23633
|
disabled: n,
|
|
23634
23634
|
showUser: r = !1,
|
|
23635
23635
|
userResource: o = "entities/user",
|
|
23636
|
-
|
|
23636
|
+
rootEntity: a = void 0,
|
|
23637
|
+
...s
|
|
23637
23638
|
}) {
|
|
23638
|
-
const [
|
|
23639
|
-
async (
|
|
23640
|
-
|
|
23641
|
-
const
|
|
23642
|
-
`/attachments/${
|
|
23643
|
-
),
|
|
23644
|
-
|
|
23639
|
+
const [c, u] = Be(null), d = sn(s), p = Bm(), h = ko(), g = Ae(
|
|
23640
|
+
async (C) => {
|
|
23641
|
+
C.preventDefault(), C.stopPropagation();
|
|
23642
|
+
const w = yt.get(d, s == null ? void 0 : s.source), I = a || h.replace("entities/", ""), M = await p.getFile(
|
|
23643
|
+
`/attachments/${I}/${e || (d == null ? void 0 : d.id)}/${t || (s == null ? void 0 : s.source)}/${(w == null ? void 0 : w.id) || (d == null ? void 0 : d.id)}`
|
|
23644
|
+
), S = document.createElement("a");
|
|
23645
|
+
S.href = M, S.download = yt.get(d, (s == null ? void 0 : s.title) || (s == null ? void 0 : s.source)), S.click();
|
|
23645
23646
|
},
|
|
23646
|
-
[
|
|
23647
|
-
),
|
|
23647
|
+
[p, d, e, h, a, t, s == null ? void 0 : s.source, s == null ? void 0 : s.title]
|
|
23648
|
+
), v = Ue(
|
|
23648
23649
|
() => ({
|
|
23649
|
-
...
|
|
23650
|
-
[
|
|
23651
|
-
[
|
|
23650
|
+
...d,
|
|
23651
|
+
[s == null ? void 0 : s.source]: (d == null ? void 0 : d.src) || yt.get(d, s == null ? void 0 : s.source),
|
|
23652
|
+
[s == null ? void 0 : s.title]: (d == null ? void 0 : d.title) || yt.get(d, (s == null ? void 0 : s.title) || (s == null ? void 0 : s.source))
|
|
23652
23653
|
}),
|
|
23653
|
-
[
|
|
23654
|
-
),
|
|
23654
|
+
[d, s == null ? void 0 : s.source, s == null ? void 0 : s.title]
|
|
23655
|
+
), b = Ro();
|
|
23655
23656
|
return Pe(() => {
|
|
23656
|
-
!
|
|
23657
|
-
}, [
|
|
23657
|
+
!d || !(d != null && d.userId) || r === !1 || p.getOne(o, { id: d == null ? void 0 : d.userId }).then(({ data: C }) => u(C)).catch(() => u(null));
|
|
23658
|
+
}, [d, p, o, r]), /* @__PURE__ */ m(
|
|
23658
23659
|
Rne,
|
|
23659
23660
|
{
|
|
23660
|
-
...
|
|
23661
|
+
...s,
|
|
23661
23662
|
disabled: n,
|
|
23662
|
-
record:
|
|
23663
|
-
onClick:
|
|
23663
|
+
record: v,
|
|
23664
|
+
onClick: g,
|
|
23664
23665
|
title: /* @__PURE__ */ J(Le, { sx: { cursor: "pointer" }, children: [
|
|
23665
|
-
/* @__PURE__ */ m(he, { variant: "subtitle1", children: yt.get(
|
|
23666
|
+
/* @__PURE__ */ m(he, { variant: "subtitle1", children: yt.get(v, (s == null ? void 0 : s.title) || (s == null ? void 0 : s.source)) }),
|
|
23666
23667
|
/* @__PURE__ */ J(he, { variant: "caption", color: "secondary", children: [
|
|
23667
|
-
yt.get(
|
|
23668
|
-
r &&
|
|
23669
|
-
r &&
|
|
23670
|
-
user:
|
|
23671
|
-
created: ro(
|
|
23668
|
+
yt.get(v, "sizeDescription"),
|
|
23669
|
+
r && c ? " | " : null,
|
|
23670
|
+
r && c ? b("ra.attachment.info", {
|
|
23671
|
+
user: c == null ? void 0 : c.name,
|
|
23672
|
+
created: ro(v == null ? void 0 : v.createdAt).format("DD/MM/YYYY HH:mm")
|
|
23672
23673
|
}) : null
|
|
23673
23674
|
] })
|
|
23674
23675
|
] })
|