@bahmni/appointments-app 0.0.1-dev.274 → 0.0.1-dev.275

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,12 +1,12 @@
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-Dqp33OCf.js";
1
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
+ import { N as V, w as h, a as C, z as O, D as P, h as B, F as G, Y as L, G as x, H as U, I as q, J as F, K as w, M as Y, O as $, P as k } from "./index-DsIJbVEt.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as j, useQuery as K } from "@tanstack/react-query";
5
- const Q = V(
4
+ import { useQueryClient as H, useQuery as K } from "@tanstack/react-query";
5
+ const j = V(
6
6
  h,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), W = ({
9
+ ), Q = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -36,7 +36,7 @@ const Q = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
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
+ ], W = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", Z = "index-module_noPrivilegeContainer__Pu5WZ", X = "index-module_table__GAPmb", d = {
40
40
  page: J,
41
41
  noPrivilegeContainer: Z,
42
42
  table: X
@@ -75,28 +75,28 @@ function ae(e, a) {
75
75
  }));
76
76
  }
77
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
+ const { t: e } = C(), a = H(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: i } = j(), [E, c] = I(null), [M, u] = I(!1), l = i?.serviceTableFields ?? [
79
79
  ...p
80
- ], m = L(s, z), v = L(
80
+ ], m = L(s, z), b = L(
81
81
  s,
82
- Y
82
+ W
83
83
  ), S = _(
84
84
  () => ee(l),
85
85
  [l]
86
- ), { data: A, isLoading: M, isError: D } = K({
86
+ ), { data: A, isLoading: v, isError: D } = K({
87
87
  queryKey: ["allAppointmentServices"],
88
- queryFn: G,
88
+ queryFn: x,
89
89
  enabled: m
90
- }), R = _(
90
+ }), N = _(
91
91
  () => te(l, e),
92
92
  [l]
93
- ), N = _(
93
+ ), R = _(
94
94
  () => ae(A ?? [], S),
95
95
  [A, S]
96
96
  ), g = async () => {
97
97
  u(!0);
98
98
  try {
99
- await H(E.id), t({
99
+ await k(E.id), t({
100
100
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
101
101
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
102
102
  type: "success",
@@ -112,26 +112,26 @@ const le = () => {
112
112
  u(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
115
- k,
115
+ Y,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
119
119
  "aria-label": `delete-service-${r.id}-btn-aria-label`,
120
120
  kind: "ghost",
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
- disabled: !v,
122
+ disabled: !b,
123
123
  onClick: () => c(r),
124
- children: /* @__PURE__ */ n(w, {})
124
+ children: /* @__PURE__ */ n($, {})
125
125
  }
126
- ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
- { id: "home", label: e("BREADCRUMB_HOME"), href: q },
126
+ ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", y = [
127
+ { id: "home", label: e("BREADCRUMB_HOME"), href: U },
128
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
129
129
  ];
130
130
  return /* @__PURE__ */ n(
131
- U,
131
+ q,
132
132
  {
133
- header: /* @__PURE__ */ n($, { breadcrumbItems: f }),
134
- main: m ? /* @__PURE__ */ y(
133
+ header: /* @__PURE__ */ n(w, { breadcrumbItems: y }),
134
+ main: m ? /* @__PURE__ */ f(
135
135
  "div",
136
136
  {
137
137
  id: "all-appointment-service-page",
@@ -144,10 +144,10 @@ const le = () => {
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
147
- headers: R,
148
- rows: N,
147
+ headers: N,
148
+ rows: R,
149
149
  ariaLabel: "all-services-table",
150
- loading: M,
150
+ loading: v,
151
151
  errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
152
152
  emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
153
153
  renderCell: T,
@@ -155,10 +155,10 @@ const le = () => {
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ n(
158
- W,
158
+ Q,
159
159
  {
160
160
  serviceName: E.name,
161
- isDeleting: b,
161
+ isDeleting: M,
162
162
  onConfirm: g,
163
163
  onCancel: () => c(null)
164
164
  }
@@ -1,20 +1,20 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { P as f, U as B, V as O, W as V, Z as X, $ as ee, _ as te, a0 as ie, D as ae, a1 as ne, a as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as $, x as oe, h as de, B as q, ad as ce, E as me, ae as Ae, af as Ie, ag as ue, H as _e, I as Te } from "./index-Dqp33OCf.js";
2
+ import { Q as f, S as B, U as O, W as V, X as z, $ as ee, Z as te, a0 as ie, G as ae, a1 as ne, a as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as $, F as oe, h as de, Y as q, ad as ce, H as me, ae as Ae, af as Ie, ag as ue, J as _e, K as Te } from "./index-DsIJbVEt.js";
3
3
  import { useState as g, useMemo as N, useEffect as h, useRef as Le, useCallback as U } from "react";
4
4
  import { useQuery as M, useQueryClient as ve } from "@tanstack/react-query";
5
5
  const Ne = "Available for appointments", w = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", be = () => {
6
6
  try {
7
- return X().uuid;
7
+ return z().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
11
11
  }, H = (e) => ({
12
12
  id: "",
13
13
  text: e
14
- }), De = (e) => ({
14
+ }), ye = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
- }), ye = (e, a) => {
17
+ }), De = (e, a) => {
18
18
  const n = e.map((t) => ({
19
19
  id: t.uuid,
20
20
  text: t.name,
@@ -173,7 +173,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
173
173
  ),
174
174
  [A]
175
175
  ), u = N(
176
- () => R(!1, !1, o, De, {
176
+ () => R(!1, !1, o, ye, {
177
177
  loading: "",
178
178
  error: "",
179
179
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
@@ -183,7 +183,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
183
183
  () => R(
184
184
  !1,
185
185
  !1,
186
- ye(
186
+ De(
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
@@ -195,7 +195,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
195
195
  }
196
196
  ),
197
197
  [_]
198
- ), D = N(
198
+ ), y = N(
199
199
  () => R(
200
200
  !1,
201
201
  !1,
@@ -215,10 +215,10 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
215
215
  return h(() => {
216
216
  if (o.length === 0) return;
217
217
  const i = be(), p = o.some(
218
- (y) => y.uuid === i
218
+ (D) => D.uuid === i
219
219
  );
220
- s((y) => ({
221
- ...y,
220
+ s((D) => ({
221
+ ...D,
222
222
  locationUuid: p ? i : ""
223
223
  }));
224
224
  }, [o]), h(() => {
@@ -229,9 +229,9 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
229
229
  }, [v]), h(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
- selectedProviderItems: D
232
+ selectedProviderItems: y
233
233
  }));
234
- }, [D]), a.current = {
234
+ }, [y]), a.current = {
235
235
  ...l,
236
236
  filteredServicesCount: _.length,
237
237
  availableProvidersCount: I.length
@@ -484,7 +484,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
484
484
  "data-testid": "provider-multiselect",
485
485
  titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
486
486
  placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
487
- items: D,
487
+ items: y,
488
488
  itemToString: (i) => i?.text ?? "",
489
489
  selectedItems: l.selectedProviderItems,
490
490
  onChange: (i) => s({
@@ -510,7 +510,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
510
510
  ), I = q(n, [
511
511
  pe,
512
512
  w
513
- ]), { data: u, isLoading: v, isError: D } = M({
513
+ ]), { data: u, isLoading: v, isError: y } = M({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -537,7 +537,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
537
537
  key: "providerName",
538
538
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
539
539
  }
540
- ], [e]), y = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), S = U(
540
+ ], [e]), D = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), S = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -566,13 +566,13 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
566
566
  s(T), !(Object.keys(T).length > 0) && await S(fe(m.current, e));
567
567
  }, [e, S]), W = U(
568
568
  (T) => {
569
- s((J) => {
570
- const P = { ...J };
569
+ s((X) => {
570
+ const P = { ...X };
571
571
  return T.forEach((Z) => delete P[Z]), P;
572
572
  });
573
573
  },
574
574
  []
575
- ), z = U(() => {
575
+ ), J = U(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -595,10 +595,10 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
595
595
  "aria-label": "appointment-unavailability-actions-table-aria-label",
596
596
  title: e("ADMIN_UNAVAILABILITY_TITLE"),
597
597
  headers: p,
598
- rows: y,
598
+ rows: D,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
- errorStateMessage: D ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
601
+ errorStateMessage: y ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
602
602
  emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
603
603
  actionButton: !o && I ? {
604
604
  label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
@@ -619,7 +619,7 @@ const Ne = "Available for appointments", w = "Get Appointment Unavailability", p
619
619
  onPrimaryButtonClick: j,
620
620
  isPrimaryButtonDisabled: A,
621
621
  secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
622
- onSecondaryButtonClick: z,
622
+ onSecondaryButtonClick: J,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
625
  ke,