@bahmni/widgets 0.0.1-dev.106 → 0.0.1-dev.107
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as p, jsx as e, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { u as Q, _ as Y, b as J, E as W, h as X, i as Z,
|
|
2
|
+
import { u as Q, _ as Y, b as J, E as W, h as X, i as Z, R as ee, x as S, a as re, d as oe, A as ae, y as te, c as x, s as ne } from "./index-DMwP4u7j.js";
|
|
3
3
|
import { useQuery as f } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as V, useMemo as u, useCallback as g } from "react";
|
|
5
5
|
import { createPortal as se } from "react-dom";
|
|
6
6
|
import { useTranslation as ce } from "react-i18next";
|
|
7
|
-
const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie = "_formContent_ua0cn_18", le = "_formDetailsContainer_ua0cn_25", ue = "_observation_ua0cn_30", pe = "_groupContainer_ua0cn_39", _e = "_rowContainer_ua0cn_43", be = "_groupLabel_ua0cn_48", fe = "_rowLabel_ua0cn_58", ge = "_rowValue_ua0cn_67", he = "_groupMembers_ua0cn_75",
|
|
7
|
+
const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie = "_formContent_ua0cn_18", le = "_formDetailsContainer_ua0cn_25", ue = "_observation_ua0cn_30", pe = "_groupContainer_ua0cn_39", _e = "_rowContainer_ua0cn_43", be = "_groupLabel_ua0cn_48", fe = "_rowLabel_ua0cn_58", ge = "_rowValue_ua0cn_67", he = "_groupMembers_ua0cn_75", ye = "_memberRow_ua0cn_81", Ne = "_memberLabel_ua0cn_86", Me = "_memberValue_ua0cn_94", Le = "_commentSection_ua0cn_102", Oe = "_commentText_ua0cn_108", Re = "_nestedGroup_ua0cn_117", ve = "_nestedGroupLabel_ua0cn_124", Ce = "_nestedGroupMembers_ua0cn_133", o = {
|
|
8
8
|
formsTableBody: de,
|
|
9
9
|
customAccordianItem: me,
|
|
10
10
|
formContent: ie,
|
|
@@ -16,12 +16,12 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
16
16
|
rowLabel: fe,
|
|
17
17
|
rowValue: ge,
|
|
18
18
|
groupMembers: he,
|
|
19
|
-
memberRow:
|
|
20
|
-
memberLabel:
|
|
19
|
+
memberRow: ye,
|
|
20
|
+
memberLabel: Ne,
|
|
21
21
|
memberValue: Me,
|
|
22
22
|
commentSection: Le,
|
|
23
|
-
commentText:
|
|
24
|
-
nestedGroup:
|
|
23
|
+
commentText: Oe,
|
|
24
|
+
nestedGroup: Re,
|
|
25
25
|
nestedGroupLabel: ve,
|
|
26
26
|
nestedGroupMembers: Ce
|
|
27
27
|
}, U = ({
|
|
@@ -57,7 +57,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
|
-
},
|
|
60
|
+
}, De = ({
|
|
61
61
|
observation: r,
|
|
62
62
|
index: m
|
|
63
63
|
}) => {
|
|
@@ -97,9 +97,9 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
97
97
|
encounterUuids: m,
|
|
98
98
|
config: i
|
|
99
99
|
}) => {
|
|
100
|
-
const { t: a } = ce(), l = Q(), [_, L] =
|
|
100
|
+
const { t: a } = ce(), l = Q(), [_, L] = V(!1), [n, O] = V(null), $ = i?.numberOfVisits, {
|
|
101
101
|
data: h = [],
|
|
102
|
-
isLoading:
|
|
102
|
+
isLoading: R,
|
|
103
103
|
isError: v,
|
|
104
104
|
error: q
|
|
105
105
|
} = f({
|
|
@@ -108,13 +108,13 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
108
108
|
enabled: !!l
|
|
109
109
|
}), C = u(() => !m || m.length === 0 ? h : h.filter(
|
|
110
110
|
(t) => m.includes(t.encounterUuid)
|
|
111
|
-
), [h, m]), { data:
|
|
111
|
+
), [h, m]), { data: D = [] } = f({
|
|
112
112
|
queryKey: ["observationForms"],
|
|
113
113
|
queryFn: J
|
|
114
114
|
}), A = g(
|
|
115
|
-
(t) =>
|
|
116
|
-
[
|
|
117
|
-
),
|
|
115
|
+
(t) => D.find((c) => c.name === t)?.uuid,
|
|
116
|
+
[D]
|
|
117
|
+
), y = u(() => {
|
|
118
118
|
if (n)
|
|
119
119
|
return A(n.formName);
|
|
120
120
|
}, [n, A]), {
|
|
@@ -122,20 +122,20 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
122
122
|
isLoading: k,
|
|
123
123
|
error: F
|
|
124
124
|
} = f({
|
|
125
|
-
queryKey: ["formMetadata",
|
|
126
|
-
queryFn: () => W(
|
|
127
|
-
enabled: !!
|
|
125
|
+
queryKey: ["formMetadata", y],
|
|
126
|
+
queryFn: () => W(y),
|
|
127
|
+
enabled: !!y && _
|
|
128
128
|
}), {
|
|
129
|
-
data:
|
|
129
|
+
data: N,
|
|
130
130
|
isLoading: H,
|
|
131
131
|
error: w
|
|
132
132
|
} = f({
|
|
133
133
|
queryKey: ["formsEncounter", n?.encounterUuid],
|
|
134
134
|
queryFn: () => X(n.encounterUuid, !0),
|
|
135
135
|
enabled: !!n?.encounterUuid && _
|
|
136
|
-
}), T = u(() => !
|
|
136
|
+
}), T = u(() => !N?.observations || !n?.formName ? [] : N.observations.filter(
|
|
137
137
|
(d) => "formFieldPath" in d && typeof d.formFieldPath == "string" && d.formFieldPath.includes(n.formName)
|
|
138
|
-
), [
|
|
138
|
+
), [N?.observations, n?.formName]), E = u(
|
|
139
139
|
() => [
|
|
140
140
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
141
141
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
@@ -173,9 +173,9 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
173
173
|
})
|
|
174
174
|
).sort((c, s) => c.formName.localeCompare(s.formName));
|
|
175
175
|
}, [C, a]), G = g((t) => {
|
|
176
|
-
|
|
176
|
+
O(t), L(!0);
|
|
177
177
|
}, []), j = g(() => {
|
|
178
|
-
L(!1),
|
|
178
|
+
L(!1), O(null);
|
|
179
179
|
}, []), I = g(
|
|
180
180
|
(t, d) => {
|
|
181
181
|
switch (d) {
|
|
@@ -190,13 +190,13 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
190
190
|
[G]
|
|
191
191
|
);
|
|
192
192
|
return /* @__PURE__ */ p(z, { children: [
|
|
193
|
-
/* @__PURE__ */ e("div", { "data-testid": "forms-table", children:
|
|
193
|
+
/* @__PURE__ */ e("div", { "data-testid": "forms-table", children: R || v || B.length === 0 ? /* @__PURE__ */ e(
|
|
194
194
|
S,
|
|
195
195
|
{
|
|
196
196
|
headers: E,
|
|
197
197
|
ariaLabel: a("FORMS_HEADING"),
|
|
198
198
|
rows: [],
|
|
199
|
-
loading:
|
|
199
|
+
loading: R,
|
|
200
200
|
errorStateMessage: v ? q?.message : void 0,
|
|
201
201
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
202
202
|
renderCell: I,
|
|
@@ -242,8 +242,8 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
|
|
|
242
242
|
passiveModal: !0,
|
|
243
243
|
size: "md",
|
|
244
244
|
testId: "form-details-modal",
|
|
245
|
-
children: /* @__PURE__ */ e("div", { className: o.formContent, children: k || H ? /* @__PURE__ */ e(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ e("div", { children:
|
|
246
|
-
|
|
245
|
+
children: /* @__PURE__ */ e("div", { className: o.formContent, children: k || H ? /* @__PURE__ */ e(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ e("div", { children: x(F).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ e("div", { children: x(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : T.length > 0 ? /* @__PURE__ */ e("div", { className: o.formDetailsContainer, children: T.map((t, d) => /* @__PURE__ */ e(
|
|
246
|
+
De,
|
|
247
247
|
{
|
|
248
248
|
observation: t,
|
|
249
249
|
index: d
|
|
@@ -75313,7 +75313,7 @@ const NGe = [
|
|
|
75313
75313
|
},
|
|
75314
75314
|
{
|
|
75315
75315
|
type: "forms",
|
|
75316
|
-
component: w1(() => import("./FormsTable-
|
|
75316
|
+
component: w1(() => import("./FormsTable-COl06FGn.js"))
|
|
75317
75317
|
}
|
|
75318
75318
|
];
|
|
75319
75319
|
class Xr {
|
|
@@ -75367,41 +75367,41 @@ const iJe = (t) => {
|
|
|
75367
75367
|
export {
|
|
75368
75368
|
l4 as A,
|
|
75369
75369
|
dKe as C,
|
|
75370
|
-
|
|
75370
|
+
vKe as D,
|
|
75371
75371
|
QGe as E,
|
|
75372
75372
|
uGe as G,
|
|
75373
|
-
|
|
75373
|
+
CYe as L,
|
|
75374
75374
|
aYe as M,
|
|
75375
75375
|
EWe as N,
|
|
75376
75376
|
tJe as P,
|
|
75377
|
-
|
|
75377
|
+
Vke as R,
|
|
75378
75378
|
nJe as S,
|
|
75379
75379
|
xGe as U,
|
|
75380
75380
|
rGe as V,
|
|
75381
75381
|
eJe as _,
|
|
75382
|
-
|
|
75382
|
+
Ai as a,
|
|
75383
75383
|
XGe as b,
|
|
75384
75384
|
tr as c,
|
|
75385
|
-
|
|
75386
|
-
|
|
75387
|
-
|
|
75388
|
-
|
|
75385
|
+
_i as d,
|
|
75386
|
+
LWe as e,
|
|
75387
|
+
Oce as f,
|
|
75388
|
+
yYe as g,
|
|
75389
75389
|
JGe as h,
|
|
75390
75390
|
Cr as i,
|
|
75391
|
-
|
|
75392
|
-
|
|
75393
|
-
|
|
75394
|
-
|
|
75395
|
-
|
|
75396
|
-
|
|
75397
|
-
|
|
75398
|
-
|
|
75391
|
+
bGe as j,
|
|
75392
|
+
hn as k,
|
|
75393
|
+
rJe as l,
|
|
75394
|
+
oJe as m,
|
|
75395
|
+
aJe as n,
|
|
75396
|
+
sJe as o,
|
|
75397
|
+
lJe as p,
|
|
75398
|
+
cJe as q,
|
|
75399
75399
|
iJe as r,
|
|
75400
75400
|
GGe as s,
|
|
75401
|
-
|
|
75401
|
+
dJe as t,
|
|
75402
75402
|
C1 as u,
|
|
75403
|
-
|
|
75404
|
-
|
|
75405
|
-
|
|
75406
|
-
|
|
75403
|
+
uJe as v,
|
|
75404
|
+
hJe as w,
|
|
75405
|
+
Qr as x,
|
|
75406
|
+
Eke as y
|
|
75407
75407
|
};
|