@bahmni/reports-app 0.0.1-dev.462 → 0.0.1-dev.463

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,15 +1,15 @@
1
1
  import { jsx as r, jsxs as S, Fragment as K } from "react/jsx-runtime";
2
- import { X as de, Y as me, _ as Se, $ as fe, a0 as Oe, a1 as ge, a2 as Pe, a3 as Ae, a4 as he, a5 as Re, a6 as Le, a as w, z as ce, a7 as De, a8 as q, a9 as Q, aa as X, ab as Ce, ac as be, ad as Ne, ae as Z, af as J, Z as ye, ag as Ie, ah as Me, ai as ee, aj as Fe, ak as te, al as Be, am as Ue, an as ve, ao as He, ap as ae, aq as Ye, ar as ne, as as we, at as xe } from "./index-By5r-Flz.js";
2
+ import { V as de, X as me, Y as Se, _ as fe, a0 as Oe, a1 as ge, a2 as Pe, a3 as Ae, a4 as he, a5 as Re, a6 as Le, a as w, z as ce, a7 as De, a8 as q, a9 as Q, aa as X, ab as Ce, ac as be, ad as Ne, ae as Z, af as J, Z as ye, ag as Ie, ah as Me, ai as ee, aj as Fe, ak as te, al as Be, am as Ue, an as ve, ao as He, ap as ae, aq as Ye, ar as ne, as as we, at as xe } from "./index-B6kNIS4-.js";
3
3
  import { useQuery as _e } from "@tanstack/react-query";
