@bahmni/appointments-app 0.0.1-dev.329 → 0.0.1-dev.331

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,8 +1,8 @@
1
- import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { W as f, S as P, T as O, Y as V, X as Z, Z as ee, $ as te, a0 as ie, F as ae, a1 as ne, u as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as H, y as oe, o as de, z as $, ad as ce, B as me, ae as Ae, af as Ie, ag as ue, J as _e, K as Te } from "./index-Bjd0Amzt.js";
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
+ import { M as f, N as B, O, Q as V, S as Z, T as ee, Y as te, a0 as ie, X as ae, a1 as ne, u as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as H, C as oe, q as de, D as $, ad as ce, F as me, ae as Ae, af as Ie, ag as ue, I as _e, J as Te } from "./index-rGSUMz8Z.js";
3
3
  import { useState as g, useMemo as N, useEffect as S, useRef as Le, useCallback as U } from "react";
4
4
  import { useQuery as M, useQueryClient as ve } from "@tanstack/react-query";
5
- const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", be = () => {
5
+ const Ne = "Available for appointments", q = "Get Appointment Unavailability", be = "Add Appointment Unavailability", w = "Appointment Location", pe = () => {
6
6
  try {
7
7
  return Z().uuid;
8
8
  } catch {
@@ -11,10 +11,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
11
11
  }, G = (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,
@@ -47,9 +47,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
47
47
  }), Ue = (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"));
@@ -137,10 +137,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, he = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
140
+ }, he = "UnavailabilityForm-module_formContent__WmNHR", Pe = "UnavailabilityForm-module_formField__8he7o", Be = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
141
  formContent: he,
142
- formField: Be,
143
- loading: Pe,
142
+ formField: Pe,
143
+ loading: Be,
144
144
  error: Oe,
145
145
  grid: Ve,
146
146
  column: Fe,
@@ -168,12 +168,12 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
168
168
  ), I = N(
169
169
  () => A.filter(
170
170
  (i) => i.attributes?.some(
171
- (p) => p.attributeType?.display === Ne && p.value
171
+ (b) => b.attributeType?.display === Ne && b.value
172
172
  )
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 Ne = "Available for appointments", q = "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
  ),
@@ -195,7 +195,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
195
195
  }
196
196
  ),
197
197
  [_]
198
- ), y = N(
198
+ ), D = N(
199
199
  () => R(
200
200
  !1,
201
201
  !1,
@@ -214,12 +214,12 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
214
214
  );
215
215
  return S(() => {
216
216
  if (o.length === 0) return;
217
- const i = be(), p = o.some(
218
- (D) => D.uuid === i
217
+ const i = pe(), b = o.some(
218
+ (y) => y.uuid === i
219
219
  );
220
- s((D) => ({
221
- ...D,
222
- locationUuid: p ? i : ""
220
+ s((y) => ({
221
+ ...y,
222
+ locationUuid: b ? i : ""
223
223
  }));
224
224
  }, [o]), S(() => {
225
225
  _.length > 0 && s((i) => ({
@@ -229,9 +229,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
229
229
  }, [v]), S(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
- selectedProviderItems: y
232
+ selectedProviderItems: D
233
233
  }));
234
- }, [y]), a.current = {
234
+ }, [D]), a.current = {
235
235
  ...l,
236
236
  filteredServicesCount: _.length,
237
237
  availableProvidersCount: I.length
@@ -250,7 +250,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
250
250
  className: d.error,
251
251
  children: t("ADMIN_UNAVAILABILITY_FORM_LOAD_ERROR_MESSAGE")
252
252
  }
253
- ) : /* @__PURE__ */ b(
253
+ ) : /* @__PURE__ */ p(
254
254
  "div",
255
255
  {
256
256
  id: "unavailability-form-content",
@@ -281,7 +281,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
281
281
  invalidText: e.location
282
282
  }
283
283
  ) }),
