@bahmni/widgets 0.0.1-dev.403 → 0.0.1-dev.404

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 (23) hide show
  1. package/dist/{DocumentsTable-Dzer5eOY.js → DocumentsTable-DjFTQRUd.js} +4 -4
  2. package/dist/{FormsTable-CwXX7pm4.js → FormsTable-BaH-u6Cj.js} +15 -15
  3. package/dist/{Observations-00pOtH3y.js → Observations-CIB2bMdg.js} +29 -29
  4. package/dist/{index-BqbZxHvD.js → index-CKyHo_Q1.js} +10357 -10205
  5. package/dist/index.css +1 -1
  6. package/dist/index.js +7 -7
  7. package/dist/search/commonSearch/CommonSearchWidget.d.ts.map +1 -1
  8. package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts.map +1 -1
  9. package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts +1 -0
  10. package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts.map +1 -1
  11. package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts.map +1 -1
  12. package/dist/search/commonSearch/__tests__/__mocks__/searchSummaryMocks.d.ts.map +1 -1
  13. package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts.map +1 -1
  14. package/dist/search/commonSearch/components/ResultsTable.d.ts +13 -2
  15. package/dist/search/commonSearch/components/ResultsTable.d.ts.map +1 -1
  16. package/dist/search/commonSearch/constants.d.ts +1 -0
  17. package/dist/search/commonSearch/constants.d.ts.map +1 -1
  18. package/dist/search/commonSearch/models.d.ts +36 -1
  19. package/dist/search/commonSearch/models.d.ts.map +1 -1
  20. package/dist/search/commonSearch/schema.json.d.ts +6 -0
  21. package/dist/search/commonSearch/utils.d.ts +4 -2
  22. package/dist/search/commonSearch/utils.d.ts.map +1 -1
  23. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Q } from "react/jsx-runtime";
