@bahmni/widgets 0.0.1-dev.456 → 0.0.1-dev.458

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,13 +1,13 @@
1
1
  import { jsx as i, jsxs as N } from "react/jsx-runtime";
2
- import { t as G, v as F, w as x, K as z, d as H, y as P, F as j, z as X, B as J, u as W, b as Y, D as Z, C as ee, E as se, G as te, X as re, H as ae, I as oe, L as ne, R as ie, Q as ce, x as le } from "./index-BSjeukzT.js";
2
+ import { s as G, t as F, v as x, w as z, f as H, y as P, F as j, z as W, B as Z, u as J, a as Y, D as X, L as ee, E as se, G as te, Z as re, H as ae, I as oe, K as ne, R as ie, Q as ce, x as le } from "./index-DepMUZYx.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";
6
- const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
6
+ const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", fe = "Observations-module_secondary__14nuS", f = {
7
7
  observations: be,
8
8
  title: me,
9
9
  wrapper: ve,
10
- secondary: ye
10
+ secondary: fe
11
11
  }, U = (t, l, n, c, u, r) => {
12
12
  const a = x(t, l, u), e = a.value, p = z(e);
13
13
  let o = e;
@@ -20,21 +20,21 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), p === "Video" && (o = /* @__PURE__ */ i(
23
- X,
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(J, { id: `${e}-pdf`, src: e }));
30
- const b = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
29
+ )), p === "PDF" && (o = /* @__PURE__ */ i(Z, { id: `${e}-pdf`, src: e }));
30
+ const b = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
31
31
  /* @__PURE__ */ i("span", { children: a.header.display }),
32
- a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
32
+ a.header.referenceRange && /* @__PURE__ */ i("span", { className: f.secondary, children: a.header.referenceRange })
33
33
  ] }), d = u("OBSERVATIONS_RECORDED_BY", {
34
34
  provider: a.provider
35
- }), m = t.effectiveDateTime ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
35
+ }), m = t.effectiveDateTime ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
36
36
  /* @__PURE__ */ i("span", { children: d }),
37
- m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
37
+ m && /* @__PURE__ */ i("span", { className: f.secondary, children: m })
38
38
  ] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
39
39
  return /* @__PURE__ */ i(
40
40
  P,
@@ -48,7 +48,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
48
48
  },
49
49
  `obs-${t.id}`
50
50
  );
51
- }, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
51
+ }, ye = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
52
52
  F,
53
53
  {
54
54
  title: t.display,
@@ -91,7 +91,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
91
91
  )
92
92
  ),
93
93
  r.groupedObservations.map(
94
- (o, b) => fe(
94
+ (o, b) => ye(
95
95
  o,
96
96
  c,
97
97
  a,
@@ -133,10 +133,10 @@ 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 } = Y(), { t: d } = w(), m = de({
136
+ } = c, p = pe(/* @__PURE__ */ new Set()), o = J(), { addNotification: b } = Y(), { t: d } = w(), m = de({
137
137
  queries: u.map((s) => ({
138
138
  queryKey: Ee(s),
139
- queryFn: () => Z(s),
139
+ queryFn: () => X(s),
140
140
  enabled: !!s
141
141
  }))
142
142
  });
@@ -148,7 +148,7 @@ 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]), g = e === "latest" || e === "latest-encounter", O = ee(
151
+ const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), y = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), g = e === "latest" || e === "latest-encounter", O = ee(
152
152
  l,
153
153
  n
154
154
  ), {
@@ -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 && !O
175
+ enabled: !!o && v.length > 0 && y && !O
176
176
  });
177
177
  re(
178
178
  (s) => {
@@ -188,7 +188,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
188
188
  type: "error"
189
189
  });
190
190
  }, [S]);
191
- const A = I(() => {
191
+ const L = I(() => {
192
192
  if (!E) return [];
193
193
  let s = ae(E);
194
194
  e === "latest-encounter" && (s = oe(s));
@@ -198,14 +198,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
198
198
  { key: "name", header: "name" },
199
199
  { key: "value", header: "value" },
200
200
  { key: "form", header: "form" }
201
- ], B = V || !f, L = S && f, Q = (!E || E.entry?.length === 0 || v.length === 0) && f, M = L ? d("ERROR_FETCHING_OBSERVATIONS") : null, k = Q ? d("NO_OBSERVATIONS_FOUND") : void 0, q = A.length > 0 && !B && !L, T = c.titleTranslationKey, h = T ? d(T) : "";
201
+ ], A = V || !y, B = S && y, Q = (!E || E.entry?.length === 0 || v.length === 0) && y, M = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, k = Q ? d("NO_OBSERVATIONS_FOUND") : void 0, q = L.length > 0 && !A && !B, T = c.titleTranslationKey, h = T ? d(T) : "";
202
202
  return /* @__PURE__ */ N(
203
203
  "div",
204
204
  {
205
205
  id: "observations",
206
206
  "data-testid": T ? `observations-${h}` : "observations",
207
207
  "aria-label": "observations-aria-label",
208
- className: y.observations,
208
+ className: f.observations,
209
209
  children: [
210
210
  /* @__PURE__ */ i(
211
211
  ce,
@@ -213,14 +213,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
213
213
  id: "observations-title",
214
214
  testId: T ? `observations-title-${h}` : "observations-title",
215
215
  title: h,
216
- className: y.title,
216
+ className: f.title,
217
217
  children: /* @__PURE__ */ i("p", { children: h })
218
218
  }
219
219
  ),
220
220
  q ? /* @__PURE__ */ i(
221
221
  Oe,
222
222
  {
223
- groupedData: A,
223
+ groupedData: L,
224
224
  title: h,
225
225
  hideThumbnail: a
226
226
  }
@@ -230,7 +230,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
230
230
  headers: K,
231
231
  rows: [],
232
232
  ariaLabel: d("OBSERVATIONS"),
233
- loading: B,
233
+ loading: A,
234
234
  errorStateMessage: M,
235
235
  emptyStateMessage: k ?? d("NO_OBSERVATIONS_AVAILABLE"),
236
236
  dataTestId: "observations-table"
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAGL,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAyNlB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+IxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,EAGL,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAkPlB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAqKxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -35,5 +35,6 @@ export interface DocumentUploadProps {
35
35
  config?: DocumentUploadConfig;
36
36
  documentsTitle?: string;
37
37
  isSaving?: boolean;
38
+ defaultOption?: string | null;
38
39
  }
39
40
  //# 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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MA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AAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,iBAAiB,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface DocumentPreviewAttachment {
3
+ url: string;
4
+ contentType?: string;
5
+ }
6
+ export interface DocumentPreviewProps {
7
+ id: string;
8
+ title: string;
9
+ attachments: DocumentPreviewAttachment[];
10
+ }
11
+ /**
12
+ * One thumbnail per document. Opening it previews every attachment of the
13
+ * document, one below the other, instead of only the first file.
14
+ */
15
+ export declare const DocumentPreview: React.FC<DocumentPreviewProps>;
16
+ export default DocumentPreview;
17
+ //# sourceMappingURL=DocumentPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentPreview.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,yBAAyB,EAAE,CAAC;CAC1C;AAqCD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0E1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { default as DocumentsTable } from './DocumentsTable';
2
+ export { DocumentPreview } from './DocumentPreview';
3
+ export type { DocumentPreviewAttachment, DocumentPreviewProps, } from './DocumentPreview';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}