@bahmni/widgets 0.0.1-dev.103 → 0.0.1-dev.106

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, E as Y, w as J, b as W, f as X, i as Z, S as ee, V as I, a as re, c as oe, A as ae, z as te, d as V, s as ne } from "./index-DQRZqaXZ.js";
2
+ import { u as Q, _ as Y, b as J, E as W, h as X, i as Z, D as ee, L as S, f as re, p as oe, A as ae, a as te, c as V, s as ne } from "./index-Dvpa5LYh.js";
3
3
  import { useQuery as f } from "@tanstack/react-query";
4
4
  import { useState as x, 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", Ne = "_memberRow_ua0cn_81", ye = "_memberLabel_ua0cn_86", Me = "_memberValue_ua0cn_94", Le = "_commentSection_ua0cn_102", Oe = "_commentText_ua0cn_108", ve = "_nestedGroup_ua0cn_117", Ce = "_nestedGroupLabel_ua0cn_124", De = "_nestedGroupMembers_ua0cn_133", o = {
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", Ne = "_memberRow_ua0cn_81", ye = "_memberLabel_ua0cn_86", Me = "_memberValue_ua0cn_94", Le = "_commentSection_ua0cn_102", De = "_commentText_ua0cn_108", Oe = "_nestedGroup_ua0cn_117", ve = "_nestedGroupLabel_ua0cn_124", Ce = "_nestedGroupMembers_ua0cn_133", o = {
8
8
  formsTableBody: de,
9
9
  customAccordianItem: me,
10
10
  formContent: ie,
@@ -20,10 +20,10 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
20
20
  memberLabel: ye,
21
21
  memberValue: Me,
22
22
  commentSection: Le,
23
- commentText: Oe,
24
- nestedGroup: ve,
25
- nestedGroupLabel: Ce,
26
- nestedGroupMembers: De
23
+ commentText: De,
24
+ nestedGroup: Oe,
25
+ nestedGroupLabel: ve,
26
+ nestedGroupMembers: Ce
27
27
  }, U = ({
28
28
  member: r,
29
29
  depth: m = 0
@@ -92,21 +92,21 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
92
92
  },
93
93
  `${r.concept.uuid}-${m}`
94
94
  );