2
- import { u as W, a as X, L as J, m as Z, Y as x, b as ee, F as te } from "./index-BqbZxHvD.js";
2
+ import { u as W, a as X, L as J, V as Z, Y as x, b as ee, F as te } from "./index-CKyHo_Q1.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
@@ -37,9 +37,9 @@ const Te = [
37
37
  ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
38
38
  const [d, M] = l(!1), [s, U] = l(
39
39
  null
40
- ), [P, A] = l(
40
+ ), [V, A] = l(
41
41
  /* @__PURE__ */ new Set()
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) => {
42
+ ), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
43
43
  U(e), M(!0);
44
44
  }, []), z = _(() => {
45
45
  M(!1), U(null), A(/* @__PURE__ */ new Set());
@@ -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 = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = P.has(t);
173
+ const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = V.has(t);
174
174
  return a === "#" || y ? /* @__PURE__ */ T(
175
175
  "div",
176
176
  {
@@ -1,13 +1,13 @@
1
1
  import { jsx as i, jsxs as $, Fragment as ge } from "react/jsx-runtime";
2
- import { u as be, c as Oe, d as Ne, f as Ee, l as Te, i as ve, e as Fe, B as Ie, O as Ae, g as _e, h as Re, j as G, Y as De, C as K, k as z, m as Me, b as Y, r as Be, n as Le, F as Ce, o as Se, p as Ue } from "./index-BqbZxHvD.js";
2
+ import { u as be, c as Oe, d as Ne, f as Ee, l as Te, i as ve, e as Fe, B as Ie, O as Ae, g as _e, h as Re, j as G, Y as De, C as K, k as z, V as Me, b as Y, r as Be, m as Le, F as Ce, n as Se, o as Ue } from "./index-CKyHo_Q1.js";
3
3
  import { useQueryClient as ke, useQuery as E } from "@tanstack/react-query";
4
4
  import { useState as Q, useMemo as d, useCallback as c } from "react";
5
5
  import { useTranslation as we } from "react-i18next";
6
- const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", T = {
6
+ const He = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", T = {
7
7
  formsTableBody: He,
8
- modalHeading: qe,
9
- customAccordianItem: Pe
10
- }, Ve = "startConsultation", ze = ({
8
+ modalHeading: Ve,
9
+ customAccordianItem: qe
10
+ }, Pe = "startConsultation", ze = ({
11
11
  episodeOfCareUuids: D,
12
12
  encounterUuids: m,
13
13
  config: W,
@@ -135,19 +135,19 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
135
135
  { key: "recordedBy", header: n("RECORDED_BY") }
136
136
  ],
137
137
  [n]
138
- ), q = d(
138
+ ), V = d(
139
139
  () => [...h, { key: "actions", header: n("ACTIONS") }],
140
140
  [h, n]
141
141
  ), fe = c(
142
- (e) => v && e.some((o) => f(o)) ? q : h,
143
- [v, f, q, h]
142
+ (e) => v && e.some((o) => f(o)) ? V : h,
143
+ [v, f, V, h]
144
144
  ), he = h, pe = d(
145
145
  () => [
146
146
  { key: "recordedOn", sortable: !0 },
147
147
  { key: "recordedBy", sortable: !0 }
148
148
  ],
149
149
  []
150
- ), P = d(() => {
150
+ ), q = d(() => {
151
151
  const e = k.reduce(
152
152
  (o, t) => {
153
153
  const s = t.formName;
@@ -172,13 +172,13 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
172
172
  )
173
173
  })
174
174
  ).sort((o, t) => o.formName.localeCompare(t.formName));
175
- }, [k, n]), V = c((e) => {
175
+ }, [k, n]), P = c((e) => {
176
176
  B(e), M(!0);
177
177
  }, []), j = c(() => {
178
178
  M(!1), B(null);
179
179
  }, []), R = c((e) => {
180
180
  globalThis.dispatchEvent(
181
- new CustomEvent(Ve, {
181
+ new CustomEvent(Pe, {
182
182
  detail: {
183
183
  editOnly: "observationForms",
184
184
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -192,7 +192,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
192
192
  (e, r) => {
193
193
  switch (r) {
194
194
  case "recordedOn":
195
- return /* @__PURE__ */ i(Me, { onClick: () => V(e), children: e.recordedOn });
195
+ return /* @__PURE__ */ i(Me, { onClick: () => P(e), children: e.recordedOn });
196
196
  case "recordedBy":
197
197
  return e.recordedBy;
198
198
  case "actions":
@@ -211,10 +211,10 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
211
211
  return null;
212
212
  }
213
213
  },
214
- [V, R, f, n]
214
+ [P, R, f, n]
215
215
  );
216
216
  return /* @__PURE__ */ $(ge, { children: [
217
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U || P.length === 0 || L ? /* @__PURE__ */ i(
217
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U || q.length === 0 || L ? /* @__PURE__ */ i(
218
218
  Y,
219
219
  {
220
220
  headers: he,
@@ -227,7 +227,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
227
227
  className: T.formsTableBody,
228
228
  dataTestId: "forms-table"
229
229
  }
230
- ) : /* @__PURE__ */ i(Be, { align: "start", children: P.map((e, r) => {
230
+ ) : /* @__PURE__ */ i(Be, { align: "start", children: q.map((e, r) => {
231
231
  const { formName: o, records: t } = e, s = fe(t);
232
232
  return /* @__PURE__ */ i(
233
233
  Le,
@@ -1,7 +1,7 @@
1
- import { jsx as d, jsxs as D } from "react/jsx-runtime";
2
- import { q as M, z as C, t as w, V as Q, s as q, y as k, N as z, v as G, u as P, a as H, R as j, w as J, O as Y, x as W, A as X, D as Z, E as x, b as ee } from "./index-BqbZxHvD.js";
1
+ import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
+ import { p as M, D as C, t as w, q as Q, s as q, T as k, R as G, S as P, u as z, a as H, v as j, w as J, O as Y, x as W, y as X, z as Z, A as x, b as ee } from "./index-CKyHo_Q1.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
- import { useRef as oe, useEffect as N, useMemo as h } from "react";
4
+ import { useRef as oe, useEffect as S, useMemo as R } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
6
6
  const A = (t, i, c, l, u, r) => {
7
7
  const s = w(t, i, u), o = s.value, a = Q(o);
@@ -15,16 +15,16 @@ const A = (t, i, c, l, u, r) => {
15
15
  hideThumbnail: r
16
16
  }
17
17
  )), a === "Video" && (n = /* @__PURE__ */ d(
18
- z,
18
+ G,
19
19
  {
20
20
  id: `${o}-video`,
21
21
  videoSrc: o,
22
22
  hideThumbnail: r
23
23
  }
24
- )), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
24
+ )), a === "PDF" && (n = /* @__PURE__ */ d(P, { id: `${o}-pdf`, src: o }));
25
25
  const b = u("OBSERVATIONS_RECORDED_BY", {
26
26
  provider: s.provider
27
- }), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
27
+ }), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
28
28
  return /* @__PURE__ */ d(
29
29
  q,
30
30
  {
@@ -62,7 +62,7 @@ const A = (t, i, c, l, u, r) => {
62
62
  }) => {
63
63
  const { t: l } = U(), u = (r, s, o) => {
64
64
  const a = M(r.encounterDetails, l);
65
- return /* @__PURE__ */ D(
65
+ return /* @__PURE__ */ N(
66
66
  C,
67
67
  {
68
68
  title: a,
@@ -106,7 +106,7 @@ const A = (t, i, c, l, u, r) => {
106
106
  )
107
107
  }
108
108
  );
109
- }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", S = {
109
+ }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", D = {
110
110
  observations: ne,
111
111
  title: ie
112
112
  }, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
@@ -114,14 +114,14 @@ const A = (t, i, c, l, u, r) => {
114
114
  conceptNames: c = [],
115
115
  conceptUuid: l = [],
116
116
  hideThumbnail: u = !1
117
- } = i, r = oe(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = H(), { t: a } = U(), n = te({
117
+ } = i, r = oe(/* @__PURE__ */ new Set()), s = z(), { addNotification: o } = H(), { t: a } = U(), n = te({
118
118
  queries: c.map((e) => ({
119
119
  queryKey: ce(e),
120
120
  queryFn: () => j(e),
121
121
  enabled: !!e
122
122
  }))
123
123
  });
124
- N(() => {
124
+ S(() => {
125
125
  n.forEach((e, v) => {
126
126
  if (e.isError && !r.current.has(v)) {
127
127
  const g = c[v];
@@ -133,46 +133,46 @@ const A = (t, i, c, l, u, r) => {
133
133
  } else e.isError || r.current.delete(v);
134
134
  });
135
135
  }, [n, c]);
136
- const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), y = h(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
- data: p,
136
+ const b = R(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), y = R(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
+ data: m,
138
138
  isLoading: f,
139
- isError: R,
139
+ isError: h,
140
140
  refetch: T
141
141
  } = se({
142
- queryKey: le(s, m),
143
- queryFn: () => J(s, m),
144
- enabled: !!s && m.length > 0 && y
142
+ queryKey: le(s, p),
143
+ queryFn: () => J(s, p),
144
+ enabled: !!s && p.length > 0 && y
145
145
  });
146
146
  Y(
147
147
  (e) => {
148
148
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
149
- (g) => m.includes(g)
149
+ (g) => p.includes(g)
150
150
  ) && T();
151
151
  },
152
152
  [s, T]
153
- ), N(() => {
154
- R && o({
153
+ ), S(() => {
154
+ h && o({
155
155
  title: a("ERROR_DEFAULT_TITLE"),
156
156
  message: a("ERROR_FETCHING_OBSERVATIONS"),
157
157
  type: "error"
158
158
  });
159
- }, [R]);
160
- const _ = h(() => {
161
- if (!p) return [];
162
- const e = W(p), v = X(e);
159
+ }, [h]);
160
+ const _ = R(() => {
161
+ if (!m) return [];
162
+ const e = W(m), v = X(e);
163
163
  return Z(v);
164
- }, [p]), B = [
164
+ }, [m]), B = [
165
165
  { key: "name", header: "name" },
166
166
  { key: "value", header: "value" },
167
167
  { key: "form", header: "form" }
168
- ], I = f || !y, $ = R && y, L = (!p || p.entry?.length === 0 || m.length === 0) && y, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = L ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
- return /* @__PURE__ */ D(
168
+ ], I = f || !y, $ = h && y, F = (!m || m.entry?.length === 0 || p.length === 0) && y, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = F ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
+ return /* @__PURE__ */ N(
170
170
  "div",
171
171
  {
172
172
  id: "observations",
173
173
  "data-testid": O ? `observations-${E}` : "observations",
174
174
  "aria-label": "observations-aria-label",
175
- className: S.observations,
175
+ className: D.observations,
176
176
  children: [
177
177
  /* @__PURE__ */ d(
178
178
  x,
@@ -180,7 +180,7 @@ const A = (t, i, c, l, u, r) => {
180
180
  id: "observations-title",
181
181
  testId: O ? `observations-title-${E}` : "observations-title",
182
182
  title: E,
183
- className: S.title,
183
+ className: D.title,
184
184
  children: /* @__PURE__ */ d("p", { children: E })
185
185
  }
186
186
  ),
@@ -198,7 +198,7 @@ const A = (t, i, c, l, u, r) => {
198
198
  rows: [],
199
199
  ariaLabel: a("OBSERVATIONS"),
200
200
  loading: I,
201
- errorStateMessage: F,
201
+ errorStateMessage: L,
202
202
  emptyStateMessage: V,
203
203
  dataTestId: "observations-table"
204
204
  }