@bahmni/appointments-app 0.0.1-dev.185 → 0.0.1-dev.187

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.
Files changed (42) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/{DocumentsTable-8I-Vd16r-D7OejRTq.js → DocumentsTable-DoINW90B-D2G4cySo.js} +2189 -2078
  3. package/dist/{FormsTable-BolXVuK_-BgiYYu8o.js → FormsTable-BFC5-_VV-CWTW1cuR.js} +89 -89
  4. package/dist/{LNWAZHJI-DtGAaLKa.js → LNWAZHJI-Bqw-U-zN.js} +2 -2
  5. package/dist/{MWZ6AO7Z-CKJz0pD6.js → MWZ6AO7Z-Dy00P9Ky.js} +2 -2
  6. package/dist/Observations-7ryo-dcA-C1usSYDg.js +170 -0
  7. package/dist/{YPM2AS64-CNFAfFEV.js → YPM2AS64-BjKcrUp9.js} +138 -138
  8. package/dist/constants/app.d.ts +1 -0
  9. package/dist/constants/app.d.ts.map +1 -1
  10. package/dist/{index-Dxc52lRE.js → index-BcyBWCkX.js} +49953 -63464
  11. package/dist/index-C8plxqhB.js +94 -0
  12. package/dist/index.css +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/locales/locale_en.json +17 -1
  16. package/dist/locales/locale_es.json +17 -1
  17. package/dist/pages/admin/allServices/__mocks__/mocks.d.ts +3 -0
  18. package/dist/pages/admin/allServices/__mocks__/mocks.d.ts.map +1 -0
  19. package/dist/pages/admin/allServices/constants.d.ts +2 -0
  20. package/dist/pages/admin/allServices/constants.d.ts.map +1 -0
  21. package/dist/pages/admin/allServices/index.d.ts +4 -0
  22. package/dist/pages/admin/allServices/index.d.ts.map +1 -0
  23. package/dist/pages/admin/allServices/model.d.ts +10 -0
  24. package/dist/pages/admin/allServices/model.d.ts.map +1 -0
  25. package/dist/pages/admin/allServices/utils.d.ts +9 -0
  26. package/dist/pages/admin/allServices/utils.d.ts.map +1 -0
  27. package/dist/providers/appointmentsConfig/constants.d.ts +2 -0
  28. package/dist/providers/appointmentsConfig/constants.d.ts.map +1 -0
  29. package/dist/providers/appointmentsConfig/context.d.ts +3 -0
  30. package/dist/providers/appointmentsConfig/context.d.ts.map +1 -0
  31. package/dist/providers/appointmentsConfig/hook.d.ts +3 -0
  32. package/dist/providers/appointmentsConfig/hook.d.ts.map +1 -0
  33. package/dist/providers/appointmentsConfig/index.d.ts +5 -0
  34. package/dist/providers/appointmentsConfig/index.d.ts.map +1 -0
  35. package/dist/providers/appointmentsConfig/models.d.ts +9 -0
  36. package/dist/providers/appointmentsConfig/models.d.ts.map +1 -0
  37. package/dist/providers/appointmentsConfig/provider.d.ts +4 -0
  38. package/dist/providers/appointmentsConfig/provider.d.ts.map +1 -0
  39. package/dist/providers/appointmentsConfig/schema.json.d.ts +19 -0
  40. package/dist/routes/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/Observations-D6R8bXEi-DqXuo3Nk.js +0 -369
@@ -0,0 +1,94 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { z as E, B as C, C as M, u as S, a as f, O as L, D as y, E as N, I as g, M as I } from "./index-BcyBWCkX.js";
3
+ import { useMemo as o } from "react";
4
+ const R = E(
5
+ C,
6
+ "useAppointmentsConfig",
7
+ "AppointmentsConfigProvider"
8
+ ), l = [
9
+ "name",
10
+ "location",
11
+ "speciality",
12
+ "durationMins",
13
+ "description"
14
+ ], D = "_tableContainer_jtyg5_1", h = "_table_jtyg5_1", c = {
15
+ tableContainer: D,
16
+ table: h
17
+ };
18
+ function O(t) {
19
+ return t.filter((n) => !l.includes(n));
20
+ }
21
+ function v(t, n) {
22
+ return [
23
+ ...t.map((e) => ({
24
+ key: e,
25
+ header: n(
26
+ `ADMIN_ALL_SERVICES_COLUMN_${M(e)}`
27
+ )
28
+ })),
29
+ {
30
+ key: "actions",
31
+ header: n("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
32
+ }
33
+ ];
34
+ }
35
+ function T(t, n) {
36
+ return t.map((e) => ({
37
+ id: e.uuid,
38
+ name: e.name,
39
+ location: e.location?.name ?? null,
40
+ speciality: e.speciality?.name ?? null,
41
+ durationMins: e.durationMins,
42
+ description: e.description,
43
+ attributes: Object.fromEntries(
44
+ n.map((a) => [
45
+ a,
46
+ e.attributes?.find((i) => i.attributeType === a)?.value ?? null
47
+ ])
48
+ )
49
+ }));
50
+ }
51
+ const j = () => {
52
+ const { t } = S(), { appointmentsConfig: n } = R(), e = n?.serviceTableFields ?? [
53
+ ...l
54
+ ], a = o(
55
+ () => O(e),
56
+ [e]
57
+ ), { data: i, isLoading: m, isError: p } = f({
58
+ queryKey: ["allAppointmentServices"],
59
+ queryFn: I
60
+ }), d = o(
61
+ () => v(e, t),
62
+ [e]
63
+ ), _ = o(
64
+ () => T(i ?? [], a),
65
+ [i, a]
66
+ ), b = (u, s) => s === "actions" ? null : l.includes(s) ? u[s] ?? "-" : u.attributes[s] ?? "-", A = [
67
+ { id: "home", label: t("BREADCRUMB_HOME"), href: L },
68
+ { id: "admin", label: t("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
69
+ ];
70
+ return /* @__PURE__ */ r(
71
+ y,
72
+ {
73
+ header: /* @__PURE__ */ r(g, { breadcrumbItems: A }),
74
+ main: /* @__PURE__ */ r("div", { className: c.tableContainer, children: /* @__PURE__ */ r(
75
+ N,
76
+ {
77
+ id: "all-services",
78
+ title: t("ADMIN_ALL_SERVICES_TITLE"),
79
+ headers: d,
80
+ rows: _,
81
+ ariaLabel: "all-services-table",
82
+ loading: m,
83
+ errorStateMessage: p ? t("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
84
+ emptyStateMessage: t("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
85
+ renderCell: b,
86
+ className: c.table
87
+ }
88
+ ) })
89
+ }
90
+ );
91
+ };
92
+ export {
93
+ j as default
94
+ };