@bahmni/appointments-app 0.0.1-dev.281 → 0.0.1-dev.282

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,112 +1,112 @@
1
- import { jsx as r, jsxs as _, Fragment as x } from "react/jsx-runtime";
2
- import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-DeAHRTCp.js";
1
+ import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
+ import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-D5Gdi7BY.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as p, useEffect as O, useMemo as h } from "react";
5
- const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", ce = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
4
+ import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
5
+ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
8
8
  documentViewerContainer: re,
9
9
  attachmentItem: de,
10
10
  attachmentCounter: se,
11
- attachmentError: ce,
12
- documentIframe: me,
11
+ attachmentError: me,
12
+ documentIframe: ce,
13
13
  documentImage: le
14
14
  }, ue = {
15
15
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
16
16
  documentType: "DOCUMENTS_TYPE",
17
17
  uploadedOn: "DOCUMENTS_UPLOADED_ON",
18
18
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
19
- action: "DOCUMENTS_ACTION"
19
+ attachments: "DOCUMENTS_ATTACHMENTS"
20
20
  };
21
21
  function R(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
- function ie(a, E) {
24
+ function ie(a, g) {
25
25
  return a.map((s) => ({
26
26
  key: s,
27
- header: E(ue[s])
27
+ header: g(ue[s])
28
28
  }));
29
29
  }
30
30
  const Te = [
31
31
  "documentIdentifier",
32
32
  "documentType",
33
+ "attachments",
33
34
  "uploadedOn",
34
- "uploadedBy",
35
- "action"
36
- ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ie = ({ config: a, encounterUuids: E }) => {
37
- const [s, S] = l(!1), [o, U] = l(
35
+ "uploadedBy"
36
+ ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: g }) => {
37
+ const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
39
  ), [$, D] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = p((e) => {
42
- U(e), S(!0);
43
- }, []), H = p(() => {
44
- S(!1), U(null), D(/* @__PURE__ */ new Set());
45
- }, []), v = p((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
+ U(e), w(!0);
43
+ }, []), H = _(() => {
44
+ w(!1), U(null), D(/* @__PURE__ */ new Set());
45
+ }, []), v = _((e) => {
46
46
  D((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
- g,
51
50
  E,
52
- f,
51
+ g,
52
+ O,
53
53
  u
54
54
  ],
55
- enabled: !!g,
55
+ enabled: !!E,
56
56
  queryFn: () => J(
57
- g,
58
57
  E,
58
+ g,
59
59
  u,
60
- f
60
+ O
61
61
  )
62
62
  });
63
- O(() => {
63
+ N(() => {
64
64
  i && A(i.total);
65
- }, [i]), O(() => {
65
+ }, [i]), N(() => {
66
66
  C(1), A(void 0);
67
- }, [g]), O(() => {
67
+ }, [E]), N(() => {
68
68
  b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, L, n]), O(() => {
73
+ }, [b, y, L, n]), N(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
77
- const t = /* @__PURE__ */ new Set(), c = B(o);
78
- for (let m = 0; m < c.length; m++) {
79
- const w = R(c[m].url);
77
+ const t = /* @__PURE__ */ new Set(), m = B(o);
78
+ for (let c = 0; c < m.length; c++) {
79
+ const S = R(m[c].url);
80
80
  try {
81
- (await fetch(w, {
81
+ (await fetch(S, {
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
- })).ok || t.add(m);
85
- } catch (N) {
86
- N instanceof Error && N.name !== "AbortError" && t.add(m);
84
+ })).ok || t.add(c);
85
+ } catch (I) {
86
+ I instanceof Error && I.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
89
  e.signal.aborted || D(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const K = p(
92
+ const K = _(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), I = h(
97
+ ), f = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), j = h(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = h(() => ie(I, n), [I, n]), z = h(
101
- () => I.map((e) => ({
100
+ ), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(f, n), [f, n]), z = p(
101
+ () => f.map((e) => ({
102
102
  key: e,
103
- sortable: e !== "action"
103
+ sortable: e !== "attachments"
104
104
  })),
105
- [I]
106
- ), T = h(
105
+ [f]
106
+ ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = p(
109
+ ), Q = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -121,7 +121,7 @@ const Te = [
121
121
  ).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
122
122
  case "uploadedBy":
123
123
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
124
- case "action":
124
+ case "attachments":
125
125
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
126
126
  X,
127
127
  {
@@ -137,7 +137,7 @@ const Te = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ _(x, { children: [
140
+ return /* @__PURE__ */ h(x, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
@@ -153,7 +153,7 @@ const Te = [
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: f,
156
+ page: O,
157
157
  onPageChange: K
158
158
  }
159
159
  ) }),
@@ -169,14 +169,14 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
172
- const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), w = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), N = $.has(t);
173
- return c === "#" || N ? /* @__PURE__ */ _(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), I = $.has(t);
173
+ return m === "#" || I ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- T.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
179
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
182
  T.length
@@ -185,21 +185,21 @@ const Te = [
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ _(
188
+ ) : /* @__PURE__ */ h(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- T.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
194
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
197
  T.length
198
198
  ] }),
199
- w ? /* @__PURE__ */ r(
199
+ S ? /* @__PURE__ */ r(
200
200
  "img",
201
201
  {
202
- src: c,
202
+ src: m,
203
203
  alt: o.documentIdentifier,
204
204
  className: d.documentImage,
205
205
  onError: () => v(t)
@@ -207,7 +207,7 @@ const Te = [
207
207
  ) : /* @__PURE__ */ r(
208
208
  "iframe",
209
209
  {
210
- src: m ? `${c}#toolbar=0` : c,
210
+ src: c ? `${m}#toolbar=0` : m,
211
211
  className: d.documentIframe,
212
212
  title: o.documentIdentifier,
213
213
  onError: () => v(t)
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- Ie as default
226
+ fe as default
227
227
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
2
- import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-DeAHRTCp.js";
2
+ import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-D5Gdi7BY.js";
3
3
  import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
4
4
  import { useState as S, useMemo as d, useCallback as y } from "react";
5
5
  const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-kt50kgaV.js";
2
- import { ah as d, ai as f, aj as e } from "./index-DeAHRTCp.js";
1
+ import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-Cqa2qcSd.js";
2
+ import { ah as d, ai as f, aj as e } from "./index-D5Gdi7BY.js";
3
3
  var h = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-kt50kgaV.js";
2
- import { ah as h, ai as v, aj as e } from "./index-DeAHRTCp.js";
1
+ import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-Cqa2qcSd.js";
2
+ import { ah as h, ai as v, aj as e } from "./index-D5Gdi7BY.js";
3
3
  var C = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-DeAHRTCp.js";
2
+ import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-D5Gdi7BY.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as R } from "react";
5
5
  const C = (t, n, d, l, b, r) => {
@@ -1,4 +1,4 @@
1
- import { ak as we, al as z, am as xt, an as B, ai as q, aj as y, ao as Ro, ap as ye, aq as R, ar as _, as as k, at as N, au as A, av as bs, aw as ir, ax as $e, ay as U, az as Hn, aA as Vn, aB as dt, aC as D, aD as xs, aE as cn, aF as Be, aG as ws, aH as qt, aI as zt, aJ as $s, aK as Cs, aL as $n, aM as Ss, aN as Nr, aO as Bt, aP as zo, aQ as ks, aR as Es, aS as j, aT as Ur, aU as Ms, aV as Ds, aW as sr, aX as As, aY as Ts, aZ as zn, a_ as Fs, a$ as Is, b0 as Z, b1 as Ps, b2 as Ls } from "./index-DeAHRTCp.js";
1
+ import { ak as we, al as z, am as xt, an as B, ai as q, aj as y, ao as Ro, ap as ye, aq as R, ar as _, as as k, at as N, au as A, av as bs, aw as ir, ax as $e, ay as U, az as Hn, aA as Vn, aB as dt, aC as D, aD as xs, aE as cn, aF as Be, aG as ws, aH as qt, aI as zt, aJ as $s, aK as Cs, aL as $n, aM as Ss, aN as Nr, aO as Bt, aP as zo, aQ as ks, aR as Es, aS as j, aT as Ur, aU as Ms, aV as Ds, aW as sr, aX as As, aY as Ts, aZ as zn, a_ as Fs, a$ as Is, b0 as Z, b1 as Ps, b2 as Ls } from "./index-D5Gdi7BY.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { G as f, H as P, R as B, T as V, S as X, Z as ee, $ as te, a0 as ie, i as ae, a1 as ne, a as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as k, ab as x, ac as $, o as oe, h as de, g as w, ad as ce, k as me, ae as Ae, af as Ie, ag as ue, p as _e, v as Te } from "./index-DeAHRTCp.js";
2
+ import { G as f, H as P, R as B, T as V, S as X, Z as ee, $ as te, a0 as ie, i as ae, a1 as ne, a as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as k, ab as x, ac as $, o as oe, h as de, g as w, ad as ce, k as me, ae as Ae, af as Ie, ag as ue, p as _e, v as Te } from "./index-D5Gdi7BY.js";
3
3
  import { useState as g, useMemo as N, useEffect as h, useRef as Le, useCallback as U } from "react";
4
4
  import { useQuery as M, useQueryClient as ve } from "@tanstack/react-query";
5
5
  const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", be = () => {
@@ -175578,7 +175578,7 @@ function Ktt(t, e, r) {
175578
175578
  return o;
175579
175579
  };
175580
175580
  }
175581
- b0(() => Promise.resolve().then(() => kG0)), b0(() => Promise.resolve().then(() => uY0)), b0(() => Promise.resolve().then(() => PY0)), b0(() => Promise.resolve().then(() => GY0)), b0(() => import("./DocumentsTable-DBTAKAkE-fj9Vc5Ge.js")), b0(() => Promise.resolve().then(() => PX0)), b0(() => import("./FormsTable-3k4qn6RT-DMkMoKGp.js")), b0(() => Promise.resolve().then(() => zX0)), b0(() => import("./Observations-BQ_tgOPv-BH7Wg6o9.js")), b0(
175581
+ b0(() => Promise.resolve().then(() => kG0)), b0(() => Promise.resolve().then(() => uY0)), b0(() => Promise.resolve().then(() => PY0)), b0(() => Promise.resolve().then(() => GY0)), b0(() => import("./DocumentsTable-BFpvq1kQ-9aEJ4hkf.js")), b0(() => Promise.resolve().then(() => PX0)), b0(() => import("./FormsTable-BmlIPu2T-CC4ciFXJ.js")), b0(() => Promise.resolve().then(() => zX0)), b0(() => import("./Observations-CsCQ1ADc-C8vHpKR7.js")), b0(
175582
175582
  () => Promise.resolve().then(() => QX0)
175583
175583
  ), b0(
175584
175584
  () => Promise.resolve().then(() => qQ0)
@@ -177418,7 +177418,7 @@ var vrt = (t, e = !1) => {
177418
177418
  const e = WWe(() => {
177419
177419
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#e;
177420
177420
  let d;
177421
- return this.#l ? d = this.#l : (d = qWe(() => import("./LNWAZHJI-Bf-p9fCB.js")), this.#l = d), hKe(this.#h, this.#r), jWe(d, FWe({
177421
+ return this.#l ? d = this.#l : (d = qWe(() => import("./LNWAZHJI-DGjKnE8G.js")), this.#l = d), hKe(this.#h, this.#r), jWe(d, FWe({
177422
177422
  get queryFlavor() {
177423
177423
  return r.#d;
177424
177424
  },
@@ -177516,7 +177516,7 @@ var vrt = (t, e = !1) => {
177516
177516
  const e = WWe(() => {
177517
177517
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#e, [d] = this.#l;
177518
177518
  let u;
177519
- return this.#i ? u = this.#i : (u = qWe(() => import("./MWZ6AO7Z-Dgh6K9Ya.js")), this.#i = u), hKe(this.#h, this.#r), jWe(u, FWe({
177519
+ return this.#i ? u = this.#i : (u = qWe(() => import("./MWZ6AO7Z-BB9-Lqku.js")), this.#i = u), hKe(this.#h, this.#r), jWe(u, FWe({
177520
177520
  get queryFlavor() {
177521
177521
  return r.#d;
177522
177522
  },
@@ -177676,11 +177676,11 @@ const a2t = {
177676
177676
  }), v2t = b0(
177677
177677
  () => import("./index-CFigb5vF.js").then((t) => ({ default: t.IndexPage }))
177678
177678
  ), E2t = b0(
177679
- () => import("./index-BAxG9hlb.js").then((t) => ({
177679
+ () => import("./index-DULG_ITo.js").then((t) => ({
177680
177680
  default: t.default
177681
177681
  }))
177682
177682
  ), M2t = b0(
177683
- () => import("./index-GcAWFlMm.js").then((t) => ({
177683
+ () => import("./index-CoK6yWnJ.js").then((t) => ({
177684
177684
  default: t.default
177685
177685
  }))
177686
177686
  ), y2t = [
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { s as V, A as O, a as C, d as h, f as P, h as B, o as x, g as L, i as G, k as U, l as q, p as w, v as k, x as F, y as K, D as $ } from "./index-DeAHRTCp.js";
2
+ import { s as V, A as O, a as C, d as h, f as P, h as B, o as x, g as L, i as G, k as U, l as q, p as w, v as k, x as F, y as K, D as $ } from "./index-D5Gdi7BY.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
4
  import { useQueryClient as j, useQuery as H } from "@tanstack/react-query";
5
5
  const Q = V(
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b3 as t } from "./index-DeAHRTCp.js";
1
+ import { b3 as t } from "./index-D5Gdi7BY.js";
2
2
  export {
3
3
  t as AppointmentsApp
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/appointments-app",
3
- "version": "0.0.1-dev.281",
3
+ "version": "0.0.1-dev.282",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",