@bahmni/home-app 0.0.1-dev.378 → 0.0.1-dev.380
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.
- package/dist/App.d.ts.map +1 -1
- package/dist/{DocumentsTable-BxoN1tm3-DyNJIM0F.js → DocumentsTable-HfGisLvD-BATt5uV9.js} +13 -13
- package/dist/{FormsTable-BRkhLCbt-BO2c0h6i.js → FormsTable-DKPMJeXX-Brn3kiuk.js} +63 -63
- package/dist/{LNWAZHJI-D37ABNYG.js → LNWAZHJI-LpdCosgu.js} +2 -2
- package/dist/{MWZ6AO7Z-x_gwjqzI.js → MWZ6AO7Z-B74vx-rW.js} +2 -2
- package/dist/{Observations-CncAOESt-Cu9puzm2.js → Observations-DdMzfzAg-CTmVBmot.js} +57 -57
- package/dist/{YPM2AS64-DiBaM0OF.js → YPM2AS64-BZsW-6Ci.js} +1 -1
- package/dist/components/HomePageHeader/HomePageHeader.d.ts.map +1 -1
- package/dist/constants/app.d.ts +0 -2
- package/dist/constants/app.d.ts.map +1 -1
- package/dist/index-BOrC-IKV.js +108 -0
- package/dist/{index-B2ApUh6V.js → index-GASoF6qD.js} +42559 -41999
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +8 -6
- package/dist/locales/locale_es.json +8 -6
- package/package.json +1 -1
- package/dist/components/UserProfileMenu/UserProfileMenu.d.ts +0 -3
- package/dist/components/UserProfileMenu/UserProfileMenu.d.ts.map +0 -1
- package/dist/components/UserProfileMenu/index.d.ts +0 -2
- package/dist/components/UserProfileMenu/index.d.ts.map +0 -1
- package/dist/index-CqqvqAq9.js +0 -10135
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { u as m, D as b, E as y, F as H, I as N, J as P, $ as E, O as v, P as G, Q as T, R as f, T as S, S as O } from "./index-GASoF6qD.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { useQuery as C } from "@tanstack/react-query";
|
|
5
|
+
const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "AppTile-module_bottom__lcJiG", d = {
|
|
6
|
+
tile: L,
|
|
7
|
+
label: B,
|
|
8
|
+
bottom: A
|
|
9
|
+
}, F = ({ id: r, label: n, icon: s, url: l }) => {
|
|
10
|
+
const { t } = m(), i = t(n);
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
|
+
b,
|
|
13
|
+
{
|
|
14
|
+
href: l,
|
|
15
|
+
className: d.tile,
|
|
16
|
+
"aria-label": i,
|
|
17
|
+
testId: `app-tile-${r}`,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e("h2", { className: d.label, "aria-hidden": "true", children: i }),
|
|
20
|
+
/* @__PURE__ */ c("div", { className: d.bottom, children: [
|
|
21
|
+
/* @__PURE__ */ e(y, { name: s, id: r, size: H.X2, "aria-hidden": "true" }),
|
|
22
|
+
/* @__PURE__ */ e(N, { size: 20, "aria-hidden": "true" })
|
|
23
|
+
] })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}, M = "HomePageGrid-module_container__Kxfim", $ = "HomePageGrid-module_tileGrid__X6-Bm", k = "HomePageGrid-module_skeletonTile__U-1vu", x = "HomePageGrid-module_emptyState__xEwoK", D = "HomePageGrid-module_errorContainer__IKR3E", o = {
|
|
28
|
+
container: M,
|
|
29
|
+
tileGrid: $,
|
|
30
|
+
skeletonTile: k,
|
|
31
|
+
emptyState: x,
|
|
32
|
+
errorContainer: D
|
|
33
|
+
}, I = () => {
|
|
34
|
+
const { t: r } = m(), {
|
|
35
|
+
userPrivileges: n,
|
|
36
|
+
isLoading: s,
|
|
37
|
+
error: l
|
|
38
|
+
} = P(), t = n?.map((a) => a.name) ?? null, {
|
|
39
|
+
data: i = [],
|
|
40
|
+
isLoading: _,
|
|
41
|
+
isError: u,
|
|
42
|
+
refetch: h
|
|
43
|
+
} = C({
|
|
44
|
+
queryKey: ["home-modules", t],
|
|
45
|
+
queryFn: () => E("org.bahmni.home.dashboard", t),
|
|
46
|
+
enabled: !s && l === null && t !== null
|
|
47
|
+
});
|
|
48
|
+
return s || _ || t === null && !l ? /* @__PURE__ */ e(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: o.container,
|
|
52
|
+
role: "status",
|
|
53
|
+
"aria-label": r("HOME_LOADING_MODULES"),
|
|
54
|
+
"aria-busy": "true",
|
|
55
|
+
children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: Array.from(
|
|
56
|
+
{ length: v },
|
|
57
|
+
(a, g) => `skeleton-${g}`
|
|
58
|
+
).map((a) => /* @__PURE__ */ e(G, { className: o.skeletonTile }, a)) })
|
|
59
|
+
}
|
|
60
|
+
) : l || u ? /* @__PURE__ */ e(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: o.errorContainer,
|
|
64
|
+
"data-testid": "home-error",
|
|
65
|
+
role: "alert",
|
|
66
|
+
children: /* @__PURE__ */ e(
|
|
67
|
+
T,
|
|
68
|
+
{
|
|
69
|
+
kind: "error",
|
|
70
|
+
lowContrast: !0,
|
|
71
|
+
subtitle: r("HOME_ERROR_FETCH_CONFIG"),
|
|
72
|
+
hideCloseButton: !1,
|
|
73
|
+
onClose: () => void h()
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
) : i.length === 0 ? /* @__PURE__ */ e("div", { className: o.emptyState, role: "status", children: r("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: o.container, children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
|
|
78
|
+
F,
|
|
79
|
+
{
|
|
80
|
+
id: a.id,
|
|
81
|
+
label: a.translationKey ?? a.label,
|
|
82
|
+
icon: a.icon,
|
|
83
|
+
url: a.url
|
|
84
|
+
},
|
|
85
|
+
a.id
|
|
86
|
+
)) }) });
|
|
87
|
+
}, K = "HomePageHeader-module_locationSelector__foYmn", R = {
|
|
88
|
+
locationSelector: K
|
|
89
|
+
}, U = () => /* @__PURE__ */ e(
|
|
90
|
+
f,
|
|
91
|
+
{
|
|
92
|
+
ariaLabel: "Bahmni",
|
|
93
|
+
brandPrefix: "Home",
|
|
94
|
+
brandHref: "/",
|
|
95
|
+
globalFeatures: [
|
|
96
|
+
/* @__PURE__ */ e("div", { className: R.locationSelector, children: /* @__PURE__ */ e(O, {}) }, "location")
|
|
97
|
+
],
|
|
98
|
+
userMenu: /* @__PURE__ */ e(S, {})
|
|
99
|
+
}
|
|
100
|
+
), j = "HomePage-module_homePageBody__0qtrS", q = {
|
|
101
|
+
homePageBody: j
|
|
102
|
+
}, X = () => /* @__PURE__ */ c(p, { children: [
|
|
103
|
+
/* @__PURE__ */ e(U, {}),
|
|
104
|
+
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(I, {}) })
|
|
105
|
+
] });
|
|
106
|
+
export {
|
|
107
|
+
X as HomePage
|
|
108
|
+
};
|