@bahmni/widgets 0.0.1-dev.281 → 0.0.1-dev.282
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-hMQu-BO-.js → DocumentsTable-_t5Q-fgi.js} +40 -40
- package/dist/{FormsTable-DxqsW2QC.js → FormsTable-Dr7LvEY-.js} +1 -1
- package/dist/{Observations-DfkGMngf.js → Observations-DGtRQbJf.js} +1 -1
- package/dist/{index-DCPifDyd.js → index-FhPWvTDE.js} +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { u as Y, a as W, y as J, X as Z, O as x, b as ee, I as te } from "./index-
|
|
2
|
+
import { u as Y, a as W, y as J, X as Z, O as x, b as ee, I as te } from "./index-FhPWvTDE.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as g, 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:
|
|
14
|
-
documentImage:
|
|
15
|
-
},
|
|
12
|
+
attachmentError: me,
|
|
13
|
+
documentIframe: le,
|
|
14
|
+
documentImage: ue
|
|
15
|
+
}, ie = {
|
|
16
16
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
17
17
|
documentType: "DOCUMENTS_TYPE",
|
|
18
18
|
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
19
19
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
|
-
|
|
20
|
+
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
21
21
|
};
|
|
22
22
|
function B(n) {
|
|
23
23
|
return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
|
|
24
24
|
}
|
|
25
|
-
function he(n,
|
|
25
|
+
function he(n, E) {
|
|
26
26
|
return n.map((d) => ({
|
|
27
27
|
key: d,
|
|
28
|
-
header:
|
|
28
|
+
header: E(ie[d])
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
31
|
const Te = [
|
|
32
32
|
"documentIdentifier",
|
|
33
33
|
"documentType",
|
|
34
|
+
"attachments",
|
|
34
35
|
"uploadedOn",
|
|
35
|
-
"uploadedBy"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const [d, M] = m(!1), [s, U] = m(
|
|
36
|
+
"uploadedBy"
|
|
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 }] : [], ge = ({ config: n, encounterUuids: E }) => {
|
|
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
|
-
),
|
|
43
|
-
U(e),
|
|
42
|
+
), f = Y(), { t: o } = ae(), { addNotification: w } = W(), V = Number(n?.pageSize) || 5, [N, O] = l(1), [u, $] = l(V), [k, C] = l(void 0), v = _((e) => {
|
|
43
|
+
U(e), L(!0);
|
|
44
44
|
}, []), z = _(() => {
|
|
45
|
-
|
|
45
|
+
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), R = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
|
-
}, []), { data:
|
|
48
|
+
}, []), { data: i, isLoading: H, isError: S, error: y } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
|
-
E,
|
|
52
51
|
f,
|
|
52
|
+
E,
|
|
53
53
|
N,
|
|
54
|
-
|
|
54
|
+
u
|
|
55
55
|
],
|
|
56
|
-
enabled: !!
|
|
56
|
+
enabled: !!f,
|
|
57
57
|
queryFn: () => J(
|
|
58
|
-
E,
|
|
59
58
|
f,
|
|
60
|
-
|
|
59
|
+
E,
|
|
60
|
+
u,
|
|
61
61
|
N
|
|
62
62
|
)
|
|
63
63
|
});
|
|
64
64
|
g(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
65
|
+
i && C(i.total);
|
|
66
|
+
}, [i]), g(() => {
|
|
67
67
|
O(1), C(void 0);
|
|
68
|
-
}, [
|
|
68
|
+
}, [f]), g(() => {
|
|
69
69
|
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
71
|
message: y?.message ?? "",
|
|
@@ -76,15 +76,15 @@ const Te = [
|
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
78
78
|
const a = /* @__PURE__ */ new Set(), I = F(s);
|
|
79
|
-
for (let
|
|
80
|
-
const b = B(I[
|
|
79
|
+
for (let m = 0; m < I.length; m++) {
|
|
80
|
+
const b = B(I[m].url);
|
|
81
81
|
try {
|
|
82
82
|
(await fetch(b, {
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
|
-
})).ok || a.add(
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
85
|
+
})).ok || a.add(m);
|
|
86
|
+
} catch (M) {
|
|
87
|
+
M instanceof Error && M.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -92,16 +92,16 @@ const Te = [
|
|
|
92
92
|
}, [d, s]);
|
|
93
93
|
const q = _(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !==
|
|
95
|
+
t !== u ? ($(t), O(1), C(void 0)) : O(e);
|
|
96
96
|
},
|
|
97
|
-
[
|
|
97
|
+
[u]
|
|
98
98
|
), D = p(
|
|
99
99
|
() => n?.fields ?? Te,
|
|
100
100
|
[n?.fields]
|
|
101
|
-
), j = p(() => [...
|
|
101
|
+
), j = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
|
|
102
102
|
() => D.map((e) => ({
|
|
103
103
|
key: e,
|
|
104
|
-
sortable: e !== "
|
|
104
|
+
sortable: e !== "attachments"
|
|
105
105
|
})),
|
|
106
106
|
[D]
|
|
107
107
|
), h = p(
|
|
@@ -122,7 +122,7 @@ const Te = [
|
|
|
122
122
|
).formattedResult || o("DOCUMENTS_NOT_AVAILABLE");
|
|
123
123
|
case "uploadedBy":
|
|
124
124
|
return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
|
|
125
|
-
case "
|
|
125
|
+
case "attachments":
|
|
126
126
|
return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ r(
|
|
127
127
|
Z,
|
|
128
128
|
{
|
|
@@ -152,7 +152,7 @@ const Te = [
|
|
|
152
152
|
renderCell: Q,
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
|
-
pageSize:
|
|
155
|
+
pageSize: u,
|
|
156
156
|
totalItems: k,
|
|
157
157
|
page: N,
|
|
158
158
|
onPageChange: q
|
|
@@ -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), I = e.contentType?.toLowerCase().includes("pdf"),
|
|
173
|
+
const a = B(e.url), I = 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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as Z, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import { K as re, u as te, x as oe, Q as ae, W as se, J as ne, L as de, d as ie, M as U, O as me, X as le, b as x, c as ce, e as ue, I as fe, f as ye } from "./index-
|
|
2
|
+
import { K as re, u as te, x as oe, Q as ae, W as se, J as ne, L as de, d as ie, M as U, O as me, X as le, b as x, c as ce, e as ue, I as fe, f as ye } from "./index-FhPWvTDE.js";
|
|
3
3
|
import { useQueryClient as be, useQuery as y } from "@tanstack/react-query";
|
|
4
4
|
import { useState as k, useMemo as d, useCallback as b } from "react";
|
|
5
5
|
import { useTranslation as pe } from "react-i18next";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as l, jsxs as U } from "react/jsx-runtime";
|
|
2
|
-
import { g as K, h as C, t as V, i as Q, j as k, p as q, k as G, l as P, u as j, a as H, U as z, N as J, d as Y, m as W, n as X, s as Z, o as x, b as ee } from "./index-
|
|
2
|
+
import { g as K, h as C, t as V, i as Q, j as k, p as q, k as G, l as P, u as j, a as H, U as z, N as J, d as Y, m as W, n as X, s as Z, o as x, b as ee } from "./index-FhPWvTDE.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as oe, useEffect as N, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as D } from "react-i18next";
|
|
@@ -93255,7 +93255,7 @@ const dHt = [
|
|
|
93255
93255
|
},
|
|
93256
93256
|
{
|
|
93257
93257
|
type: "patientDocuments",
|
|
93258
|
-
component: B1(() => import("./DocumentsTable-
|
|
93258
|
+
component: B1(() => import("./DocumentsTable-_t5Q-fgi.js"))
|
|
93259
93259
|
},
|
|
93260
93260
|
{
|
|
93261
93261
|
type: "flowSheet",
|
|
@@ -93263,7 +93263,7 @@ const dHt = [
|
|
|
93263
93263
|
},
|
|
93264
93264
|
{
|
|
93265
93265
|
type: "forms",
|
|
93266
|
-
component: B1(() => import("./FormsTable-
|
|
93266
|
+
component: B1(() => import("./FormsTable-Dr7LvEY-.js"))
|
|
93267
93267
|
},
|
|
93268
93268
|
{
|
|
93269
93269
|
type: "labOrders",
|
|
@@ -93271,7 +93271,7 @@ const dHt = [
|
|
|
93271
93271
|
},
|
|
93272
93272
|
{
|
|
93273
93273
|
type: "observations",
|
|
93274
|
-
component: B1(() => import("./Observations-
|
|
93274
|
+
component: B1(() => import("./Observations-DGtRQbJf.js"))
|
|
93275
93275
|
},
|
|
93276
93276
|
{
|
|
93277
93277
|
type: "ordersControl",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as t, a2 as s, A as o, a1 as r, q as n, a0 as g, r as l, C as c, v as P, D as d, G as v, F as C, B as T, ae as b, ag as f, ah as u, w as A, T as m, Y as p, f as I, P as R, E as S, H as D, z as L, R as W, S as y, $ as N, V as U, a6 as h, a5 as x, ac as H, ab as E, a8 as G, a9 as O, aa as V, a7 as _, ad as q, a3 as w, _ as z, af as B, a as F, u as M, Z as k } from "./index-
|
|
1
|
+
import { a4 as t, a2 as s, A as o, a1 as r, q as n, a0 as g, r as l, C as c, v as P, D as d, G as v, F as C, B as T, ae as b, ag as f, ah as u, w as A, T as m, Y as p, f as I, P as R, E as S, H as D, z as L, R as W, S as y, $ as N, V as U, a6 as h, a5 as x, ac as H, ab as E, a8 as G, a9 as O, aa as V, a7 as _, ad as q, a3 as w, _ as z, af as B, a as F, u as M, Z as k } from "./index-FhPWvTDE.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
t as ActivePractitionerContext,
|