@bahmni/appointments-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.
@@ -1,10 +1,10 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
- import { $ as f, a0 as P, a1 as O, a2 as V, a3 as J, a4 as ee, a5 as te, a6 as ie, G as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as k, ah as x, ai as $, X as oe, K as de, E as q, aj as ce, M as me, ak as Ae, al as Ie, am as ue, P as _e, R as Te, S as Le } from "./index-36QZ74PH.js";
3
- import { useState as g, useMemo as N, useEffect as S, useRef as ve, useCallback as U } from "react";
2
+ import { $ as f, a0 as O, a1 as P, a2 as V, a3 as X, a4 as ee, a5 as te, a6 as ie, P as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as U, ad as C, ae as F, af as Y, ag as k, ah as x, ai as $, J as oe, Z as de, O as q, aj as ce, Q as me, ak as Ae, al as Ie, am as ue, S as _e, T as Te, U as Le } from "./index-Dj6Y8Rrb.js";
3
+ import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as E } from "react";
4
4
  import { useQuery as D, useQueryClient as Ne } from "@tanstack/react-query";
5
5
  const be = "Available for appointments", w = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", Me = () => {
6
6
  try {
7
- return J().uuid;
7
+ return X().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
@@ -25,7 +25,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
25
25
  text: a,
26
26
  isSelectAll: !0
27
27
  }), n;
