@bahmni/appointments-app 0.0.1-dev.379 → 0.0.1-dev.381

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,20 +1,20 @@
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 Z, 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, I as de, K as q, aj as ce, Q as me, ak as Ae, al as Ie, am as ue, T as _e, U as Te, X as Le } from "./index-BQrlKDpC.js";
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, M 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, D as q, aj as ce, O as me, ak as Ae, al as Ie, am as ue, Q as _e, R as Te, T as Le } from "./index-BzzcvxBx.js";
3
3
  import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as E } from "react";
4
- import { useQuery as D, useQueryClient as Ne } from "@tanstack/react-query";
4
+ import { useQuery as y, 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 Z().uuid;
7
+ return X().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
11
11
  }, H = (e) => ({
12
12
  id: "",
13
13
  text: e
14
- }), ye = (e) => ({
14
+ }), De = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
- }), De = (e, a) => {
17
+ }), ye = (e, a) => {
18
18
  const n = e.map((t) => ({
19
19
  id: t.uuid,
20
20
  text: t.name,
@@ -39,17 +39,17 @@ const be = "Available for appointments", w = "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: 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"));
@@ -91,14 +91,14 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
91
91
  data: e,
92
92
  isLoading: a,
93
93
  isError: n
94
- } = D({
94
+ } = y({
95
95
  queryKey: ["currentUser"],
96
96
  queryFn: ee
97
97
  }), {
98
98
  data: t = [],
99
99
  isLoading: o,
100
100
  isError: c
101
- } = D({
101
+ } = y({
102
102
  queryKey: ["providerLoginLocations", e?.uuid],
103
103
  queryFn: async () => {
104
104
  const I = await te(
@@ -119,14 +119,14 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
119
119
  data: A = [],
120
120
  isLoading: L,
121
121
  isError: m
122
- } = D({
122
+ } = y({
123
123
  queryKey: ["appointmentServices"],
124
124
  queryFn: ae
125
125
  }), {
126
126
  data: l = [],
127
127
  isLoading: s,
128
128
  isError: _
129
- } = D({
129
+ } = y({
130
130
  queryKey: ["providers"],
131
131
  queryFn: ne
132
132
  });
@@ -137,10 +137,10 @@ 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", 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 = {
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
145
  grid: Ce,
146
146
  column: Fe,
@@ -173,7 +173,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
173
173
  ),
174
174
  [A]
175
175
  ), u = N(
176
- () => R(!1, !1, o, ye, {
176
+ () => R(!1, !1, o, De, {
177
177
  loading: "",
178
178
  error: "",
179
179
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
@@ -183,7 +183,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
183
183
  () => R(
184
184
  !1,
185
185
  !1,
186
- De(
186
+ ye(
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
@@ -215,10 +215,10 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
215
215
  return h(() => {
216
216
  if (o.length === 0) return;
217
217
  const i = Me(), b = 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: b ? i : ""
223
223
  }));
224
224
  }, [o]), h(() => {
@@ -510,7 +510,7 @@ const be = "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: M } = D({
513
+ ]), { data: u, isLoading: v, isError: M } = y({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -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]), S = E(
540
+ ], [e]), D = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = E(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -564,15 +564,15 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
564
564
  if (!m.current) return;
565
565
  const T = ge(m.current, e);
566
566
  s(T), !(Object.keys(T).length > 0) && await S(Re(m.current, e));
567
- }, [e, S]), z = E(
567
+ }, [e, S]), J = E(
568
568
  (T) => {
569
- s((W) => {
570
- const B = { ...W };
571
- return T.forEach((X) => delete B[X]), B;
569
+ s((Z) => {
570
+ const B = { ...Z };
571
+ return T.forEach((z) => delete B[z]), B;
572
572
  });
573
573
  },
574
574
  []
575
- ), J = E(() => {
575
+ ), W = E(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -595,7 +595,7 @@ const be = "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: b,
598
- rows: y,
598
+ rows: D,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
601
  errorStateMessage: M ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
@@ -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: J,
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: z
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 { R as V, D as P, u as C, F as O, E as h, I as B, J as G, K as L, P as x, Q as U, S as F, T as q, U as k, X as K, Y as Q, Z as $, _ as j } from "./index-BQrlKDpC.js";
2
+ import { I as V, r as O, u as C, F as P, t as h, Z as B, J as G, D as L, M as x, O as U, P as F, Q as q, R as k, T as Q, U as W, W as $, X as j } from "./index-BzzcvxBx.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
4
  import { useQueryClient as w, useQuery as H } from "@tanstack/react-query";
5
- const W = V(
6
- P,
5
+ const K = V(
6
+ O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), Y = ({
9
+ ), Z = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -14,7 +14,7 @@ const W = V(
14
14
  }) => {
15
15
  const { t: n } = C();
16
16
  return /* @__PURE__ */ i(
17
- O,
17
+ P,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -36,8 +36,8 @@ const W = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
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,
39
+ ], J = "app:appointments:manageServices", Y = "app:appointments:adminTab", z = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
+ page: z,
41
41
  noPrivilegeContainer: X,
42
42
  table: ee
43
43
  };
@@ -75,24 +75,24 @@ function ie(e, a) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), a = w(), { 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 = w(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = K(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], S = L(s, J), M = L(
80
+ ], m = L(s, Y), M = L(
81
81
  s,
82
- z
83
- ), m = _(
82
+ J
83
+ ), S = _(
84
84
  () => te(l),
85
85
  [l]
86
86
  ), { data: A, isLoading: R, isError: v } = H({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
- enabled: S
89
+ enabled: m
90
90
  }), D = _(
91
91
  () => ae(l, e),
92
92
  [l]
93
93
  ), N = _(
94
- () => ie(A ?? [], m),
95
- [A, m]
94
+ () => ie(A ?? [], S),
95
+ [A, S]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
@@ -112,7 +112,7 @@ const oe = () => {
112
112
  p(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
- Q,
115
+ W,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -130,8 +130,8 @@ const oe = () => {
130
130
  return /* @__PURE__ */ i(
131
131
  F,
132
132
  {
133
- header: /* @__PURE__ */ i(k, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(K, {}) }),
134
- main: S ? /* @__PURE__ */ y(
133
+ header: /* @__PURE__ */ i(k, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(Q, {}) }),
134
+ main: m ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
137
137
  id: "all-appointment-service-page",
@@ -155,7 +155,7 @@ const oe = () => {
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ i(
158
- Y,
158
+ Z,
159
159
  {
160
160
  serviceName: E.name,
161
161
  isDeleting: b,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b9 as t } from "./index-BQrlKDpC.js";
1
+ import { b9 as t } from "./index-BzzcvxBx.js";
2
2
  export {
3
3
  t as AppointmentsApp
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/appointments-app",
3
- "version": "0.0.1-dev.379",
3
+ "version": "0.0.1-dev.381",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",