@bahmni/admin-app 0.0.1-dev.457 → 0.0.1-dev.458
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/{AdminDashboard-CwN5Lzwq.js → AdminDashboard-D2myV8h8.js} +4 -4
- package/dist/{AuditLog-CsZ4vNwR.js → AuditLog-BANA_El_.js} +8 -8
- package/dist/{CsvExport-jwy1zF89.js → CsvExport-D3MLPM8D.js} +16 -16
- package/dist/{CsvUpload-B0PPRKKZ.js → CsvUpload-BKdwBbmG.js} +1 -1
- package/dist/DocumentsTable-ClDSnyUa-CID7otGi.js +387 -0
- package/dist/{FormsTable-D04JNgYd-DVFhiA43.js → FormsTable-Cbe9Shu--DHI0E9vM.js} +49 -49
- package/dist/{LNWAZHJI-BkFyhfYL.js → LNWAZHJI-ioGdkR1P.js} +4 -4
- package/dist/{MWZ6AO7Z-4hUZm9Dp.js → MWZ6AO7Z-JcHU5Vtp.js} +5 -5
- package/dist/{Observations-B0V1ebXI-DNdFriUj.js → Observations-foWY-TMm-BQi7Rhp-.js} +36 -36
- package/dist/{YPM2AS64-DchGGbed.js → YPM2AS64-WlM3cWX3.js} +1 -1
- package/dist/{index-C_3VFMYg.js → index-DibGUGp0.js} +27342 -27289
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-BY19cMyH-6qlZAUQx.js +0 -439
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import "react";
|
|
2
|
+
import { H as o, M as a, P as s, S as t } from "./index-DibGUGp0.js";
|
|
4
3
|
import "@tanstack/react-query";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import "react";
|
|
5
|
+
const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
|
|
6
|
+
a,
|
|
7
7
|
{
|
|
8
8
|
extensionPointId: t,
|
|
9
9
|
appName: s,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { a8 as ee, a9 as te, aa as se, ab as K, a as ae, ac as ne, ad as re, H as ie, a4 as oe, ae as ue, af as de, ag as C, a6 as V, ah as le } from "./index-DibGUGp0.js";
|
|
3
3
|
import { useState as l, useRef as U, useEffect as k, useMemo as ce, useCallback as me } from "react";
|
|
4
4
|
import { useQuery as Ee } from "@tanstack/react-query";
|
|
5
5
|
const q = Symbol.for("constructDateFrom");
|
|
@@ -38,7 +38,7 @@ const Le = (e, t) => {
|
|
|
38
38
|
startTime: "00:00",
|
|
39
39
|
username: "",
|
|
40
40
|
patientId: ""
|
|
41
|
-
}), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R, p] = l(null), [b, f] = l(!1), [
|
|
41
|
+
}), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R, p] = l(null), [b, f] = l(!1), [O, g] = l(!1), [F, M] = l(1), I = U(1), s = (c) => {
|
|
42
42
|
I.current = c, M(c);
|
|
43
43
|
}, o = U(0), [n, Q] = l(null), B = U(null), { data: N, isLoading: j, isFetching: L, isError: z } = Ee({
|
|
44
44
|
queryKey: ["auditLogs", n?.requestId],
|
|
@@ -159,8 +159,8 @@ const Le = (e, t) => {
|
|
|
159
159
|
firstIndex: r,
|
|
160
160
|
lastIndex: i,
|
|
161
161
|
hasNext: b,
|
|
162
|
-
hasPrevious:
|
|
163
|
-
currentPageNumber:
|
|
162
|
+
hasPrevious: O,
|
|
163
|
+
currentPageNumber: F,
|
|
164
164
|
next: Z,
|
|
165
165
|
prev: $,
|
|
166
166
|
runReport: x,
|
|
@@ -183,9 +183,9 @@ const Le = (e, t) => {
|
|
|
183
183
|
hasPrevious: p,
|
|
184
184
|
currentPageNumber: b,
|
|
185
185
|
next: f,
|
|
186
|
-
prev:
|
|
186
|
+
prev: O,
|
|
187
187
|
runReport: g,
|
|
188
|
-
reset:
|
|
188
|
+
reset: F
|
|
189
189
|
} = Te(), M = ce(
|
|
190
190
|
() => [
|
|
191
191
|
{ key: "auditLogId", header: e("EVENT_ID") },
|
|
@@ -301,7 +301,7 @@ const Le = (e, t) => {
|
|
|
301
301
|
V,
|
|
302
302
|
{
|
|
303
303
|
kind: "tertiary",
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: F,
|
|
305
305
|
disabled: u,
|
|
306
306
|
testId: "audit-log-reset-button",
|
|
307
307
|
children: e("AUDIT_LOG_RESET_BUTTON_LABEL")
|
|
@@ -340,7 +340,7 @@ const Le = (e, t) => {
|
|
|
340
340
|
disabled: u,
|
|
341
341
|
previousLabel: e("AUDIT_LOG_PREV_BUTTON_LABEL"),
|
|
342
342
|
nextLabel: e("AUDIT_LOG_NEXT_BUTTON_LABEL"),
|
|
343
|
-
onSetChange: (s) => s === "next" ? f() :
|
|
343
|
+
onSetChange: (s) => s === "next" ? f() : O()
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
) })
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI",
|
|
2
|
+
import { a as A, z as M, _ as R, a0 as h, a1 as O, a2 as P, a3 as g, H as D, a4 as V, a5 as f, a6 as x, a7 as b } from "./index-DibGUGp0.js";
|
|
3
|
+
import { useQuery as y, useMutation as L } from "@tanstack/react-query";
|
|
4
|
+
import { useState as E, useMemo as v } from "react";
|
|
5
|
+
const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H = "CsvExport-module_form__w-cN-", z = "CsvExport-module_search__G82i7", r = {
|
|
6
6
|
tile: X,
|
|
7
7
|
title: B,
|
|
8
|
-
form:
|
|
9
|
-
search:
|
|
10
|
-
},
|
|
11
|
-
const { t } = A(), { addNotification: i } = M(), [
|
|
8
|
+
form: H,
|
|
9
|
+
search: z
|
|
10
|
+
}, G = 300, p = 2, _ = 5e3, U = "custom:(uuid,setMembers:(uuid))", Q = () => {
|
|
11
|
+
const { t } = A(), { addNotification: i } = M(), [S, C] = E(""), [s, c] = E(
|
|
12
12
|
null
|
|
13
|
-
), n = R(
|
|
13
|
+
), n = R(S.trim(), G), { data: l = [] } = y({
|
|
14
14
|
queryKey: ["csvExportConceptSearch", n],
|
|
15
15
|
queryFn: () => h(n),
|
|
16
|
-
enabled: n.length >=
|
|
16
|
+
enabled: n.length >= p && n !== s?.name,
|
|
17
17
|
// Keep prior options visible while the next term loads, but not once the input is too short to search
|
|
18
|
-
placeholderData: (e) => n.length >=
|
|
19
|
-
}), T =
|
|
18
|
+
placeholderData: (e) => n.length >= p ? e : void 0
|
|
19
|
+
}), T = v(
|
|
20
20
|
() => l.flatMap(
|
|
21
21
|
(e) => e.name?.name ? [{ uuid: e.uuid, name: e.name.name }] : []
|
|
22
22
|
),
|
|
23
23
|
[l]
|
|
24
|
-
), o =
|
|
24
|
+
), o = L({
|
|
25
25
|
mutationFn: async (e) => (await P(e.uuid, U)).setMembers?.length ? g(e.name) : null,
|
|
26
26
|
onSuccess: (e, u) => {
|
|
27
27
|
const m = u.name;
|
|
@@ -65,8 +65,8 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", z
|
|
|
65
65
|
o.mutate(s);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */ a(
|
|
69
|
-
|
|
68
|
+
return /* @__PURE__ */ a(D, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
|
|
69
|
+
V,
|
|
70
70
|
{
|
|
71
71
|
id: "admin-csv-export-page",
|
|
72
72
|
"data-testid": "admin-csv-export-page-test-id",
|
|
@@ -118,5 +118,5 @@ const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", z
|
|
|
118
118
|
) });
|
|
119
119
|
};
|
|
120
120
|
export {
|
|
121
|
-
|
|
121
|
+
Q as CsvExport
|
|
122
122
|
};
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import { u as pe, a as Ee, z as ge, i as Ne, Q as Ce, w as Ie, T as v, b as Ae, c as be, K as Le, h as fe, O as ye, d as De, U as j, J as ve, L as we, I as Oe, e as Se, N as Ue, X as J, G as ee } from "./index-DibGUGp0.js";
|
|
3
|
+
import { useQuery as Me } from "@tanstack/react-query";
|
|
4
|
+
import { useState as T, useRef as Re, useEffect as E, useMemo as g, useCallback as _ } from "react";
|
|
5
|
+
const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", Be = "DocumentsTable-module_printContainer__rtarJ", Ge = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", xe = "DocumentsTable-module_attachmentLoading__FAR6p", qe = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Pe = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", je = "DocumentsTable-module_printAllButton__IVYUW", Je = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
|
|
6
|
+
documentsTableBody: ke,
|
|
7
|
+
viewAttachmentsLink: $e,
|
|
8
|
+
documentViewerContainer: He,
|
|
9
|
+
printContainer: Be,
|
|
10
|
+
attachmentItem: Ge,
|
|
11
|
+
attachmentCounter: ze,
|
|
12
|
+
attachmentError: Ve,
|
|
13
|
+
documentIframe: We,
|
|
14
|
+
attachmentContent: Fe,
|
|
15
|
+
attachmentLoading: xe,
|
|
16
|
+
hiddenWhileLoading: qe,
|
|
17
|
+
documentImage: Ke,
|
|
18
|
+
header: Pe,
|
|
19
|
+
documentTypeCell: Qe,
|
|
20
|
+
printAllButton: je,
|
|
21
|
+
attachmentHeader: Je
|
|
22
|
+
}, Xe = "startConsultation", Ye = "add", Ze = "documents", X = "document-print-container", Y = () => /* @__PURE__ */ n(ee, {}), et = /* @__PURE__ */ new Set([
|
|
23
|
+
"ArrowUp",
|
|
24
|
+
"ArrowDown",
|
|
25
|
+
"PageUp",
|
|
26
|
+
"PageDown",
|
|
27
|
+
"Home",
|
|
28
|
+
"End",
|
|
29
|
+
" "
|
|
30
|
+
]), tt = 15e3, nt = [
|
|
31
|
+
"documentType",
|
|
32
|
+
"documentIdentifier",
|
|
33
|
+
"attachments",
|
|
34
|
+
"uploadedOn",
|
|
35
|
+
"uploadedBy"
|
|
36
|
+
], at = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, Z = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], lt = ({ config: l, encounterUuids: H }) => {
|
|
37
|
+
const [m, B] = T(!1), [r, G] = T(
|
|
38
|
+
null
|
|
39
|
+
), [b, w] = T(
|
|
40
|
+
/* @__PURE__ */ new Set()
|
|
41
|
+
), [L, O] = T(
|
|
42
|
+
/* @__PURE__ */ new Set()
|
|
43
|
+
), C = Re(null), [S, z] = T(
|
|
44
|
+
null
|
|
45
|
+
), V = S !== null;
|
|
46
|
+
E(() => () => C.current?.abort(), []);
|
|
47
|
+
const N = pe(), { t: a } = Ee(), { addNotification: f } = ge(), c = g(
|
|
48
|
+
() => l?.actions?.find(
|
|
49
|
+
(e) => e.type === Ye
|
|
50
|
+
),
|
|
51
|
+
[l?.actions]
|
|
52
|
+
), te = Ne(c?.requiredPrivilege), ne = !!c && te, ae = Number(l?.pageSize) || 5, [U, M] = T(1), [I, oe] = T(ae), [re, R] = T(void 0), W = _((e) => {
|
|
53
|
+
G(e), B(!0);
|
|
54
|
+
}, []), de = _(() => {
|
|
55
|
+
C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), w(/* @__PURE__ */ new Set());
|
|
56
|
+
}, []), F = _((e) => {
|
|
57
|
+
O((t) => new Set(t).add(e));
|
|
58
|
+
}, []), x = _((e) => {
|
|
59
|
+
w((t) => new Set(t).add(e));
|
|
60
|
+
}, []), se = _(() => {
|
|
61
|
+
c && globalThis.dispatchEvent(
|
|
62
|
+
new CustomEvent(Xe, {
|
|
63
|
+
detail: {
|
|
64
|
+
encounterType: c.encounterType,
|
|
65
|
+
editOnly: c.editOnly ?? Ze,
|
|
66
|
+
...c.editTitle ? { editTitle: c.editTitle } : {}
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
}, [c]), { data: A, isLoading: le, isError: k, error: $, refetch: q } = Me({
|
|
71
|
+
queryKey: [
|
|
72
|
+
"documents",
|
|
73
|
+
N,
|
|
74
|
+
H,
|
|
75
|
+
U,
|
|
76
|
+
I
|
|
77
|
+
],
|
|
78
|
+
enabled: !!N,
|
|
79
|
+
queryFn: () => Ce(
|
|
80
|
+
N,
|
|
81
|
+
H,
|
|
82
|
+
I,
|
|
83
|
+
U
|
|
84
|
+
)
|
|
85
|
+
});
|
|
86
|
+
Ie(
|
|
87
|
+
(e) => {
|
|
88
|
+
e.patientUUID === N && e.updatedResources.documents && q();
|
|
89
|
+
},
|
|
90
|
+
[N, q]
|
|
91
|
+
), E(() => {
|
|
92
|
+
A && R(A.total);
|
|
93
|
+
}, [A]), E(() => {
|
|
94
|
+
M(1), R(void 0);
|
|
95
|
+
}, [N]), E(() => {
|
|
96
|
+
k && f({
|
|
97
|
+
title: a("ERROR_DEFAULT_TITLE"),
|
|
98
|
+
message: $?.message ?? "",
|
|
99
|
+
type: "error"
|
|
100
|
+
});
|
|
101
|
+
}, [k, $, f, a]), E(() => {
|
|
102
|
+
const e = new AbortController();
|
|
103
|
+
return (async () => {
|
|
104
|
+
if (!m || !r) return;
|
|
105
|
+
const t = /* @__PURE__ */ new Set(), d = Z(r);
|
|
106
|
+
for (let s = 0; s < d.length; s++) {
|
|
107
|
+
const u = v(d[s].url);
|
|
108
|
+
try {
|
|
109
|
+
(await fetch(u, {
|
|
110
|
+
method: "HEAD",
|
|
111
|
+
signal: e.signal
|
|
112
|
+
})).ok || t.add(s);
|
|
113
|
+
} catch (p) {
|
|
114
|
+
p instanceof Error && p.name !== "AbortError" && t.add(s);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
e.signal.aborted || w(t);
|
|
118
|
+
})(), () => e.abort();
|
|
119
|
+
}, [m, r]), E(() => {
|
|
120
|
+
if (!m || !r) return;
|
|
121
|
+
const e = document.querySelector(
|
|
122
|
+
'[data-testid="document-view-modal"] .cds--modal-content'
|
|
123
|
+
);
|
|
124
|
+
if (!e) return;
|
|
125
|
+
let t = !1;
|
|
126
|
+
const d = () => {
|
|
127
|
+
t = !0;
|
|
128
|
+
}, s = (D) => {
|
|
129
|
+
D.target === e && d();
|
|
130
|
+
}, u = (D) => {
|
|
131
|
+
const Te = D.target;
|
|
132
|
+
et.has(D.key) && !Te?.closest("button, input, textarea, select, a") && d();
|
|
133
|
+
}, p = () => {
|
|
134
|
+
!t && e.scrollTop !== 0 && (e.scrollTop = 0);
|
|
135
|
+
};
|
|
136
|
+
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchmove", d, { passive: !0 }), e.addEventListener("mousedown", s), e.addEventListener("keydown", u), e.addEventListener("scroll", p), () => {
|
|
137
|
+
e.removeEventListener("wheel", d), e.removeEventListener("touchmove", d), e.removeEventListener("mousedown", s), e.removeEventListener("keydown", u), e.removeEventListener("scroll", p);
|
|
138
|
+
};
|
|
139
|
+
}, [m, r]);
|
|
140
|
+
const ie = _(
|
|
141
|
+
(e, t) => {
|
|
142
|
+
t !== I ? (oe(t), M(1), R(void 0)) : M(e);
|
|
143
|
+
},
|
|
144
|
+
[I]
|
|
145
|
+
), y = g(
|
|
146
|
+
() => l?.fields ?? nt,
|
|
147
|
+
[l?.fields]
|
|
148
|
+
), ce = g(() => [...A?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [A]), me = g(() => Ae(y, a), [y, a]), ue = g(
|
|
149
|
+
() => y.map((e) => ({
|
|
150
|
+
key: e,
|
|
151
|
+
sortable: e !== "attachments"
|
|
152
|
+
})),
|
|
153
|
+
[y]
|
|
154
|
+
), i = g(
|
|
155
|
+
() => r ? Z(r) : [],
|
|
156
|
+
[r]
|
|
157
|
+
), K = i.every(
|
|
158
|
+
(e, t) => L.has(t) || b.has(t) || v(e.url) === "#"
|
|
159
|
+
);
|
|
160
|
+
E(() => {
|
|
161
|
+
if (!m || i.length === 0) return;
|
|
162
|
+
const e = setTimeout(
|
|
163
|
+
() => O(new Set(i.keys())),
|
|
164
|
+
tt
|
|
165
|
+
);
|
|
166
|
+
return () => clearTimeout(e);
|
|
167
|
+
}, [m, i]);
|
|
168
|
+
const P = _(
|
|
169
|
+
async (e, t) => {
|
|
170
|
+
if (!r || C.current) return;
|
|
171
|
+
const d = new AbortController(), { signal: s } = d;
|
|
172
|
+
C.current = d, z(t);
|
|
173
|
+
const u = document.getElementById(X);
|
|
174
|
+
try {
|
|
175
|
+
await be(
|
|
176
|
+
e,
|
|
177
|
+
r.documentIdentifier,
|
|
178
|
+
{ container: u, signal: s }
|
|
179
|
+
);
|
|
180
|
+
} catch {
|
|
181
|
+
s.aborted || f({
|
|
182
|
+
title: a("ERROR_DEFAULT_TITLE"),
|
|
183
|
+
message: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT"),
|
|
184
|
+
type: "error"
|
|
185
|
+
});
|
|
186
|
+
} finally {
|
|
187
|
+
C.current = null, z(null);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
[r, f, a]
|
|
191
|
+
), Q = g(
|
|
192
|
+
() => i.filter(
|
|
193
|
+
(e, t) => v(e.url) !== "#" && !b.has(t)
|
|
194
|
+
),
|
|
195
|
+
[i, b]
|
|
196
|
+
), he = _(
|
|
197
|
+
(e, t) => {
|
|
198
|
+
switch (t) {
|
|
199
|
+
case "documentIdentifier":
|
|
200
|
+
return /* @__PURE__ */ n("span", { children: e.documentIdentifier?.trim() || "-" });
|
|
201
|
+
case "documentType":
|
|
202
|
+
return /* @__PURE__ */ h("div", { className: o.documentTypeCell, children: [
|
|
203
|
+
/* @__PURE__ */ n("span", { children: e.documentType ?? a("DOCUMENTS_NOT_AVAILABLE") }),
|
|
204
|
+
e.description && /* @__PURE__ */ n(
|
|
205
|
+
ye,
|
|
206
|
+
{
|
|
207
|
+
iconName: "fa-file-lines",
|
|
208
|
+
content: e.description,
|
|
209
|
+
ariaLabel: e.description,
|
|
210
|
+
testId: `document-notes-${e.id}`
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] });
|
|
214
|
+
case "uploadedOn":
|
|
215
|
+
return fe(
|
|
216
|
+
e.uploadedOn,
|
|
217
|
+
a,
|
|
218
|
+
!0
|
|
219
|
+
).formattedResult || a("DOCUMENTS_NOT_AVAILABLE");
|
|
220
|
+
case "uploadedBy":
|
|
221
|
+
return e.uploadedBy ?? a("DOCUMENTS_NOT_AVAILABLE");
|
|
222
|
+
case "attachments":
|
|
223
|
+
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
|
|
224
|
+
Le,
|
|
225
|
+
{
|
|
226
|
+
onClick: () => W(e),
|
|
227
|
+
className: o.viewAttachmentsLink,
|
|
228
|
+
"data-testid": `view-attachments-${e.id}`,
|
|
229
|
+
children: a("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
230
|
+
}
|
|
231
|
+
) : "--";
|
|
232
|
+
default:
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
[W, a]
|
|
237
|
+
);
|
|
238
|
+
return /* @__PURE__ */ h(_e, { children: [
|
|
239
|
+
ne && /* @__PURE__ */ h(De, { className: o.header, testId: "documents-header", children: [
|
|
240
|
+
/* @__PURE__ */ n("p", { children: a("DOCUMENTS_TABLE_HEADING") }),
|
|
241
|
+
/* @__PURE__ */ n(
|
|
242
|
+
j,
|
|
243
|
+
{
|
|
244
|
+
autoAlign: !0,
|
|
245
|
+
size: "lg",
|
|
246
|
+
kind: "ghost",
|
|
247
|
+
label: a(c.label),
|
|
248
|
+
testId: "documents-add-button",
|
|
249
|
+
onClick: se,
|
|
250
|
+
children: /* @__PURE__ */ n(ve, { id: "documents-add-icon", name: "fa-plus", size: we.LG })
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ n("div", { "data-testid": "documents-table", children: /* @__PURE__ */ n(
|
|
255
|
+
Oe,
|
|
256
|
+
{
|
|
257
|
+
headers: me,
|
|
258
|
+
ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
|
|
259
|
+
rows: ce,
|
|
260
|
+
loading: le,
|
|
261
|
+
errorStateMessage: k ? $?.message : null,
|
|
262
|
+
sortable: ue,
|
|
263
|
+
emptyStateMessage: a("DOCUMENTS_NO_RECORDS"),
|
|
264
|
+
renderCell: he,
|
|
265
|
+
className: o.documentsTableBody,
|
|
266
|
+
dataTestId: "documents-table",
|
|
267
|
+
pageSize: I,
|
|
268
|
+
totalItems: re,
|
|
269
|
+
page: U,
|
|
270
|
+
onPageChange: ie
|
|
271
|
+
}
|
|
272
|
+
) }),
|
|
273
|
+
m && r && /* @__PURE__ */ n(
|
|
274
|
+
Se,
|
|
275
|
+
{
|
|
276
|
+
id: "modalIdForActionAreaLayout",
|
|
277
|
+
portalId: "main-display-area",
|
|
278
|
+
open: m,
|
|
279
|
+
onRequestClose: de,
|
|
280
|
+
modalHeading: r.documentIdentifier,
|
|
281
|
+
passiveModal: !0,
|
|
282
|
+
size: "lg",
|
|
283
|
+
testId: "document-view-modal",
|
|
284
|
+
children: /* @__PURE__ */ h("div", { className: o.documentViewerContainer, children: [
|
|
285
|
+
Q.length > 1 && /* @__PURE__ */ n(
|
|
286
|
+
Ue,
|
|
287
|
+
{
|
|
288
|
+
kind: "tertiary",
|
|
289
|
+
size: "sm",
|
|
290
|
+
className: o.printAllButton,
|
|
291
|
+
renderIcon: S === "all" ? Y : J,
|
|
292
|
+
disabled: V || !K,
|
|
293
|
+
testId: "print-all-attachments",
|
|
294
|
+
onClick: () => P(Q, "all"),
|
|
295
|
+
children: a("DOCUMENTS_PRINT_ALL")
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
i.map((e, t) => {
|
|
299
|
+
const d = v(e.url), s = e.contentType?.toLowerCase().includes("pdf"), u = (e.contentType?.toLowerCase().includes("image") ?? !1) || at.test(e.url ?? ""), p = b.has(t);
|
|
300
|
+
return d === "#" || p ? /* @__PURE__ */ h(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
className: o.attachmentError,
|
|
304
|
+
"data-testid": `attachment-error-${t}`,
|
|
305
|
+
children: [
|
|
306
|
+
i.length > 1 && /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
|
|
307
|
+
current: t + 1,
|
|
308
|
+
total: i.length
|
|
309
|
+
}) }),
|
|
310
|
+
/* @__PURE__ */ n("p", { children: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
`${r.id}-${e.url}`
|
|
314
|
+
) : /* @__PURE__ */ h(
|
|
315
|
+
"div",
|
|
316
|
+
{
|
|
317
|
+
className: o.attachmentItem,
|
|
318
|
+
"data-testid": `attachment-item-${t}`,
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ h("div", { className: o.attachmentHeader, children: [
|
|
321
|
+
i.length > 1 ? /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
|
|
322
|
+
current: t + 1,
|
|
323
|
+
total: i.length
|
|
324
|
+
}) }) : /* @__PURE__ */ n("span", {}),
|
|
325
|
+
/* @__PURE__ */ n(
|
|
326
|
+
j,
|
|
327
|
+
{
|
|
328
|
+
kind: "ghost",
|
|
329
|
+
size: "sm",
|
|
330
|
+
label: a("DOCUMENTS_PRINT_ATTACHMENT", {
|
|
331
|
+
index: t + 1
|
|
332
|
+
}),
|
|
333
|
+
disabled: V || !K,
|
|
334
|
+
testId: `print-attachment-${t}`,
|
|
335
|
+
onClick: () => P([e], t),
|
|
336
|
+
children: S === t ? /* @__PURE__ */ n(Y, {}) : /* @__PURE__ */ n(J, {})
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ h("div", { className: o.attachmentContent, children: [
|
|
341
|
+
!L.has(t) && /* @__PURE__ */ n(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
className: o.attachmentLoading,
|
|
345
|
+
"data-testid": `attachment-loading-${t}`,
|
|
346
|
+
children: /* @__PURE__ */ n(
|
|
347
|
+
ee,
|
|
348
|
+
{
|
|
349
|
+
description: a("DOCUMENTS_LOADING_ATTACHMENT")
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
u ? /* @__PURE__ */ n(
|
|
355
|
+
"img",
|
|
356
|
+
{
|
|
357
|
+
src: d,
|
|
358
|
+
alt: r.documentIdentifier,
|
|
359
|
+
className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
360
|
+
onLoad: () => F(t),
|
|
361
|
+
onError: () => x(t)
|
|
362
|
+
}
|
|
363
|
+
) : /* @__PURE__ */ n(
|
|
364
|
+
"iframe",
|
|
365
|
+
{
|
|
366
|
+
src: s ? `${d}#toolbar=0` : d,
|
|
367
|
+
className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
368
|
+
title: r.documentIdentifier,
|
|
369
|
+
onLoad: () => F(t),
|
|
370
|
+
onError: () => x(t)
|
|
371
|
+
}
|
|
372
|
+
)
|
|
373
|
+
] })
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
`${r.id}-${e.url}`
|
|
377
|
+
);
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ n("div", { id: X, className: o.printContainer })
|
|
380
|
+
] })
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
] });
|
|
384
|
+
};
|
|
385
|
+
export {
|
|
386
|
+
lt as default
|
|
387
|
+
};
|