@bahmni/widgets 0.0.1-dev.346 → 0.0.1-dev.348
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-Dtvjttoa.js → DocumentsTable-B7UTGYR4.js} +14 -14
- package/dist/{FormsTable-BKd88Ugp.js → FormsTable-DPsJz4yi.js} +35 -35
- package/dist/{Observations-3Ged1eJY.js → Observations-CkemtZ5h.js} +1 -1
- package/dist/forms/FormsTable.d.ts.map +1 -1
- package/dist/{index-D-OVBhy0.js → index-BbuEus1P.js} +49427 -53149
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -59
- package/dist/medications/components/Actions.d.ts.map +1 -1
- package/dist/observations/__mocks__/observationTestData.d.ts +6 -0
- package/dist/observations/__mocks__/observationTestData.d.ts.map +1 -1
- package/dist/observations/index.d.ts +1 -1
- package/dist/observations/index.d.ts.map +1 -1
- package/dist/observations/utils.d.ts +2 -0
- package/dist/observations/utils.d.ts.map +1 -1
- package/dist/tasks/TaskList.d.ts.map +1 -1
- package/dist/tasks/__tests__/__mocks__/configMocks.d.ts +9 -0
- package/dist/tasks/__tests__/__mocks__/configMocks.d.ts.map +1 -0
- package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts +2 -2
- package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts.map +1 -1
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts +5 -4
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts.map +1 -1
- package/dist/tasks/{components → actions}/TaskActions.d.ts +2 -3
- package/dist/tasks/actions/TaskActions.d.ts.map +1 -0
- package/dist/tasks/actions/actionHandlers.d.ts +3 -0
- package/dist/tasks/actions/actionHandlers.d.ts.map +1 -0
- package/dist/tasks/actions/index.d.ts +3 -0
- package/dist/tasks/actions/index.d.ts.map +1 -0
- package/dist/tasks/constants.d.ts +11 -0
- package/dist/tasks/constants.d.ts.map +1 -0
- package/dist/tasks/models.d.ts +14 -4
- package/dist/tasks/models.d.ts.map +1 -1
- package/dist/tasks/utils.d.ts +7 -18
- package/dist/tasks/utils.d.ts.map +1 -1
- package/dist/tasks/views/TaskViewResults.d.ts +9 -0
- package/dist/tasks/views/TaskViewResults.d.ts.map +1 -0
- package/dist/tasks/views/ViewFormData/ViewFormData.d.ts +12 -0
- package/dist/tasks/views/ViewFormData/ViewFormData.d.ts.map +1 -0
- package/dist/tasks/views/ViewFormData/index.d.ts +2 -0
- package/dist/tasks/views/ViewFormData/index.d.ts.map +1 -0
- package/dist/tasks/views/index.d.ts +4 -0
- package/dist/tasks/views/index.d.ts.map +1 -0
- package/dist/tasks/views/viewHandlers.d.ts +4 -0
- package/dist/tasks/views/viewHandlers.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/forms/utils.d.ts +0 -18
- package/dist/forms/utils.d.ts.map +0 -1
- package/dist/tasks/components/TaskActions.d.ts.map +0 -1
- package/dist/tasks/components/actionHandlers.d.ts +0 -9
- package/dist/tasks/components/actionHandlers.d.ts.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X,
|
|
2
|
+
import { u as W, a as X, d as J, B as Z, R as x, q as ee, F as te } from "./index-BbuEus1P.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
6
|
-
const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3",
|
|
6
|
+
const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
|
|
7
7
|
documentsTableBody: oe,
|
|
8
8
|
viewAttachmentsLink: se,
|
|
9
9
|
documentViewerContainer: re,
|
|
10
10
|
attachmentItem: ce,
|
|
11
11
|
attachmentCounter: de,
|
|
12
|
-
attachmentError:
|
|
13
|
-
documentIframe:
|
|
12
|
+
attachmentError: me,
|
|
13
|
+
documentIframe: le,
|
|
14
14
|
documentImage: ue
|
|
15
15
|
}, ie = {
|
|
16
16
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
@@ -35,11 +35,11 @@ const Te = [
|
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
37
|
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, F = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
|
|
38
|
-
const [d, L] =
|
|
38
|
+
const [d, L] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [P, A] =
|
|
40
|
+
), [P, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] =
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
44
|
}, []), H = _(() => {
|
|
45
45
|
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
@@ -76,15 +76,15 @@ const Te = [
|
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
78
78
|
const a = /* @__PURE__ */ new Set(), g = F(s);
|
|
79
|
-
for (let
|
|
80
|
-
const b = B(g[
|
|
79
|
+
for (let m = 0; m < g.length; m++) {
|
|
80
|
+
const b = B(g[m].url);
|
|
81
81
|
try {
|
|
82
82
|
(await fetch(b, {
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
|
-
})).ok || a.add(
|
|
85
|
+
})).ok || a.add(m);
|
|
86
86
|
} catch (M) {
|
|
87
|
-
M instanceof Error && M.name !== "AbortError" && a.add(
|
|
87
|
+
M instanceof Error && M.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -170,7 +170,7 @@ const Te = [
|
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = B(e.url), g = e.contentType?.toLowerCase().includes("pdf"),
|
|
173
|
+
const a = B(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
|
|
174
174
|
return a === "#" || b ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -197,7 +197,7 @@ const Te = [
|
|
|
197
197
|
"/",
|
|
198
198
|
h.length
|
|
199
199
|
] }),
|
|
200
|
-
|
|
200
|
+
m ? /* @__PURE__ */ r(
|
|
201
201
|
"img",
|
|
202
202
|
{
|
|
203
203
|
src: a,
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { jsx as i, jsxs as oe, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import { u as se,
|
|
2
|
+
import { u as se, $ as ae, H as ne, j as de, V as ie, w as ce, n as le, e as me, b as U, R as ue, B as fe, q as k, T as ye, c as be, F as pe, O as ge } from "./index-BbuEus1P.js";
|
|
3
3
|
import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as H, useMemo as d, useCallback as p } from "react";
|
|
5
5
|
import { useTranslation as Fe } from "react-i18next";
|
|
6
6
|
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
7
7
|
formsTableBody: Ne,
|
|
8
8
|
customAccordianItem: Oe
|
|
9
|
-
},
|
|
9
|
+
}, Ae = ({
|
|
10
10
|
episodeOfCareUuids: v,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
12
|
+
config: j
|
|
13
13
|
}) => {
|
|
14
|
-
const { t: n } = Fe(), m = se(), [f,
|
|
15
|
-
numberOfVisits:
|
|
16
|
-
hideThumbnail:
|
|
14
|
+
const { t: n } = Fe(), m = se(), [f, E] = H(!1), [a, M] = H(null), {
|
|
15
|
+
numberOfVisits: w,
|
|
16
|
+
hideThumbnail: V = !1,
|
|
17
17
|
forms: y
|
|
18
|
-
} =
|
|
18
|
+
} = j ?? {}, B = ae(
|
|
19
19
|
v,
|
|
20
20
|
l
|
|
21
|
-
),
|
|
22
|
-
data:
|
|
23
|
-
isLoading:
|
|
21
|
+
), $ = he(), {
|
|
22
|
+
data: I = [],
|
|
23
|
+
isLoading: A,
|
|
24
24
|
isError: D,
|
|
25
|
-
error:
|
|
26
|
-
refetch:
|
|
25
|
+
error: x,
|
|
26
|
+
refetch: K
|
|
27
27
|
} = b({
|
|
28
28
|
queryKey: ["forms", m, v],
|
|
29
|
-
queryFn: () => ne(m, void 0,
|
|
30
|
-
enabled: !!m && !
|
|
29
|
+
queryFn: () => ne(m, void 0, w),
|
|
30
|
+
enabled: !!m && !B
|
|
31
31
|
}), T = d(() => {
|
|
32
|
-
let e =
|
|
32
|
+
let e = I;
|
|
33
33
|
return l && l.length > 0 && (e = e.filter(
|
|
34
34
|
(o) => l.includes(o.encounterUuid)
|
|
35
35
|
)), Array.isArray(y) && y.length > 0 && (e = e.filter(
|
|
36
36
|
(o) => y.some((r) => r.toLowerCase() === o.formName.toLowerCase())
|
|
37
37
|
)), e;
|
|
38
|
-
}, [
|
|
38
|
+
}, [I, l, y]), { data: R = [] } = b({
|
|
39
39
|
queryKey: ["observationForms"],
|
|
40
40
|
queryFn: () => de()
|
|
41
41
|
}), _ = p(
|
|
@@ -46,7 +46,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
46
46
|
return _(a.formName);
|
|
47
47
|
}, [a, _]), {
|
|
48
48
|
data: c,
|
|
49
|
-
isLoading:
|
|
49
|
+
isLoading: P,
|
|
50
50
|
isError: z,
|
|
51
51
|
error: h
|
|
52
52
|
} = b({
|
|
@@ -65,7 +65,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
65
65
|
});
|
|
66
66
|
le(
|
|
67
67
|
(e) => {
|
|
68
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (
|
|
68
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), $.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[m]
|
|
71
71
|
);
|
|
@@ -114,7 +114,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
114
114
|
{ key: "recordedBy", sortable: !0 }
|
|
115
115
|
],
|
|
116
116
|
[]
|
|
117
|
-
),
|
|
117
|
+
), C = d(() => {
|
|
118
118
|
const e = T.reduce(
|
|
119
119
|
(r, t) => {
|
|
120
120
|
const s = t.formName;
|
|
@@ -139,38 +139,38 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
139
139
|
)
|
|
140
140
|
})
|
|
141
141
|
).sort((r, t) => r.formName.localeCompare(t.formName));
|
|
142
|
-
}, [T, n]),
|
|
143
|
-
|
|
142
|
+
}, [T, n]), q = p((e) => {
|
|
143
|
+
M(e), E(!0);
|
|
144
144
|
}, []), ee = p(() => {
|
|
145
|
-
|
|
146
|
-
}, []),
|
|
145
|
+
E(!1), M(null);
|
|
146
|
+
}, []), S = p(
|
|
147
147
|
(e, o) => {
|
|
148
148
|
switch (o) {
|
|
149
149
|
case "recordedOn":
|
|
150
|
-
return /* @__PURE__ */ i(fe, { onClick: () =>
|
|
150
|
+
return /* @__PURE__ */ i(fe, { onClick: () => q(e), children: e.recordedOn });
|
|
151
151
|
case "recordedBy":
|
|
152
152
|
return e.recordedBy;
|
|
153
153
|
default:
|
|
154
154
|
return null;
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[q]
|
|
158
158
|
);
|
|
159
159
|
return /* @__PURE__ */ oe(te, { children: [
|
|
160
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
160
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: A || D || C.length === 0 || B ? /* @__PURE__ */ i(
|
|
161
161
|
k,
|
|
162
162
|
{
|
|
163
163
|
headers: L,
|
|
164
164
|
ariaLabel: n("FORMS_HEADING"),
|
|
165
165
|
rows: [],
|
|
166
|
-
loading:
|
|
167
|
-
errorStateMessage: D ?
|
|
166
|
+
loading: A,
|
|
167
|
+
errorStateMessage: D ? x?.message : void 0,
|
|
168
168
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
169
|
-
renderCell:
|
|
169
|
+
renderCell: S,
|
|
170
170
|
className: O.formsTableBody,
|
|
171
171
|
dataTestId: "forms-table"
|
|
172
172
|
}
|
|
173
|
-
) : /* @__PURE__ */ i(ye, { align: "start", children:
|
|
173
|
+
) : /* @__PURE__ */ i(ye, { align: "start", children: C.map((e, o) => {
|
|
174
174
|
const { formName: r, records: t } = e;
|
|
175
175
|
return /* @__PURE__ */ i(
|
|
176
176
|
be,
|
|
@@ -189,7 +189,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
189
189
|
errorStateMessage: "",
|
|
190
190
|
sortable: Z,
|
|
191
191
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
192
|
-
renderCell:
|
|
192
|
+
renderCell: S,
|
|
193
193
|
className: O.formsTableBody,
|
|
194
194
|
dataTestId: `forms-table-${r}`
|
|
195
195
|
}
|
|
@@ -214,12 +214,12 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
214
214
|
ge,
|
|
215
215
|
{
|
|
216
216
|
observations: Y,
|
|
217
|
-
isLoading:
|
|
217
|
+
isLoading: P || G,
|
|
218
218
|
isError: z || Q,
|
|
219
219
|
errorMessage: X,
|
|
220
220
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
221
221
|
testIdPrefix: a.formName,
|
|
222
|
-
hideThumbnail:
|
|
222
|
+
hideThumbnail: V,
|
|
223
223
|
controlOrder: J,
|
|
224
224
|
sectionMap: W
|
|
225
225
|
}
|
|
@@ -229,5 +229,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
229
229
|
] });
|
|
230
230
|
};
|
|
231
231
|
export {
|
|
232
|
-
|
|
232
|
+
Ae as default
|
|
233
233
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { f as K, Q as D, t as V, g as q, W as k, h as w,
|
|
2
|
+
import { f as K, Q as D, t as V, g as q, W as k, h as w, i as H, k as G, u as P, a as j, l as z, m as W, n as J, o as Y, p as X, s as Z, r as x, q as ee } from "./index-BbuEus1P.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as oe, useEffect as C, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormsTable.d.ts","sourceRoot":"","sources":["../../src/forms/FormsTable.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormsTable.d.ts","sourceRoot":"","sources":["../../src/forms/FormsTable.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD;;;GAGG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+VrC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|