@bahmni/registration-app 0.0.1-dev.344 → 0.0.1-dev.346
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/{DocumentsTable-eF8z2BlA-DqCJKvJa.js → DocumentsTable-D-yL-evA-DZGsbudm.js} +59 -59
- package/dist/{FormsTable-CPVRSlLS-Y1CrJ_5Z.js → FormsTable-BbwKhyCn-XUgn41-t.js} +87 -87
- package/dist/{LNWAZHJI-BHo7jHY1.js → LNWAZHJI-CP9Msf3J.js} +4 -4
- package/dist/{MWZ6AO7Z-0wSHS6BF.js → MWZ6AO7Z-5NR2BSYW.js} +5 -5
- package/dist/{Observations-DisYmEmq-6CcFwlpk.js → Observations-CiATLznu-CbKIk6FK.js} +39 -39
- package/dist/{YPM2AS64-DkNsMgxJ.js → YPM2AS64-xU0_PomT.js} +706 -706
- package/dist/{index-4vPm1a3c.js → index-xj_SoTJ9.js} +46919 -46523
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { V as G, u as W, o as Y, g as J, p as X, M as Z, Q as ee, z as te } from "./index-xj_SoTJ9.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2",
|
|
4
|
+
import { useState as c, useCallback as h, useEffect as I, useMemo as _ } from "react";
|
|
5
|
+
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ce = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
8
8
|
documentViewerContainer: re,
|
|
9
9
|
attachmentItem: de,
|
|
10
10
|
attachmentCounter: se,
|
|
11
11
|
attachmentError: me,
|
|
12
|
-
documentIframe:
|
|
13
|
-
documentImage:
|
|
12
|
+
documentIframe: le,
|
|
13
|
+
documentImage: ce
|
|
14
14
|
}, ue = {
|
|
15
15
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
16
16
|
documentType: "DOCUMENTS_TYPE",
|
|
@@ -21,10 +21,10 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
|
|
|
21
21
|
function R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ie(a,
|
|
24
|
+
function ie(a, g) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: g(ue[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
const Te = [
|
|
@@ -33,80 +33,80 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
37
|
-
const [s, w] =
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, w] = c(!1), [o, M] = c(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [V, O] = c(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: U } = Y(), $ = Number(a?.pageSize) || 5, [f, C] = c(1), [u, k] = c($), [F, A] = c(void 0), L = h((e) => {
|
|
42
42
|
M(e), w(!0);
|
|
43
|
-
}, []), H =
|
|
44
|
-
w(!1), M(null),
|
|
45
|
-
}, []), v =
|
|
46
|
-
|
|
47
|
-
}, []), { data: i, isLoading: q, isError:
|
|
43
|
+
}, []), H = h(() => {
|
|
44
|
+
w(!1), M(null), O(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), v = h((e) => {
|
|
46
|
+
O((t) => new Set(t).add(e));
|
|
47
|
+
}, []), { data: i, isLoading: q, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
g,
|
|
51
50
|
E,
|
|
52
|
-
|
|
51
|
+
g,
|
|
52
|
+
f,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
56
|
-
queryFn: () =>
|
|
57
|
-
g,
|
|
55
|
+
enabled: !!E,
|
|
56
|
+
queryFn: () => J(
|
|
58
57
|
E,
|
|
58
|
+
g,
|
|
59
59
|
u,
|
|
60
|
-
|
|
60
|
+
f
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
I(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
|
|
65
|
+
}, [i]), I(() => {
|
|
66
|
+
C(1), A(void 0);
|
|
67
|
+
}, [E]), I(() => {
|
|
68
|
+
b && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
|
-
message:
|
|
70
|
+
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [
|
|
73
|
+
}, [b, y, U, n]), I(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
77
|
const t = /* @__PURE__ */ new Set(), m = B(o);
|
|
78
|
-
for (let
|
|
79
|
-
const S = R(m[
|
|
78
|
+
for (let l = 0; l < m.length; l++) {
|
|
79
|
+
const S = R(m[l].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
|
-
})).ok || t.add(
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
84
|
+
})).ok || t.add(l);
|
|
85
|
+
} catch (D) {
|
|
86
|
+
D instanceof Error && D.name !== "AbortError" && t.add(l);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const
|
|
92
|
+
const z = h(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== u ? (
|
|
94
|
+
t !== u ? (k(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), N = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), Q = _(() => [...i?.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), [i]), j = _(() => ie(N, n), [N, n]), P = _(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
106
|
-
), T =
|
|
105
|
+
[N]
|
|
106
|
+
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), K =
|
|
109
|
+
), K = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -123,7 +123,7 @@ const Te = [
|
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "attachments":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
X,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => L(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -137,24 +137,24 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[L, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ p(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: j,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: Q,
|
|
147
147
|
loading: q,
|
|
148
|
-
errorStateMessage:
|
|
149
|
-
sortable:
|
|
148
|
+
errorStateMessage: b ? y?.message : null,
|
|
149
|
+
sortable: P,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: K,
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
|
-
page:
|
|
157
|
-
onPageChange:
|
|
156
|
+
page: f,
|
|
157
|
+
onPageChange: z
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ r(
|
|
@@ -169,14 +169,14 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m = R(e.url),
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), l = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), D = V.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
@@ -185,13 +185,13 @@ const Te = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
@@ -207,7 +207,7 @@ const Te = [
|
|
|
207
207
|
) : /* @__PURE__ */ r(
|
|
208
208
|
"iframe",
|
|
209
209
|
{
|
|
210
|
-
src:
|
|
210
|
+
src: l ? `${m}#toolbar=0` : m,
|
|
211
211
|
className: d.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
213
|
onError: () => v(t)
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ne as default
|
|
227
227
|
};
|
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
import { jsx as i, jsxs as re, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { u as ae,
|
|
2
|
+
import { u as ae, V as te, d as se, w as ne, r as de, m as ie, f as me, a as le, t as ce, n as q, M as ue, p as fe, Q as k, b as ye, c as pe, z as be, k as he } from "./index-xj_SoTJ9.js";
|
|
3
3
|
import { useQueryClient as ge, useQuery as y } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as w, useMemo as d, useCallback as p } from "react";
|
|
5
5
|
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", A = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Oe
|
|
8
|
-
},
|
|
8
|
+
}, Ee = ({
|
|
9
9
|
episodeOfCareUuids: I,
|
|
10
10
|
encounterUuids: l,
|
|
11
|
-
config:
|
|
11
|
+
config: V
|
|
12
12
|
}) => {
|
|
13
|
-
const { t: n } = ae(), c =
|
|
14
|
-
numberOfVisits:
|
|
15
|
-
hideThumbnail:
|
|
13
|
+
const { t: n } = ae(), c = te(), [u, T] = w(!1), [t, M] = w(null), {
|
|
14
|
+
numberOfVisits: z,
|
|
15
|
+
hideThumbnail: K = !1,
|
|
16
16
|
forms: f
|
|
17
|
-
} =
|
|
17
|
+
} = V ?? {}, E = se(
|
|
18
18
|
I,
|
|
19
19
|
l
|
|
20
|
-
),
|
|
20
|
+
), Q = ge(), {
|
|
21
21
|
data: F = [],
|
|
22
|
-
isLoading:
|
|
23
|
-
isError:
|
|
24
|
-
error:
|
|
25
|
-
refetch:
|
|
22
|
+
isLoading: L,
|
|
23
|
+
isError: B,
|
|
24
|
+
error: j,
|
|
25
|
+
refetch: x
|
|
26
26
|
} = y({
|
|
27
27
|
queryKey: ["forms", c, I],
|
|
28
|
-
queryFn: () => ne(c, void 0,
|
|
29
|
-
enabled: !!c && !
|
|
30
|
-
}),
|
|
28
|
+
queryFn: () => ne(c, void 0, z),
|
|
29
|
+
enabled: !!c && !E
|
|
30
|
+
}), _ = d(() => {
|
|
31
31
|
let e = F;
|
|
32
32
|
return l && l.length > 0 && (e = e.filter(
|
|
33
33
|
(r) => l.includes(r.encounterUuid)
|
|
34
34
|
)), Array.isArray(f) && f.length > 0 && (e = e.filter(
|
|
35
35
|
(r) => f.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
36
36
|
)), e;
|
|
37
|
-
}, [F, l, f]), { data:
|
|
37
|
+
}, [F, l, f]), { data: S = [] } = y({
|
|
38
38
|
queryKey: ["observationForms"],
|
|
39
39
|
queryFn: () => de()
|
|
40
|
-
}),
|
|
41
|
-
(e) =>
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
if (
|
|
45
|
-
return
|
|
46
|
-
}, [
|
|
40
|
+
}), C = p(
|
|
41
|
+
(e) => S.find((r) => r.name === e)?.uuid,
|
|
42
|
+
[S]
|
|
43
|
+
), b = d(() => {
|
|
44
|
+
if (t)
|
|
45
|
+
return C(t.formName);
|
|
46
|
+
}, [t, C]), {
|
|
47
47
|
data: m,
|
|
48
|
-
isLoading:
|
|
49
|
-
isError:
|
|
50
|
-
error:
|
|
48
|
+
isLoading: H,
|
|
49
|
+
isError: $,
|
|
50
|
+
error: h
|
|
51
51
|
} = y({
|
|
52
|
-
queryKey: ["formMetadata",
|
|
53
|
-
queryFn: () => ie(
|
|
54
|
-
enabled: !!
|
|
52
|
+
queryKey: ["formMetadata", b],
|
|
53
|
+
queryFn: () => ie(b),
|
|
54
|
+
enabled: !!b && u
|
|
55
55
|
}), {
|
|
56
56
|
data: g,
|
|
57
|
-
isLoading:
|
|
58
|
-
isError:
|
|
57
|
+
isLoading: G,
|
|
58
|
+
isError: Y,
|
|
59
59
|
error: N
|
|
60
60
|
} = y({
|
|
61
|
-
queryKey: ["formsEncounterFHIR",
|
|
62
|
-
queryFn: () => me(
|
|
63
|
-
enabled: !!
|
|
61
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
62
|
+
queryFn: () => me(t.encounterUuid),
|
|
63
|
+
enabled: !!t?.encounterUuid && u
|
|
64
64
|
});
|
|
65
65
|
le(
|
|
66
66
|
(e) => {
|
|
67
|
-
e.patientUUID === c && e.updatedConcepts.size > 0 && (
|
|
67
|
+
e.patientUUID === c && e.updatedConcepts.size > 0 && (x(), Q.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
68
68
|
},
|
|
69
69
|
[c]
|
|
70
70
|
);
|
|
71
|
-
const
|
|
71
|
+
const P = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
72
72
|
const r = ce(e);
|
|
73
|
-
return !r || r.includes(
|
|
74
|
-
}), [g,
|
|
73
|
+
return !r || r.includes(t.formName);
|
|
74
|
+
}), [g, t?.formName]), J = d(() => {
|
|
75
75
|
if (!m?.schema) return;
|
|
76
76
|
const e = [], r = (o) => {
|
|
77
|
-
(o ?? []).forEach((
|
|
78
|
-
const a =
|
|
77
|
+
(o ?? []).forEach((s) => {
|
|
78
|
+
const a = s;
|
|
79
79
|
a.id != null && e.push(String(a.id)), a.controls && r(a.controls);
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
return r(
|
|
83
83
|
m.schema.controls ?? []
|
|
84
84
|
), e.length > 0 ? e : void 0;
|
|
85
|
-
}, [m]),
|
|
85
|
+
}, [m]), W = d(() => {
|
|
86
86
|
if (!m?.schema) return;
|
|
87
|
-
const e = {}, r = (o,
|
|
87
|
+
const e = {}, r = (o, s) => {
|
|
88
88
|
for (const a of o)
|
|
89
89
|
if (a.type === "section") {
|
|
90
90
|
const O = a.label?.value ?? "Section";
|
|
91
91
|
r(a.controls ?? [], O);
|
|
92
92
|
} else
|
|
93
|
-
a.id != null &&
|
|
93
|
+
a.id != null && s && (e[String(a.id)] = s), a.controls && r(a.controls, s);
|
|
94
94
|
};
|
|
95
95
|
return r(
|
|
96
96
|
m.schema.controls ?? [],
|
|
97
97
|
null
|
|
98
98
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
99
|
-
}, [m]),
|
|
100
|
-
if (
|
|
101
|
-
return
|
|
99
|
+
}, [m]), X = d(() => {
|
|
100
|
+
if (h)
|
|
101
|
+
return q(h).message;
|
|
102
102
|
if (N)
|
|
103
|
-
return
|
|
104
|
-
}, [
|
|
103
|
+
return q(N).message;
|
|
104
|
+
}, [h, N]), D = d(
|
|
105
105
|
() => [
|
|
106
106
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
107
107
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -113,13 +113,13 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
113
113
|
{ key: "recordedBy", sortable: !0 }
|
|
114
114
|
],
|
|
115
115
|
[]
|
|
116
|
-
),
|
|
117
|
-
const e =
|
|
116
|
+
), R = d(() => {
|
|
117
|
+
const e = _.reduce(
|
|
118
118
|
(r, o) => {
|
|
119
|
-
const
|
|
120
|
-
r[
|
|
119
|
+
const s = o.formName;
|
|
120
|
+
r[s] ??= [];
|
|
121
121
|
const a = o.providers.map((O) => O.providerName).filter(Boolean).join(", ");
|
|
122
|
-
return r[
|
|
122
|
+
return r[s].push({
|
|
123
123
|
id: o.encounterUuid,
|
|
124
124
|
formName: o.formName,
|
|
125
125
|
recordedOn: ue(o.encounterDateTime, n, !0).formattedResult,
|
|
@@ -134,45 +134,45 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
134
134
|
([r, o]) => ({
|
|
135
135
|
formName: r,
|
|
136
136
|
records: o.sort(
|
|
137
|
-
(
|
|
137
|
+
(s, a) => a.encounterDateTime - s.encounterDateTime
|
|
138
138
|
)
|
|
139
139
|
})
|
|
140
140
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
141
|
-
}, [
|
|
142
|
-
|
|
143
|
-
}, []), ee =
|
|
144
|
-
|
|
145
|
-
}, []),
|
|
141
|
+
}, [_, n]), v = p((e) => {
|
|
142
|
+
M(e), T(!0);
|
|
143
|
+
}, []), ee = p(() => {
|
|
144
|
+
T(!1), M(null);
|
|
145
|
+
}, []), U = p(
|
|
146
146
|
(e, r) => {
|
|
147
147
|
switch (r) {
|
|
148
148
|
case "recordedOn":
|
|
149
|
-
return /* @__PURE__ */ i(fe, { onClick: () =>
|
|
149
|
+
return /* @__PURE__ */ i(fe, { onClick: () => v(e), children: e.recordedOn });
|
|
150
150
|
case "recordedBy":
|
|
151
151
|
return e.recordedBy;
|
|
152
152
|
default:
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
-
[
|
|
156
|
+
[v]
|
|
157
157
|
);
|
|
158
158
|
return /* @__PURE__ */ re(oe, { children: [
|
|
159
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
159
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || R.length === 0 || E ? /* @__PURE__ */ i(
|
|
160
160
|
k,
|
|
161
161
|
{
|
|
162
|
-
headers:
|
|
162
|
+
headers: D,
|
|
163
163
|
ariaLabel: n("FORMS_HEADING"),
|
|
164
164
|
rows: [],
|
|
165
|
-
loading:
|
|
166
|
-
errorStateMessage:
|
|
165
|
+
loading: L,
|
|
166
|
+
errorStateMessage: B ? j?.message : void 0,
|
|
167
167
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
168
|
-
renderCell:
|
|
168
|
+
renderCell: U,
|
|
169
169
|
className: A.formsTableBody,
|
|
170
170
|
dataTestId: "forms-table"
|
|
171
171
|
}
|
|
172
|
-
) : /* @__PURE__ */ i(ye, { align: "start", children:
|
|
173
|
-
const { formName: o, records:
|
|
172
|
+
) : /* @__PURE__ */ i(ye, { align: "start", children: R.map((e, r) => {
|
|
173
|
+
const { formName: o, records: s } = e;
|
|
174
174
|
return /* @__PURE__ */ i(
|
|
175
|
-
|
|
175
|
+
pe,
|
|
176
176
|
{
|
|
177
177
|
title: o,
|
|
178
178
|
className: A.customAccordianItem,
|
|
@@ -181,14 +181,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
181
181
|
children: /* @__PURE__ */ i(
|
|
182
182
|
k,
|
|
183
183
|
{
|
|
184
|
-
headers:
|
|
184
|
+
headers: D,
|
|
185
185
|
ariaLabel: n("FORMS_HEADING"),
|
|
186
|
-
rows:
|
|
186
|
+
rows: s,
|
|
187
187
|
loading: !1,
|
|
188
188
|
errorStateMessage: "",
|
|
189
189
|
sortable: Z,
|
|
190
190
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
191
|
-
renderCell:
|
|
191
|
+
renderCell: U,
|
|
192
192
|
className: A.formsTableBody,
|
|
193
193
|
dataTestId: `forms-table-${o}`
|
|
194
194
|
}
|
|
@@ -197,30 +197,30 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
197
197
|
o
|
|
198
198
|
);
|
|
199
199
|
}) }) }),
|
|
200
|
-
u &&
|
|
201
|
-
|
|
200
|
+
u && t && /* @__PURE__ */ i(
|
|
201
|
+
be,
|
|
202
202
|
{
|
|
203
203
|
id: "modalIdForActionAreaLayout",
|
|
204
204
|
portalId: "main-display-area",
|
|
205
205
|
open: u,
|
|
206
206
|
onRequestClose: ee,
|
|
207
|
-
modalHeading:
|
|
208
|
-
modalLabel: `${
|
|
207
|
+
modalHeading: t.formName,
|
|
208
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
209
209
|
passiveModal: !0,
|
|
210
210
|
size: "md",
|
|
211
211
|
testId: "form-details-modal",
|
|
212
212
|
children: /* @__PURE__ */ i(
|
|
213
|
-
|
|
213
|
+
he,
|
|
214
214
|
{
|
|
215
|
-
observations:
|
|
216
|
-
isLoading:
|
|
217
|
-
isError:
|
|
218
|
-
errorMessage:
|
|
215
|
+
observations: P,
|
|
216
|
+
isLoading: H || G,
|
|
217
|
+
isError: $ || Y,
|
|
218
|
+
errorMessage: X,
|
|
219
219
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
220
|
-
testIdPrefix:
|
|
221
|
-
hideThumbnail:
|
|
222
|
-
controlOrder:
|
|
223
|
-
sectionMap:
|
|
220
|
+
testIdPrefix: t.formName,
|
|
221
|
+
hideThumbnail: K,
|
|
222
|
+
controlOrder: J,
|
|
223
|
+
sectionMap: W
|
|
224
224
|
}
|
|
225
225
|
)
|
|
226
226
|
}
|
|
@@ -228,5 +228,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
228
228
|
] });
|
|
229
229
|
};
|
|
230
230
|
export {
|
|
231
|
-
|
|
231
|
+
Ee as default
|
|
232
232
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-xU0_PomT.js";
|
|
2
|
+
import { s as d, y as f, B as e } from "./index-xj_SoTJ9.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -14,10 +14,10 @@ var p = (a) => {
|
|
|
14
14
|
localStore: r,
|
|
15
15
|
setLocalStore: t,
|
|
16
16
|
get children() {
|
|
17
|
-
return e(
|
|
17
|
+
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
|
-
return e(
|
|
20
|
+
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
22
|
setLocalStore: t
|
|
23
23
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
1
|
+
import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-xU0_PomT.js";
|
|
2
|
+
import { s as v, y as C, B as e } from "./index-xj_SoTJ9.js";
|
|
3
3
|
var h = (t) => {
|
|
4
|
-
const [r, o] =
|
|
4
|
+
const [r, o] = l({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a = v(),
|
|
6
|
+
}), a = v(), s = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -16,7 +16,7 @@ var h = (t) => {
|
|
|
16
16
|
setLocalStore: o,
|
|
17
17
|
get children() {
|
|
18
18
|
return e(i.Provider, {
|
|
19
|
-
value:
|
|
19
|
+
value: s,
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
22
22
|
get children() {
|