@bahmni/appointments-app 0.0.1-dev.270 → 0.0.1-dev.271

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,6 +1,7 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
- import { r as V, t as h, a as C, v as O, x as P, f as B, h as G, B as x, D as A, b as U, E as q, F, H as w, I as $, N as k, L as H, O as j, P as K } from "./index-U58J_2Iy.js";
1
+ import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
+ import { p as V, q as h, a as C, r as O, v as P, h as B, x, B as L, D as G, E as q, F as U, H as F, I as $, L as k, N as w, O as H } from "./index-DIOplafV.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
+ import { useQueryClient as j, useQuery as K } from "@tanstack/react-query";
4
5
  const Q = V(
5
6
  h,
6
7
  "useAppointmentsConfig",
@@ -35,10 +36,10 @@ const Q = V(
35
36
  "speciality",
36
37
  "durationMins",
37
38
  "description"
38
- ], Y = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "_page_10v94_1", X = "_noPrivilegeContainer_10v94_1", Z = "_table_10v94_18", d = {
39
+ ], Y = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", Z = "index-module_noPrivilegeContainer__Pu5WZ", X = "index-module_table__GAPmb", d = {
39
40
  page: J,
40
- noPrivilegeContainer: X,
41
- table: Z
41
+ noPrivilegeContainer: Z,
42
+ table: X
42
43
  };
43
44
  function ee(e) {
44
45
  return e.filter((a) => !p.includes(a));
@@ -73,29 +74,29 @@ function ae(e, a) {
73
74
  )
74
75
  }));
75
76
  }
76
- const re = () => {
77
- const { t: e } = C(), a = B(), { addNotification: t } = G(), { userPrivileges: s } = x(), { appointmentsConfig: i } = Q(), [E, c] = I(null), [v, S] = I(!1), l = i?.serviceTableFields ?? [
77
+ const le = () => {
78
+ const { t: e } = C(), a = j(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: i } = Q(), [E, c] = I(null), [b, u] = I(!1), l = i?.serviceTableFields ?? [
78
79
  ...p
79
- ], u = A(s, z), M = A(
80
+ ], m = L(s, z), v = L(
80
81
  s,
81
82
  Y
82
- ), m = _(
83
+ ), S = _(
83
84
  () => ee(l),
84
85
  [l]
85
- ), { data: L, isLoading: b, isError: D } = U({
86
+ ), { data: A, isLoading: M, isError: D } = K({
86
87
  queryKey: ["allAppointmentServices"],
87
- queryFn: K,
88
- enabled: u
89
- }), N = _(
88
+ queryFn: G,
89
+ enabled: m
90
+ }), R = _(
90
91
  () => te(l, e),
91
92
  [l]
92
- ), R = _(
93
- () => ae(L ?? [], m),
94
- [L, m]
93
+ ), N = _(
94
+ () => ae(A ?? [], S),
95
+ [A, S]
95
96
  ), g = async () => {
96
- S(!0);
97
+ u(!0);
97
98
  try {
98
- await j(E.id), t({
99
+ await H(E.id), t({
99
100
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
100
101
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
101
102
  type: "success",
@@ -108,7 +109,7 @@ const re = () => {
108
109
  type: "error"
109
110
  });
110
111
  } finally {
111
- S(!1);
112
+ u(!1);
112
113
  }
113
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
114
115
  k,
@@ -118,19 +119,19 @@ const re = () => {
118
119
  "aria-label": `delete-service-${r.id}-btn-aria-label`,
119
120
  kind: "ghost",
120
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
121
- disabled: !M,
122
+ disabled: !v,
122
123
  onClick: () => c(r),
123
- children: /* @__PURE__ */ n(H, {})
124
+ children: /* @__PURE__ */ n(w, {})
124
125
  }
125
- ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", y = [
126
+ ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
126
127
  { id: "home", label: e("BREADCRUMB_HOME"), href: q },
127
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
128
129
  ];
129
130
  return /* @__PURE__ */ n(
130
- F,
131
+ U,
131
132
  {
132
- header: /* @__PURE__ */ n($, { breadcrumbItems: y }),
133
- main: u ? /* @__PURE__ */ f(
133
+ header: /* @__PURE__ */ n($, { breadcrumbItems: f }),
134
+ main: m ? /* @__PURE__ */ y(
134
135
  "div",
135
136
  {
136
137
  id: "all-appointment-service-page",
@@ -139,14 +140,14 @@ const re = () => {
139
140
  className: d.page,
140
141
  children: [
141
142
  /* @__PURE__ */ n(
142
- w,
143
+ F,
143
144
  {
144
145
  id: "all-services",
145
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
146
- headers: N,
147
- rows: R,
147
+ headers: R,
148
+ rows: N,
148
149
  ariaLabel: "all-services-table",
149
- loading: b,
150
+ loading: M,
150
151
  errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
151
152
  emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
152
153
  renderCell: T,
@@ -157,7 +158,7 @@ const re = () => {
157
158
  W,
158
159
  {
159
160
  serviceName: E.name,
160
- isDeleting: v,
161
+ isDeleting: b,
161
162
  onConfirm: g,
162
163
  onCancel: () => c(null)
163
164
  }
@@ -178,5 +179,5 @@ const re = () => {
178
179
  );
179
180
  };
180
181
  export {
181
- re as default
182
+ le as default
182
183
  };