@bahmni/reports-app 0.0.1-dev.440 → 0.0.1-dev.442

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,5 +1,5 @@
1
1
  import { jsx as a, jsxs as m, Fragment as H } from "react/jsx-runtime";
2
- import { C as W, p as se, r as oe, t as ie, x as le, y as de, A as Re, M as ce, O as Y, u as b, z as X, S as N, T as F, U as M, V as _e, _ as Te, a0 as pe, a1 as x, k as ue, a2 as me, a3 as Ee, a4 as q, a5 as Se, a6 as U, a7 as fe, a8 as Oe, a9 as Pe, aa as ge, ab as k, ac as Ae, ad as $, ae as he, af as De } from "./index-CSBzaxP9.js";
2
+ import { K as z, C as se, F as oe, G as ie, I as le, M as de, N as Re, O as ce, P as Y, u as b, z as X, U as N, V as F, Y as M, Z as _e, _ as Te, a0 as pe, a1 as x, k as ue, a2 as me, a3 as Ee, a4 as q, a5 as Se, a6 as U, a7 as fe, a8 as Oe, a9 as Pe, aa as ge, ab as G, ac as Ae, ad as k, ae as he, af as De } from "./index-g9wj_kf9.js";
3
3
  import Le, { useCallback as K, useState as A, useEffect as V, useMemo as y } from "react";
4
4
  import { useQuery as J } from "@tanstack/react-query";
5
5
  import { useLocation as Ce, useNavigate as be } from "react-router-dom";
@@ -31,7 +31,7 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
31
31
  queryKey: Q.reportsAppConfig,
32
32
  queryFn: async () => {
33
33
  try {
34
- return await W(
34
+ return await z(
35
35
  se,
36
36
  Be
37
37
  );
@@ -39,32 +39,32 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
39
39
  return {};
40
40
  }
41
41
  }
42
- }), xe = "http://json-schema.org/draft-07/schema#", qe = "Reports Configuration", Ue = "object", ke = { type: "object", required: ["name", "type"], properties: { name: { type: "string", description: "Display name of the report" }, type: { type: "string", description: "Report generator type" }, requiredPrivilege: { type: "string", description: "Privilege required to view/run this report" }, config: { type: "object", properties: { dateRangeRequired: { type: "boolean", description: "Whether this report requires a date range (defaults to true)" }, paperSize: { type: "string", description: "Paper size for PDF generation (e.g., A4)" }, macroTemplatePath: { type: "string", description: "Path to macro template for custom Excel reports" } }, additionalProperties: !0 } } }, $e = {
42
+ }), xe = "http://json-schema.org/draft-07/schema#", qe = "Reports Configuration", Ue = "object", Ge = { type: "object", required: ["name", "type"], properties: { name: { type: "string", description: "Display name of the report" }, type: { type: "string", description: "Report generator type" }, requiredPrivilege: { type: "string", description: "Privilege required to view/run this report" }, config: { type: "object", properties: { dateRangeRequired: { type: "boolean", description: "Whether this report requires a date range (defaults to true)" }, paperSize: { type: "string", description: "Paper size for PDF generation (e.g., A4)" }, macroTemplatePath: { type: "string", description: "Path to macro template for custom Excel reports" } }, additionalProperties: !0 } } }, ke = {
43
43
  $schema: xe,
44
44
  title: qe,
45
45
  type: Ue,
46
- additionalProperties: ke
47
- }, je = () => J({
46
+ additionalProperties: Ge
47
+ }, $e = () => J({
48
48
  queryKey: Q.reportsConfig,
49
- queryFn: () => W(oe, $e),
49
+ queryFn: () => z(oe, ke),
50
50
  retry: !1
51
- }), j = Symbol.for("constructDateFrom");
51
+ }), $ = Symbol.for("constructDateFrom");
52
52
  function Z(e, t) {
53
- return typeof e == "function" ? e(t) : e && typeof e == "object" && j in e ? e[j](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
53
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && $ in e ? e[$](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
54
54
  }
55
55
  function ee(e, t) {
56
56
  return Z(e, e);
57
57
  }
58
- function Ge(e, t, s) {
58
+ function je(e, t, s) {
59
59
  const d = ee(e);
60
60
  return isNaN(t) ? Z(e, NaN) : (d.setDate(d.getDate() + t), d);
61
61
  }
62
- function ze(e, t) {
62
+ function We(e, t) {
63
63
  const s = ee(e);
64
64
  return s.setDate(1), s.setHours(0, 0, 0, 0), s;
65
65
  }
66
- function We(e, t, s) {
67
- return Ge(e, -6);
66
+ function ze(e, t, s) {
67
+ return je(e, -6);
68
68
  }
69
69
  const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
70
70
  (s) => Xe(t, s.requiredPrivilege)
@@ -77,9 +77,9 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
77
77
  const t = /* @__PURE__ */ new Date();
78
78
  switch (e) {
79
79
  case "THIS_MONTH":
80
- return [ze(t), t];
81
- case "LAST_7_DAYS":
82
80
  return [We(t), t];
81
+ case "LAST_7_DAYS":
82
+ return [ze(t), t];
83
83
  default:
84
84
  return [new Date(t), new Date(t)];
85
85
  }
@@ -445,7 +445,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
445
445
  /* @__PURE__ */ a(x, { kind: "primary", onClick: P, children: i("REPORTS_APPLY_BUTTON") })
446
446
  ] })
447
447
  ] });
