@bahmni/widgets 0.0.1-dev.306 → 0.0.1-dev.310

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,7 +1,7 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as X, T as J, t as Z, A as x, i as ee, I as te } from "./index-BxMJqMBe.js";
2
+ import { u as W, a as Z, T as X, Z as J, A as x, j as ee, P as te } from "./index-CDaZ5sPl.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
- import { useState as l, useCallback as _, useEffect as g, useMemo as p } from "react";
4
+ import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
6
6
  const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
7
7
  documentsTableBody: oe,
@@ -34,18 +34,18 @@ const Te = [
34
34
  "attachments",
35
35
  "uploadedOn",
36
36
  "uploadedBy"
37
- ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, F = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], ge = ({ config: n, encounterUuids: E }) => {
38
- const [d, w] = l(!1), [s, L] = l(
37
+ ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, P = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: E }) => {
38
+ const [d, L] = l(!1), [s, U] = l(
39
39
  null
40
- ), [P, A] = l(
40
+ ), [F, A] = l(
41
41
  /* @__PURE__ */ new Set()
42
- ), f = W(), { t: o } = ae(), { addNotification: U } = X(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
43
- L(e), w(!0);
44
- }, []), z = _(() => {
45
- w(!1), L(null), A(/* @__PURE__ */ new Set());
42
+ ), f = W(), { t: o } = ae(), { addNotification: w } = Z(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
43
+ U(e), L(!0);
44
+ }, []), H = _(() => {
45
+ L(!1), U(null), A(/* @__PURE__ */ new Set());
46
46
  }, []), R = _((e) => {
47
47
  A((t) => new Set(t).add(e));
48
- }, []), { data: i, isLoading: H, isError: S, error: y } = ne({
48
+ }, []), { data: i, isLoading: z, isError: S, error: y } = ne({
49
49
  queryKey: [
50
50
  "documents",
51
51
  f,
@@ -54,30 +54,30 @@ const Te = [
54
54
  u
55
55
  ],
56
56
  enabled: !!f,
57
- queryFn: () => J(
57
+ queryFn: () => X(
58
58
  f,
59
59
  E,
60
60
  u,
61
61
  N
62
62
  )
63
63
  });
64
- g(() => {
64
+ I(() => {
65
65
  i && O(i.total);
66
- }, [i]), g(() => {
66
+ }, [i]), I(() => {
67
67
  C(1), O(void 0);
68
- }, [f]), g(() => {
69
- S && U({
68
+ }, [f]), I(() => {
69
+ S && w({
70
70
  title: o("ERROR_DEFAULT_TITLE"),
71
71
  message: y?.message ?? "",
72
72
  type: "error"
73
73
  });
74
- }, [S, y, U, o]), g(() => {
74
+ }, [S, y, w, o]), I(() => {
75
75
  const e = new AbortController();
76
76
  return (async () => {
77
77
  if (!d || !s) return;
78
- const a = /* @__PURE__ */ new Set(), I = F(s);
79
- for (let m = 0; m < I.length; m++) {
80
- const b = B(I[m].url);
78
+ const a = /* @__PURE__ */ new Set(), g = P(s);
79
+ for (let m = 0; m < g.length; m++) {
80
+ const b = B(g[m].url);
81
81
  try {
82
82
  (await fetch(b, {
83
83
  method: "HEAD",
@@ -90,7 +90,7 @@ const Te = [
90
90
  e.signal.aborted || A(a);
91
91
  })(), () => e.abort();
92
92
  }, [d, s]);
93
- const q = _(
93
+ const j = _(
94
94
  (e, t) => {
95
95
  t !== u ? ($(t), C(1), O(void 0)) : C(e);
96
96
  },
@@ -98,14 +98,14 @@ const Te = [
98
98
  ), D = p(
99
99
  () => n?.fields ?? Te,
100
100
  [n?.fields]
101
- ), j = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
101
+ ), q = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
102
102
  () => D.map((e) => ({
103
103
  key: e,
104
104
  sortable: e !== "attachments"
105
105
  })),
106
106
  [D]
107
107
  ), h = p(
108
- () => s ? F(s) : [],
108
+ () => s ? P(s) : [],
109
109
  [s]
110
110
  ), Q = _(
111
111
  (e, t) => {
@@ -124,7 +124,7 @@ const Te = [
124
124
  return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
125
125
  case "attachments":
126
126
  return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ r(
127
- Z,
127
+ J,
128
128
  {
129
129
  onClick: () => v(e),
130
130
  className: c.viewAttachmentsLink,
@@ -144,8 +144,8 @@ const Te = [
144
144
  {
145
145
  headers: K,
146
146
  ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
147
- rows: j,
148
- loading: H,
147
+ rows: q,
148
+ loading: z,
149
149
  errorStateMessage: S ? y?.message : null,
150
150
  sortable: G,
151
151
  emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
@@ -155,7 +155,7 @@ const Te = [
155
155
  pageSize: u,
156
156
  totalItems: k,
157
157
  page: N,
158
- onPageChange: q
158
+ onPageChange: j
159
159
  }
160
160
  ) }),
161
161
  d && s && /* @__PURE__ */ r(
@@ -164,13 +164,13 @@ const Te = [
164
164
  id: "modalIdForActionAreaLayout",
165
165
  portalId: "main-display-area",
166
166
  open: d,
167
- onRequestClose: z,
167
+ onRequestClose: H,
168
168
  modalHeading: s.documentIdentifier,
169
169
  passiveModal: !0,
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 = B(e.url), I = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
173
+ const a = B(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = F.has(t);
174
174
  return a === "#" || b ? /* @__PURE__ */ T(
175
175
  "div",
176
176
  {
@@ -208,7 +208,7 @@ const Te = [
208
208
  ) : /* @__PURE__ */ r(
209
209
  "iframe",
210
210
  {
211
- src: I ? `${a}#toolbar=0` : a,
211
+ src: g ? `${a}#toolbar=0` : a,
212
212
  className: c.documentIframe,
213
213
  title: s.documentIdentifier,
214
214
  onError: () => R(t)
@@ -224,5 +224,5 @@ const Te = [
224
224
  ] });
225
225
  };
226
226
  export {
227
- ge as default
227
+ Ie as default
228
228
  };
@@ -1,54 +1,54 @@
1
1
  import { jsx as i, jsxs as te, Fragment as oe } from "react/jsx-runtime";
2
- import { Q as se, u as ae, V as ne, n as de, b as ie, r as ce, q as le, y as me, M as k, A as ue, t as fe, i as x, X as ye, c as be, I as pe, O as he } from "./index-BxMJqMBe.js";
2
+ import { Q as se, u as ae, V as ne, n as de, t as ie, r as ce, q as le, y as me, M as k, A as ue, Z as fe, j as x, b as ye, R as be, P as pe, O as he } from "./index-CDaZ5sPl.js";
3
3
  import { useQueryClient as ge, useQuery as p } from "@tanstack/react-query";
4
- import { useState as w, useMemo as d, useCallback as h } from "react";
4
+ import { useState as P, useMemo as d, useCallback as h } from "react";
5
5
  import { useTranslation as Fe } from "react-i18next";
6
6
  const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", v = {
7
7
  formsTableBody: Ne,
8
8
  customAccordianItem: Oe
9
9
  }, Ee = (m) => m ? m.extension?.find(
10
10
  (g) => g.url === se
11
- )?.valueString : void 0, Be = ({
11
+ )?.valueString : void 0, Te = ({
12
12
  episodeOfCareUuids: m,
13
13
  encounterUuids: c,
14
14
  config: g
15
15
  }) => {
16
- const { t: n } = Fe(), u = ae(), [y, I] = w(!1), [a, M] = w(null), {
17
- numberOfVisits: P,
18
- hideThumbnail: Q = !1,
16
+ const { t: n } = Fe(), u = ae(), [y, M] = P(!1), [a, A] = P(null), {
17
+ numberOfVisits: j,
18
+ hideThumbnail: H = !1,
19
19
  forms: b
20
- } = g ?? {}, A = ne(
20
+ } = g ?? {}, I = ne(
21
21
  m,
22
22
  c
23
23
  ), V = ge(), {
24
24
  data: D = [],
25
- isLoading: B,
26
- isError: T,
27
- error: j,
28
- refetch: H
25
+ isLoading: T,
26
+ isError: B,
27
+ error: w,
28
+ refetch: K
29
29
  } = p({
30
30
  queryKey: ["forms", u, m],
31
- queryFn: () => de(u, void 0, P),
32
- enabled: !!u && !A
33
- }), _ = d(() => {
31
+ queryFn: () => de(u, void 0, j),
32
+ enabled: !!u && !I
33
+ }), R = d(() => {
34
34
  let e = D;
35
35
  return c && c.length > 0 && (e = e.filter(
36
36
  (t) => c.includes(t.encounterUuid)
37
37
  )), Array.isArray(b) && b.length > 0 && (e = e.filter(
38
38
  (t) => b.some((r) => r.toLowerCase() === t.formName.toLowerCase())
39
39
  )), e;
40
- }, [D, c, b]), { data: L = [] } = p({
40
+ }, [D, c, b]), { data: _ = [] } = p({
41
41
  queryKey: ["observationForms"],
42
42
  queryFn: () => ie()
43
- }), R = h(
44
- (e) => L.find((r) => r.name === e)?.uuid,
45
- [L]
43
+ }), L = h(
44
+ (e) => _.find((r) => r.name === e)?.uuid,
45
+ [_]
46
46
  ), F = d(() => {
47
47
  if (a)
48
- return R(a.formName);
49
- }, [a, R]), {
48
+ return L(a.formName);
49
+ }, [a, L]), {
50
50
  data: l,
51
- isLoading: K,
51
+ isLoading: Q,
52
52
  isError: $,
53
53
  error: N
54
54
  } = p({
@@ -67,11 +67,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
67
67
  });
68
68
  me(
69
69
  (e) => {
70
- e.patientUUID === u && e.updatedConcepts.size > 0 && (H(), V.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
70
+ e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), V.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
71
71
  },
72
72
  [u]
73
73
  );
74
- const X = d(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => {
74
+ const Z = d(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => {
75
75
  const r = Ee(t);
76
76
  return !r || r.includes(a.formName);
77
77
  }), [O, a?.formName]), Y = d(() => {
@@ -110,14 +110,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
110
110
  { key: "recordedBy", header: n("RECORDED_BY") }
111
111
  ],
112
112
  [n]
113
- ), Z = d(
113
+ ), X = d(
114
114
  () => [
115
115
  { key: "recordedOn", sortable: !0 },
116
116
  { key: "recordedBy", sortable: !0 }
117
117
  ],
118
118
  []
119
119
  ), S = d(() => {
120
- const e = _.reduce(
120
+ const e = R.reduce(
121
121
  (r, o) => {
122
122
  const s = o.formName;
123
123
  r[s] ??= [];
@@ -141,10 +141,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
141
141
  )
142
142
  })
143
143
  ).sort((r, o) => r.formName.localeCompare(o.formName));
144
- }, [_, n]), q = h((e) => {
145
- M(e), I(!0);
144
+ }, [R, n]), q = h((e) => {
145
+ A(e), M(!0);
146
146
  }, []), ee = h(() => {
147
- I(!1), M(null);
147
+ M(!1), A(null);
148
148
  }, []), U = h(
149
149
  (e, t) => {
150
150
  switch (t) {
@@ -159,14 +159,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
159
159
  [q]
160
160
  );
161
161
  return /* @__PURE__ */ te(oe, { children: [
162
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || T || S.length === 0 || A ? /* @__PURE__ */ i(
162
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: T || B || S.length === 0 || I ? /* @__PURE__ */ i(
163
163
  x,
164
164
  {
165
165
  headers: C,
166
166
  ariaLabel: n("FORMS_HEADING"),
167
167
  rows: [],
168
- loading: B,
169
- errorStateMessage: T ? j?.message : void 0,
168
+ loading: T,
169
+ errorStateMessage: B ? w?.message : void 0,
170
170
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
171
171
  renderCell: U,
172
172
  className: v.formsTableBody,
@@ -189,7 +189,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
189
189
  rows: o,
190
190
  loading: !1,
191
191
  errorStateMessage: "",
192
- sortable: Z,
192
+ sortable: X,
193
193
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
194
194
  renderCell: U,
195
195
  className: v.formsTableBody,
@@ -215,13 +215,13 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
215
215
  children: /* @__PURE__ */ i(
216
216
  he,
217
217
  {
218
- observations: X,
219
- isLoading: K || z,
218
+ observations: Z,
219
+ isLoading: Q || z,
220
220
  isError: $ || G,
221
221
  errorMessage: W,
222
222
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
223
223
  testIdPrefix: a.formName,
224
- hideThumbnail: Q,
224
+ hideThumbnail: H,
225
225
  controlOrder: Y,
226
226
  sectionMap: J
227
227
  }
@@ -231,5 +231,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
231
231
  ] });
232
232
  };
233
233
  export {
234
- Be as default
234
+ Te as default
235
235
  };
@@ -1,13 +1,13 @@
1
1
  import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
- import { f as M, d as D, e as V, g as Q, o as k, h as q, w as H, m as G, u as P, a as j, j as z, C as J, y as Y, k as W, l as X, s as Z, H as x, i as ee } from "./index-BxMJqMBe.js";
2
+ import { f as K, J as D, c as Q, d as V, F as w, X as k, e as q, g as j, u as G, a as P, h as J, C as z, y as X, i as Y, k as W, s as Z, o as x, j as ee } from "./index-CDaZ5sPl.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
- import { useRef as oe, useEffect as C, useMemo as h } from "react";
4
+ import { useRef as oe, useEffect as C, useMemo as g } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
6
- const w = (t, i, c, l, u, r) => {
7
- const s = V(t, i, u), o = s.value, a = Q(o);
6
+ const F = (t, i, c, l, u, r) => {
7
+ const s = Q(t, i, u), o = s.value, a = V(o);
8
8
  let n = o;
9
9
  a === "Image" && (n = /* @__PURE__ */ d(
10
- q,
10
+ k,
11
11
  {
12
12
  imageSrc: o,
13
13
  alt: o,
@@ -15,18 +15,18 @@ const w = (t, i, c, l, u, r) => {
15
15
  hideThumbnail: r
16
16
  }
17
17
  )), a === "Video" && (n = /* @__PURE__ */ d(
18
- H,
18
+ q,
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(j, { 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", y = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
27
+ }), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
28
28
  return /* @__PURE__ */ d(
29
- k,
29
+ w,
30
30
  {
31
31
  header: s.header,
32
32
  value: n,
@@ -44,7 +44,7 @@ const w = (t, i, c, l, u, r) => {
44
44
  id: `grouped-obs-${t.display}-${l}`,
45
45
  open: c,
46
46
  children: t.members?.map(
47
- (o, a) => w(
47
+ (o, a) => F(
48
48
  o,
49
49
  a,
50
50
  u,
@@ -61,7 +61,7 @@ const w = (t, i, c, l, u, r) => {
61
61
  hideThumbnail: c
62
62
  }) => {
63
63
  const { t: l } = U(), u = (r, s, o) => {
64
- const a = M(r.encounterDetails, l);
64
+ const a = K(r.encounterDetails, l);
65
65
  return /* @__PURE__ */ N(
66
66
  D,
67
67
  {
@@ -70,7 +70,7 @@ const w = (t, i, c, l, u, r) => {
70
70
  open: s,
71
71
  children: [
72
72
  r.observations.map(
73
- (n, b) => w(
73
+ (n, b) => F(
74
74
  n,
75
75
  b,
76
76
  o,
@@ -114,10 +114,10 @@ const w = (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 } = j(), { t: a } = U(), n = te({
117
+ } = i, r = oe(/* @__PURE__ */ new Set()), s = G(), { addNotification: o } = P(), { t: a } = U(), n = te({
118
118
  queries: c.map((e) => ({
119
119
  queryKey: ce(e),
120
- queryFn: () => z(e),
120
+ queryFn: () => J(e),
121
121
  enabled: !!e
122
122
  }))
123
123
  });
@@ -133,39 +133,39 @@ const w = (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]), f = h(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
- data: p,
136
+ const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), f = g(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
+ data: m,
138
138
  isLoading: y,
139
- isError: g,
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 && f
142
+ queryKey: le(s, p),
143
+ queryFn: () => z(s, p),
144
+ enabled: !!s && p.length > 0 && f
145
145
  });
146
- Y(
146
+ X(
147
147
  (e) => {
148
148
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
149
- (R) => m.includes(R)
149
+ (R) => p.includes(R)
150
150
  ) && T();
151
151
  },
152
152
  [s, T]
153
153
  ), C(() => {
154
- g && o({
154
+ h && o({
155
155
  title: a("ERROR_DEFAULT_TITLE"),
156
156
  message: a("ERROR_FETCHING_OBSERVATIONS"),
157
157
  type: "error"
158
158
  });
159
- }, [g]);
160
- const _ = h(() => {
161
- if (!p) return [];
162
- const e = W(p), v = X(e);
159
+ }, [h]);
160
+ const _ = g(() => {
161
+ if (!m) return [];
162
+ const e = Y(m), v = W(e);
163
163
  return Z(v);
164
- }, [p]), A = [
164
+ }, [m]), A = [
165
165
  { key: "name", header: "name" },
166
166
  { key: "value", header: "value" },
167
167
  { key: "form", header: "form" }
168
- ], I = y || !f, $ = g && f, B = (!p || p.entry?.length === 0 || m.length === 0) && f, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = B ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
168
+ ], I = y || !f, $ = h && f, B = (!m || m.entry?.length === 0 || p.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = B ? a("NO_OBSERVATIONS_FOUND") : void 0, H = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
169
  return /* @__PURE__ */ N(
170
170
  "div",
171
171
  {
@@ -184,7 +184,7 @@ const w = (t, i, c, l, u, r) => {
184
184
  children: /* @__PURE__ */ d("p", { children: E })
185
185
  }
186
186
  ),
187
- K ? /* @__PURE__ */ d(
187
+ H ? /* @__PURE__ */ d(
188
188
  ae,
189
189
  {
190
190
  groupedData: _,
@@ -198,8 +198,8 @@ const w = (t, i, c, l, u, r) => {
198
198
  rows: [],
199
199
  ariaLabel: a("OBSERVATIONS"),
200
200
  loading: I,
201
- errorStateMessage: F,
202
- emptyStateMessage: L,
201
+ errorStateMessage: L,
202
+ emptyStateMessage: M,
203
203
  dataTestId: "observations-table"
204
204
  }
205
205
  )
@@ -8,10 +8,13 @@ interface DocumentPrintButtonProps {
8
8
  printOptions?: PrintOption[];
9
9
  renderContext: Record<string, string>;
10
10
  renderData?: Record<string, unknown>;
11
+ getRenderData?: (templateId: string) => Promise<Record<string, unknown>>;
11
12
  size?: 'sm' | 'md' | 'lg';
12
13
  disabled?: boolean;
13
14
  'data-testid'?: string;
15
+ iconOnly?: boolean;
16
+ iconLabel?: string;
14
17
  }
15
- export declare const DocumentPrintButton: ({ printOptions, renderContext, renderData, size, disabled, "data-testid": dataTestId, }: DocumentPrintButtonProps) => import("react/jsx-runtime").JSX.Element | null;
18
+ export declare const DocumentPrintButton: ({ printOptions, renderContext, renderData, getRenderData, size, disabled, "data-testid": dataTestId, iconOnly, iconLabel, }: DocumentPrintButtonProps) => import("react/jsx-runtime").JSX.Element | null;
16
19
  export {};
17
20
  //# sourceMappingURL=DocumentPrintButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentPrintButton.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/DocumentPrintButton.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,UAAU,wBAAwB;IAChC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,GAAI,yFAOjC,wBAAwB,mDA6D1B,CAAC"}
1
+ {"version":3,"file":"DocumentPrintButton.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/DocumentPrintButton.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,UAAU,wBAAwB;IAChC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAI,6HAUjC,wBAAwB,mDA2G1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function printViaIframe(html: string): Promise<void>;
2
+ //# sourceMappingURL=printViaIframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printViaIframe.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/printViaIframe.ts"],"names":[],"mappings":"AAiEA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BhE"}