@bahmni/appointments-app 0.0.1-dev.382 → 0.0.1-dev.383

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,9 +1,9 @@
1
1
  import { jsx as i, jsxs as y } from "react/jsx-runtime";
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-Djz7NxTJ.js";
3
- import { useState as I, useMemo as _ } from "react";
2
+ import { s as V, v as P, u as I, F as O, x as h, L as B, Q as x, C as A, D as G, I as U, J as F, S as q, U as Q, Z as k, W, X as $, _ as j } from "./index-B6SqeItn.js";
3
+ import { useState as C, useMemo as _ } from "react";
4
4
  import { useQueryClient as w, useQuery as H } from "@tanstack/react-query";
5
5
  const K = V(
6
- O,
6
+ P,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
9
  ), Z = ({
@@ -12,9 +12,9 @@ const K = V(
12
12
  onConfirm: t,
13
13
  onCancel: s
14
14
  }) => {
15
- const { t: n } = C();
15
+ const { t: n } = I();
16
16
  return /* @__PURE__ */ i(
17
- P,
17
+ O,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -36,8 +36,8 @@ const K = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
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,
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
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 } = K(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = I(), a = w(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: n } = K(), [E, c] = C(null), [b, p] = C(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], m = L(s, Y), M = L(
80
+ ], S = A(s, z), M = A(
81
81
  s,
82
- J
83
- ), S = _(
82
+ Y
83
+ ), m = _(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: R, isError: v } = H({
86
+ ), { data: L, isLoading: v, isError: D } = H({
87
87
  queryKey: ["allAppointmentServices"],
88
- queryFn: x,
89
- enabled: m
90
- }), D = _(
88
+ queryFn: G,
89
+ enabled: S
90
+ }), R = _(
91
91
  () => ae(l, e),
92
92
  [l]
93
93
  ), N = _(
94
- () => ie(A ?? [], S),
95
- [A, S]
94
+ () => ie(L ?? [], m),
95
+ [L, m]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
@@ -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(Q, {}) }),
134
- main: m ? /* @__PURE__ */ y(
133
+ header: /* @__PURE__ */ i(Q, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(k, {}) }),
134
+ main: S ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
137
137
  id: "all-appointment-service-page",
@@ -144,11 +144,11 @@ const oe = () => {
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
147
- headers: D,
147
+ headers: R,
148
148
  rows: N,
149
149
  ariaLabel: "all-services-table",
150
- loading: R,
151
- errorStateMessage: v ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
150
+ loading: v,
151
+ errorStateMessage: D ? 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
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
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-Djz7NxTJ.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, D 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 $, Q as oe, L as de, C as q, aj as ce, I as me, ak as Ae, al as Ie, am as ue, S as _e, U as Te, Z as Le } from "./index-B6SqeItn.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 y, useQueryClient as Ne } from "@tanstack/react-query";
5
- const be = "Available for appointments", w = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", Me = () => {
5
+ const be = "Available for appointments", w = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", De = () => {
6
6
  try {
7
7
  return X().uuid;
8
8
  } catch {
@@ -11,7 +11,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
11
11
  }, H = (e) => ({
12
12
  id: "",
13
13
  text: e
14
- }), De = (e) => ({
14
+ }), Me = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
17
  }), ye = (e, a) => {
@@ -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, De, {
176
+ () => R(!1, !1, o, Me, {
177
177
  loading: "",
178
178
  error: "",
179
179
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
@@ -195,7 +195,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
195
195
  }
196
196
  ),
197
197
  [_]
198
- ), M = N(
198
+ ), D = N(
199
199
  () => R(
200
200
  !1,
201
201
  !1,
@@ -214,11 +214,11 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
214
214
  );
215
215
  return h(() => {
216
216
  if (o.length === 0) return;
217
- const i = Me(), b = o.some(
218
- (D) => D.uuid === i
217
+ const i = De(), b = o.some(
218
+ (M) => M.uuid === i
219
219
  );
220
- s((D) => ({
221
- ...D,
220
+ s((M) => ({
221
+ ...M,
222
222
  locationUuid: b ? i : ""
223
223
  }));
224
224
  }, [o]), h(() => {
@@ -229,9 +229,9 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
229
229
  }, [v]), h(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
- selectedProviderItems: M
232
+ selectedProviderItems: D
233
233
  }));
234
- }, [M]), a.current = {
234
+ }, [D]), a.current = {
235
235
  ...l,
236
236
  filteredServicesCount: _.length,
237
237
  availableProvidersCount: I.length
@@ -484,7 +484,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
484
484
  "data-testid": "provider-multiselect",
485
485
  titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
486
486
  placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
487
- items: M,
487
+ items: D,
488
488
  itemToString: (i) => i?.text ?? "",
489
489
  selectedItems: l.selectedProviderItems,
490
490
  onChange: (i) => s({
@@ -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 } = y({
513
+ ]), { data: u, isLoading: v, isError: D } = 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]), D = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = E(
540
+ ], [e]), M = 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]), J = E(
567
+ }, [e, S]), W = 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((J) => delete B[J]), 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(
@@ -595,10 +595,10 @@ 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: D,
598
+ rows: M,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
- errorStateMessage: M ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
601
+ errorStateMessage: D ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
602
602
  emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
603
603
  actionButton: !o && I ? {
604
604
  label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
@@ -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: J
629
+ onClearErrors: W
630
630
  }
631
631
  )
632
632
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b9 as t } from "./index-Djz7NxTJ.js";
1
+ import { b9 as t } from "./index-B6SqeItn.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.382",
3
+ "version": "0.0.1-dev.383",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",