@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.
- package/dist/components/ra-fields/AttachmentField.d.ts +10 -3
- package/dist/components/ra-fields/AttachmentField.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 +33 -26
- 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/ra-fields/AttachmentField.tsx +18 -5
package/dist/react-admin.es.js
CHANGED
|
@@ -18408,41 +18408,48 @@ WQ.propTypes = {
|
|
|
18408
18408
|
ping: u.string,
|
|
18409
18409
|
rel: u.string
|
|
18410
18410
|
};
|
|
18411
|
-
const UQ = ({
|
|
18412
|
-
|
|
18413
|
-
|
|
18414
|
-
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
|
|
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
|
-
[
|
|
18421
|
-
),
|
|
18427
|
+
[d, A, e, f, t, a == null ? void 0 : a.source, a == null ? void 0 : a.title]
|
|
18428
|
+
), h = Ze(
|
|
18422
18429
|
() => ({
|
|
18423
|
-
...
|
|
18424
|
-
[
|
|
18425
|
-
[
|
|
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
|
-
[
|
|
18428
|
-
),
|
|
18434
|
+
[A, a == null ? void 0 : a.source, a == null ? void 0 : a.title]
|
|
18435
|
+
), m = Dr();
|
|
18429
18436
|
return Re(() => {
|
|
18430
|
-
!
|
|
18431
|
-
}, [
|
|
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
|
-
...
|
|
18441
|
+
...a,
|
|
18435
18442
|
disabled: n,
|
|
18436
|
-
record:
|
|
18437
|
-
onClick:
|
|
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(
|
|
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(
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
user:
|
|
18445
|
-
created: Bo(
|
|
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
|
] })
|