4
- import qe, { useCallback as W, useState as A, useEffect as ue, useMemo as x } from "react";
5
- import { useLocation as Qe, useNavigate as $e } from "react-router";
6
- const Ge = "http://json-schema.org/draft-07/schema#", ke = "Reports App Configuration", Xe = "object", je = { config: { type: "object", properties: { supportedFormats: { type: "array", items: { type: "string" }, description: "List of supported report formats" }, paperSize: { type: "string", description: "Default paper size for generated reports (e.g., A4)" }, enableReportQueue: { type: "boolean", description: "Whether reports can be queued (run asynchronously) in addition to running immediately" } }, additionalProperties: !0 } }, ze = !0, We = {
7
- $schema: Ge,
4
+ import qe, { useCallback as V, useState as A, useEffect as ue, useMemo as x } from "react";
5
+ import { useLocation as Qe, useNavigate as Ge } from "react-router";
6
+ const $e = "http://json-schema.org/draft-07/schema#", ke = "Reports App Configuration", Xe = "object", je = { config: { type: "object", properties: { supportedFormats: { type: "array", items: { type: "string" }, description: "List of supported report formats" }, paperSize: { type: "string", description: "Default paper size for generated reports (e.g., A4)" }, enableReportQueue: { type: "boolean", description: "Whether reports can be queued (run asynchronously) in addition to running immediately" } }, additionalProperties: !0 } }, ze = !0, Ve = {
7
+ $schema: $e,
8
8
  title: ke,
9
9
  type: Xe,
10
10
  properties: je,
11
11
  additionalProperties: ze
12
- }, Ve = {
12
+ }, We = {
13
13
  PDF: "REPORTS_FORMAT_PDF",
14
14
  CSV: "REPORTS_FORMAT_CSV",
15
15
  HTML: "REPORTS_FORMAT_HTML",
@@ -41,7 +41,7 @@ const Ge = "http://json-schema.org/draft-07/schema#", ke = "Reports App Configur
41
41
  try {
42
42
  return await de(
43
43
  me,
44
- We
44
+ Ve
45
45
  );
46
46
  } catch {
47
47
  return {};
@@ -57,20 +57,20 @@ const Ge = "http://json-schema.org/draft-07/schema#", ke = "Reports App Configur
57
57
  queryFn: () => de(Se, st),
58
58
  retry: !1
59
59
  }), re = Symbol.for("constructDateFrom");
60
- function $(e, t) {
60
+ function G(e, t) {
61
61
  return typeof e == "function" ? e(t) : e && typeof e == "object" && re in e ? e[re](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
62
62
  }
63
63
  function U(e, t) {
64
- return $(e, e);
64
+ return G(e, e);
65
65
  }
66
66
  function it(e, t, a) {
67
67
  const l = U(e);
68
- return isNaN(t) ? $(e, NaN) : (t && l.setDate(l.getDate() + t), l);
68
+ return isNaN(t) ? G(e, NaN) : (t && l.setDate(l.getDate() + t), l);
69
69
  }
70
70
  function lt(e, t, a) {
71
71
  const l = U(e);
72
- if (isNaN(t)) return $(e, NaN);
73
- const o = l.getDate(), s = $(e, l.getTime());
72
+ if (isNaN(t)) return G(e, NaN);
73
+ const o = l.getDate(), s = G(e, l.getTime());
74
74
  s.setMonth(l.getMonth() + t + 1, 0);
75
75
  const _ = s.getDate();
76
76
  return o >= _ ? s : (l.setFullYear(
@@ -128,7 +128,7 @@ const ut = (e, t) => t ? ge(e, t) : !0, Tt = (e, t) => e.filter(
128
128
  default:
129
129
  return [new Date(t), new Date(t)];
130
130
  }
131
- }, Ee = (e) => (t) => t ? e(Ve[t]) : "", j = (e, t) => t ?? e.config?.macroTemplatePath ?? null, St = (e, t) => {
131
+ }, Ee = (e) => (t) => t ? e(We[t]) : "", j = (e, t) => t ?? e.config?.macroTemplatePath ?? null, St = (e, t) => {
132
132
  const {
133
133
  report: a,
134
134
  requiresDateRange: l,
@@ -173,7 +173,7 @@ const ut = (e, t) => t ? ge(e, t) : !0, Tt = (e, t) => e.filter(
173
173
  });
174
174
  }, Ot = () => {
175
175
  const { user: e } = Ae();
176
- return { queueReport: W(
176
+ return { queueReport: V(
177
177
  async (a, l, o, s, _, E) => {
178
178
  if (!e?.username)
179
179
  return console.error("Error queueing report: no current user"), !1;
@@ -196,7 +196,7 @@ const ut = (e, t) => t ? ge(e, t) : !0, Tt = (e, t) => e.filter(
196
196
  },
197
197
  [e?.username]
198
198
  ) };
199
- }, gt = () => ({ runReport: W(
199
+ }, gt = () => ({ runReport: V(
200
200
  (t, a, l, o, s, _) => {
201
201
  try {
202
202
  const E = Le(
@@ -515,8 +515,8 @@ const ut = (e, t) => t ? ge(e, t) : !0, Tt = (e, t) => e.filter(
515
515
  ),
516
516
  labelTitle: s("REPORTS_UPLOAD_TEMPLATE_LABEL"),
517
517
  filenameStatus: F,
518
- onChange: (g, V) => {
519
- const n = V?.addedFiles?.[0]?.file ?? g?.target?.files?.[0];
518
+ onChange: (g, W) => {
519
+ const n = W?.addedFiles?.[0]?.file ?? g?.target?.files?.[0];
520
520
  n && N(R, n);
521
521
  }
522
522
  },
@@ -563,7 +563,7 @@ const ut = (e, t) => t ? ge(e, t) : !0, Tt = (e, t) => e.filter(
563
563
  }
564
564
  );
565
565
  z.displayName = "ReportsTable";
566
- const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWidth__p10hj", Bt = "ReportList-module_emptyState__0xMZ9", G = {
566
+ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWidth__p10hj", Bt = "ReportList-module_emptyState__0xMZ9", $ = {
567
567
  reportList: Mt,
568
568
  fullWidth: Ft,
569
569
  emptyState: Bt
@@ -706,7 +706,7 @@ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWi
706
706
  {
707
707
  id: "reports-config-loading",
708
708
  testId: "reports-config-loading",
709
- className: G.fullWidth,
709
+ className: $.fullWidth,
710
710
  type: "multi"
711
711
  }
712
712
  ) : _ ? null : !o || m.length === 0 ? /* @__PURE__ */ r(
@@ -714,7 +714,7 @@ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWi
714
714
  {
715
715
  id: "reports-empty-state",
716
716
  "data-testid": "reports-empty-state",
717
- className: G.emptyState,
717
+ className: $.emptyState,
718
718
  children: e("REPORTS_EMPTY_STATE_MESSAGE")
719
719
  }
720
720
  ) : /* @__PURE__ */ S(
@@ -722,7 +722,7 @@ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWi
722
722
  {
723
723
  id: "report-list",
724
724
  "data-testid": "report-list",
725
- className: G.reportList,
725
+ className: $.reportList,
726
726
  children: [
727
727
  /* @__PURE__ */ r(
728
728
  xt,
@@ -781,17 +781,17 @@ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWi
781
781
  ]
782
782
  }
783
783
  );
784
- }, Qt = "ReportsPage-module_page__ewRXe", $t = "ReportsPage-module_panel__HFBCt", k = {
784
+ }, Qt = "ReportsPage-module_page__ewRXe", Gt = "ReportsPage-module_panel__HFBCt", k = {
785
785
  page: Qt,
786
- panel: $t
787
- }, le = 1, Gt = 0, Vt = () => {
788
- const { t: e } = w(), t = Qe(), a = $e(), l = x(
786
+ panel: Gt
787
+ }, le = 1, $t = 0, Wt = () => {
788
+ const { t: e } = w(), t = Qe(), a = Ge(), l = x(
789
789
  () => [
790
790
  { id: "home", label: e("REPORTS_HOME_LABEL"), href: Fe },
791
791
  { id: "reports", label: e("REPORTS_LABEL"), isCurrentPage: !0 }
792
792
  ],
793
793
  [e]
794
- ), o = t.pathname === te ? le : Gt, s = W(
794
+ ), o = t.pathname === te ? le : $t, s = V(
795
795
  ({ selectedIndex: _ }) => {
796
796
  a(
797
797
  _ === le ? te : Be
@@ -882,6 +882,6 @@ const Mt = "ReportList-module_reportList__tPpsJ", Ft = "ReportList-module_fullWi
882
882
  );
883
883
  };
884
884
  export {
885
- Vt as ReportsPage,
886
- Vt as default
885
+ Wt as ReportsPage,
886
+ Wt as default
887
887
  };
@@ -1,4 +1,4 @@
1
- import { ax as we, ay as z, az as xt, aA as B, av as q, aw as y, aB as Ro, aC as ye, aD as R, aE as _, aF as k, aG as N, aH as A, aI as bs, aJ as ir, aK as $e, aL as U, aM as Hn, aN as Vn, aO as dt, aP as D, aQ as xs, aR as cn, aS as Be, aT as ws, aU as qt, aV as zt, aW as $s, aX as Cs, aY as $n, aZ as Ss, a_ as Nr, a$ as Bt, b0 as zo, b1 as ks, b2 as Es, b3 as j, b4 as Ur, b5 as Ms, b6 as Ds, b7 as sr, b8 as As, b9 as Ts, ba as zn, bb as Fs, bc as Is, bd as Z, be as Ps, bf as Ls } from "./index-By5r-Flz.js";
1
+ import { ax as we, ay as z, az as xt, aA as B, av as q, aw as y, aB as Ro, aC as ye, aD as R, aE as _, aF as k, aG as N, aH as A, aI as bs, aJ as ir, aK as $e, aL as U, aM as Hn, aN as Vn, aO as dt, aP as D, aQ as xs, aR as cn, aS as Be, aT as ws, aU as qt, aV as zt, aW as $s, aX as Cs, aY as $n, aZ as Ss, a_ as Nr, a$ as Bt, b0 as zo, b1 as ks, b2 as Es, b3 as j, b4 as Ur, b5 as Ms, b6 as Ds, b7 as sr, b8 as As, b9 as Ts, ba as zn, bb as Fs, bc as Is, bd as Z, be as Ps, bf as Ls } from "./index-B6kNIS4-.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {