@bahmni/appointments-app 0.0.1-dev.345 → 0.0.1-dev.348

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 { T as f, V as P, Y as O, Z as V, _ as z, $ as ee, a0 as te, a1 as ie, v as ae, a2 as ne, u as Q, a3 as R, a4 as le, a5 as re, a6 as se, a7 as E, a8 as F, a9 as C, aa as Y, ab as x, ac as k, ad as H, I as oe, r as de, w as $, ae as ce, B as me, af as Ae, ag as Ie, ah as ue, H as _e, Q as Te, J as Le } from "./index-CVzkkY6F.js";
2
+ import { R as f, J as B, K as O, L as V, P as Z, W as ee, a0 as te, a1 as ie, v as ae, a2 as ne, u as Q, a3 as R, a4 as le, a5 as re, a6 as se, a7 as E, a8 as F, a9 as C, aa as Y, ab as k, ac as x, ad as H, M as oe, o as de, t as $, ae as ce, w as me, af as Ae, ag as Ie, ah as ue, z as _e, B as Te, D as Le } from "./index-O_QvEYsZ.js";
3
3
  import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as U } from "react";
4
- import { useQuery as M, useQueryClient as Ne } from "@tanstack/react-query";
5
- const be = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", ye = () => {
4
+ import { useQuery as y, useQueryClient as Ne } from "@tanstack/react-query";
5
+ const be = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", Me = () => {
6
6
  try {
7
- return z().uuid;
7
+ return Z().uuid;
8
8
  } catch {
9
9
  return "";
10
10
  }
@@ -14,7 +14,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
14
14
  }), De = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
- }), Me = (e, a) => {
17
+ }), ye = (e, a) => {
18
18
  const n = e.map((t) => ({
19
19
  id: t.uuid,
20
20
  text: t.name,
@@ -47,9 +47,9 @@ const be = "Available for appointments", q = "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 = P(
50
+ const o = B(
51
51
  `${e.startTime} ${e.startTimePeriod}`
52
- ), c = P(
52
+ ), c = B(
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", q = "Get Appointment Unavailability", p
91
91
  data: e,
92
92
  isLoading: a,
93
93
  isError: n
94
- } = M({
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
- } = M({
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", q = "Get Appointment Unavailability", p
119
119
  data: A = [],
120
120
  isLoading: L,
121
121
  isError: m
122
- } = M({
122
+ } = y({
123
123
  queryKey: ["appointmentServices"],
124
124
  queryFn: ae
125
125
  }), {
126
126
  data: l = [],
127
127
  isLoading: s,
128
128
  isError: _
129
- } = M({
129
+ } = y({
130
130
  queryKey: ["providers"],
131
131
  queryFn: ne
132
132
  });
@@ -137,16 +137,16 @@ const be = "Available for appointments", q = "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", 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: Pe,
140
+ }, Pe = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Fe = "UnavailabilityForm-module_grid__t6NKR", Ce = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
+ formContent: Pe,
142
+ formField: Be,
143
143
  loading: Oe,
144
144
  error: Ve,
145
145
  grid: Fe,
146
146
  column: Ce,
147
147
  dateTimeColumn: Ye,
148
- datePicker: xe,
149
- timePicker: ke
148
+ datePicker: ke,
149
+ timePicker: xe
150
150
  }, He = ({
151
151
  errors: e,
152
152
  formDataRef: a,
@@ -183,7 +183,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
183
183
  () => R(
184
184
  !1,
185
185
  !1,
186
- Me(
186
+ ye(
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
@@ -195,7 +195,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
195
195
  }
196
196
  ),
197
197
  [_]
198
- ), y = N(
198
+ ), M = N(
199
199
  () => R(
200
200
  !1,
201
201
  !1,
@@ -214,7 +214,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
214
214
  );
215
215
  return h(() => {
216
216
  if (o.length === 0) return;
217
- const i = ye(), b = o.some(
217
+ const i = Me(), b = o.some(
218
218
  (D) => D.uuid === i
219
219
  );
220
220
  s((D) => ({
@@ -229,9 +229,9 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
229
229
  }, [v]), h(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
- selectedProviderItems: y
232
+ selectedProviderItems: M
233
233
  }));
234
- }, [y]), a.current = {
234
+ }, [M]), a.current = {
235
235
  ...l,
236
236
  filteredServicesCount: _.length,
237
237
  availableProvidersCount: I.length
@@ -327,7 +327,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
327
327
  }
328
328
  ),
329
329
  /* @__PURE__ */ r(
330
- x,
330
+ k,
331
331
  {
332
332
  id: "start-time",
333
333
  "data-testid": "start-time-input",
@@ -342,7 +342,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
342
342
  use24HourFormat: !1,
343
343
  className: d.timePicker,
344
344
  children: /* @__PURE__ */ p(
345
- k,
345
+ x,
346
346
  {
347
347
  id: "start-time-period",
348
348
  "data-testid": "start-time-period-select",
@@ -402,7 +402,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
402
402
  }
403
403
  ),
404
404
  /* @__PURE__ */ r(
405
- x,
405
+ k,
406
406
  {
407
407
  id: "end-time",
408
408
  "data-testid": "end-time-input",
@@ -417,7 +417,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
417
417
  use24HourFormat: !1,
418
418
  className: d.timePicker,
419
419
  children: /* @__PURE__ */ p(
420
- k,
420
+ x,
421
421
  {
422
422
  id: "end-time-period",
423
423
  "data-testid": "end-time-period-select",
@@ -484,7 +484,7 @@ const be = "Available for appointments", q = "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: y,
487
+ items: M,
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", q = "Get Appointment Unavailability", p
510
510
  ), I = $(n, [
511
511
  pe,
512
512
  q
513
- ]), { data: u, isLoading: v, isError: y } = M({
513
+ ]), { data: u, isLoading: v, isError: M } = y({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -564,15 +564,15 @@ const be = "Available for appointments", q = "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 = U(
567
+ }, [e, S]), W = U(
568
568
  (T) => {
569
569
  s((J) => {
570
- const B = { ...J };
571
- return T.forEach((X) => delete B[X]), B;
570
+ const P = { ...J };
571
+ return T.forEach((X) => delete P[X]), P;
572
572
  });
573
573
  },
574
574
  []
575
- ), W = U(() => {
575
+ ), z = U(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -598,7 +598,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
598
598
  rows: D,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
- errorStateMessage: y ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
601
+ errorStateMessage: M ? 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", q = "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
  He,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,
629
- onClearErrors: Z
629
+ onClearErrors: W
630
630
  }
631
631
  )
632
632
  }