@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, 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";
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 x, useMemo as u, useCallback as g } from "react";
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", 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 = {
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: Ne,
20
- memberLabel: ye,
19
+ memberRow: ye,
20
+ memberLabel: Ne,
21
21
  memberValue: Me,
22
22
  commentSection: Le,
23
- commentText: De,
24
- nestedGroup: Oe,
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
- }, Re = ({
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] = x(!1), [n, D] = x(null), $ = i?.numberOfVisits, {
100
+ const { t: a } = ce(), l = Q(), [_, L] = V(!1), [n, O] = V(null), $ = i?.numberOfVisits, {
101
101
  data: h = [],
102
- isLoading: O,
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: R = [] } = f({
111
+ ), [h, m]), { data: D = [] } = f({
112
112
  queryKey: ["observationForms"],
113
113
  queryFn: J
114
114
  }), A = g(
115
- (t) => R.find((c) => c.name === t)?.uuid,
116
- [R]
117
- ), N = u(() => {
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", N],
126
- queryFn: () => W(N),
127
- enabled: !!N && _
125
+ queryKey: ["formMetadata", y],
126
+ queryFn: () => W(y),
127
+ enabled: !!y && _
128
128
  }), {
129
- data: y,
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(() => !y?.observations || !n?.formName ? [] : y.observations.filter(
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
- ), [y?.observations, n?.formName]), E = u(
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
- D(t), L(!0);
176
+ O(t), L(!0);
177
177
  }, []), j = g(() => {
178
- L(!1), D(null);
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: O || v || B.length === 0 ? /* @__PURE__ */ e(
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: O,
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: 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
- Re,
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-RBLUc7i_.js"))
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
- Vke as D,
75370
+ vKe as D,
75371
75371
  QGe as E,
75372
75372
  uGe as G,
75373
- Qr as L,
75373
+ CYe as L,
75374
75374
  aYe as M,
75375
75375
  EWe as N,
75376
75376
  tJe as P,
75377
- yYe as R,
75377
+ Vke as R,
75378
75378
  nJe as S,
75379
75379
  xGe as U,
75380
75380
  rGe as V,
75381
75381
  eJe as _,
75382
- Eke as a,
75382
+ Ai as a,
75383
75383
  XGe as b,
75384
75384
  tr as c,
75385
- LWe as d,
75386
- Oce as e,
75387
- Ai as f,
75388
- vKe as g,
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
- CYe as j,
75392
- bGe as k,
75393
- hn as l,
75394
- rJe as m,
75395
- oJe as n,
75396
- aJe as o,
75397
- _i as p,
75398
- sJe as q,
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
- lJe as t,
75401
+ dJe as t,
75402
75402
  C1 as u,
75403
- cJe as v,
75404
- dJe as w,
75405
- uJe as x,
75406
- hJe as y
75403
+ uJe as v,
75404
+ hJe as w,
75405
+ Qr as x,
75406
+ Eke as y
75407
75407
  };