@bahmni/widgets 0.0.1-dev.346 → 0.0.1-dev.348

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.
Files changed (51) hide show
  1. package/dist/{DocumentsTable-Dtvjttoa.js → DocumentsTable-B7UTGYR4.js} +14 -14
  2. package/dist/{FormsTable-BKd88Ugp.js → FormsTable-DPsJz4yi.js} +35 -35
  3. package/dist/{Observations-3Ged1eJY.js → Observations-CkemtZ5h.js} +1 -1
  4. package/dist/forms/FormsTable.d.ts.map +1 -1
  5. package/dist/{index-D-OVBhy0.js → index-BbuEus1P.js} +49427 -53149
  6. package/dist/index.css +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +61 -59
  10. package/dist/medications/components/Actions.d.ts.map +1 -1
  11. package/dist/observations/__mocks__/observationTestData.d.ts +6 -0
  12. package/dist/observations/__mocks__/observationTestData.d.ts.map +1 -1
  13. package/dist/observations/index.d.ts +1 -1
  14. package/dist/observations/index.d.ts.map +1 -1
  15. package/dist/observations/utils.d.ts +2 -0
  16. package/dist/observations/utils.d.ts.map +1 -1
  17. package/dist/tasks/TaskList.d.ts.map +1 -1
  18. package/dist/tasks/__tests__/__mocks__/configMocks.d.ts +9 -0
  19. package/dist/tasks/__tests__/__mocks__/configMocks.d.ts.map +1 -0
  20. package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts +2 -2
  21. package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts.map +1 -1
  22. package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts +5 -4
  23. package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts.map +1 -1
  24. package/dist/tasks/{components → actions}/TaskActions.d.ts +2 -3
  25. package/dist/tasks/actions/TaskActions.d.ts.map +1 -0
  26. package/dist/tasks/actions/actionHandlers.d.ts +3 -0
  27. package/dist/tasks/actions/actionHandlers.d.ts.map +1 -0
  28. package/dist/tasks/actions/index.d.ts +3 -0
  29. package/dist/tasks/actions/index.d.ts.map +1 -0
  30. package/dist/tasks/constants.d.ts +11 -0
  31. package/dist/tasks/constants.d.ts.map +1 -0
  32. package/dist/tasks/models.d.ts +14 -4
  33. package/dist/tasks/models.d.ts.map +1 -1
  34. package/dist/tasks/utils.d.ts +7 -18
  35. package/dist/tasks/utils.d.ts.map +1 -1
  36. package/dist/tasks/views/TaskViewResults.d.ts +9 -0
  37. package/dist/tasks/views/TaskViewResults.d.ts.map +1 -0
  38. package/dist/tasks/views/ViewFormData/ViewFormData.d.ts +12 -0
  39. package/dist/tasks/views/ViewFormData/ViewFormData.d.ts.map +1 -0
  40. package/dist/tasks/views/ViewFormData/index.d.ts +2 -0
  41. package/dist/tasks/views/ViewFormData/index.d.ts.map +1 -0
  42. package/dist/tasks/views/index.d.ts +4 -0
  43. package/dist/tasks/views/index.d.ts.map +1 -0
  44. package/dist/tasks/views/viewHandlers.d.ts +4 -0
  45. package/dist/tasks/views/viewHandlers.d.ts.map +1 -0
  46. package/package.json +1 -1
  47. package/dist/forms/utils.d.ts +0 -18
  48. package/dist/forms/utils.d.ts.map +0 -1
  49. package/dist/tasks/components/TaskActions.d.ts.map +0 -1
  50. package/dist/tasks/components/actionHandlers.d.ts +0 -9
  51. package/dist/tasks/components/actionHandlers.d.ts.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as X, l as J, B as Z, R as x, q as ee, F as te } from "./index-D-OVBhy0.js";
2
+ import { u as W, a as X, d as J, B as Z, R as x, q as ee, F as te } from "./index-BbuEus1P.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
- import { useState as m, useCallback as _, useEffect as I, useMemo as p } from "react";
4
+ import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
6
- const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", le = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
6
+ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
7
7
  documentsTableBody: oe,
8
8
  viewAttachmentsLink: se,
9
9
  documentViewerContainer: re,
10
10
  attachmentItem: ce,
11
11
  attachmentCounter: de,
12
- attachmentError: le,
13
- documentIframe: me,
12
+ attachmentError: me,
13
+ documentIframe: le,
14
14
  documentImage: ue