28
- }, Ee = (e, a) => {
28
+ }, Ue = (e, a) => {
29
29
  const n = e.map((t) => ({
30
30
  id: t.uuid,
31
31
  text: t.person?.display,
@@ -36,20 +36,20 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
36
36
  text: a,
37
37
  isSelectAll: !0
38
38
  }), n;
39
- }, Ue = (e, a) => ({
39
+ }, Ee = (e, a) => ({
40
40
  locationUuid: e.locationUuid,
41
41
  startDate: f(e.startDate, a, !1, V).formattedResult,
42
- startTime: O(
42
+ startTime: P(
43
43
  `${e.startTime} ${e.startTimePeriod}`
44
44
  ),
45
45
  endDate: f(e.endDate, a, !1, V).formattedResult,
46
- endTime: O(`${e.endTime} ${e.endTimePeriod}`)
46
+ endTime: P(`${e.endTime} ${e.endTimePeriod}`)
47
47
  }), ge = (e, a) => {
48
48
  const n = {}, t = a("ADMIN_UNAVAILABILITY_FORM_REQUIRED");
49
49
  if (e.locationUuid || (n.location = t), e.startDate || (n.startDate = t), e.startTime || (n.startTime = t), e.endDate || (n.endDate = t), e.endTime || (n.endTime = t), e.startDate && e.startTime && e.endDate && e.endTime && e.startDate.toDateString() === e.endDate.toDateString()) {
50
- const o = P(
50
+ const o = O(
51
51
  `${e.startTime} ${e.startTimePeriod}`
52
- ), c = P(
52
+ ), c = O(
53
53
  `${e.endTime} ${e.endTimePeriod}`
54
54
  );
55
55
  o !== null && c !== null && c <= o && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
@@ -63,7 +63,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
63
63
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
64
64
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
65
65
  }), K = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), Re = (e, a) => {
66
- const n = Ue(
66
+ const n = Ee(
67
67
  {
68
68
  locationUuid: e.locationUuid,
69
69
  startDate: e.startDate,
@@ -82,11 +82,11 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
82
82
  providerUuid: s
83
83
  }))
84
84
  );
85
- }, Se = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
+ }, he = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
86
86
  uuid: a.resource?.id ?? "",
87
87
  display: a.resource?.name ?? "",
88
88
  childLocations: []
89
- })), he = () => {
89
+ })), Se = () => {
90
90
  const {
91
91
  data: e,
92
92
  isLoading: a,
@@ -108,7 +108,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
108
108
  const u = await ie(
109
109
  G
110
110
  );
111
- return Se(u);
111
+ return he(u);
112
112
  }
113
113
  return I.filter(
114
114
  (u) => u.tags?.some((v) => v.display === G)
@@ -137,13 +137,13 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, Be = "UnavailabilityForm-module_formContent__WmNHR", Pe = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
140
+ }, Be = "UnavailabilityForm-module_formContent__WmNHR", Oe = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Ce = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
141
  formContent: Be,
142
- formField: Pe,
143
- loading: Oe,
142
+ formField: Oe,
143
+ loading: Pe,
144
144
  error: Ve,
145
- grid: Fe,
146
- column: Ce,
145
+ grid: Ce,
146
+ column: Fe,
147
147
  dateTimeColumn: Ye,
148
148
  datePicker: ke,
149
149
  timePicker: xe
@@ -152,7 +152,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
152
152
  formDataRef: a,
153
153
  onClearErrors: n
154
154
  }) => {
155
- const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = g({
155
+ const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = Se(), [l, s] = g({
156
156
  locationUuid: "",
157
157
  selectedServiceItems: [],
158
158
  selectedProviderItems: [],
@@ -199,7 +199,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
199
199
  () => R(
200
200
  !1,
201
201
  !1,
202
- Ee(
202
+ Ue(
203
203
  I,
204
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
205
205
  ),
@@ -212,7 +212,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
212
212
  ),
213
213
  [I]
214
214
  );
215
- return S(() => {
215
+ return h(() => {
216
216
  if (o.length === 0) return;
217
217
  const i = Me(), b = o.some(
218
218
  (y) => y.uuid === i
@@ -221,12 +221,12 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
221
221
  ...y,
222
222
  locationUuid: b ? i : ""
223
223
  }));
224
- }, [o]), S(() => {
224
+ }, [o]), h(() => {
225
225
  _.length > 0 && s((i) => ({
226
226
  ...i,
227
227
  selectedServiceItems: v
228
228
  }));
229
- }, [v]), S(() => {
229
+ }, [v]), h(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
232
  selectedProviderItems: M
@@ -290,7 +290,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
290
290
  className: d.grid,
291
291
  children: [
292
292
  /* @__PURE__ */ p(
293
- E,
293
+ U,
294
294
  {
295
295
  id: "unavailability-form-start-date-time",
296
296
  "data-testid": "unavailability-form-start-date-time-test-id",
@@ -301,10 +301,10 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
301
301
  className: `${d.column} ${d.dateTimeColumn}`,
302
302
  children: [
303
303
  /* @__PURE__ */ r(
304
- F,
304
+ C,
305
305
  {
306
306
  datePickerType: "single",
307
- minDate: C(),
307
+ minDate: F(),
308
308
  value: l.startDate ?? void 0,
309
309
  onChange: (i) => {
310
310
  i[0] && (n(["startDate", "dateTime"]), s({
@@ -365,7 +365,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
365
365
  }
366
366
  ),
367
367
  /* @__PURE__ */ p(
368
- E,
368
+ U,
369
369
  {
370
370
  id: "unavailability-form-end-date-time",
371
371
  "data-testid": "unavailability-form-end-date-time-test-id",
@@ -376,10 +376,10 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
376
376
  className: `${d.column} ${d.dateTimeColumn}`,
377
377
  children: [
378
378
  /* @__PURE__ */ r(
379
- F,
379
+ C,
380
380
  {
381
381
  datePickerType: "single",
382
- minDate: l.startDate ?? C(),
382
+ minDate: l.startDate ?? F(),
383
383
  value: l.endDate ?? void 0,
384
384
  onChange: (i) => {
385
385
  i[0] && (n(["endDate", "dateTime"]), s({
@@ -440,7 +440,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
440
440
  }
441
441
  ),
442
442
  /* @__PURE__ */ r(
443
- E,
443
+ U,
444
444
  {
445
445
  id: "unavailability-form-service",
446
446
  "data-testid": "unavailability-form-service-test-id",
@@ -468,7 +468,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
468
468
  }
469
469
  ),
470
470
  /* @__PURE__ */ r(
471
- E,
471
+ U,
472
472
  {
473
473
  id: "unavailability-form-provider",
474
474
  "data-testid": "unavailability-form-provider-test-id",
@@ -537,7 +537,7 @@ const be = "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) => fe(T, e)) : [], [u, e]), h = U(
540
+ ], [e]), y = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = E(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -560,19 +560,19 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
560
560
  }
561
561
  },
562
562
  [t, a, e]
563
- ), j = U(async () => {
563
+ ), j = E(async () => {
564
564
  if (!m.current) return;
565
565
  const T = ge(m.current, e);
566
- s(T), !(Object.keys(T).length > 0) && await h(Re(m.current, e));
567
- }, [e, h]), W = U(
566
+ s(T), !(Object.keys(T).length > 0) && await S(Re(m.current, e));
567
+ }, [e, S]), J = E(
568
568
  (T) => {
569
- s((z) => {
570
- const B = { ...z };
571
- return T.forEach((Z) => delete B[Z]), B;
569
+ s((Z) => {
570
+ const B = { ...Z };
571
+ return T.forEach((z) => delete B[z]), B;
572
572
  });
573
573
  },
574
574
  []
575
- ), X = U(() => {
575
+ ), W = E(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -619,14 +619,14 @@ const be = "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: X,
622
+ onSecondaryButtonClick: W,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
625
  $e,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,
629
- onClearErrors: W
629
+ onClearErrors: J
630
630
  }
631
631
  )
632
632
  }
@@ -1,12 +1,12 @@
1
1
  import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import { C as V, D as O, u as C, F as P, L as h, K as B, X as G, E as L, G as x, M as U, O as F, P as q, R as H, S as K, T as k, U as Q, _ as $ } from "./index-36QZ74PH.js";
2
+ import { D as V, E as O, u as C, F as P, I as h, Z as B, J as G, O as L, P as x, Q as U, R as F, S as q, T as k, U as Q, X as $, Y as j, _ as w } from "./index-Dj6Y8Rrb.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as j, useQuery as w } from "@tanstack/react-query";
4
+ import { useQueryClient as H, useQuery as K } from "@tanstack/react-query";
5
5
  const W = V(
6
6
  O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), X = ({
9
+ ), Y = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -36,9 +36,9 @@ const W = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Y = "app:appointments:manageServices", z = "app:appointments:adminTab", Z = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
- page: Z,
41
- noPrivilegeContainer: J,
39
+ ], Z = "app:appointments:manageServices", J = "app:appointments:adminTab", z = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
+ page: z,
41
+ noPrivilegeContainer: X,
42
42
  table: ee
43
43
  };
44
44
  function te(e) {
@@ -75,15 +75,15 @@ function ie(e, a) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), a = j(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = W(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = C(), a = H(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = W(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], S = L(s, z), M = L(
80
+ ], S = L(s, J), M = L(
81
81
  s,
82
- Y
82
+ Z
83
83
  ), m = _(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: D } = w({
86
+ ), { data: A, isLoading: D, isError: v } = K({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
89
  enabled: S
@@ -96,7 +96,7 @@ const oe = () => {
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await $(E.id), t({
99
+ await w(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,7 +112,7 @@ const oe = () => {
112
112
  p(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
- k,
115
+ $,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -121,7 +121,7 @@ const oe = () => {
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
122
  disabled: !M,
123
123
  onClick: () => c(r),
124
- children: /* @__PURE__ */ i(Q, {})
124
+ children: /* @__PURE__ */ i(j, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
127
  { id: "home", label: e("BREADCRUMB_HOME"), href: U },
@@ -130,7 +130,7 @@ const oe = () => {
130
130
  return /* @__PURE__ */ i(
131
131
  F,
132
132
  {
133
- header: /* @__PURE__ */ i(H, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(K, {}) }),
133
+ header: /* @__PURE__ */ i(k, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(Q, {}) }),
134
134
  main: S ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
@@ -147,15 +147,15 @@ const oe = () => {
147
147
  headers: R,
148
148
  rows: N,
149
149
  ariaLabel: "all-services-table",
150
- loading: v,
151
- errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
150
+ loading: D,
151
+ errorStateMessage: v ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
152
152
  emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
153
153
  renderCell: T,
154
154
  className: d.table
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ i(
158
- X,
158
+ Y,
159
159
  {
160
160
  serviceName: E.name,
161
161
  isDeleting: b,