@bahmni/widgets 0.0.1-dev.105 → 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, _ as Y, b as J, E as W, h as X, i as Z, S as ee, V as I, a as re, f as oe, A as ae, z as te, c as V, s as ne } from "./index-BwOAdUc7.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"],
@@ -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
  }
@@ -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-BkEYszLa.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,
75370
+ Vke as D,
75371
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,
75380
+ rGe as V,
75381
75381
  eJe as _,
75382
- Ai as a,
75382
+ Eke as a,
75383
75383
  XGe as b,
75384
75384
  tr as c,
75385
75385
  LWe as d,
75386
75386
  Oce as e,
75387
- _i as f,
75388
- nJe as g,
75387
+ Ai as f,
75388
+ vKe as g,
75389
75389
  JGe as h,
75390
75390
  Cr as i,
75391
- rGe as j,
75391
+ CYe as j,
75392
75392
  bGe as k,
75393
75393
  hn as l,
75394
75394
  rJe as m,
75395
75395
  oJe as n,
75396
75396
  aJe as o,
75397
- sJe as p,
75398
- lJe as q,
75397
+ _i as p,
75398
+ sJe as q,
75399
75399
  iJe as r,
75400
75400
  GGe as s,
75401
- cJe as t,
75401
+ lJe as t,
75402
75402
  C1 as u,
75403
- dJe as v,
75404
- uJe as w,
75405
- hJe as x,
75406
- Eke as z
75403
+ cJe as v,
75404
+ dJe as w,
75405
+ uJe as x,
75406
+ hJe as y
75407
75407
  };