284
- /* @__PURE__ */ b(
284
+ /* @__PURE__ */ p(
285
285
  se,
286
286
  {
287
287
  id: "unavailability-form-grid",
@@ -289,7 +289,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
289
289
  "aria-label": "unavailability-form-grid-aria-label",
290
290
  className: d.grid,
291
291
  children: [
292
- /* @__PURE__ */ b(
292
+ /* @__PURE__ */ p(
293
293
  E,
294
294
  {
295
295
  id: "unavailability-form-start-date-time",
@@ -341,7 +341,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
341
341
  pattern: "(1[012]|[0-9]):[0-5][0-9]",
342
342
  use24HourFormat: !1,
343
343
  className: d.timePicker,
344
- children: /* @__PURE__ */ b(
344
+ children: /* @__PURE__ */ p(
345
345
  k,
346
346
  {
347
347
  id: "start-time-period",
@@ -364,7 +364,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
364
364
  ]
365
365
  }
366
366
  ),
367
- /* @__PURE__ */ b(
367
+ /* @__PURE__ */ p(
368
368
  E,
369
369
  {
370
370
  id: "unavailability-form-end-date-time",
@@ -416,7 +416,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
416
416
  pattern: "(1[012]|[0-9]):[0-5][0-9]",
417
417
  use24HourFormat: !1,
418
418
  className: d.timePicker,
419
- children: /* @__PURE__ */ b(
419
+ children: /* @__PURE__ */ p(
420
420
  k,
421
421
  {
422
422
  id: "end-time-period",
@@ -484,7 +484,7 @@ const Ne = "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: D,
488
488
  itemToString: (i) => i?.text ?? "",
489
489
  selectedItems: l.selectedProviderItems,
490
490
  onChange: (i) => s({
@@ -508,9 +508,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
508
508
  n,
509
509
  q
510
510
  ), I = $(n, [
511
- pe,
511
+ be,
512
512
  q
513
- ]), { data: u, isLoading: v, isError: y } = M({
513
+ ]), { data: u, isLoading: v, isError: D } = M({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -522,7 +522,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
522
522
  href: "/appointments"
523
523
  },
524
524
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
525
- ], p = N(() => [
525
+ ], b = N(() => [
526
526
  { key: "startDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_START") },
527
527
  { key: "endDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_END") },
528
528
  {
@@ -537,7 +537,7 @@ const Ne = "Available for appointments", q = "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) => ge(T, e)) : [], [u, e]), h = U(
540
+ ], [e]), y = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), h = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -564,15 +564,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
564
564
  if (!m.current) return;
565
565
  const T = Ue(m.current, e);
566
566
  s(T), !(Object.keys(T).length > 0) && await h(fe(m.current, e));
567
- }, [e, h]), W = U(
567
+ }, [e, h]), J = U(
568
568
  (T) => {
569
- s((z) => {
570
- const B = { ...z };
571
- return T.forEach((X) => delete B[X]), B;
569
+ s((X) => {
570
+ const P = { ...X };
571
+ return T.forEach((z) => delete P[z]), P;
572
572
  });
573
573
  },
574
574
  []
575
- ), J = U(() => {
575
+ ), W = U(() => {
576
576
  c(!1), m.current = null, s({});
577
577
  }, []);
578
578
  return /* @__PURE__ */ r(
@@ -594,11 +594,11 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
594
594
  "data-testid": "appointment-unavailability-actions-table-test-id",
595
595
  "aria-label": "appointment-unavailability-actions-table-aria-label",
596
596
  title: e("ADMIN_UNAVAILABILITY_TITLE"),
597
- headers: p,
598
- rows: D,
597
+ headers: b,
598
+ rows: y,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
- errorStateMessage: y ? 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 Ne = "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: J,
622
+ onSecondaryButtonClick: W,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
625
  ke,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,
629
- onClearErrors: W
629
+ onClearErrors: J
630
630
  }
631
631
  )
632
632
  }