@bahmni/widgets 0.0.1-dev.423 → 0.0.1-dev.425

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 (31) hide show
  1. package/dist/{DocumentsTable-D1kC4SWG.js → DocumentsTable-CQT2oAMN.js} +1 -1
  2. package/dist/{FormsTable-CZODqZPI.js → FormsTable-DX99pPRT.js} +32 -32
  3. package/dist/{Observations-FjWj0n8r.js → Observations-BVDqjCF9.js} +31 -31
  4. package/dist/documentUpload/DocumentUpload.d.ts +2 -2
  5. package/dist/documentUpload/DocumentUpload.d.ts.map +1 -1
  6. package/dist/documentUpload/index.d.ts +1 -1
  7. package/dist/documentUpload/index.d.ts.map +1 -1
  8. package/dist/documentUpload/models.d.ts +18 -0
  9. package/dist/documentUpload/models.d.ts.map +1 -1
  10. package/dist/{index-Bt6J9dni.js → index-Bu7Awl9c.js} +22551 -22324
  11. package/dist/index.css +1 -1
  12. package/dist/index.d.ts +2 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +57 -54
  15. package/dist/moduleTiles/AppTile/AppTile.d.ts +10 -0
  16. package/dist/moduleTiles/AppTile/AppTile.d.ts.map +1 -0
  17. package/dist/moduleTiles/AppTile/__tests__/__mocks__/AppTileMocks.d.ts +7 -0
  18. package/dist/moduleTiles/AppTile/__tests__/__mocks__/AppTileMocks.d.ts.map +1 -0
  19. package/dist/moduleTiles/AppTile/index.d.ts +2 -0
  20. package/dist/moduleTiles/AppTile/index.d.ts.map +1 -0
  21. package/dist/moduleTiles/ModuleTileGrid/ModuleTileGrid.d.ts +25 -0
  22. package/dist/moduleTiles/ModuleTileGrid/ModuleTileGrid.d.ts.map +1 -0
  23. package/dist/moduleTiles/ModuleTileGrid/__tests__/__mocks__/moduleTileGridMocks.d.ts +12 -0
  24. package/dist/moduleTiles/ModuleTileGrid/__tests__/__mocks__/moduleTileGridMocks.d.ts.map +1 -0
  25. package/dist/moduleTiles/ModuleTileGrid/index.d.ts +2 -0
  26. package/dist/moduleTiles/ModuleTileGrid/index.d.ts.map +1 -0
  27. package/dist/moduleTiles/constants.d.ts +3 -0
  28. package/dist/moduleTiles/constants.d.ts.map +1 -0
  29. package/dist/moduleTiles/index.d.ts +4 -0
  30. package/dist/moduleTiles/index.d.ts.map +1 -0
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as X, r as J, V as Z, h as x, b as ee, F as te } from "./index-Bt6J9dni.js";
2
+ import { u as W, a as X, n as J, V as Z, p as x, b as ee, F as te } from "./index-Bu7Awl9c.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";
@@ -1,27 +1,27 @@
1
- import { jsx as n, jsxs as K, Fragment as ge } from "react/jsx-runtime";
2
- import { u as Ne, c as Oe, d as pe, C as Ee, D as Te, $ as Fe, N as Ie, f as Ae, K as _e, e as ve, g as De, i as Re, G as x, h as Me, j, B as z, V as Le, b as Q, k as Be, l as Ce, F as Se, O as Ue, m as we } from "./index-Bt6J9dni.js";
3
- import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
1
+ import { jsx as n, jsxs as $, Fragment as ge } from "react/jsx-runtime";
2
+ import { u as Ne, c as pe, d as Oe, x as Ee, C as Te, N as Fe, I as Ie, h as Ae, W as _e, e as ve, f as Re, g as De, G as j, p as Me, i as K, B as z, V as Le, b as Q, r as Be, j as Ce, F as Se, O as Ue, k as we } from "./index-Bu7Awl9c.js";
3
+ import { useQueryClient as ke, useQuery as p } from "@tanstack/react-query";
4
4
  import { useState as W, useMemo as i, useCallback as d } from "react";
5
5
  import { useTranslation as He } from "react-i18next";
6
- const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", p = {
6
+ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", O = {
7
7
  formsTableBody: Ve,