448
- }, G = {
448
+ }, j = {
449
449
  startDate: null,
450
450
  endDate: null,
451
451
  format: null,
@@ -455,7 +455,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
455
455
  data: n,
456
456
  isLoading: _,
457
457
  error: R
458
- } = je(), { data: u } = Ye();
458
+ } = $e(), { data: u } = Ye();
459
459
  V(() => {
460
460
  R && d({
461
461
  title: e("REPORTS_ERROR_TITLE"),
@@ -463,7 +463,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
463
463
  type: "error"
464
464
  });
465
465
  }, [R, d, e]);
466
- const [f, p] = A(null), [P, i] = A(null), [r, O] = A(null), [S, h] = A(null), [o, l] = A(G), c = y(() => n ? Ke(
466
+ const [f, p] = A(null), [P, i] = A(null), [r, O] = A(null), [S, h] = A(null), [o, l] = A(j), c = y(() => n ? Ke(
467
467
  et(n),
468
468
  t
469
469
  ) : [], [n, t]), D = y(
@@ -480,7 +480,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
480
480
  version: v.version + 1
481
481
  }));
482
482
  }, ne = () => {
483
- p(null), i(null), O(null), h(null), l((v) => ({ ...G, version: v.version + 1 }));
483
+ p(null), i(null), O(null), h(null), l((v) => ({ ...j, version: v.version + 1 }));
484
484
  };
485
485
  return _ || s ? /* @__PURE__ */ a(
486
486
  me,
@@ -563,17 +563,17 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
563
563
  }, Pt = "ReportsPage-module_page__ewRXe", gt = "ReportsPage-module_panel__HFBCt", B = {
564
564
  page: Pt,
565
565
  panel: gt
566
- }, z = 1, At = 0, yt = () => {
566
+ }, W = 1, At = 0, yt = () => {
567
567
  const { t: e } = b(), t = Ce(), s = be(), d = y(
568
568
  () => [
569
569
  { id: "home", label: e("REPORTS_HOME_LABEL"), href: Se },
570
570
  { id: "reports", label: e("REPORTS_LABEL"), isCurrentPage: !0 }
571
571
  ],
572
572
  [e]
573
- ), n = t.pathname === U ? z : At, _ = K(
573
+ ), n = t.pathname === U ? W : At, _ = K(
574
574
  ({ selectedIndex: R }) => {
575
575
  s(
576
- R === z ? U : fe
576
+ R === W ? U : fe
577
577
  );
578
578
  },
579
579
  [s]
@@ -612,7 +612,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
612
612
  "aria-label": e("REPORTS_TAB_LIST_ARIA_LABEL"),
613
613
  children: [
614
614
  /* @__PURE__ */ a(
615
- k,
615
+ G,
616
616
  {
617
617
  id: "reports-tab",
618
618
  "data-testid": "reports-tab-test-id",
@@ -621,7 +621,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
621
621
  }
622
622
  ),
623
623
  /* @__PURE__ */ a(
624
- k,
624
+ G,
625
625
  {
626
626
  id: "my-reports-tab",
627
627
  "data-testid": "my-reports-tab-test-id",
@@ -634,7 +634,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
634
634
  ),
635
635
  /* @__PURE__ */ m(Ae, { children: [
636
636
  /* @__PURE__ */ a(
637
- $,
637
+ k,
638
638
  {
639
639
  id: "reports-tab-panel",
640
640
  "data-testid": "reports-tab-panel-test-id",
@@ -644,7 +644,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
644
644
  }
645
645
  ),
646
646
  /* @__PURE__ */ a(
647
- $,
647
+ k,
648
648
  {
649
649
  id: "my-reports-tab-panel",
650
650
  "data-testid": "my-reports-tab-panel-test-id",
@@ -1,4 +1,4 @@
1
- import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-CSBzaxP9.js";
1
+ import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-g9wj_kf9.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {