@opencitylabs/formio-custom-components 0.6.2 → 0.6.3

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.
package/dist/index.js CHANGED
@@ -5601,21 +5601,18 @@ var bt = {
5601
5601
  }, _e = (e) => {
5602
5602
  t?.root?.data?.place && N.current.setOption("eventSources", [{ events: z }]);
5603
5603
  };
5604
- async function z(e, n, r) {
5604
+ async function z(e) {
5605
5605
  try {
5606
5606
  N.current.setOption("events", []);
5607
- let r = p(e.start).format("YYYY-MM-DD"), i = new Date(e.end);
5608
- i.setDate(i.getDate() - 1);
5609
- let a = p(i).format("YYYY-MM-DD"), s = t?.root?.data?.place?.merge_availabilities ? t?.root?.data?.place?.merged_availabilities_link : null, c = s ? F(s, r, a) : de(r, a, null), l = Ct("AVAILABILITY", c), u = St("AVAILABILITY", l), d;
5610
- if (u ? (d = u, g(!1)) : (d = await window.FormioHelper.fetchAPIUrlLimit(c), xt("AVAILABILITY", l, d)), !d?.length) {
5611
- n([]), S.fire({
5612
- icon: "warning",
5613
- title: o.t("warning"),
5614
- html: o.t("no_meetings")
5615
- });
5616
- return;
5617
- }
5618
- let f = d.map((e) => ({
5607
+ let n = p(e.start).format("YYYY-MM-DD"), r = new Date(e.end);
5608
+ r.setDate(r.getDate() - 1);
5609
+ let i = p(r).format("YYYY-MM-DD"), a = t?.root?.data?.place?.merge_availabilities ? t?.root?.data?.place?.merged_availabilities_link : null, s = a ? F(a, n, i) : de(n, i, null), c = Ct("AVAILABILITY", s), l = St("AVAILABILITY", c), u;
5610
+ if (l ? (u = l, g(!1)) : (u = await window.FormioHelper.fetchAPIUrlLimit(s), xt("AVAILABILITY", c, u)), !u?.length) return S.fire({
5611
+ icon: "warning",
5612
+ title: o.t("warning"),
5613
+ html: o.t("no_meetings")
5614
+ }), [];
5615
+ let d = u.map((e) => ({
5619
5616
  id: e.opening_hour_id,
5620
5617
  allDay: !1,
5621
5618
  start: `${e.date}T${e.start_time}:00`,
@@ -5627,12 +5624,12 @@ var bt = {
5627
5624
  textColor: "#000",
5628
5625
  className: "event-slot",
5629
5626
  extendedProps: { ...e }
5630
- })), m = le(d);
5631
- N.current.setOption("slotMinTime", m.earliestStartTime), N.current.setOption("slotMaxTime", m.latestEndTime), P(d), yt(N.current, f), n(f), setTimeout(() => {
5632
- B(f);
5633
- }, 500);
5627
+ })), f = le(u);
5628
+ return N.current.setOption("slotMinTime", f.earliestStartTime), N.current.setOption("slotMaxTime", f.latestEndTime), P(u), yt(N.current, d), setTimeout(() => {
5629
+ B(d);
5630
+ }, 500), d;
5634
5631
  } catch (e) {
5635
- console.error("Errore nel caricamento disponibilità:", e), r?.(e);
5632
+ throw console.error("Errore nel caricamento disponibilità:", e), e;
5636
5633
  }
5637
5634
  }
5638
5635
  s(() => {