95
- }, Se = ({
95
+ }, Ie = ({
96
96
  episodeOfCareUuids: r,
97
97
  encounterUuids: m,
98
98
  config: i
99
99
  }) => {
100
- const { t: a } = ce(), l = Q(), [_, L] = x(!1), [n, O] = x(null), $ = i?.numberOfVisits, {
100
+ const { t: a } = ce(), l = Q(), [_, L] = x(!1), [n, D] = x(null), $ = i?.numberOfVisits, {
101
101
  data: h = [],
102
- isLoading: v,
103
- isError: C,
102
+ isLoading: O,
103
+ isError: v,
104
104
  error: q
105
105
  } = f({
106
106
  queryKey: ["forms", l, r],
107
107
  queryFn: () => Y(l, void 0, $),
108
108
  enabled: !!l
109
- }), D = u(() => !m || m.length === 0 ? h : h.filter(
109
+ }), C = u(() => !m || m.length === 0 ? h : h.filter(
110
110
  (t) => m.includes(t.encounterUuid)
111
111
  ), [h, m]), { data: R = [] } = f({
112
112
  queryKey: ["observationForms"],
@@ -120,7 +120,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
120
120
  }, [n, A]), {
121
121
  data: Ae,
122
122
  isLoading: k,
123
- error: w
123
+ error: F
124
124
  } = f({
125
125
  queryKey: ["formMetadata", N],
126
126
  queryFn: () => W(N),
@@ -128,7 +128,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
128
128
  }), {
129
129
  data: y,
130
130
  isLoading: H,
131
- error: F
131
+ error: w
132
132
  } = f({
133
133
  queryKey: ["formsEncounter", n?.encounterUuid],
134
134
  queryFn: () => X(n.encounterUuid, !0),
@@ -148,7 +148,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
148
148
  ],
149
149
  []
150
150
  ), B = u(() => {
151
- const t = D.reduce(
151
+ const t = C.reduce(
152
152
  (c, s) => {
153
153
  const b = s.formName;
154
154
  c[b] ??= [];
@@ -172,11 +172,11 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
172
172
  )
173
173
  })
174
174
  ).sort((c, s) => c.formName.localeCompare(s.formName));
175
- }, [D, a]), G = g((t) => {
176
- O(t), L(!0);
175
+ }, [C, a]), G = g((t) => {
176
+ D(t), L(!0);
177
177
  }, []), j = g(() => {
178
- L(!1), O(null);
179
- }, []), S = g(
178
+ L(!1), D(null);
179
+ }, []), I = g(
180
180
  (t, d) => {
181
181
  switch (d) {
182
182
  case "recordedOn":
@@ -190,16 +190,16 @@ 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: v || C || B.length === 0 ? /* @__PURE__ */ e(
194
- I,
193
+ /* @__PURE__ */ e("div", { "data-testid": "forms-table", children: O || v || B.length === 0 ? /* @__PURE__ */ e(
194
+ S,
195
195
  {
196
196
  headers: E,
197
197
  ariaLabel: a("FORMS_HEADING"),
198
198
  rows: [],
199
- loading: v,
200
- errorStateMessage: C ? q?.message : void 0,
199
+ loading: O,
200
+ errorStateMessage: v ? q?.message : void 0,
201
201
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
202
- renderCell: S,
202
+ renderCell: I,
203
203
  className: o.formsTableBody,
204
204
  "data-testid": "sortable-data-table"
205
205
  }
@@ -213,7 +213,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
213
213
  testId: "accordian-table-title",
214
214
  open: d === 0,
215
215
  children: /* @__PURE__ */ e(
216
- I,
216
+ S,
217
217
  {
218
218
  headers: E,
219
219
  ariaLabel: a("FORMS_HEADING"),
@@ -222,7 +222,7 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
222
222
  errorStateMessage: "",
223
223
  sortable: P,
224
224
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
225
- renderCell: S,
225
+ renderCell: I,
226
226
  className: o.formsTableBody,
227
227
  "data-testid": "sortable-data-table"
228
228
  }
@@ -242,7 +242,7 @@ 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 }) : w ? /* @__PURE__ */ e("div", { children: V(w).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : F ? /* @__PURE__ */ e("div", { children: V(F).message ?? a("ERROR_FETCHING_FORM_DATA") }) : T.length > 0 ? /* @__PURE__ */ e("div", { className: o.formDetailsContainer, children: T.map((t, d) => /* @__PURE__ */ e(
245
+ children: /* @__PURE__ */ e("div", { className: o.formContent, children: k || H ? /* @__PURE__ */ e(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ e("div", { children: V(F).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ e("div", { children: V(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : T.length > 0 ? /* @__PURE__ */ e("div", { className: o.formDetailsContainer, children: T.map((t, d) => /* @__PURE__ */ e(
246
246
  Re,
247
247
  {
248
248
  observation: t,
@@ -257,5 +257,5 @@ const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie =
257
257
  ] });
258
258
  };
259
259
  export {
260
- Se as default
260
+ Ie as default
261
261
  };
@@ -75313,7 +75313,7 @@ const NGe = [
75313
75313
  },
75314
75314
  {
75315
75315
  type: "forms",
75316
- component: w1(() => import("./FormsTable-DLr7yxQC.js"))
75316
+ component: w1(() => import("./FormsTable-RBLUc7i_.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
- vKe as D,
75371
- eJe as E,
75370
+ Vke as D,
75371
+ QGe as E,
75372
75372
  uGe as G,
75373
- CYe as L,
75373
+ Qr as L,
75374
75374
  aYe as M,
75375
75375
  EWe as N,
75376
75376
  tJe as P,
75377
75377
  yYe as R,
75378
- Vke as S,
75378
+ nJe as S,
75379
75379
  xGe as U,
75380
- Qr as V,
75381
- Ai as a,
75382
- QGe as b,
75383
- _i as c,
75384
- tr as d,
75385
- LWe as e,
75386
- JGe as f,
75387
- Oce as g,
75388
- nJe as h,
75380
+ rGe as V,
75381
+ eJe as _,
75382
+ Eke as a,
75383
+ XGe as b,
75384
+ tr as c,
75385
+ LWe as d,
75386
+ Oce as e,
75387
+ Ai as f,
75388
+ vKe as g,
75389
+ JGe as h,
75389
75390
  Cr as i,
75390
- rGe as j,
75391
+ CYe as j,
75391
75392
  bGe as k,
75392
75393
  hn as l,
75393
75394
  rJe as m,
75394
75395
  oJe as n,
75395
75396
  aJe as o,
75396
- sJe as p,
75397
- lJe as q,
75397
+ _i as p,
75398
+ sJe as q,
75398
75399
  iJe as r,
75399
75400
  GGe as s,
75400
- cJe as t,
75401
+ lJe as t,
75401
75402
  C1 as u,
75402
- dJe as v,
75403
- XGe as w,
75403
+ cJe as v,
75404
+ dJe as w,
75404
75405
  uJe as x,
75405
- hJe as y,
75406
- Eke as z
75406
+ hJe as y
75407
75407
  };