@bahmni/appointments-app 0.0.1-dev.283 → 0.0.1-dev.285

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,14 +1,14 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { G as f, H as P, R as B, T as V, S as X, Z as ee, $ as te, a0 as ie, i 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 k, ab as x, ac as $, o as oe, h as de, g as w, ad as ce, k as me, ae as Ae, af as Ie, ag as ue, p as _e, v as Te } from "./index-B27qCCeI.js";
2
+ import { G as f, J as O, M as P, Q as V, V as z, Y as ee, Z as te, a0 as ie, r 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 w, o as oe, h as de, K as $, ad as ce, s as me, ae as Ae, af as Ie, ag as ue, B as _e, x as Te } from "./index-B9MuWhA2.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", q = "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
- }, H = (e) => ({
11
+ }, K = (e) => ({
12
12
  id: "",
13
13
  text: e
14
14
  }), ye = (e) => ({
@@ -39,17 +39,17 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
39
39
  }, Ee = (e, a) => ({
40
40
  locationUuid: e.locationUuid,
41
41
  startDate: f(e.startDate, a, !1, V).formattedResult,
42
- startTime: B(
42
+ startTime: P(
43
43
  `${e.startTime} ${e.startTimePeriod}`
44
44
  ),
45
45
  endDate: f(e.endDate, a, !1, V).formattedResult,
46
- endTime: B(`${e.endTime} ${e.endTimePeriod}`)
46
+ endTime: P(`${e.endTime} ${e.endTimePeriod}`)
47
47
  }), Ue = (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"));
@@ -62,7 +62,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
62
62
  locationName: e.location.name,
63
63
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
64
64
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
65
- }), K = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
65
+ }), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
66
66
  const n = Ee(
67
67
  {
68
68
  locationUuid: e.locationUuid,
@@ -74,7 +74,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
74
74
  endTimePeriod: e.endTimePeriod
75
75
  },
76
76
  a
77
- ), t = K(e.selectedServiceItems), o = K(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = o.length === e.availableProvidersCount || o.length === 0 ? [void 0] : o;
77
+ ), t = H(e.selectedServiceItems), o = H(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = o.length === e.availableProvidersCount || o.length === 0 ? [void 0] : o;
78
78
  return A.flatMap(
79
79
  (l) => m.map((s) => ({
80
80
  ...n,
@@ -137,17 +137,17 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, Se = "UnavailabilityForm-module_formContent__WmNHR", Oe = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Be = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
140
+ }, Se = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Pe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
141
  formContent: Se,
142
- formField: Oe,
143
- loading: Pe,
144
- error: Be,
142
+ formField: Be,
143
+ loading: Oe,
144
+ error: Pe,
145
145
  grid: Ve,
146
146
  column: Fe,
147
147
  dateTimeColumn: Ce,
148
148
  datePicker: Ye,
149
- timePicker: ke
150
- }, xe = ({
149
+ timePicker: xe
150
+ }, ke = ({
151
151
  errors: e,
152
152
  formDataRef: a,
153
153
  onClearErrors: n
@@ -187,7 +187,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
190
- H,
190
+ K,
191
191
  {
192
192
  loading: "",
193
193
  error: "",
@@ -203,7 +203,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
203
203
  I,
204
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
205
205
  ),
206
- H,
206
+ K,
207
207
  {
208
208
  loading: "",
209
209
  error: "",
@@ -327,7 +327,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
327
327
  }
328
328
  ),
329
329
  /* @__PURE__ */ r(
330
- k,
330
+ x,
331
331
  {
332
332
  id: "start-time",
333
333
  "data-testid": "start-time-input",
@@ -342,7 +342,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
342
342
  use24HourFormat: !1,
343
343
  className: d.timePicker,
344
344
  children: /* @__PURE__ */ b(
345
- x,
345
+ k,
346
346
  {
347
347
  id: "start-time-period",
348
348
  "data-testid": "start-time-period-select",
@@ -402,7 +402,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
402
402
  }
403
403
  ),
404
404
  /* @__PURE__ */ r(
405
- k,
405
+ x,
406
406
  {
407
407
  id: "end-time",
408
408
  "data-testid": "end-time-input",
@@ -417,7 +417,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
417
417
  use24HourFormat: !1,
418
418
  className: d.timePicker,
419
419
  children: /* @__PURE__ */ b(
420
- x,
420
+ k,
421
421
  {
422
422
  id: "end-time-period",
423
423
  "data-testid": "end-time-period-select",
@@ -450,7 +450,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
450
450
  lg: 8,
451
451
  className: d.column,
452
452
  children: /* @__PURE__ */ r(
453
- $,
453
+ w,
454
454
  {
455
455
  id: "service-multiselect",
456
456
  "data-testid": "service-multiselect",
@@ -478,7 +478,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
478
478
  lg: 8,
479
479
  className: d.column,
480
480
  children: /* @__PURE__ */ r(
481
- $,
481
+ w,
482
482
  {
483
483
  id: "provider-multiselect",
484
484
  "data-testid": "provider-multiselect",
@@ -501,13 +501,13 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
501
501
  ]
502
502
  }
503
503
  );
504
- }, $e = "index-module_page__s2h2y", we = {
505
- page: $e
504
+ }, we = "index-module_page__s2h2y", $e = {
505
+ page: we
506
506
  }, Qe = () => {
507
- const { t: e } = Q(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = Le(null), [l, s] = g({}), _ = w(
507
+ const { t: e } = Q(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = Le(null), [l, s] = g({}), _ = $(
508
508
  n,
509
509
  q
510
- ), I = w(n, [
510
+ ), I = $(n, [
511
511
  pe,
512
512
  q
513
513
  ]), { data: u, isLoading: v, isError: y } = M({
@@ -566,9 +566,9 @@ const Ne = "Available for appointments", q = "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((Z) => {
570
- const O = { ...Z };
571
- return T.forEach((z) => delete O[z]), O;
569
+ s((X) => {
570
+ const B = { ...X };
571
+ return T.forEach((Z) => delete B[Z]), B;
572
572
  });
573
573
  },
574
574
  []
@@ -586,7 +586,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
586
586
  id: "appointment-unavailability-page",
587
587
  "data-testid": "appointment-unavailability-page-test-id",
588
588
  "aria-label": "appointment-unavailability-page-aria-label",
589
- className: we.page,
589
+ className: $e.page,
590
590
  children: /* @__PURE__ */ r(
591
591
  _e,
592
592
  {
@@ -622,7 +622,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
622
622
  onSecondaryButtonClick: J,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
- xe,
625
+ ke,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,
@@ -1,20 +1,20 @@
1
1
  import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { s as V, A as O, a as C, d as h, f as P, h as B, o as x, g as L, i as G, k as U, l as q, p as w, v as k, x as F, y as K, D as $ } from "./index-B27qCCeI.js";
2
+ import { X as V, A as h, a as C, k as O, l as P, h as B, o as x, K as L, r as G, s as U, t as q, B as w, x as k, E as F, y as K, C as H } from "./index-B9MuWhA2.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as j, useQuery as H } from "@tanstack/react-query";
4
+ import { useQueryClient as $, useQuery as j } from "@tanstack/react-query";
5
5
  const Q = V(
6
- O,
6
+ h,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
9
  ), W = ({
10
10
  serviceName: e,
11
- isDeleting: i,
11
+ isDeleting: a,
12
12
  onConfirm: t,
13
13
  onCancel: s
14
14
  }) => {
15
- const { t: a } = C();
15
+ const { t: i } = C();
16
16
  return /* @__PURE__ */ n(
17
- h,
17
+ O,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -23,11 +23,11 @@ const Q = V(
23
23
  danger: !0,
24
24
  onRequestClose: s,
25
25
  onRequestSubmit: t,
26
- primaryButtonText: a("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
27
- secondaryButtonText: a("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
28
- primaryButtonDisabled: i,
29
- modalHeading: a("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
30
- children: a("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
26
+ primaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
27
+ secondaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
28
+ primaryButtonDisabled: a,
29
+ modalHeading: i("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
30
+ children: i("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
31
31
  }
32
32
  );
33
33
  }, p = [
@@ -36,29 +36,29 @@ const Q = 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", X = "index-module_table__GAPmb", d = {
40
- page: z,
41
- noPrivilegeContainer: J,
42
- table: X
39
+ ], X = "app:appointments:manageServices", Y = "app:appointments:adminTab", Z = "index-module_page__Gsfbu", z = "index-module_noPrivilegeContainer__Pu5WZ", J = "index-module_table__GAPmb", d = {
40
+ page: Z,
41
+ noPrivilegeContainer: z,
42
+ table: J
43
43
  };
44
44
  function ee(e) {
45
- return e.filter((i) => !p.includes(i));
45
+ return e.filter((a) => !p.includes(a));
46
46
  }
47
- function te(e, i) {
47
+ function te(e, a) {
48
48
  return [
49
49
  ...e.map((t) => ({
50
50
  key: t,
51
- header: i(
51
+ header: a(
52
52
  `ADMIN_ALL_SERVICES_COLUMN_${P(t)}`
53
53
  )
54
54
  })),
55
55
  {
56
56
  key: "actions",
57
- header: i("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
57
+ header: a("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
58
58
  }
59
59
  ];
60
60
  }
61
- function ie(e, i) {
61
+ function ae(e, a) {
62
62
  return e.map((t) => ({
63
63
  id: t.uuid,
64
64
  name: t.name,
@@ -67,41 +67,41 @@ function ie(e, i) {
67
67
  durationMins: t.durationMins,
68
68
  description: t.description,
69
69
  attributes: Object.fromEntries(
70
- i.map((s) => [
70
+ a.map((s) => [
71
71
  s,
72
- t.attributes?.find((a) => a.attributeType === s)?.value ?? null
72
+ t.attributes?.find((i) => i.attributeType === s)?.value ?? null
73
73
  ])
74
74
  )
75
75
  }));
76
76
  }
77
77
  const le = () => {
78
- const { t: e } = C(), i = j(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: a } = Q(), [E, c] = I(null), [M, u] = I(!1), l = a?.serviceTableFields ?? [
78
+ const { t: e } = C(), a = $(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: i } = Q(), [E, c] = I(null), [b, u] = I(!1), l = i?.serviceTableFields ?? [
79
79
  ...p
80
- ], m = L(s, Z), b = L(
80
+ ], m = L(s, Y), M = L(
81
81
  s,
82
- Y
82
+ X
83
83
  ), S = _(
84
84
  () => ee(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: D } = H({
86
+ ), { data: A, isLoading: v, isError: D } = j({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: G,
89
89
  enabled: m
90
90
  }), R = _(
91
91
  () => te(l, e),
92
92
  [l]
93
- ), g = _(
94
- () => ie(A ?? [], S),
93
+ ), N = _(
94
+ () => ae(A ?? [], S),
95
95
  [A, S]
96
- ), N = async () => {
96
+ ), g = async () => {
97
97
  u(!0);
98
98
  try {
99
- await $(E.id), t({
99
+ await H(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",
103
103
  timeout: 5e3
104
- }), c(null), i.invalidateQueries({ queryKey: ["allAppointmentServices"] });
104
+ }), c(null), a.invalidateQueries({ queryKey: ["allAppointmentServices"] });
105
105
  } catch {
106
106
  t({
107
107
  title: e("ADMIN_ALL_SERVICES_DELETE_ERROR_TITLE"),
@@ -119,7 +119,7 @@ const le = () => {
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: !b,
122
+ disabled: !M,
123
123
  onClick: () => c(r),
124
124
  children: /* @__PURE__ */ n(K, {})
125
125
  }
@@ -145,7 +145,7 @@ const le = () => {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
147
147
  headers: R,
148
- rows: g,
148
+ rows: N,
149
149
  ariaLabel: "all-services-table",
150
150
  loading: v,
151
151
  errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
@@ -158,8 +158,8 @@ const le = () => {
158
158
  W,
159
159
  {
160
160
  serviceName: E.name,
161
- isDeleting: M,
162
- onConfirm: N,
161
+ isDeleting: b,
162
+ onConfirm: g,
163
163
  onCancel: () => c(null)
164
164
  }
165
165
  )