@bahmni/registration-app 0.0.1-dev.193 → 0.0.1-dev.194

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,8 +1,8 @@
1
- import { jsx as o, jsxs as l, Fragment as $ } from "react/jsx-runtime";
2
- import { d as V, u as F, t as H, z as x, O as z, R as P, N as j, L as G } from "./index-ZU51OKCH.js";
1
+ import { jsx as o, jsxs as l, Fragment as k } from "react/jsx-runtime";
2
+ import { d as V, u as F, t as H, z as q, O as x, R as z, N as P, L as G } from "./index-B2pFpWVI.js";
3
3
  import { useQuery as W } from "@tanstack/react-query";
4
- import { useState as C, useCallback as T, useEffect as S, useMemo as E } from "react";
5
- const Y = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
4
+ import { useState as O, useCallback as T, useEffect as S, useMemo as p } from "react";
5
+ const Y = "_documentsTableBody_1voj8_1", J = "_viewAttachmentsLink_1voj8_11", K = "_documentViewerContainer_1voj8_15", Q = "_attachmentItem_1voj8_23", X = "_attachmentCounter_1voj8_27", Z = "_attachmentError_1voj8_36", ee = "_documentIframe_1voj8_44", te = "_documentImage_1voj8_50", d = {
6
6
  documentsTableBody: Y,
7
7
  viewAttachmentsLink: J,
8
8
  documentViewerContainer: K,
@@ -33,60 +33,60 @@ const re = [
33
33
  "uploadedOn",
34
34
  "uploadedBy",
35
35
  "action"
36
- ], w = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], me = ({ config: a, encounterUuids: u }) => {
37
- const [s, A] = C(!1), [r, g] = C(
36
+ ], oe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, v = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ie = ({ config: a, encounterUuids: u }) => {
37
+ const [s, C] = O(!1), [r, A] = O(
38
38
  null
39
- ), [M, N] = C(
39
+ ), [w, E] = O(
40
40
  /* @__PURE__ */ new Set()
41
- ), p = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
42
- g(e), A(!0);
43
- }, []), b = T(() => {
44
- A(!1), g(null), N(/* @__PURE__ */ new Set());
41
+ ), N = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
42
+ A(e), C(!0);
43
+ }, []), M = T(() => {
44
+ C(!1), A(null), E(/* @__PURE__ */ new Set());
45
45
  }, []), L = T((e) => {
46
- N((t) => new Set(t).add(e));
47
- }, []), { data: R, isLoading: q, isError: f, error: I } = W({
48
- queryKey: ["documents", p, u],
49
- enabled: !!p,
50
- queryFn: () => x(p, u)
46
+ E((t) => new Set(t).add(e));
47
+ }, []), { data: b, isLoading: R, isError: f, error: g } = W({
48
+ queryKey: ["documents", N, u],
49
+ enabled: !!N,
50
+ queryFn: () => q(N, u)
51
51
  });
