@bahmni/appointments-app 0.0.1-dev.409 → 0.0.1-dev.411

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
1
  import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import { H as V, I as O, u as C, J as P, K as h, z as B, a as x, N as L, O as G, _ as U, R as q, T as F, U as H, W as $, Z as k, $ as K, a0 as W } from "./index-DqgfD6Rf.js";
3
- import { useState as I, useMemo as c } from "react";
4
- import { useQueryClient as j, useQuery as w } from "@tanstack/react-query";
5
- const z = V(
2
+ import { K as V, L as O, u as C, M as P, O as h, z as B, e as x, Q as L, R as G, T as U, U as F, W as q, X as $, Z as k, $ as z, a0 as H, a1 as K } from "./index-CIvsd-ae.js";
3
+ import { useState as I, useMemo as _ } from "react";
4
+ import { useQueryClient as Q, useQuery as W } from "@tanstack/react-query";
5
+ const j = V(
6
6
  O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), Q = ({
9
+ ), w = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -36,9 +36,9 @@ const z = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
- page: J,
41
- noPrivilegeContainer: X,
39
+ ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", X = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
+ page: X,
41
+ noPrivilegeContainer: J,
42
42
  table: ee
43
43
  };
44
44
  function te(e) {
@@ -75,33 +75,33 @@ function ie(e, a) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), a = j(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: n } = z(), [E, _] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = C(), a = Q(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: n } = j(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
80
  ], m = L(s, Z), M = L(
81
81
  s,
82
82
  Y
83
- ), S = c(
83
+ ), S = _(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: R } = w({
86
+ ), { data: A, isLoading: v, isError: R } = W({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: G,
89
89
  enabled: m
90
- }), D = c(
90
+ }), D = _(
91
91
  () => ae(l, e),
92
92
  [l]
93
- ), N = c(
93
+ ), N = _(
94
94
  () => ie(A ?? [], S),
95
95
  [A, S]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await W(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",
103
103
  timeout: 5e3
104
- }), _(null), a.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"),
@@ -112,7 +112,7 @@ const oe = () => {
112
112
  p(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
- k,
115
+ z,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -120,17 +120,17 @@ const oe = () => {
120
120
  kind: "ghost",
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
122
  disabled: !M,
123
- onClick: () => _(r),
124
- children: /* @__PURE__ */ i(K, {})
123
+ onClick: () => c(r),
124
+ children: /* @__PURE__ */ i(H, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
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__ */ i(
131
- q,
131
+ F,
132
132
  {
133
- header: /* @__PURE__ */ i(H, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i($, {}) }),
133
+ header: /* @__PURE__ */ i($, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(k, {}) }),
134
134
  main: m ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
@@ -140,7 +140,7 @@ const oe = () => {
140
140
  className: d.page,
141
141
  children: [
142
142
  /* @__PURE__ */ i(
143
- F,
143
+ q,
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
@@ -155,12 +155,12 @@ const oe = () => {
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ i(
158
- Q,
158
+ w,
159
159
  {
160
160
  serviceName: E.name,
161
161
  isDeleting: b,
162
162
  onConfirm: g,
163
- onCancel: () => _(null)
163
+ onCancel: () => c(null)
164
164
  }
165
165
  )
166
166
  ]
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
- import { a1 as f, a2 as B, a3 as P, a4 as V, a5 as J, a6 as ee, a7 as te, a8 as ie, O as ae, a9 as ne, u as Q, aa as R, ab as le, ac as re, ad as se, ae as E, af as F, ag as C, ah as Y, ai as x, aj as k, ak as $, a as oe, z as de, N as q, al as ce, _ as me, am as Ae, an as Ie, ao as ue, T as _e, U as Te, W as Le } from "./index-DqgfD6Rf.js";
3
- import { useState as g, useMemo as N, useEffect as S, useRef as ve, useCallback as U } from "react";
2
+ import { a2 as f, a3 as O, a4 as P, a5 as V, a6 as J, a7 as ee, a8 as te, a9 as ie, R as ae, aa as ne, u as Q, ab as R, ac as le, ad as re, ae as se, af as E, ag as F, ah as C, ai as Y, aj as x, ak as k, al as $, e as oe, z as de, Q as q, am as ce, T as me, an as Ae, ao as Ie, ap as ue, W as _e, X as Te, Z as Le } from "./index-CIvsd-ae.js";
3
+ import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as U } from "react";
4
4
  import { useQuery as M, useQueryClient as Ne } from "@tanstack/react-query";
5
5
  const be = "Available for appointments", G = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", ye = () => {
6
6
  try {
@@ -47,9 +47,9 @@ const be = "Available for appointments", G = "Get Appointment Unavailability", p
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 = B(
50
+ const o = O(
51
51
  `${e.startTime} ${e.startTimePeriod}`
52
- ), c = B(
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"));
@@ -82,11 +82,11 @@ const be = "Available for appointments", G = "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", G = "Get Appointment Unavailability", p
108
108
  const u = await ie(
109
109
  w
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 === w)
@@ -137,9 +137,9 @@ const be = "Available for appointments", G = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, Oe = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", xe = "UnavailabilityForm-module_datePicker__6HgbO", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
- formContent: Oe,
142
- formField: Be,
140
+ }, Be = "UnavailabilityForm-module_formContent__WmNHR", Oe = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", xe = "UnavailabilityForm-module_datePicker__6HgbO", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
+ formContent: Be,
142
+ formField: Oe,
143
143
  loading: Pe,
144
144
  error: Ve,
145
145
  grid: Fe,
@@ -152,7 +152,7 @@ const be = "Available for appointments", G = "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: [],
@@ -212,7 +212,7 @@ const be = "Available for appointments", G = "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 = ye(), b = o.some(
218
218
  (D) => D.uuid === i
@@ -221,12 +221,12 @@ const be = "Available for appointments", G = "Get Appointment Unavailability", p
221
221
  ...D,
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: y
@@ -537,7 +537,7 @@ const be = "Available for appointments", G = "Get Appointment Unavailability", p
537
537
  key: "providerName",
538
538
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
539
539
  }
540
- ], [e]), D = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), h = U(
540
+ ], [e]), D = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -563,12 +563,12 @@ const be = "Available for appointments", G = "Get Appointment Unavailability", p
563
563
  ), j = U(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]), W = U(
568
568
  (T) => {
569
569
  s((X) => {
570
- const O = { ...X };
571
- return T.forEach((Z) => delete O[Z]), O;
570
+ const B = { ...X };
571
+ return T.forEach((Z) => delete B[Z]), B;
572
572
  });
573
573
  },
574
574
  []