15
15
  }, ie = {
16
16
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
@@ -35,11 +35,11 @@ const Te = [
35
35
  "uploadedOn",
36
36
  "uploadedBy"
37
37
  ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, F = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
38
- const [d, L] = m(!1), [s, U] = m(
38
+ const [d, L] = l(!1), [s, U] = l(
39
39
  null
40
- ), [P, A] = m(
40
+ ), [P, A] = l(
41
41
  /* @__PURE__ */ new Set()
42
- ), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] = m(1), [u, $] = m(V), [k, O] = m(void 0), v = _((e) => {
42
+ ), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
43
43
  U(e), L(!0);
44
44
  }, []), H = _(() => {
45
45
  L(!1), U(null), A(/* @__PURE__ */ new Set());
@@ -76,15 +76,15 @@ const Te = [
76
76
  return (async () => {
77
77
  if (!d || !s) return;
78
78
  const a = /* @__PURE__ */ new Set(), g = F(s);
79
- for (let l = 0; l < g.length; l++) {
80
- const b = B(g[l].url);
79
+ for (let m = 0; m < g.length; m++) {
80
+ const b = B(g[m].url);
81
81
  try {
82
82
  (await fetch(b, {
83
83
  method: "HEAD",
84
84
  signal: e.signal
85
- })).ok || a.add(l);
85
+ })).ok || a.add(m);
86
86
  } catch (M) {
87
- M instanceof Error && M.name !== "AbortError" && a.add(l);
87
+ M instanceof Error && M.name !== "AbortError" && a.add(m);
88
88
  }
89
89
  }
90
90
  e.signal.aborted || A(a);
@@ -170,7 +170,7 @@ const Te = [
170
170
  size: "lg",
171
171
  testId: "document-view-modal",
172
172
  children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
173
- const a = B(e.url), g = e.contentType?.toLowerCase().includes("pdf"), l = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
173
+ const a = B(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
174
174
  return a === "#" || b ? /* @__PURE__ */ T(
175
175
  "div",
176
176
  {
@@ -197,7 +197,7 @@ const Te = [
197
197
  "/",
198
198
  h.length
199
199
  ] }),
200
- l ? /* @__PURE__ */ r(
200
+ m ? /* @__PURE__ */ r(
201
201
  "img",
202
202
  {
203
203
  src: a,
@@ -1,41 +1,41 @@
1
1
  import { jsx as i, jsxs as oe, Fragment as te } from "react/jsx-runtime";
2
- import { u as se, A as ae, V as ne, b as de, j as ie, S as ce, r as le, e as me, c as U, R as ue, B as fe, q as k, T as ye, d as be, F as pe, O as ge } from "./index-D-OVBhy0.js";
2
+ import { u as se, $ as ae, H as ne, j as de, V as ie, w as ce, n as le, e as me, b as U, R as ue, B as fe, q as k, T as ye, c as be, F as pe, O as ge } from "./index-BbuEus1P.js";
3
3
  import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
4
- import { useState as j, useMemo as d, useCallback as p } from "react";
4
+ import { useState as H, useMemo as d, useCallback as p } from "react";
5
5
  import { useTranslation as Fe } from "react-i18next";
6
6
  const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", O = {
7
7
  formsTableBody: Ne,
8
8
  customAccordianItem: Oe
9
- }, Ie = ({
9
+ }, Ae = ({
10
10
  episodeOfCareUuids: v,
11
11
  encounterUuids: l,
12
- config: H
12
+ config: j
13
13
  }) => {
14
- const { t: n } = Fe(), m = se(), [f, A] = j(!1), [a, E] = j(null), {
15
- numberOfVisits: V,
16
- hideThumbnail: w = !1,
14
+ const { t: n } = Fe(), m = se(), [f, E] = H(!1), [a, M] = H(null), {
15
+ numberOfVisits: w,
16
+ hideThumbnail: V = !1,
17
17
  forms: y
18
- } = H ?? {}, M = ae(
18
+ } = j ?? {}, B = ae(
19
19
  v,
20
20
  l
21
- ), x = he(), {
22
- data: B = [],
23
- isLoading: I,
21
+ ), $ = he(), {
22
+ data: I = [],
23
+ isLoading: A,
24
24
  isError: D,
25
- error: K,
26
- refetch: P
25
+ error: x,
26
+ refetch: K
27
27
  } = b({
28
28
  queryKey: ["forms", m, v],
29
- queryFn: () => ne(m, void 0, V),
30
- enabled: !!m && !M
29
+ queryFn: () => ne(m, void 0, w),
30
+ enabled: !!m && !B
31
31
  }), T = d(() => {
32
- let e = B;
32
+ let e = I;
33
33
  return l && l.length > 0 && (e = e.filter(
34
34
  (o) => l.includes(o.encounterUuid)
35
35
  )), Array.isArray(y) && y.length > 0 && (e = e.filter(
36
36
  (o) => y.some((r) => r.toLowerCase() === o.formName.toLowerCase())
37
37
  )), e;
38
- }, [B, l, y]), { data: R = [] } = b({
38
+ }, [I, l, y]), { data: R = [] } = b({
39
39
  queryKey: ["observationForms"],
40
40
  queryFn: () => de()
41
41
  }), _ = p(
@@ -46,7 +46,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
46
46
  return _(a.formName);
47
47
  }, [a, _]), {
48
48
  data: c,
49
- isLoading: $,
49
+ isLoading: P,
50
50
  isError: z,
51
51
  error: h
52
52
  } = b({
@@ -65,7 +65,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
65
65
  });
66
66
  le(
67
67
  (e) => {
68
- e.patientUUID === m && e.updatedConcepts.size > 0 && (P(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
68
+ e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), $.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
69
69
  },
70
70
  [m]
71
71
  );
@@ -114,7 +114,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
114
114
  { key: "recordedBy", sortable: !0 }
115
115
  ],
116
116
  []
117
- ), S = d(() => {
117
+ ), C = d(() => {
118
118
  const e = T.reduce(
119
119
  (r, t) => {
120
120
  const s = t.formName;
@@ -139,38 +139,38 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
139
139
  )
140
140
  })
141
141
  ).sort((r, t) => r.formName.localeCompare(t.formName));
142
- }, [T, n]), C = p((e) => {
143
- E(e), A(!0);
142
+ }, [T, n]), q = p((e) => {
143
+ M(e), E(!0);
144
144
  }, []), ee = p(() => {
145
- A(!1), E(null);
146
- }, []), q = p(
145
+ E(!1), M(null);
146
+ }, []), S = p(
147
147
  (e, o) => {
148
148
  switch (o) {
149
149
  case "recordedOn":
150
- return /* @__PURE__ */ i(fe, { onClick: () => C(e), children: e.recordedOn });
150
+ return /* @__PURE__ */ i(fe, { onClick: () => q(e), children: e.recordedOn });
151
151
  case "recordedBy":
152
152
  return e.recordedBy;
153
153
  default:
154
154
  return null;
155
155
  }
156
156
  },
157
- [C]
157
+ [q]
158
158
  );
159
159
  return /* @__PURE__ */ oe(te, { children: [
160
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: I || D || S.length === 0 || M ? /* @__PURE__ */ i(
160
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: A || D || C.length === 0 || B ? /* @__PURE__ */ i(
161
161
  k,
162
162
  {
163
163
  headers: L,
164
164
  ariaLabel: n("FORMS_HEADING"),
165
165
  rows: [],
166
- loading: I,
167
- errorStateMessage: D ? K?.message : void 0,
166
+ loading: A,
167
+ errorStateMessage: D ? x?.message : void 0,
168
168
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
169
- renderCell: q,
169
+ renderCell: S,
170
170
  className: O.formsTableBody,
171
171
  dataTestId: "forms-table"
172
172
  }
173
- ) : /* @__PURE__ */ i(ye, { align: "start", children: S.map((e, o) => {
173
+ ) : /* @__PURE__ */ i(ye, { align: "start", children: C.map((e, o) => {
174
174
  const { formName: r, records: t } = e;
175
175
  return /* @__PURE__ */ i(
176
176
  be,
@@ -189,7 +189,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
189
189
  errorStateMessage: "",
190
190
  sortable: Z,
191
191
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
192
- renderCell: q,
192
+ renderCell: S,
193
193
  className: O.formsTableBody,
194
194
  dataTestId: `forms-table-${r}`
195
195
  }
@@ -214,12 +214,12 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
214
214
  ge,
215
215
  {
216
216
  observations: Y,
217
- isLoading: $ || G,
217
+ isLoading: P || G,
218
218
  isError: z || Q,
219
219
  errorMessage: X,
220
220
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
221
221
  testIdPrefix: a.formName,
222
- hideThumbnail: w,
222
+ hideThumbnail: V,
223
223
  controlOrder: J,
224
224
  sectionMap: W
225
225
  }
@@ -229,5 +229,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
229
229
  ] });
230
230
  };
231
231
  export {
232
- Ie as default
232
+ Ae as default
233
233
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
- import { f as K, Q as D, t as V, g as q, W as k, h as w, n as H, i as G, u as P, a as j, k as z, m as W, r as J, o as Y, p as X, s as Z, v as x, q as ee } from "./index-D-OVBhy0.js";
2
+ import { f as K, Q as D, t as V, g as q, W as k, h as w, i as H, k as G, u as P, a as j, l as z, m as W, n as J, o as Y, p as X, s as Z, r as x, q as ee } from "./index-BbuEus1P.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
4
  import { useRef as oe, useEffect as C, useMemo as g } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
@@ -1 +1 @@
1
- {"version":3,"file":"FormsTable.d.ts","sourceRoot":"","sources":["../../src/forms/FormsTable.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD;;;GAGG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+VrC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"FormsTable.d.ts","sourceRoot":"","sources":["../../src/forms/FormsTable.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD;;;GAGG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+VrC,CAAC;AAEF,eAAe,UAAU,CAAC"}