52
52
  S(() => {
53
53
  f && y({
54
54
  title: n("ERROR_DEFAULT_TITLE"),
55
- message: I?.message ?? "",
55
+ message: g?.message ?? "",
56
56
  type: "error"
57
57
  });
58
- }, [f, I, y, n]), S(() => {
58
+ }, [f, g, y, n]), S(() => {
59
59
  const e = new AbortController();
60
60
  return (async () => {
61
61
  if (!s || !r) return;
62
- const t = /* @__PURE__ */ new Set(), c = w(r);
62
+ const t = /* @__PURE__ */ new Set(), c = v(r);
63
63
  for (let m = 0; m < c.length; m++) {
64
- const O = U(c[m].url);
64
+ const I = U(c[m].url);
65
65
  try {
66
- (await fetch(O, {
66
+ (await fetch(I, {
67
67
  method: "HEAD",
68
68
  signal: e.signal
69
69
  })).ok || t.add(m);
70
- } catch (_) {
71
- _ instanceof Error && _.name !== "AbortError" && t.add(m);
70
+ } catch (h) {
71
+ h instanceof Error && h.name !== "AbortError" && t.add(m);
72
72
  }
73
73
  }
74
- e.signal.aborted || N(t);
74
+ e.signal.aborted || E(t);
75
75
  })(), () => e.abort();
76
76
  }, [s, r]);
77
- const h = E(
77
+ const _ = p(
78
78
  () => a?.fields ?? re,
79
79
  [a?.fields]
80
- ), B = E(() => ne(h, n), [h, n]), v = E(
81
- () => h.map((e) => ({
80
+ ), j = p(() => ne(_, n), [_, n]), B = p(
81
+ () => _.map((e) => ({
82
82
  key: e,
83
83
  sortable: e !== "action"
84
84
  })),
85
- [h]
86
- ), i = E(
87
- () => r ? w(r) : [],
85
+ [_]
86
+ ), i = p(
87
+ () => r ? v(r) : [],
88
88
  [r]
89
- ), k = T(
89
+ ), $ = T(
90
90
  (e, t) => {
91
91
  switch (t) {
92
92
  case "documentIdentifier":
@@ -94,7 +94,7 @@ const re = [
94
94
  case "documentType":
95
95
  return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
96
96
  case "uploadedOn":
97
- return P(
97
+ return z(
98
98
  e.uploadedOn,
99
99
  n,
100
100
  !0
@@ -103,7 +103,7 @@ const re = [
103
103
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
104
104
  case "action":
105
105
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
106
- z,
106
+ x,
107
107
  {
108
108
  onClick: () => D(e),
109
109
  className: d.viewAttachmentsLink,
@@ -117,18 +117,18 @@ const re = [
117
117
  },
118
118
  [D, n]
119
119
  );
120
- return /* @__PURE__ */ l($, { children: [
120
+ return /* @__PURE__ */ l(k, { children: [
121
121
  /* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
122
- j,
122
+ P,
123
123
  {
124
- headers: B,
124
+ headers: j,
125
125
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
126
- rows: R ?? [],
127
- loading: q,
128
- errorStateMessage: f ? I?.message : null,
129
- sortable: v,
126
+ rows: b ?? [],
127
+ loading: R,
128
+ errorStateMessage: f ? g?.message : null,
129
+ sortable: B,
130
130
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
131
- renderCell: k,
131
+ renderCell: $,
132
132
  className: d.documentsTableBody,
133
133
  dataTestId: "documents-table"
134
134
  }
@@ -139,14 +139,14 @@ const re = [
139
139
  id: "modalIdForActionAreaLayout",
140
140
  portalId: "main-display-area",
141
141
  open: s,
142
- onRequestClose: b,
142
+ onRequestClose: M,
143
143
  modalHeading: r.documentIdentifier,
144
144
  passiveModal: !0,
145
145
  size: "lg",
146
146
  testId: "document-view-modal",
147
147
  children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
148
- const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = M.has(t);
149
- return c === "#" || _ ? /* @__PURE__ */ l(
148
+ const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), I = (e.contentType?.toLowerCase().includes("image") ?? !1) || oe.test(e.url ?? ""), h = w.has(t);
149
+ return c === "#" || h ? /* @__PURE__ */ l(
150
150
  "div",
151
151
  {
152
152
  className: d.attachmentError,
@@ -172,7 +172,7 @@ const re = [
172
172
  "/",
173
173
  i.length
174
174
  ] }),
175
- O ? /* @__PURE__ */ o(
175
+ I ? /* @__PURE__ */ o(
176
176
  "img",
177
177
  {
178
178
  src: c,
@@ -199,5 +199,5 @@ const re = [
199
199
  ] });
200
200
  };
201
201
  export {
202
- me as default
202
+ ie as default
203
203
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as O, d as ae, m as te, a as oe, b as ne, x as se, M as de, E as me, R as ie, O as le, N as q, W as ce, K as ue, L as be, X as pe, I as H, V as fe, n as k, C, c as _e, e as $e, r as ge, f as ve, g as he } from "./index-ZU51OKCH.js";
2
+ import { u as O, d as ae, m as te, a as oe, b as ne, x as se, M as de, E as me, R as ie, O as le, N as q, W as ce, K as ue, L as be, X as pe, I as H, V as fe, n as k, C, c as _e, e as $e, r as ge, f as ve, g as he } from "./index-B2pFpWVI.js";
3
3
  import { useQueryClient as ye, useQuery as L } from "@tanstack/react-query";
4
4
  import { useState as K, useMemo as h, useCallback as R } from "react";
5
5
  const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Se = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DGdGSxXG.js";
2
- import { l as p, o as d, p as e } from "./index-ZU51OKCH.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DYohSIWU.js";
2
+ import { l as p, o as d, p as e } from "./index-B2pFpWVI.js";
3
3
  var f = (a) => {
4
4
  const [r, o] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-DGdGSxXG.js";
2
- import { l as v, o as C, p as e } from "./index-ZU51OKCH.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-DYohSIWU.js";
2
+ import { l as v, o as C, p as e } from "./index-B2pFpWVI.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
- import { d as k, t as B, u as I, y as Q, H, E as K, V as j, h as w, i as x, j as G, N as M, k as z, Q as S, T as P, c as Y, $ as J, e as W, r as X, f as Z } from "./index-ZU51OKCH.js";
2
+ import { d as k, t as B, u as I, y as Q, H, E as K, V as j, h as w, i as x, j as G, N as M, k as z, Q as S, T as P, c as Y, $ as J, e as W, r as X, f as Z } from "./index-B2pFpWVI.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as ae, useEffect as T, useMemo as f } from "react";
5
5
  const D = (t, d, n, u, r) => {
@@ -1,4 +1,4 @@
1
- import { q as we, s as z, v as xt, w as B, o as q, p as y, P as Ro, A as ye, S as R, B as _, D as k, F as N, G as A, J as bs, U as ir, Y as $e, Z as U, _ as Hn, a0 as Vn, a1 as dt, a2 as D, a3 as xs, a4 as cn, a5 as Be, a6 as ws, a7 as qt, a8 as zt, a9 as $s, aa as Cs, ab as $n, ac as Ss, ad as Nr, ae as Bt, af as zo, ag as ks, ah as Es, ai as j, aj as Ur, ak as Ms, al as Ds, am as sr, an as As, ao as Ts, ap as zn, aq as Fs, ar as Is, as as Z, at as Ps, au as Ls } from "./index-ZU51OKCH.js";
1
+ import { q as we, s as z, v as xt, w as B, o as q, p as y, P as Ro, A as ye, S as R, B as _, D as k, F as N, G as A, J as bs, U as ir, Y as $e, Z as U, _ as Hn, a0 as Vn, a1 as dt, a2 as D, a3 as xs, a4 as cn, a5 as Be, a6 as ws, a7 as qt, a8 as zt, a9 as $s, aa as Cs, ab as $n, ac as Ss, ad as Nr, ae as Bt, af as zo, ag as ks, ah as Es, ai as j, aj as Ur, ak as Ms, al as Ds, am as sr, an as As, ao as Ts, ap as zn, aq as Fs, ar as Is, as as Z, at as Ps, au as Ls } from "./index-B2pFpWVI.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -158561,7 +158561,7 @@ function $$0(t, e, r) {
158561
158561
  return n;
158562
158562
  };
158563
158563
  }
158564
- xt(() => Promise.resolve().then(() => dL0)), xt(() => Promise.resolve().then(() => oA0)), xt(() => Promise.resolve().then(() => DA0)), xt(() => Promise.resolve().then(() => PA0)), xt(() => import("./DocumentsTable-CYxu-75r-BJbhfu1m.js")), xt(() => Promise.resolve().then(() => s$0)), xt(() => import("./FormsTable-DrKr31Pe-BUdMioni.js")), xt(() => Promise.resolve().then(() => RT0)), xt(() => import("./Observations-21c_55Fg-Dt82889t.js")), xt(
158564
+ xt(() => Promise.resolve().then(() => dL0)), xt(() => Promise.resolve().then(() => oA0)), xt(() => Promise.resolve().then(() => DA0)), xt(() => Promise.resolve().then(() => PA0)), xt(() => import("./DocumentsTable-BJ1OXT8Q-DZtC5qGa.js")), xt(() => Promise.resolve().then(() => s$0)), xt(() => import("./FormsTable-CF5ZuCw3-lnWcroF_.js")), xt(() => Promise.resolve().then(() => RT0)), xt(() => import("./Observations-COn04_t4-DSd6R0Eo.js")), xt(
158565
158565
  () => Promise.resolve().then(() => E$0)
158566
158566
  ), xt(
158567
158567
  () => Promise.resolve().then(() => oT0)
@@ -160400,7 +160400,7 @@ var VF0 = (t, e = !1) => {
160400
160400
  const e = BR1(() => {
160401
160401
  const r = this, [n] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t;
160402
160402
  let d;
160403
- return this.#i ? d = this.#i : (d = ZR1(() => import("./LNWAZHJI-CiTcaWYv.js")), this.#i = d), cS1(this.#h, this.#r), SR1(d, kR1({
160403
+ return this.#i ? d = this.#i : (d = ZR1(() => import("./LNWAZHJI-DxBy8POI.js")), this.#i = d), cS1(this.#h, this.#r), SR1(d, kR1({
160404
160404
  get queryFlavor() {
160405
160405
  return r.#d;
160406
160406
  },
@@ -160498,7 +160498,7 @@ var VF0 = (t, e = !1) => {
160498
160498
  const e = BR1(() => {
160499
160499
  const r = this, [n] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t, [d] = this.#i;
160500
160500
  let u;
160501
- return this.#l ? u = this.#l : (u = ZR1(() => import("./MWZ6AO7Z-BclFgirQ.js")), this.#l = u), cS1(this.#h, this.#r), SR1(u, kR1({
160501
+ return this.#l ? u = this.#l : (u = ZR1(() => import("./MWZ6AO7Z-k3pobJ_Q.js")), this.#l = u), cS1(this.#h, this.#r), SR1(u, kR1({
160502
160502
  get queryFlavor() {
160503
160503
  return r.#d;
160504
160504
  },