@bahmni/clinical-app 0.0.1-dev.461 → 0.0.1-dev.462
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/{ConsultationPage-CXV01hq4.js → ConsultationPage-BUgqEjfJ.js} +8818 -8766
- package/dist/{DocumentsTable-CD8jsIEf-DrjoKA9C.js → DocumentsTable-B1OOYRCh-CgScfyMP.js} +138 -143
- package/dist/{FormsTable-CGD1xMCV-DpgiSejk.js → FormsTable-B4yfF96D-YGx2s9xx.js} +90 -93
- package/dist/LNWAZHJI-DkAEmvZc.js +33 -0
- package/dist/{MWZ6AO7Z-BojEYN1U.js → MWZ6AO7Z-D4o2ufzo.js} +4 -4
- package/dist/{Observations-x0JPCClc-BAwERdQ4.js → Observations-TvRbwiDc-Bl4uaJHl.js} +27 -27
- package/dist/{YPM2AS64-CTLJv53e.js → YPM2AS64-DVg6AcWF.js} +1 -1
- package/dist/components/consultationPad/index.d.ts +2 -2
- package/dist/components/consultationPad/index.d.ts.map +1 -1
- package/dist/components/consultationPad/utils.d.ts +3 -1
- package/dist/components/consultationPad/utils.d.ts.map +1 -1
- package/dist/components/consultationPadContainer/index.d.ts +2 -2
- package/dist/components/consultationPadContainer/index.d.ts.map +1 -1
- package/dist/components/forms/allergies/AllergiesForm.d.ts +2 -2
- package/dist/components/forms/allergies/AllergiesForm.d.ts.map +1 -1
- package/dist/components/forms/allergies/index.d.ts.map +1 -1
- package/dist/components/forms/conditionsAndDiagnoses/index.d.ts.map +1 -1
- package/dist/components/forms/documents/index.d.ts.map +1 -1
- package/dist/components/forms/encounterDetails/EncounterDetails.d.ts +2 -2
- package/dist/components/forms/encounterDetails/EncounterDetails.d.ts.map +1 -1
- package/dist/components/forms/immunization/ImmunizationForm.d.ts +2 -2
- package/dist/components/forms/immunization/ImmunizationForm.d.ts.map +1 -1
- package/dist/components/forms/immunization/index.d.ts.map +1 -1
- package/dist/components/forms/investigations/index.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/index.d.ts.map +1 -1
- package/dist/components/forms/models.d.ts +12 -4
- package/dist/components/forms/models.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts +2 -3
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsPanel.d.ts +2 -2
- package/dist/components/forms/observations/ObservationFormsPanel.d.ts.map +1 -1
- package/dist/components/forms/observations/index.d.ts.map +1 -1
- package/dist/components/forms/renderer.d.ts +2 -2
- package/dist/components/forms/renderer.d.ts.map +1 -1
- package/dist/components/forms/stopMedications/StopMedicationForm.d.ts +2 -2
- package/dist/components/forms/stopMedications/StopMedicationForm.d.ts.map +1 -1
- package/dist/components/patientHeader/ConsultationActionButton.d.ts +2 -0
- package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
- package/dist/components/patientHeader/PatientHeader.d.ts.map +1 -1
- package/dist/{hook-Bb80yJ-3.js → hook-BtxhzaYD.js} +1 -1
- package/dist/{index-BJEWkQAN.js → index-27idhXQ7.js} +1 -1
- package/dist/{index-Cj1SYOcJ.js → index-BUT1d7B9.js} +30945 -30978
- package/dist/{index-BPFyc-0E.js → index-k_EsGh1g.js} +13 -13
- package/dist/index.js +2 -2
- package/dist/pages/ConsultationPage.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/LNWAZHJI-C64hlPI1.js +0 -33
- package/dist/events/startConsultation/constants.d.ts +0 -2
- package/dist/events/startConsultation/constants.d.ts.map +0 -1
- package/dist/events/startConsultation/event.d.ts +0 -3
- package/dist/events/startConsultation/event.d.ts.map +0 -1
- package/dist/events/startConsultation/hooks.d.ts +0 -3
- package/dist/events/startConsultation/hooks.d.ts.map +0 -1
- package/dist/events/startConsultation/index.d.ts +0 -5
- package/dist/events/startConsultation/index.d.ts.map +0 -1
- package/dist/events/startConsultation/models.d.ts +0 -15
- package/dist/events/startConsultation/models.d.ts.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
+
import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, G as Ie, w as fe, O as w, e as Ae, t as Le, K as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, I as Se, b as Re, c as Ue, Q as J, d as ee } from "./index-BUT1d7B9.js";
|
|
3
3
|
import { useQuery as Me } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
documentsTableBody:
|
|
7
|
-
viewAttachmentsLink:
|
|
8
|
-
documentViewerContainer:
|
|
9
|
-
printContainer:
|
|
10
|
-
attachmentItem:
|
|
11
|
-
attachmentCounter:
|
|
12
|
-
attachmentError:
|
|
13
|
-
documentIframe:
|
|
14
|
-
attachmentContent:
|
|
15
|
-
attachmentLoading:
|
|
16
|
-
hiddenWhileLoading:
|
|
17
|
-
documentImage:
|
|
18
|
-
header:
|
|
19
|
-
documentTypeCell:
|
|
20
|
-
printAllButton:
|
|
21
|
-
attachmentHeader:
|
|
22
|
-
},
|
|
4
|
+
import { useState as h, useRef as ke, useEffect as _, useMemo as E, useCallback as T } from "react";
|
|
5
|
+
const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", Ge = "DocumentsTable-module_printContainer__rtarJ", ze = "DocumentsTable-module_attachmentItem__17KA7", Ve = "DocumentsTable-module_attachmentCounter__WFiI3", We = "DocumentsTable-module_attachmentError__RI4U2", qe = "DocumentsTable-module_documentIframe__ptq5I", xe = "DocumentsTable-module_attachmentContent__IaCEe", Fe = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
|
|
6
|
+
documentsTableBody: $e,
|
|
7
|
+
viewAttachmentsLink: He,
|
|
8
|
+
documentViewerContainer: Be,
|
|
9
|
+
printContainer: Ge,
|
|
10
|
+
attachmentItem: ze,
|
|
11
|
+
attachmentCounter: Ve,
|
|
12
|
+
attachmentError: We,
|
|
13
|
+
documentIframe: qe,
|
|
14
|
+
attachmentContent: xe,
|
|
15
|
+
attachmentLoading: Fe,
|
|
16
|
+
hiddenWhileLoading: Ke,
|
|
17
|
+
documentImage: Pe,
|
|
18
|
+
header: je,
|
|
19
|
+
documentTypeCell: Qe,
|
|
20
|
+
printAllButton: Je,
|
|
21
|
+
attachmentHeader: Ye
|
|
22
|
+
}, Ze = "add", Y = "document-print-container", Z = () => /* @__PURE__ */ n(ee, {}), Xe = /* @__PURE__ */ new Set([
|
|
23
23
|
"ArrowUp",
|
|
24
24
|
"ArrowDown",
|
|
25
25
|
"PageUp",
|
|
@@ -27,86 +27,81 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
27
27
|
"Home",
|
|
28
28
|
"End",
|
|
29
29
|
" "
|
|
30
|
-
]),
|
|
30
|
+
]), et = 15e3, tt = [
|
|
31
31
|
"documentType",
|
|
32
32
|
"documentIdentifier",
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
37
|
-
const [
|
|
36
|
+
], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: H }) => {
|
|
37
|
+
const [i, B] = h(!1), [r, G] = h(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [A, v] = h(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), [
|
|
41
|
+
), [L, O] = h(
|
|
42
42
|
/* @__PURE__ */ new Set()
|
|
43
|
-
),
|
|
43
|
+
), C = ke(null), [S, z] = h(
|
|
44
44
|
null
|
|
45
45
|
), V = S !== null;
|
|
46
|
-
|
|
47
|
-
const
|
|
46
|
+
_(() => () => C.current?.abort(), []);
|
|
47
|
+
const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), N = E(
|
|
48
48
|
() => l?.actions?.find(
|
|
49
|
-
(e) => e.type ===
|
|
49
|
+
(e) => e.type === Ze
|
|
50
50
|
),
|
|
51
51
|
[l?.actions]
|
|
52
|
-
), te =
|
|
52
|
+
), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [I, oe] = h(ae), [re, M] = h(void 0), W = T((e) => {
|
|
53
53
|
G(e), B(!0);
|
|
54
|
-
}, []), de =
|
|
55
|
-
|
|
56
|
-
}, []),
|
|
54
|
+
}, []), de = T(() => {
|
|
55
|
+
C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), v(/* @__PURE__ */ new Set());
|
|
56
|
+
}, []), q = T((e) => {
|
|
57
57
|
O((t) => new Set(t).add(e));
|
|
58
|
-
}, []), x =
|
|
59
|
-
|
|
60
|
-
}, []), se =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
...c.editTitle ? { editTitle: c.editTitle } : {}
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
);
|
|
70
|
-
}, [c]), { data: A, isLoading: le, isError: k, error: $, refetch: q } = Me({
|
|
58
|
+
}, []), x = T((e) => {
|
|
59
|
+
v((t) => new Set(t).add(e));
|
|
60
|
+
}, []), se = T(() => {
|
|
61
|
+
N && Ce({
|
|
62
|
+
context: { encounterType: N.encounterType },
|
|
63
|
+
action: { type: "create", resourceType: "DocumentReference" }
|
|
64
|
+
});
|
|
65
|
+
}, [N]), { data: f, isLoading: le, isError: k, error: $, refetch: F } = Me({
|
|
71
66
|
queryKey: [
|
|
72
67
|
"documents",
|
|
73
|
-
|
|
68
|
+
g,
|
|
74
69
|
H,
|
|
75
|
-
|
|
70
|
+
R,
|
|
76
71
|
I
|
|
77
72
|
],
|
|
78
|
-
enabled: !!
|
|
79
|
-
queryFn: () =>
|
|
80
|
-
|
|
73
|
+
enabled: !!g,
|
|
74
|
+
queryFn: () => Ie(
|
|
75
|
+
g,
|
|
81
76
|
H,
|
|
82
77
|
I,
|
|
83
|
-
|
|
78
|
+
R
|
|
84
79
|
)
|
|
85
80
|
});
|
|
86
|
-
|
|
81
|
+
fe(
|
|
87
82
|
(e) => {
|
|
88
|
-
e.patientUUID ===
|
|
83
|
+
e.patientUUID === g && e.updatedResources.documents && F();
|
|
89
84
|
},
|
|
90
|
-
[
|
|
91
|
-
),
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
k &&
|
|
85
|
+
[g, F]
|
|
86
|
+
), _(() => {
|
|
87
|
+
f && M(f.total);
|
|
88
|
+
}, [f]), _(() => {
|
|
89
|
+
U(1), M(void 0);
|
|
90
|
+
}, [g]), _(() => {
|
|
91
|
+
k && b({
|
|
97
92
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
98
93
|
message: $?.message ?? "",
|
|
99
94
|
type: "error"
|
|
100
95
|
});
|
|
101
|
-
}, [k, $,
|
|
96
|
+
}, [k, $, b, a]), _(() => {
|
|
102
97
|
const e = new AbortController();
|
|
103
98
|
return (async () => {
|
|
104
|
-
if (!
|
|
105
|
-
const t = /* @__PURE__ */ new Set(), d =
|
|
99
|
+
if (!i || !r) return;
|
|
100
|
+
const t = /* @__PURE__ */ new Set(), d = X(r);
|
|
106
101
|
for (let s = 0; s < d.length; s++) {
|
|
107
|
-
const
|
|
102
|
+
const m = w(d[s].url);
|
|
108
103
|
try {
|
|
109
|
-
(await fetch(
|
|
104
|
+
(await fetch(m, {
|
|
110
105
|
method: "HEAD",
|
|
111
106
|
signal: e.signal
|
|
112
107
|
})).ok || t.add(s);
|
|
@@ -114,10 +109,10 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
114
109
|
p instanceof Error && p.name !== "AbortError" && t.add(s);
|
|
115
110
|
}
|
|
116
111
|
}
|
|
117
|
-
e.signal.aborted ||
|
|
112
|
+
e.signal.aborted || v(t);
|
|
118
113
|
})(), () => e.abort();
|
|
119
|
-
}, [
|
|
120
|
-
if (!
|
|
114
|
+
}, [i, r]), _(() => {
|
|
115
|
+
if (!i || !r) return;
|
|
121
116
|
const e = document.querySelector(
|
|
122
117
|
'[data-testid="document-view-modal"] .cds--modal-content'
|
|
123
118
|
);
|
|
@@ -125,81 +120,81 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
125
120
|
let t = !1;
|
|
126
121
|
const d = () => {
|
|
127
122
|
t = !0;
|
|
128
|
-
}, s = (
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
const Te =
|
|
132
|
-
|
|
123
|
+
}, s = (y) => {
|
|
124
|
+
y.target === e && d();
|
|
125
|
+
}, m = (y) => {
|
|
126
|
+
const Te = y.target;
|
|
127
|
+
Xe.has(y.key) && !Te?.closest("button, input, textarea, select, a") && d();
|
|
133
128
|
}, p = () => {
|
|
134
129
|
!t && e.scrollTop !== 0 && (e.scrollTop = 0);
|
|
135
130
|
};
|
|
136
|
-
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchmove", d, { passive: !0 }), e.addEventListener("mousedown", s), e.addEventListener("keydown",
|
|
137
|
-
e.removeEventListener("wheel", d), e.removeEventListener("touchmove", d), e.removeEventListener("mousedown", s), e.removeEventListener("keydown",
|
|
131
|
+
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchmove", d, { passive: !0 }), e.addEventListener("mousedown", s), e.addEventListener("keydown", m), e.addEventListener("scroll", p), () => {
|
|
132
|
+
e.removeEventListener("wheel", d), e.removeEventListener("touchmove", d), e.removeEventListener("mousedown", s), e.removeEventListener("keydown", m), e.removeEventListener("scroll", p);
|
|
138
133
|
};
|
|
139
|
-
}, [
|
|
140
|
-
const
|
|
134
|
+
}, [i, r]);
|
|
135
|
+
const ce = T(
|
|
141
136
|
(e, t) => {
|
|
142
|
-
t !== I ? (oe(t),
|
|
137
|
+
t !== I ? (oe(t), U(1), M(void 0)) : U(e);
|
|
143
138
|
},
|
|
144
139
|
[I]
|
|
145
|
-
),
|
|
146
|
-
() => l?.fields ??
|
|
140
|
+
), D = E(
|
|
141
|
+
() => l?.fields ?? tt,
|
|
147
142
|
[l?.fields]
|
|
148
|
-
),
|
|
149
|
-
() =>
|
|
143
|
+
), ie = E(() => [...f?.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), [f]), me = E(() => Ae(D, a), [D, a]), ue = E(
|
|
144
|
+
() => D.map((e) => ({
|
|
150
145
|
key: e,
|
|
151
146
|
sortable: e !== "attachments"
|
|
152
147
|
})),
|
|
153
|
-
[
|
|
154
|
-
),
|
|
155
|
-
() => r ?
|
|
148
|
+
[D]
|
|
149
|
+
), c = E(
|
|
150
|
+
() => r ? X(r) : [],
|
|
156
151
|
[r]
|
|
157
|
-
), K =
|
|
158
|
-
(e, t) =>
|
|
152
|
+
), K = c.every(
|
|
153
|
+
(e, t) => L.has(t) || A.has(t) || w(e.url) === "#"
|
|
159
154
|
);
|
|
160
|
-
|
|
161
|
-
if (!
|
|
155
|
+
_(() => {
|
|
156
|
+
if (!i || c.length === 0) return;
|
|
162
157
|
const e = setTimeout(
|
|
163
|
-
() => O(new Set(
|
|
164
|
-
|
|
158
|
+
() => O(new Set(c.keys())),
|
|
159
|
+
et
|
|
165
160
|
);
|
|
166
161
|
return () => clearTimeout(e);
|
|
167
|
-
}, [
|
|
168
|
-
const P =
|
|
162
|
+
}, [i, c]);
|
|
163
|
+
const P = T(
|
|
169
164
|
async (e, t) => {
|
|
170
|
-
if (!r ||
|
|
165
|
+
if (!r || C.current) return;
|
|
171
166
|
const d = new AbortController(), { signal: s } = d;
|
|
172
|
-
|
|
173
|
-
const
|
|
167
|
+
C.current = d, z(t);
|
|
168
|
+
const m = document.getElementById(Y);
|
|
174
169
|
try {
|
|
175
|
-
await
|
|
170
|
+
await Le(
|
|
176
171
|
e,
|
|
177
172
|
r.documentIdentifier,
|
|
178
|
-
{ container:
|
|
173
|
+
{ container: m, signal: s }
|
|
179
174
|
);
|
|
180
175
|
} catch {
|
|
181
|
-
s.aborted ||
|
|
176
|
+
s.aborted || b({
|
|
182
177
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
183
178
|
message: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT"),
|
|
184
179
|
type: "error"
|
|
185
180
|
});
|
|
186
181
|
} finally {
|
|
187
|
-
|
|
182
|
+
C.current = null, z(null);
|
|
188
183
|
}
|
|
189
184
|
},
|
|
190
|
-
[r,
|
|
191
|
-
), j =
|
|
192
|
-
() =>
|
|
193
|
-
(e, t) =>
|
|
185
|
+
[r, b, a]
|
|
186
|
+
), j = E(
|
|
187
|
+
() => c.filter(
|
|
188
|
+
(e, t) => w(e.url) !== "#" && !A.has(t)
|
|
194
189
|
),
|
|
195
|
-
[
|
|
196
|
-
), he =
|
|
190
|
+
[c, A]
|
|
191
|
+
), he = T(
|
|
197
192
|
(e, t) => {
|
|
198
193
|
switch (t) {
|
|
199
194
|
case "documentIdentifier":
|
|
200
195
|
return /* @__PURE__ */ n("span", { children: e.documentIdentifier?.trim() || "-" });
|
|
201
196
|
case "documentType":
|
|
202
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ u("div", { className: o.documentTypeCell, children: [
|
|
203
198
|
/* @__PURE__ */ n("span", { children: e.documentType ?? a("DOCUMENTS_NOT_AVAILABLE") }),
|
|
204
199
|
e.description && /* @__PURE__ */ n(
|
|
205
200
|
ye,
|
|
@@ -212,7 +207,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
212
207
|
)
|
|
213
208
|
] });
|
|
214
209
|
case "uploadedOn":
|
|
215
|
-
return
|
|
210
|
+
return De(
|
|
216
211
|
e.uploadedOn,
|
|
217
212
|
a,
|
|
218
213
|
!0
|
|
@@ -221,7 +216,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
221
216
|
return e.uploadedBy ?? a("DOCUMENTS_NOT_AVAILABLE");
|
|
222
217
|
case "attachments":
|
|
223
218
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
|
|
224
|
-
|
|
219
|
+
be,
|
|
225
220
|
{
|
|
226
221
|
onClick: () => W(e),
|
|
227
222
|
className: o.viewAttachmentsLink,
|
|
@@ -235,8 +230,8 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
235
230
|
},
|
|
236
231
|
[W, a]
|
|
237
232
|
);
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
ne && /* @__PURE__ */
|
|
233
|
+
return /* @__PURE__ */ u(pe, { children: [
|
|
234
|
+
ne && /* @__PURE__ */ u(we, { className: o.header, testId: "documents-header", children: [
|
|
240
235
|
/* @__PURE__ */ n("p", { children: a("DOCUMENTS_TABLE_HEADING") }),
|
|
241
236
|
/* @__PURE__ */ n(
|
|
242
237
|
Q,
|
|
@@ -244,19 +239,19 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
244
239
|
autoAlign: !0,
|
|
245
240
|
size: "lg",
|
|
246
241
|
kind: "ghost",
|
|
247
|
-
label: a(
|
|
242
|
+
label: a(N.label),
|
|
248
243
|
testId: "documents-add-button",
|
|
249
244
|
onClick: se,
|
|
250
|
-
children: /* @__PURE__ */ n(ve, { id: "documents-add-icon", name: "fa-plus", size:
|
|
245
|
+
children: /* @__PURE__ */ n(ve, { id: "documents-add-icon", name: "fa-plus", size: Oe.LG })
|
|
251
246
|
}
|
|
252
247
|
)
|
|
253
248
|
] }),
|
|
254
249
|
/* @__PURE__ */ n("div", { "data-testid": "documents-table", children: /* @__PURE__ */ n(
|
|
255
|
-
|
|
250
|
+
Se,
|
|
256
251
|
{
|
|
257
252
|
headers: me,
|
|
258
253
|
ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
|
|
259
|
-
rows:
|
|
254
|
+
rows: ie,
|
|
260
255
|
loading: le,
|
|
261
256
|
errorStateMessage: k ? $?.message : null,
|
|
262
257
|
sortable: ue,
|
|
@@ -266,61 +261,61 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
266
261
|
dataTestId: "documents-table",
|
|
267
262
|
pageSize: I,
|
|
268
263
|
totalItems: re,
|
|
269
|
-
page:
|
|
270
|
-
onPageChange:
|
|
264
|
+
page: R,
|
|
265
|
+
onPageChange: ce
|
|
271
266
|
}
|
|
272
267
|
) }),
|
|
273
|
-
|
|
274
|
-
|
|
268
|
+
i && r && /* @__PURE__ */ n(
|
|
269
|
+
Re,
|
|
275
270
|
{
|
|
276
271
|
id: "modalIdForActionAreaLayout",
|
|
277
272
|
portalId: "main-display-area",
|
|
278
|
-
open:
|
|
273
|
+
open: i,
|
|
279
274
|
onRequestClose: de,
|
|
280
275
|
modalHeading: r.documentIdentifier,
|
|
281
276
|
passiveModal: !0,
|
|
282
277
|
size: "lg",
|
|
283
278
|
testId: "document-view-modal",
|
|
284
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ u("div", { className: o.documentViewerContainer, children: [
|
|
285
280
|
j.length > 1 && /* @__PURE__ */ n(
|
|
286
281
|
Ue,
|
|
287
282
|
{
|
|
288
283
|
kind: "tertiary",
|
|
289
284
|
size: "sm",
|
|
290
285
|
className: o.printAllButton,
|
|
291
|
-
renderIcon: S === "all" ?
|
|
286
|
+
renderIcon: S === "all" ? Z : J,
|
|
292
287
|
disabled: V || !K,
|
|
293
288
|
testId: "print-all-attachments",
|
|
294
289
|
onClick: () => P(j, "all"),
|
|
295
290
|
children: a("DOCUMENTS_PRINT_ALL")
|
|
296
291
|
}
|
|
297
292
|
),
|
|
298
|
-
|
|
299
|
-
const d =
|
|
300
|
-
return d === "#" || p ? /* @__PURE__ */
|
|
293
|
+
c.map((e, t) => {
|
|
294
|
+
const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = A.has(t);
|
|
295
|
+
return d === "#" || p ? /* @__PURE__ */ u(
|
|
301
296
|
"div",
|
|
302
297
|
{
|
|
303
298
|
className: o.attachmentError,
|
|
304
299
|
"data-testid": `attachment-error-${t}`,
|
|
305
300
|
children: [
|
|
306
|
-
|
|
301
|
+
c.length > 1 && /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
|
|
307
302
|
current: t + 1,
|
|
308
|
-
total:
|
|
303
|
+
total: c.length
|
|
309
304
|
}) }),
|
|
310
305
|
/* @__PURE__ */ n("p", { children: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
311
306
|
]
|
|
312
307
|
},
|
|
313
308
|
`${r.id}-${e.url}`
|
|
314
|
-
) : /* @__PURE__ */
|
|
309
|
+
) : /* @__PURE__ */ u(
|
|
315
310
|
"div",
|
|
316
311
|
{
|
|
317
312
|
className: o.attachmentItem,
|
|
318
313
|
"data-testid": `attachment-item-${t}`,
|
|
319
314
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
315
|
+
/* @__PURE__ */ u("div", { className: o.attachmentHeader, children: [
|
|
316
|
+
c.length > 1 ? /* @__PURE__ */ n("p", { className: o.attachmentCounter, children: a("DOCUMENTS_ATTACHMENT_COUNTER", {
|
|
322
317
|
current: t + 1,
|
|
323
|
-
total:
|
|
318
|
+
total: c.length
|
|
324
319
|
}) }) : /* @__PURE__ */ n("span", {}),
|
|
325
320
|
/* @__PURE__ */ n(
|
|
326
321
|
Q,
|
|
@@ -333,12 +328,12 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
333
328
|
disabled: V || !K,
|
|
334
329
|
testId: `print-attachment-${t}`,
|
|
335
330
|
onClick: () => P([e], t),
|
|
336
|
-
children: S === t ? /* @__PURE__ */ n(
|
|
331
|
+
children: S === t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ n(J, {})
|
|
337
332
|
}
|
|
338
333
|
)
|
|
339
334
|
] }),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
!
|
|
335
|
+
/* @__PURE__ */ u("div", { className: o.attachmentContent, children: [
|
|
336
|
+
!L.has(t) && /* @__PURE__ */ n(
|
|
342
337
|
"div",
|
|
343
338
|
{
|
|
344
339
|
className: o.attachmentLoading,
|
|
@@ -351,22 +346,22 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
351
346
|
)
|
|
352
347
|
}
|
|
353
348
|
),
|
|
354
|
-
|
|
349
|
+
m ? /* @__PURE__ */ n(
|
|
355
350
|
"img",
|
|
356
351
|
{
|
|
357
352
|
src: d,
|
|
358
353
|
alt: r.documentIdentifier,
|
|
359
|
-
className: `${o.documentImage} ${
|
|
360
|
-
onLoad: () =>
|
|
354
|
+
className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
355
|
+
onLoad: () => q(t),
|
|
361
356
|
onError: () => x(t)
|
|
362
357
|
}
|
|
363
358
|
) : /* @__PURE__ */ n(
|
|
364
359
|
"iframe",
|
|
365
360
|
{
|
|
366
361
|
src: s ? `${d}#toolbar=0` : d,
|
|
367
|
-
className: `${o.documentIframe} ${
|
|
362
|
+
className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
368
363
|
title: r.documentIdentifier,
|
|
369
|
-
onLoad: () =>
|
|
364
|
+
onLoad: () => q(t),
|
|
370
365
|
onError: () => x(t)
|
|
371
366
|
}
|
|
372
367
|
)
|
|
@@ -376,12 +371,12 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
|
|
|
376
371
|
`${r.id}-${e.url}`
|
|
377
372
|
);
|
|
378
373
|
}),
|
|
379
|
-
/* @__PURE__ */ n("div", { id:
|
|
374
|
+
/* @__PURE__ */ n("div", { id: Y, className: o.printContainer })
|
|
380
375
|
] })
|
|
381
376
|
}
|
|
382
377
|
)
|
|
383
378
|
] });
|
|
384
379
|
};
|
|
385
380
|
export {
|
|
386
|
-
|
|
381
|
+
st as default
|
|
387
382
|
};
|