@bahmni/appointments-app 0.0.1-dev.384 → 0.0.1-dev.386

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 B, a1 as O, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, v 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 x, ah as k, ai as $, Q as oe, L as de, t as q, aj as ce, C as me, ak as Ae, al as Ie, am as ue, I as _e, J as Te, T as Le } from "./index-kRAzelzQ.js";
2
+ import { Z as f, a0 as O, a1 as P, a2 as V, a3 as X, a4 as ee, a5 as te, a6 as ie, v 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 F, ae as C, af as Y, ag as x, ah as k, ai as $, Q as oe, L as de, t as q, aj as ce, C as me, ak as Ae, al as Ie, am as ue, H as _e, J as Te, O as Le } from "./index-BYUNYfJ9.js";
3
3
  import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as E } from "react";
4
4
  import { useQuery as M, 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", ye = () => {
6
6
  try {
7
- return Z().uuid;
7
+ return X().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
@@ -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 = 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"));
@@ -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
- }, Pe = "UnavailabilityForm-module_formContent__WmNHR", Be = "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", xe = "UnavailabilityForm-module_datePicker__6HgbO", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
- formContent: Pe,
142
- formField: Be,
143
- loading: Oe,
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
+ loading: Pe,
144
144
  error: Ve,
145
- grid: Ce,
146
- column: Fe,
145
+ grid: Fe,
146
+ column: Ce,
147
147
  dateTimeColumn: Ye,
148
148
  datePicker: xe,
149
149
  timePicker: ke
@@ -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
- C,
304
+ F,
305
305
  {
306
306
  datePickerType: "single",
307
- minDate: F(),
307
+ minDate: C(),
308
308
  value: l.startDate ?? void 0,
309
309
  onChange: (i) => {
310
310
  i[0] && (n(["startDate", "dateTime"]), s({
@@ -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
- C,
379
+ F,
380
380
  {
381
381
  datePickerType: "single",
382
- minDate: l.startDate ?? F(),
382
+ minDate: l.startDate ?? C(),
383
383
  value: l.endDate ?? void 0,
384
384
  onChange: (i) => {
385
385
  i[0] && (n(["endDate", "dateTime"]), s({
@@ -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]), W = E(
568
568
  (T) => {
569
569
  s((J) => {
570
- const P = { ...J };
571
- return T.forEach((X) => delete P[X]), P;
570
+ const B = { ...J };
571
+ return T.forEach((Z) => delete B[Z]), B;
572
572
  });
573
573
  },
574
574
  []
575
- ), W = E(() => {
575
+ ), z = 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: W,
622
+ onSecondaryButtonClick: z,
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: W
630
630
  }
631
631
  )
632
632
  }
@@ -1,9 +1,9 @@
1
1
  import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { U as V, n as P, u as I, r as O, s as h, L as B, Q as G, t as A, v as x, C as U, H as q, I as F, J as Q, T as $, W as k, X as H, Z as W } from "./index-kRAzelzQ.js";
3
- import { useState as C, useMemo as c } from "react";
2
+ import { W as V, r as O, u as I, F as P, s as h, L as B, Q as G, t as A, v as x, C as U, M as F, H as q, J as Q, O as W, T as $, U as k, X as H } from "./index-BYUNYfJ9.js";
3
+ import { useState as C, useMemo as _ } from "react";
4
4
  import { useQueryClient as j, useQuery as w } from "@tanstack/react-query";
5
5
  const K = V(
6
- P,
6
+ O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
9
  ), Y = ({
@@ -14,7 +14,7 @@ const K = V(
14
14
  }) => {
15
15
  const { t: n } = I();
16
16
  return /* @__PURE__ */ a(
17
- O,
17
+ P,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -36,9 +36,9 @@ const K = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Z = "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
+ ], z = "app:appointments:manageServices", J = "app:appointments:adminTab", X = "index-module_page__Gsfbu", Z = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
+ page: X,
41
+ noPrivilegeContainer: Z,
42
42
  table: ee
43
43
  };
44
44
  function te(e) {
@@ -75,33 +75,33 @@ function ae(e, i) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = I(), i = j(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = K(), [E, _] = C(null), [M, p] = C(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = I(), i = j(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = K(), [E, c] = C(null), [M, p] = C(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], m = A(s, z), b = A(
80
+ ], m = A(s, J), b = A(
81
81
  s,
82
- Z
83
- ), S = c(
82
+ z
83
+ ), S = _(
84
84
  () => te(l),
85
85
  [l]
86
86
  ), { data: L, isLoading: v, isError: D } = w({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
89
  enabled: m
90
- }), R = c(
90
+ }), N = _(
91
91
  () => ie(l, e),
92
92
  [l]
93
- ), N = c(
93
+ ), R = _(
94
94
  () => ae(L ?? [], S),
95
95
  [L, S]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await W(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
- }), _(null), i.invalidateQueries({ queryKey: ["allAppointmentServices"] });
104
+ }), c(null), i.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__ */ a(
115
- k,
115
+ $,
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: !b,
123
- onClick: () => _(r),
124
- children: /* @__PURE__ */ a(H, {})
123
+ onClick: () => c(r),
124
+ children: /* @__PURE__ */ a(k, {})
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__ */ a(
131
- q,
131
+ F,
132
132
  {
133
- header: /* @__PURE__ */ a(Q, { breadcrumbItems: f, userMenu: /* @__PURE__ */ a($, {}) }),
133
+ header: /* @__PURE__ */ a(Q, { breadcrumbItems: f, userMenu: /* @__PURE__ */ a(W, {}) }),
134
134
  main: m ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
@@ -140,12 +140,12 @@ const oe = () => {
140
140
  className: d.page,
141
141
  children: [
142
142
  /* @__PURE__ */ a(
143
- F,
143
+ q,
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
150
  loading: v,
151
151
  errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
@@ -160,7 +160,7 @@ const oe = () => {
160
160
  serviceName: E.name,
161
161
  isDeleting: M,
162
162
  onConfirm: g,
163
- onCancel: () => _(null)
163
+ onCancel: () => c(null)
164
164
  }
165
165
  )
166
166
  ]
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b9 as t } from "./index-kRAzelzQ.js";
1
+ import { b9 as t } from "./index-BYUNYfJ9.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.384",
3
+ "version": "0.0.1-dev.386",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",