@bahmni/widgets 0.0.1-dev.128 → 0.0.1-dev.129

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 b, jsx as a, Fragment as Q } from "react/jsx-runtime";
2
- import { c as L, u as Y, L as W, H as Z, F as ee, V as te, k as re, J as oe, l as ae, K as U, m as se, w as ne, p as ce, X as de, a as k, o as le } from "./index-BEusKCC8.js";
2
+ import { c as M, u as Y, L as W, H as Z, F as ee, V as te, k as re, J as oe, l as ae, K as U, m as se, w as ne, p as ce, X as de, a as k, o as le } from "./index-DN-Xic0O.js";
3
3
  import { useQuery as h } from "@tanstack/react-query";
4
- import { useState as q, useMemo as g, useCallback as M } from "react";
4
+ import { useState as q, useMemo as g, useCallback as L } from "react";
5
5
  import { createPortal as me } from "react-dom";
6
6
  import { useTranslation as ie } from "react-i18next";
7
- const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be = "_formContent_1pd36_18", _e = "_formDetailsContainer_1pd36_25", fe = "_observation_1pd36_30", ge = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ye = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", Me = "_groupMembers_1pd36_75", Le = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Te = "_memberValue_1pd36_94", Ae = "_abnormalValue_1pd36_102", Oe = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Fe = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", ve = "_nestedGroupMembers_1pd36_141", o = {
7
+ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be = "_formContent_1pd36_18", _e = "_formDetailsContainer_1pd36_25", fe = "_observation_1pd36_30", ge = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ye = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", Le = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Oe = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Fe = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", ve = "_nestedGroupMembers_1pd36_141", o = {
8
8
  formsTableBody: ue,
9
9
  customAccordianItem: pe,
10
10
  formContent: be,
@@ -15,11 +15,11 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
15
15
  groupLabel: $e,
16
16
  rowLabel: ye,
17
17
  rowValue: he,
18
- groupMembers: Me,
19
- memberRow: Le,
20
- memberLabel: De,
21
- memberValue: Te,
22
- abnormalValue: Ae,
18
+ groupMembers: Le,
19
+ memberRow: Me,
20
+ memberLabel: Ae,
21
+ memberValue: De,
22
+ abnormalValue: Te,
23
23
  commentSection: Oe,
24
24
  commentText: Re,
25
25
  nestedGroup: Fe,
@@ -82,7 +82,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
82
82
  /* @__PURE__ */ b(
83
83
  "p",
84
84
  {
85
- className: L(
85
+ className: M(
86
86
  o.memberLabel,
87
87
  f ? o.abnormalValue : ""
88
88
  ),
@@ -96,7 +96,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
96
96
  /* @__PURE__ */ b(
97
97
  "p",
98
98
  {
99
- className: L(
99
+ className: M(
100
100
  o.memberValue,
101
101
  f ? o.abnormalValue : ""
102
102
  ),
@@ -131,7 +131,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
131
131
  /* @__PURE__ */ b(
132
132
  "p",
133
133
  {
134
- className: L(
134
+ className: M(
135
135
  t ? o.groupLabel : o.rowLabel,
136
136
  !t && l ? o.abnormalValue : ""
137
137
  ),
@@ -161,7 +161,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
161
161
  ) : /* @__PURE__ */ b(
162
162
  "p",
163
163
  {
164
- className: L(
164
+ className: M(
165
165
  o.rowValue,
166
166
  l ? o.abnormalValue : ""
167
167
  ),
@@ -212,31 +212,31 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
212
212
  ), [$, s]), { data: C = [] } = h({
213
213
  queryKey: ["observationForms"],
214
214
  queryFn: () => ee()
215
- }), v = M(
215
+ }), v = L(
216
216
  (c) => C.find((m) => m.name === c)?.uuid,
217
217
  [C]
218
- ), D = g(() => {
218
+ ), A = g(() => {
219
219
  if (r)
220
220
  return v(r.formName);
221
221
  }, [r, v]), {
222
- data: Ve,
222
+ data: Ie,
223
223
  isLoading: j,
224
224
  error: w
225
225
  } = h({
226
- queryKey: ["formMetadata", D],
227
- queryFn: () => te(D),
228
- enabled: !!D && n
226
+ queryKey: ["formMetadata", A],
227
+ queryFn: () => te(A),
228
+ enabled: !!A && n
229
229
  }), {
230
- data: T,
230
+ data: D,
231
231
  isLoading: J,
232
232
  error: E
233
233
  } = h({
234
234
  queryKey: ["formsEncounter", r?.encounterUuid],
235
235
  queryFn: () => re(r.encounterUuid, !0),
236
236
  enabled: !!r?.encounterUuid && n
237
- }), V = g(() => !T?.observations || !r?.formName ? [] : T.observations.filter(
237
+ }), I = g(() => !D?.observations || !r?.formName ? [] : D.observations.filter(
238
238
  (p) => "formFieldPath" in p && typeof p.formFieldPath == "string" && p.formFieldPath.includes(r.formName)
239
- ), [T?.observations, r?.formName]), B = g(
239
+ ), [D?.observations, r?.formName]), V = g(
240
240
  () => [
241
241
  { key: "recordedOn", header: t("FORM_RECORDED_ON") },
242
242
  { key: "recordedBy", header: t("FORM_RECORDED_BY") }
@@ -248,17 +248,17 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
248
248
  { key: "recordedBy", sortable: !0 }
249
249
  ],
250
250
  []
251
- ), I = g(() => {
251
+ ), B = g(() => {
252
252
  const c = F.reduce(
253
253
  (m, i) => {
254
254
  const y = i.formName;
255
255
  m[y] ??= [];
256
- const A = i.providers.map((z) => z.providerName).filter(Boolean).join(", ");
256
+ const T = i.providers.map((z) => z.providerName).filter(Boolean).join(", ");
257
257
  return m[y].push({
258
258
  id: i.encounterUuid,
259
259
  formName: i.formName,
260
260
  recordedOn: oe(i.encounterDateTime, t, le).formattedResult,
261
- recordedBy: A ?? "--",
261
+ recordedBy: T ?? "--",
262
262
  encounterDateTime: i.encounterDateTime,
263
263
  encounterUuid: i.encounterUuid
264
264
  }), m;
@@ -269,15 +269,15 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
269
269
  ([m, i]) => ({
270
270
  formName: m,
271
271
  records: i.sort(
272
- (y, A) => A.encounterDateTime - y.encounterDateTime
272
+ (y, T) => T.encounterDateTime - y.encounterDateTime
273
273
  )
274
274
  })
275
275
  ).sort((m, i) => m.formName.localeCompare(i.formName));
276
- }, [F, t]), S = M((c) => {
276
+ }, [F, t]), S = L((c) => {
277
277
  _(c), l(!0);
278
- }, []), x = M(() => {
278
+ }, []), x = L(() => {
279
279
  l(!1), _(null);
280
- }, []), G = M(
280
+ }, []), G = L(
281
281
  (c, p) => {
282
282
  switch (p) {
283
283
  case "recordedOn":
@@ -291,10 +291,10 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
291
291
  [S]
292
292
  );
293
293
  return /* @__PURE__ */ b(Q, { children: [
294
- /* @__PURE__ */ a("div", { "data-testid": "forms-table", children: O || R || I.length === 0 || N ? /* @__PURE__ */ a(
294
+ /* @__PURE__ */ a("div", { "data-testid": "forms-table", children: O || R || B.length === 0 || N ? /* @__PURE__ */ a(
295
295
  U,
296
296
  {
297
- headers: B,
297
+ headers: V,
298
298
  ariaLabel: t("FORMS_HEADING"),
299
299
  rows: [],
300
300
  loading: O,
@@ -304,7 +304,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
304
304
  className: o.formsTableBody,
305
305
  dataTestId: "forms-table"
306
306
  }
307
- ) : /* @__PURE__ */ a(se, { align: "start", children: I.map((c, p) => {
307
+ ) : /* @__PURE__ */ a(se, { align: "start", children: B.map((c, p) => {
308
308
  const { formName: m, records: i } = c;
309
309
  return /* @__PURE__ */ a(
310
310
  ne,
@@ -316,7 +316,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
316
316
  children: /* @__PURE__ */ a(
317
317
  U,
318
318
  {
319
- headers: B,
319
+ headers: V,
320
320
  ariaLabel: t("FORMS_HEADING"),
321
321
  rows: i,
322
322
  loading: !1,
@@ -336,7 +336,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
336
336
  /* @__PURE__ */ a(
337
337
  ce,
338
338
  {
339
- id: "formDetailsModal",
339
+ id: "modalIdForActionAreaLayout",
340
340
  open: n,
341
341
  onRequestClose: x,
342
342
  modalHeading: r.formName,
@@ -344,7 +344,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", be =
344
344
  passiveModal: !0,
345
345
  size: "md",
346
346
  testId: "form-details-modal",
347
- children: /* @__PURE__ */ a("div", { className: o.formContent, children: j || J ? /* @__PURE__ */ a(de, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ a("div", { children: k(w).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ a("div", { children: k(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : V.length > 0 ? /* @__PURE__ */ a("div", { className: o.formDetailsContainer, children: V.map((c, p) => /* @__PURE__ */ a(
347
+ children: /* @__PURE__ */ a("div", { className: o.formContent, children: j || J ? /* @__PURE__ */ a(de, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ a("div", { children: k(w).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ a("div", { children: k(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ a("div", { className: o.formDetailsContainer, children: I.map((c, p) => /* @__PURE__ */ a(
348
348
  Ee,
349
349
  {
350
350
  observation: c,
@@ -1,5 +1,5 @@
1
1
  import { jsx as v, jsxs as _ } from "react/jsx-runtime";
2
- import { Y as F, b as N, d as K, C as q, e as Q, f as k, u as G, g as H, h as P, I as x, S as Y, K as j } from "./index-BEusKCC8.js";
2
+ import { Y as F, b as N, d as K, C as q, e as Q, f as k, u as G, g as H, h as P, I as x, S as Y, K as j } from "./index-DN-Xic0O.js";
3
3
  import { useQueries as z, useQuery as J } from "@tanstack/react-query";
4
4
  import { useRef as W, useEffect as T, useMemo as y } from "react";
5
5
  import { useTranslation as A } from "react-i18next";