8
8
  modalHeading: qe,
9
9
  customAccordianItem: Pe
10
- }, $e = "startConsultation", Qe = ({
11
- episodeOfCareUuids: D,
10
+ }, xe = "startConsultation", Qe = ({
11
+ episodeOfCareUuids: R,
12
12
  encounterUuids: m,
13
13
  config: Y,
14
14
  disableActions: J = !1,
15
15
  activeEncounterUuid: b = null
16
16
  }) => {
17
- const { t: s } = He(), c = Ne(), [h, R] = W(!1), [o, M] = W(null), {
17
+ const { t: s } = He(), c = Ne(), [h, D] = W(!1), [o, M] = W(null), {
18
18
  numberOfVisits: X,
19
19
  hideThumbnail: Z = !1,
20
20
  forms: y
21
- } = Y ?? {}, ee = Oe(
21
+ } = Y ?? {}, ee = pe(
22
22
  we.EDIT_OBSERVATIONS
23
- ), { userPrivileges: g } = pe(), E = ee && !J && !!b, L = Ee(
24
- D,
23
+ ), { userPrivileges: g } = Oe(), E = ee && !J && !!b, L = Ee(
24
+ R,
25
25
  m
26
26
  ), re = ke(), {
27
27
  data: B = [],
@@ -29,8 +29,8 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
29
29
  isError: S,
30
30
  error: te,
31
31
  refetch: ae
32
- } = O({
33
- queryKey: ["forms", c, D],
32
+ } = p({
33
+ queryKey: ["forms", c, R],
34
34
  queryFn: () => Te(c, void 0, X),
35
35
  enabled: !!c && !L
36
36
  }), U = i(() => {
@@ -40,7 +40,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
40
40
  )), Array.isArray(y) && y.length > 0 && (e = e.filter(
41
41
  (r) => y.some((t) => t.toLowerCase() === r.formName.toLowerCase())
42
42
  )), e;
43
- }, [B, m, y]), { data: N = [] } = O({
43
+ }, [B, m, y]), { data: N = [] } = p({
44
44
  queryKey: ["observationForms"],
45
45
  queryFn: () => Fe()
46
46
  }), w = d(
@@ -68,7 +68,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
68
68
  isLoading: oe,
69
69
  isError: se,
70
70
  error: F
71
- } = O({
71
+ } = p({
72
72
  queryKey: ["formMetadata", T],
73
73
  queryFn: () => Ie(T),
74
74
  enabled: !!T && h
@@ -77,7 +77,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
77
77
  isLoading: ne,
78
78
  isError: ie,
79
79
  error: A
80
- } = O({
80
+ } = p({
81
81
  queryKey: ["formsEncounterFHIR", o?.encounterUuid],
82
82
  queryFn: () => Ae(o.encounterUuid),
83
83
  enabled: !!o?.encounterUuid && h
@@ -88,14 +88,14 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
88
88
  },
89
89
  [c]
90
90
  );
91
- const de = i(() => !I?.entry || !o?.formName ? [] : I.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => ve(r) ? De(r)?.toLowerCase() === o.formName.toLowerCase() : !0), [I, o?.formName]), { controlOrder: le, sectionMap: me, conceptDatatypeMap: ce } = i(
92
- () => Re(H?.schema),
91
+ const de = i(() => !I?.entry || !o?.formName ? [] : I.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => ve(r) ? Re(r)?.toLowerCase() === o.formName.toLowerCase() : !0), [I, o?.formName]), { controlOrder: le, sectionMap: me, conceptDatatypeMap: ce } = i(
92
+ () => De(H?.schema),
93
93
  [H]
94
94
  ), ue = i(() => {
95
95
  if (F)
96
- return x(F).message;
96
+ return j(F).message;
97
97
  if (A)
98
- return x(A).message;
98
+ return j(A).message;
99
99
  }, [F, A]), f = i(
100
100
  () => [
101
101
  { key: "recordedOn", header: s("RECORDED_ON") },
@@ -140,12 +140,12 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
140
140
  })
141
141
  ).sort((t, a) => t.formName.localeCompare(a.formName));
142
142
  }, [U, s]), P = d((e) => {
143
- M(e), R(!0);
144
- }, []), $ = d(() => {
145
- R(!1), M(null);
143
+ M(e), D(!0);
144
+ }, []), x = d(() => {
145
+ D(!1), M(null);
146
146
  }, []), _ = d((e) => {
147
147
  globalThis.dispatchEvent(
148
- new CustomEvent($e, {
148
+ new CustomEvent(xe, {
149
149
  detail: {
150
150
  editOnly: "observationForms",
151
151
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -164,7 +164,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
164
164
  return e.recordedBy;
165
165
  case "actions":
166
166
  return u(e) ? /* @__PURE__ */ n(
167
- j,
167
+ K,
168
168
  {
169
169
  label: s("EDIT_OBSERVATION_FORM"),
170
170
  kind: "ghost",
@@ -180,7 +180,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
180
180
  },
181
181
  [P, _, u, s]
182
182
  );
183
- return /* @__PURE__ */ K(ge, { children: [
183
+ return /* @__PURE__ */ $(ge, { children: [
184
184
  /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: C || S || q.length === 0 || L ? /* @__PURE__ */ n(
185
185
  Q,
186
186
  {
@@ -191,7 +191,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
191
191
  errorStateMessage: S ? te?.message : void 0,
192
192
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
193
193
  renderCell: G,
194
- className: p.formsTableBody,
194
+ className: O.formsTableBody,
195
195
  dataTestId: "forms-table"
196
196
  }
197
197
  ) : /* @__PURE__ */ n(Be, { align: "start", children: q.map((e, r) => {
@@ -200,7 +200,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
200
200
  Ce,
201
201
  {
202
202
  title: t,
203
- className: p.customAccordianItem,
203
+ className: O.customAccordianItem,
204
204
  testId: `accordian-title-${t}`,
205
205
  open: r === 0,
206
206
  children: /* @__PURE__ */ n(
@@ -214,7 +214,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
214
214
  sortable: he,
215
215
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
216
216
  renderCell: G,
217
- className: p.formsTableBody,
217
+ className: O.formsTableBody,
218
218
  dataTestId: `forms-table-${t}`
219
219
  }
220
220
  )
@@ -228,18 +228,18 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
228
228
  id: "modalIdForActionAreaLayout",
229
229
  portalId: "main-display-area",
230
230
  open: h,
231
- onRequestClose: $,
232
- modalHeading: /* @__PURE__ */ K("div", { className: p.modalHeading, children: [
231
+ onRequestClose: x,
232
+ modalHeading: /* @__PURE__ */ $("div", { className: O.modalHeading, children: [
233
233
  /* @__PURE__ */ n("span", { children: o.formName }),
234
234
  E && u(o) && /* @__PURE__ */ n(
235
- j,
235
+ K,
236
236
  {
237
237
  label: s("EDIT_OBSERVATION_FORM"),
238
238
  kind: "ghost",
239
239
  size: "sm",
240
240
  testId: `edit-form-modal-${o.encounterUuid}`,
241
241
  onClick: () => {
242
- $(), _(o);
242
+ x(), _(o);
243
243
  },
244
244
  children: /* @__PURE__ */ n(z, {})
245
245
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as S } from "react/jsx-runtime";
2
- import { n as z, o as F, t as G, p as H, h as P, q as j, T as x, R as J, S as Y, u as W, a as X, s as Z, C as ee, v as se, w as te, K as re, x as ae, y as oe, z as ne, A as ie, E as ce, b as le } from "./index-Bt6J9dni.js";
2
+ import { l as z, D as F, t as G, m as x, p as H, o as P, T as j, R as W, S as J, u as Y, a as X, q as Z, x as ee, s as se, v as te, W as re, w as ae, y as oe, z as ne, A as ie, E as ce, b as le } from "./index-Bu7Awl9c.js";
3
3
  import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as C, useMemo as I } from "react";
5
5
  import { useTranslation as w } from "react-i18next";
@@ -9,10 +9,10 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
9
9
  wrapper: ve,
10
10
  secondary: ye
11
11
  }, U = (t, l, n, c, u, r) => {
12
- const a = G(t, l, u), e = a.value, p = H(e);
12
+ const a = G(t, l, u), e = a.value, p = x(e);
13
13
  let o = e;
14
14
  p === "Image" && (o = /* @__PURE__ */ i(
15
- x,
15
+ j,
16
16
  {
17
17
  imageSrc: e,
18
18
  alt: e,
@@ -20,31 +20,31 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), p === "Video" && (o = /* @__PURE__ */ i(
23
- J,
23
+ W,
24
24
  {
25
25
  id: `${e}-video`,
26
26
  videoSrc: e,
27
27
  hideThumbnail: r
28
28
  }
29
- )), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
29
+ )), p === "PDF" && (o = /* @__PURE__ */ i(J, { id: `${e}-pdf`, src: e }));
30
30
  const b = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
31
31
  /* @__PURE__ */ i("span", { children: a.header.display }),
32
32
  a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
33
33
  ] }), d = u("OBSERVATIONS_RECORDED_BY", {
34
34
  provider: a.provider
35
- }), m = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
35
+ }), m = t.effectiveDateTime ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
36
36
  /* @__PURE__ */ i("span", { children: d }),
37
37
  m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
38
- ] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", h = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
38
+ ] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
39
39
  return /* @__PURE__ */ i(
40
- j,
40
+ P,
41
41
  {
42
42
  header: b,
43
43
  value: o,
44
44
  info: _,
45
- id: h,
46
- testId: h,
47
- ariaLabel: h
45
+ id: O,
46
+ testId: O,
47
+ ariaLabel: O
48
48
  },
49
49
  `obs-${t.id}`
50
50
  );
@@ -66,7 +66,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
66
66
  )
67
67
  },
68
68
  `grouped-obs-${t.id}`
69
- ), he = ({
69
+ ), Oe = ({
70
70
  groupedData: t,
71
71
  title: l = "",
72
72
  hideThumbnail: n
@@ -117,7 +117,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
117
117
  )
118
118
  }
119
119
  );
120
- }, Oe = (t) => ["conceptUuid", t], Ee = (t, l, n, c) => [
120
+ }, Ee = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
121
121
  "observations",
122
122
  t,
123
123
  ...l,
@@ -133,9 +133,9 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
133
133
  conceptUuid: r = [],
134
134
  hideThumbnail: a = !1,
135
135
  scope: e = "all"
136
- } = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } = w(), m = de({
136
+ } = c, p = pe(/* @__PURE__ */ new Set()), o = Y(), { addNotification: b } = X(), { t: d } = w(), m = de({
137
137
  queries: u.map((s) => ({
138
- queryKey: Oe(s),
138
+ queryKey: Ee(s),
139
139
  queryFn: () => Z(s),
140
140
  enabled: !!s
141
141
  }))
@@ -148,16 +148,16 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
148
148
  type: "error"
149
149
  }), p.current.add(0)) : !s && R && p.current.clear();
150
150
  }, [m, b, d]);
151
- const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), T = e === "latest" || e === "latest-encounter", h = ee(
151
+ const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), T = e === "latest" || e === "latest-encounter", O = ee(
152
152
  l,
153
153
  n
154
154
  ), {
155
- data: O,
155
+ data: E,
156
156
  isLoading: V,
157
157
  isError: N,
158
158
  refetch: D
159
159
  } = ue({
160
- queryKey: Ee(
160
+ queryKey: he(
161
161
  o,
162
162
  v,
163
163
  n,
@@ -172,7 +172,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
172
172
  v,
173
173
  n
174
174
  ),
175
- enabled: !!o && v.length > 0 && f && !h
175
+ enabled: !!o && v.length > 0 && f && !O
176
176
  });
177
177
  re(
178
178
  (s) => {
@@ -189,21 +189,21 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
189
189
  });
190
190
  }, [N]);
191
191
  const A = I(() => {
192
- if (!O) return [];
193
- let s = ae(O);
192
+ if (!E) return [];
193
+ let s = ae(E);
194
194
  e === "latest-encounter" && (s = oe(s));
195
195
  const R = ne(s);
196
196
  return ie(R);
197
- }, [O, e]), K = [
197
+ }, [E, e]), K = [
198
198
  { key: "name", header: "name" },
199
199
  { key: "value", header: "value" },
200
200
  { key: "form", header: "form" }
201
- ], L = V || !f, B = N && f, M = (!O || O.entry?.length === 0 || v.length === 0) && f, k = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = A.length > 0 && !L && !B, g = c.titleTranslationKey, E = g ? d(g) : "";
201
+ ], L = V || !f, B = N && f, M = (!E || E.entry?.length === 0 || v.length === 0) && f, k = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = A.length > 0 && !L && !B, g = c.titleTranslationKey, h = g ? d(g) : "";
202
202
  return /* @__PURE__ */ S(
203
203
  "div",
204
204
  {
205
205
  id: "observations",
206
- "data-testid": g ? `observations-${E}` : "observations",
206
+ "data-testid": g ? `observations-${h}` : "observations",
207
207
  "aria-label": "observations-aria-label",
208
208
  className: y.observations,
209
209
  children: [
@@ -211,17 +211,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
211
211
  ce,
212
212
  {
213
213
  id: "observations-title",
214
- testId: g ? `observations-title-${E}` : "observations-title",
215
- title: E,
214
+ testId: g ? `observations-title-${h}` : "observations-title",
215
+ title: h,
216
216
  className: y.title,
217
- children: /* @__PURE__ */ i("p", { children: E })
217
+ children: /* @__PURE__ */ i("p", { children: h })
218
218
  }
219
219
  ),
220
220
  Q ? /* @__PURE__ */ i(
221
- he,
221
+ Oe,
222
222
  {
223
223
  groupedData: A,
224
- title: E,
224
+ title: h,
225
225
  hideThumbnail: a
226
226
  }
227
227
  ) : /* @__PURE__ */ i(
@@ -241,7 +241,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
241
241
  );
242
242
  };
243
243
  export {
244
- Oe as conceptUuidQueryKeys,
244
+ Ee as conceptUuidQueryKeys,
245
245
  Se as default,
246
- Ee as observationsQueryKeys
246
+ he as observationsQueryKeys
247
247
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { DocumentUploadProps } from './models';
3
- export declare const DocumentUpload: React.FC<DocumentUploadProps>;
2
+ import { DocumentUploadRef, DocumentUploadProps } from './models';
3
+ export declare const DocumentUpload: React.ForwardRefExoticComponent<DocumentUploadProps & React.RefAttributes<DocumentUploadRef>>;
4
4
  export default DocumentUpload;
5
5
  //# sourceMappingURL=DocumentUpload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAIhE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4OxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"AAcA,OAAO,KAMN,MAAM,OAAO,CAAC;AAMf,OAAO,EAGL,iBAAiB,EACjB,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAYlB,eAAO,MAAM,cAAc,+FA2WzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { DocumentUpload } from './DocumentUpload';
2
2
  export { renderDocumentTile } from './renderDocumentTile';
3
3
  export type { DocumentTileData } from './renderDocumentTile';
4
- export type { DocumentUploadProps, DocumentSaveTarget } from './models';
4
+ export type { DocumentUploadProps, DocumentUploadRef, DocumentSaveSummary, DocumentSaveFailure, DocumentSaveTarget, } from './models';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documentUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documentUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
@@ -1,5 +1,16 @@
1
1
  import { DocumentSaveTarget, DocumentType } from '@bahmni/services';
2
2
  export type { DocumentSaveTarget } from '@bahmni/services';
3
+ export interface DocumentSaveFailure {
4
+ fileName: string;
5
+ message: string;
6
+ }
7
+ export interface DocumentSaveSummary {
8
+ savedCount: number;
9
+ failures: DocumentSaveFailure[];
10
+ }
11
+ export interface DocumentUploadRef {
12
+ save: () => Promise<DocumentSaveSummary>;
13
+ }
3
14
  export interface DocumentUploadProps {
4
15
  patientUuid: string;
5
16
  encounterTypeName: string;
@@ -7,10 +18,17 @@ export interface DocumentUploadProps {
7
18
  documentTypes?: DocumentType[];
8
19
  defaultOption?: string | null;
9
20
  onSaved?: () => void;
21
+ onPendingChange?: (hasPendingDocument: boolean) => void;
10
22
  }
11
23
  export interface PendingDocument {
24
+ id: string;
25
+ file: File;
12
26
  url: string;
13
27
  fileName: string;
14
28
  contentType: string;
29
+ documentType: DocumentType | null;
30
+ note: string;
31
+ isNoteVisible: boolean;
32
+ uploadedUrl?: string;
15
33
  }
16
34
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentUpload/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentUpload/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,kBAAkB,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}