@wix/form-elements 1.146.0 → 1.148.0
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/component/{appointment-rac-scUix9QX.js → appointment-rac-BNqXl3dq.js} +168 -164
- package/dist/component/{bookings-address-rac-CKemkJOO.js → bookings-address-rac-DzLf588z.js} +1 -1
- package/dist/component/{bookings-email-rac-CDqdhPAB.js → bookings-email-rac-BCNWH7ss.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DEy_7Hjb.js → bookings-first-name-rac-D36aHUOJ.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl4xy9lB.js → bookings-header-rac-CNr2y2ES.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsL9xQ1W.js → bookings-last-name-rac-yHE6ZIxr.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DkHYQ4No.js → bookings-login-bar-rac-C3weOc1i.js} +6 -6
- package/dist/component/{bookings-phone-rac-BoBiFwbV.js → bookings-phone-rac-CIo_ApRf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DZZnPKWA.js → bookings-rich-text-rac-rgKnvt57.js} +1 -1
- package/dist/component/{checkbox-field-rac-UgLmJxB-.js → checkbox-field-rac-CMaVxLNe.js} +9 -7
- package/dist/component/{checkbox-group-field-headless-C809nB0Q.js → checkbox-group-field-headless-XPtqS8Km.js} +68 -68
- package/dist/component/{checkbox-group-field-rac-u4i4wG21.js → checkbox-group-field-rac-C_58XfQt.js} +9 -9
- package/dist/component/{checkbox-group-rac-DBAQhSo3.js → checkbox-group-rac-FQrWViSh.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-6173wvuW.js → checkbox-indicator-module-classes-akWZsZNn.js} +1 -1
- package/dist/component/{checkbox-rac-FDQVsI5-.js → checkbox-rac-C5Lj2b1N.js} +1 -1
- package/dist/component/{contacts-address-rac-DnArylPa.js → contacts-address-rac-OhpLzD0X.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-C19jhGEO.js → contacts-birthdate-rac-Dnqq84ct.js} +1 -1
- package/dist/component/{contacts-company-rac-Dxs0hs_i.js → contacts-company-rac-DMnTF55t.js} +1 -1
- package/dist/component/{contacts-email-rac-D-H43L8r.js → contacts-email-rac-DmZhScW2.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DwV5NESk.js → contacts-first-name-rac-B6A4fuzK.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C5v2xurf.js → contacts-last-name-rac-DVz97lew.js} +1 -1
- package/dist/component/{contacts-phone-rac-D9a5x-xl.js → contacts-phone-rac-DV8aO0uS.js} +1 -1
- package/dist/component/{contacts-position-rac-DfsgOv-k.js → contacts-position-rac-BP_yBIE4.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-B-Hho0Kb.js → contacts-subscribe-rac-wmTprtLf.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-q6TQkB4b.js → contacts-tax-id-rac-CUEPBQye.js} +1 -1
- package/dist/component/{date-availability-CMDvf5VU.js → date-availability-BK_0gLRv.js} +1 -1
- package/dist/component/{date-input-field-rac-C1WLUct3.js → date-input-field-rac-BfWPvRnd.js} +84 -78
- package/dist/component/{date-input-rac-cNQ-nr4D.js → date-input-rac-B7vAMRBX.js} +1 -1
- package/dist/component/{date-picker-field-rac-mx11z-MO.js → date-picker-field-rac-CpDY4EkU.js} +111 -105
- package/dist/component/{date-picker-rac-DeTz17zC.js → date-picker-rac-BCswaZB1.js} +1 -1
- package/dist/component/{date-time-input-field-rac-feQ2E1eU.js → date-time-input-field-rac-D9w4eEa0.js} +135 -129
- package/dist/component/{date-time-input-rac-G0s0xP4v.js → date-time-input-rac-_im8-JRC.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BcTN1nJb.js → dext-checkbox-group-rac-Di7B1Wzv.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DX0TOrCO.js → dext-checkbox-rac-BPendOsP.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CpDp11oa.js → dext-date-picker-rac-_-Ig9Qn6.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BRvO8izU.js → dext-date-time-input-rac-dKFW87yu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DGZ4Yi_X.js → dext-dropdown-rac-Cpdpps7P.js} +1 -1
- package/dist/component/{dext-email-rac-B9YCFHB4.js → dext-email-rac-D4UmYH5m.js} +1 -1
- package/dist/component/{dext-number-input-rac-D890dBZf.js → dext-number-input-rac-DUetGnYJ.js} +1 -1
- package/dist/component/{dext-phone-rac-BAQftbXo.js → dext-phone-rac-Bsz_DAT9.js} +1 -1
- package/dist/component/dext-radio-group-rac-B_soj2FD.js +18 -0
- package/dist/component/{dext-rating-input-rac-BqQKVaHo.js → dext-rating-input-rac-cm40qt4O.js} +1 -1
- package/dist/component/{dext-tags-rac-zxxKcNUe.js → dext-tags-rac-D1ULx6t1.js} +2 -2
- package/dist/component/{dext-text-area-rac-Ctp9SwPg.js → dext-text-area-rac-IkL67rHB.js} +1 -1
- package/dist/component/{dext-text-input-rac-c_QMlyjr.js → dext-text-input-rac-DsYSTEL2.js} +1 -1
- package/dist/component/{dext-url-input-rac-96pv15aC.js → dext-url-input-rac-BKvEkpYu.js} +1 -1
- package/dist/component/{donation-rac-GEWKSLJY.js → donation-rac-CaCXMa-H.js} +87 -85
- package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-DcrQK8mL.js} +36 -34
- package/dist/component/{dropdown-field-rac-CCXfBmSc.js → dropdown-field-rac-CuGoz_6I.js} +9 -10
- package/dist/component/{dropdown-rac-CR7hswXE.js → dropdown-rac-rIe6ZqaZ.js} +1 -1
- package/dist/component/{ecom-address-rac-khMuxEFD.js → ecom-address-rac-DT0rzvvp.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CAi_AHpb.js → ecom-subscription-checkbox-rac-ZfbiME6e.js} +5 -5
- package/dist/component/{email-input-field-rac-B83mY2lg.js → email-input-field-rac-8Qn3yskh.js} +62 -62
- package/dist/component/{events-repeater-rac-ClEwXgmb.js → events-repeater-rac-DyHrMd3y.js} +25 -21
- package/dist/component/{events-rsvp-rac-BJ5q2SVR.js → events-rsvp-rac-CoL-euuc.js} +9 -9
- package/dist/component/{field-error-headless-CsYQCsiT.js → field-error-headless-RylIeqXr.js} +6 -6
- package/dist/component/{field-label-headless-Yg_1PMSg.js → field-label-headless-d3hZxIEc.js} +15 -15
- package/dist/component/field-rac.module-DP0lkkEv.js +25 -0
- package/dist/component/{file-upload-rac-DJsuI_lR.js → file-upload-rac-rXbabrgc.js} +172 -168
- package/dist/component/{fixed-payment-rac-BMFe9wxU.js → fixed-payment-rac-CaR7pXXA.js} +13 -13
- package/dist/component/{form-Bed4Kfz8.js → form-DhIEC3nB.js} +2309 -2308
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-DPQTrOSZ.js → header-field-rac-nELbyGjP.js} +4 -4
- package/dist/component/{header-rac-CzXsuLmE.js → header-rac-q80EQNmM.js} +1 -1
- package/dist/component/{image-choice-rac-R_4pbOSr.js → image-choice-rac-CLMiTQK0.js} +42 -42
- package/dist/component/{index-DZxHlvzt.js → index-C-jVrv9Y.js} +91 -91
- package/dist/component/{index-qSZCe_WC.js → index-DnLJzPM-.js} +2 -2
- package/dist/component/{isObjectLike-B-a5uaU-.js → isObjectLike-Bf577MHV.js} +15 -15
- package/dist/component/{multiline-address-field-rac-rv4IZZy_.js → multiline-address-field-rac-BVAv1w9F.js} +155 -137
- package/dist/component/{multiline-address-rac-DZ7cYtgn.js → multiline-address-rac-qMuUHA9U.js} +1 -1
- package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-B_vnBWFG.js} +24 -22
- package/dist/component/{number-input-rac-BeGn6qJR.js → number-input-rac-BPCIW8Fz.js} +1 -1
- package/dist/component/{password-rac-DfvhdsKG.js → password-rac-D72HG72u.js} +28 -26
- package/dist/component/{payment-input-rac-BmMfi5rf.js → payment-input-rac-DthVgsAi.js} +32 -30
- package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-XIPkH8Fb.js} +46 -46
- package/dist/component/{phone-rac-quZjJ08H.js → phone-rac-U94fCfer.js} +1 -1
- package/dist/component/{product-list-rac-Ci0KB7sN.js → product-list-rac-BRMGPyhr.js} +78 -78
- package/dist/component/{quiz-radio-group-rac--UUtGx2t.js → quiz-radio-group-rac-DafNzzgX.js} +1 -1
- package/dist/component/radio-button-module-classes-DtFlHID_.js +134 -0
- package/dist/component/{radio-group-field-rac-w8fHpFKJ.js → radio-group-field-rac-BXrYWjew.js} +13 -13
- package/dist/component/{radio-group-rac-jO8aghii.js → radio-group-rac-BNyFfQYV.js} +1 -1
- package/dist/component/{rating-input-field-rac-BRc2PtqE.js → rating-input-field-rac-KbkiVCZ7.js} +27 -27
- package/dist/component/{rating-input-rac-D9zs06xR.js → rating-input-rac-zT4vPkwP.js} +1 -1
- package/dist/component/{rich-content-rac.module-Cv3ZmD00.js → rich-content-rac.module-C0OQetct.js} +8 -8
- package/dist/component/{rich-text-field-rac-BmWuIfA8.js → rich-text-field-rac-T4NoShC0.js} +4 -4
- package/dist/component/{rich-text-rac-BnqnrvB1.js → rich-text-rac-m6VRCRZu.js} +1 -1
- package/dist/component/{service-dropdown-rac-Cl81KfJU.js → service-dropdown-rac-BFwKhL1l.js} +44 -45
- package/dist/component/{services-multi-choice-rac-sQ1NF9hY.js → services-multi-choice-rac-DjzcuRWv.js} +13 -13
- package/dist/component/{signature-rac-Huairu7V.js → signature-rac-B1LPKnIw.js} +281 -279
- package/dist/component/{submit-button-rac-Dpg7N0TG.js → submit-button-rac-Cz3PVtW4.js} +25 -25
- package/dist/component/{tags-field-rac-BQ8TEqXH.js → tags-field-rac-DzSoL__s.js} +82 -82
- package/dist/component/{tags-rac-CFOmyCCc.js → tags-rac-DMYJDrm-.js} +1 -1
- package/dist/component/{text-area-field-rac-DNiMa7d3.js → text-area-field-rac-SuMzBm-Q.js} +30 -28
- package/dist/component/{text-area-rac-kLFe-KbZ.js → text-area-rac-C-zmnJgt.js} +1 -1
- package/dist/component/{text-input-field-rac-CqENSUUX.js → text-input-field-rac-BmQlXTK9.js} +6 -6
- package/dist/component/text-input-headless-BsrjGTK4.js +47 -0
- package/dist/component/{text-input-rac-uYQEfOtE.js → text-input-rac-DhQFKG4h.js} +1 -1
- package/dist/component/time-input-rac-CRZZdbTI.js +161 -0
- package/dist/component/{url-input-field-rac-BioH7kuz.js → url-input-field-rac-D617Pvsf.js} +30 -28
- package/dist/component/{url-input-rac-D2VSSyqW.js → url-input-rac-CLvxaWZz.js} +1 -1
- package/dist/component/use-dropdown-trigger-class-name-C4uqTKFP.js +117 -0
- package/dist/component/{use-element-state-class-name-oiKCauK-.js → use-element-state-class-name-DJx-T0zf.js} +3 -3
- package/dist/component/use-hoverable-input-class-name-pwVZXwrY.js +25 -0
- package/dist/component/use-is-forced-open-dropdown-DBpm1D-o.js +48 -0
- package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-xHeVTve3.js} +6 -6
- package/dist/component/use-text-input-class-name-CrEjJ2Z8.js +6 -0
- package/dist/form.d.ts +5 -0
- package/package.json +2 -2
- package/dist/component/dext-radio-group-rac-CtEjnu_X.js +0 -18
- package/dist/component/field-rac.module-DfEb7pBp.js +0 -25
- package/dist/component/radio-button-module-classes-CqdBGknT.js +0 -132
- package/dist/component/text-input-headless-BdPkEeK2.js +0 -45
- package/dist/component/time-input-rac-BYoojlJ9.js +0 -159
- package/dist/component/use-dropdown-option-class-name-BEmvU-Gg.js +0 -115
- package/dist/component/use-dropdown-trigger-class-name-qj9skLWZ.js +0 -40
- package/dist/component/use-hoverable-input-class-name-BW3nCyhG.js +0 -25
- package/dist/component/use-text-input-class-name-BhQFcXYH.js +0 -6
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import o, { useRef as
|
|
1
|
+
import o, { useRef as X, useState as Q, useEffect as P, createContext as Ke, useContext as $e, useMemo as B, useCallback as re } from "react";
|
|
2
2
|
import { RicosViewer as it } from "@wix/ricos/viewer";
|
|
3
|
-
import
|
|
3
|
+
import v from "classnames";
|
|
4
4
|
import { C as he } from "./chevron-down-icon-CcpVm6B-.js";
|
|
5
5
|
import { E as lt } from "./error-icon-hZxQ6DEy.js";
|
|
6
6
|
import { g as ct, c as Ce } from "./calendar.module-CKCBG_Pg.js";
|
|
7
7
|
import { H as me } from "./custom-focus-class-_483Pkwp.js";
|
|
8
|
-
import { s as ue } from "./field-rac.module-
|
|
9
|
-
import {
|
|
10
|
-
import { u as gt } from "./use-element-state-class-name-
|
|
11
|
-
import { ListBox as Tt, Button as
|
|
8
|
+
import { s as ue } from "./field-rac.module-DP0lkkEv.js";
|
|
9
|
+
import { bg as De, bf as mt, bk as Te, by as ut, bx as dt, bo as ie, bl as le, bq as ft, bn as Dt, F as Et, h as St, S as _t, a0 as pt, g as Nt, j as We, i as yt, m as At, k as bt, H as It, v as Lt, l as Ot } from "./form-DhIEC3nB.js";
|
|
10
|
+
import { u as gt } from "./use-element-state-class-name-DJx-T0zf.js";
|
|
11
|
+
import { ListBox as Tt, Button as ve, ListBoxItem as vt, RadioGroup as kt, RadioField as Rt, RadioButton as Mt } from "react-aria-components";
|
|
12
12
|
import { f as T, a as Ee } from "./find-child-C60k4CxG.js";
|
|
13
|
-
import { D as
|
|
14
|
-
import { L as ht } from "./field-label-headless-
|
|
13
|
+
import { D as wt, E as Ft } from "./field-error-headless-RylIeqXr.js";
|
|
14
|
+
import { L as ht } from "./field-label-headless-d3hZxIEc.js";
|
|
15
15
|
import { F as Ct } from "./fieldset-headless-CD3fds9J.js";
|
|
16
16
|
import "date-fns";
|
|
17
17
|
import { V as Ge } from "./headless-styles-CmcyA_pi.js";
|
|
@@ -23,10 +23,10 @@ var Le = /* @__PURE__ */ (function(e) {
|
|
|
23
23
|
})({}), z = /* @__PURE__ */ (function(e) {
|
|
24
24
|
return e.LOADING = "LOADING", e.DONE = "DONE", e.ERROR = "ERROR", e;
|
|
25
25
|
})({});
|
|
26
|
-
const
|
|
27
|
-
var
|
|
26
|
+
const q = 4;
|
|
27
|
+
var J = /* @__PURE__ */ (function(e) {
|
|
28
28
|
return e.FORM = "form", e.NO_AVAILABILITY_FOR_DATE = "no availability for date empty state", e.NO_AVAILABILITY_AT_ALL = "no availability at all empty state", e.SLOT = "slot", e.DATE = "date", e.PAGINATION = "pagination", e.SHOW_MORE = "show more", e;
|
|
29
|
-
})({}),
|
|
29
|
+
})({}), ne = /* @__PURE__ */ (function(e) {
|
|
30
30
|
return e.LOAD = "load", e.CLICK = "click", e;
|
|
31
31
|
})({});
|
|
32
32
|
const Bt = (e) => {
|
|
@@ -47,7 +47,7 @@ const Bt = (e) => {
|
|
|
47
47
|
});
|
|
48
48
|
}, Ze = (e) => {
|
|
49
49
|
var i;
|
|
50
|
-
const { appointmentFieldProps: t } =
|
|
50
|
+
const { appointmentFieldProps: t } = ke(), { isEditor: n, isComposer: a } = De(), s = mt(), r = e || ((i = t == null ? void 0 : t.initialData) == null ? void 0 : i.service);
|
|
51
51
|
if (!(n || a))
|
|
52
52
|
return {
|
|
53
53
|
...s,
|
|
@@ -151,38 +151,38 @@ const Pt = (e) => {
|
|
|
151
151
|
availabilitySlots: r,
|
|
152
152
|
availabilityDates: s,
|
|
153
153
|
timezone: t,
|
|
154
|
-
currentSlotBulkSize:
|
|
154
|
+
currentSlotBulkSize: q,
|
|
155
155
|
selectedDate: s.length > 0 && ((d = (E = s[0]) == null ? void 0 : E.slot) != null && d.startDate) ? new Date(s[0].slot.startDate) : void 0
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
function Kt(e) {
|
|
159
159
|
var d;
|
|
160
|
-
const { initialData: t, onChange: n, value: a } = e, { isEditor: s, isComposer: r } = De(), i = (d = t == null ? void 0 : t.service) == null ? void 0 : d.id, { actions: l } = Te(), c =
|
|
160
|
+
const { initialData: t, onChange: n, value: a } = e, { isEditor: s, isComposer: r } = De(), i = (d = t == null ? void 0 : t.service) == null ? void 0 : d.id, { actions: l } = Te(), c = X(l);
|
|
161
161
|
c.current = l;
|
|
162
|
-
const D = !!(l != null && l.getAvailabilityDates && (l != null && l.getAvailabilitySlots)), [u, S] =
|
|
162
|
+
const D = !!(l != null && l.getAvailabilityDates && (l != null && l.getAvailabilitySlots)), [u, S] = Q(null), E = Ze(t == null ? void 0 : t.service);
|
|
163
163
|
return P(() => {
|
|
164
164
|
i && !s && !r && D && (async () => {
|
|
165
165
|
var b, I, U, x, H;
|
|
166
|
-
const
|
|
167
|
-
currentSlotBulkSize:
|
|
168
|
-
timezone:
|
|
166
|
+
const M = Ve(), y = {
|
|
167
|
+
currentSlotBulkSize: q,
|
|
168
|
+
timezone: M,
|
|
169
169
|
dataStatus: z.LOADING
|
|
170
170
|
};
|
|
171
171
|
try {
|
|
172
|
-
const Y = async (
|
|
172
|
+
const Y = async (oe) => {
|
|
173
173
|
var _, p;
|
|
174
|
-
const { startDate: $, endDate:
|
|
174
|
+
const { startDate: $, endDate: w } = xt(oe, M);
|
|
175
175
|
return (p = (_ = c.current) == null ? void 0 : _.getAvailabilityDates) == null ? void 0 : p.call(_, {
|
|
176
176
|
serviceId: i,
|
|
177
177
|
fromDate: $,
|
|
178
|
-
toDate:
|
|
179
|
-
timeZone:
|
|
178
|
+
toDate: w,
|
|
179
|
+
timeZone: M
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
-
if (
|
|
182
|
+
if (y.availabilityDates = await Y(2), (b = y.availabilityDates) != null && b.length || (y.availabilityDates = await Y(6)), !((I = y.availabilityDates) != null && I.length)) {
|
|
183
183
|
E == null || E.report({
|
|
184
|
-
action:
|
|
185
|
-
component:
|
|
184
|
+
action: ne.LOAD,
|
|
185
|
+
component: J.NO_AVAILABILITY_AT_ALL
|
|
186
186
|
}), S({
|
|
187
187
|
dataStatus: z.ERROR,
|
|
188
188
|
error: {
|
|
@@ -192,15 +192,15 @@ function Kt(e) {
|
|
|
192
192
|
});
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
y.selectedDate = Ht(y.availabilityDates), y.selectedDate && (y.availabilitySlots = await ((x = (U = c.current) == null ? void 0 : U.getAvailabilitySlots) == null ? void 0 : x.call(U, {
|
|
196
196
|
serviceId: i,
|
|
197
|
-
timeZone:
|
|
198
|
-
selectedDate:
|
|
197
|
+
timeZone: M,
|
|
198
|
+
selectedDate: y.selectedDate
|
|
199
199
|
}))), E == null || E.report({
|
|
200
|
-
action:
|
|
201
|
-
component: (H =
|
|
200
|
+
action: ne.LOAD,
|
|
201
|
+
component: (H = y.availabilityDates) != null && H.length ? J.FORM : J.NO_AVAILABILITY_FOR_DATE
|
|
202
202
|
}), a != null && a.startDate || n(void 0), S({
|
|
203
|
-
...
|
|
203
|
+
...y,
|
|
204
204
|
dataStatus: z.DONE
|
|
205
205
|
});
|
|
206
206
|
} catch (Y) {
|
|
@@ -225,7 +225,7 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
225
225
|
setAppointmentState: () => {
|
|
226
226
|
}
|
|
227
227
|
}), $t = ({ appointmentFieldProps: e, children: t }) => {
|
|
228
|
-
const { isEditor: n, isComposer: a } = De(), [s, r] =
|
|
228
|
+
const { isEditor: n, isComposer: a } = De(), [s, r] = Q(() => Ut({
|
|
229
229
|
appointmentFieldProps: e,
|
|
230
230
|
isEditor: n,
|
|
231
231
|
isComposer: a
|
|
@@ -247,7 +247,7 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
247
247
|
})
|
|
248
248
|
}
|
|
249
249
|
}, t);
|
|
250
|
-
},
|
|
250
|
+
}, ke = () => $e(qe), Gt = (e, t) => {
|
|
251
251
|
if (e.startOfWeek.getMonth() === e.endOfWeek.getMonth())
|
|
252
252
|
return new Intl.DateTimeFormat(t, {
|
|
253
253
|
month: "long",
|
|
@@ -281,7 +281,7 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
281
281
|
formatType: "offset"
|
|
282
282
|
});
|
|
283
283
|
return `${n} (${a})`;
|
|
284
|
-
},
|
|
284
|
+
}, ae = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), qt = (e, t) => {
|
|
285
285
|
const n = new Date(e);
|
|
286
286
|
n.setDate(e.getDate() - t);
|
|
287
287
|
const a = new Date(e);
|
|
@@ -290,11 +290,11 @@ const qe = /* @__PURE__ */ Ke({
|
|
|
290
290
|
toDate: a
|
|
291
291
|
};
|
|
292
292
|
}, jt = ({ setIsReloadingSlots: e }) => {
|
|
293
|
-
const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } =
|
|
293
|
+
const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } = ke(), { value: s } = t, { actions: r } = Te();
|
|
294
294
|
P(() => {
|
|
295
295
|
(async () => {
|
|
296
296
|
var l, c;
|
|
297
|
-
if (s != null && s.startDate && (n != null && n.selectedDate) && (n == null ? void 0 : n.dataStatus) === z.DONE && !
|
|
297
|
+
if (s != null && s.startDate && (n != null && n.selectedDate) && (n == null ? void 0 : n.dataStatus) === z.DONE && !ae(new Date(s.startDate), n == null ? void 0 : n.selectedDate)) {
|
|
298
298
|
e(!0);
|
|
299
299
|
const u = new Date(s.startDate), { fromDate: S, toDate: E } = qt(u, 8), [d, g] = await Promise.all([
|
|
300
300
|
(l = r == null ? void 0 : r.getAvailabilityDates) == null ? void 0 : l.call(r, {
|
|
@@ -352,7 +352,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
352
352
|
var t;
|
|
353
353
|
return ((t = e == null ? void 0 : e.params) == null ? void 0 : t.reason) === nn;
|
|
354
354
|
}, on = ({ error: e, selectedSlot: t }) => {
|
|
355
|
-
const [n, a] =
|
|
355
|
+
const [n, a] = Q([]), s = an(e), r = t == null ? void 0 : t.startDate, i = X(!1);
|
|
356
356
|
return P(() => {
|
|
357
357
|
if (!s) {
|
|
358
358
|
i.current = !1;
|
|
@@ -366,18 +366,18 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
366
366
|
s,
|
|
367
367
|
r
|
|
368
368
|
]), n;
|
|
369
|
-
},
|
|
369
|
+
}, j = 7, ge = (e) => {
|
|
370
370
|
const t = new Date(e);
|
|
371
371
|
return t.setHours(0, 0, 0, 0), t;
|
|
372
372
|
}, sn = (e) => {
|
|
373
373
|
const t = new Date(e);
|
|
374
374
|
return t.setHours(23, 59, 59, 999), t;
|
|
375
|
-
},
|
|
375
|
+
}, te = (e, t) => {
|
|
376
376
|
const n = new Date(e);
|
|
377
377
|
return n.setDate(n.getDate() + t), n;
|
|
378
378
|
}, He = (e, t) => {
|
|
379
|
-
const n = ge(e), a = (n.getDay() - t +
|
|
380
|
-
return
|
|
379
|
+
const n = ge(e), a = (n.getDay() - t + j) % j;
|
|
380
|
+
return te(n, -a);
|
|
381
381
|
}, rn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, ln = (e, t, n) => {
|
|
382
382
|
const a = new Intl.DateTimeFormat(n, {
|
|
383
383
|
month: "short",
|
|
@@ -386,19 +386,19 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
386
386
|
return typeof a.formatRange == "function" ? a.formatRange(e, t) : `${a.format(e)} - ${a.format(t)}`;
|
|
387
387
|
}, cn = (e, t = []) => t.some((n) => {
|
|
388
388
|
var a;
|
|
389
|
-
return !!((a = n.slot) != null && a.startDate) &&
|
|
389
|
+
return !!((a = n.slot) != null && a.startDate) && ae(new Date(n.slot.startDate), e);
|
|
390
390
|
}), mn = () => {
|
|
391
391
|
var Fe;
|
|
392
|
-
const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } =
|
|
392
|
+
const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } = ke(), { language: a, isEditor: s, isComposer: r } = De(), { t: i } = ut(), { actions: l } = Te(), c = Ze(), [D, u] = Q(!1), [S, E] = Q(!1), [d, g] = Q(), [M, y] = Q();
|
|
393
393
|
jt({
|
|
394
394
|
setIsReloadingSlots: u
|
|
395
395
|
});
|
|
396
|
-
const { onChange: b, value: I, target: U, initialData: x, formatDescription: H, locationType: Y, error:
|
|
397
|
-
error:
|
|
396
|
+
const { onChange: b, value: I, target: U, initialData: x, formatDescription: H, locationType: Y, error: oe } = e, { availabilityDates: $, availabilitySlots: w, timezone: _ = "", selectedDate: p, currentSlotBulkSize: k, dataStatus: G, error: Z } = t, K = (Fe = x == null ? void 0 : x.service) == null ? void 0 : Fe.id, V = G === z.LOADING, ee = D || S, Se = !!Z, Me = on({
|
|
397
|
+
error: oe,
|
|
398
398
|
selectedSlot: I
|
|
399
|
-
}),
|
|
400
|
-
|
|
401
|
-
|
|
399
|
+
}), A = B(() => Qt(w, Me), [
|
|
400
|
+
w,
|
|
401
|
+
Me
|
|
402
402
|
]);
|
|
403
403
|
P(() => {
|
|
404
404
|
b == null || b(Zt(I));
|
|
@@ -408,30 +408,30 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
408
408
|
_
|
|
409
409
|
]), dt((f) => {
|
|
410
410
|
const L = f == null ? void 0 : f[U];
|
|
411
|
-
|
|
412
|
-
availabilitySlots:
|
|
411
|
+
w != null && w.length && n({
|
|
412
|
+
availabilitySlots: w.filter((O) => {
|
|
413
413
|
var R;
|
|
414
414
|
return ((R = O == null ? void 0 : O.slot) == null ? void 0 : R.startDate) !== (L == null ? void 0 : L.startDate);
|
|
415
415
|
})
|
|
416
416
|
});
|
|
417
417
|
}), P(() => {
|
|
418
|
-
if (
|
|
419
|
-
const f = en(de(I ?? void 0),
|
|
420
|
-
f && f + 1 >
|
|
418
|
+
if (A != null && A.length && k) {
|
|
419
|
+
const f = en(de(I ?? void 0), A);
|
|
420
|
+
f && f + 1 > k && n({
|
|
421
421
|
currentSlotBulkSize: f + 1
|
|
422
422
|
});
|
|
423
|
-
} else !(
|
|
423
|
+
} else !(A != null && A.length) && I && (b == null || b(void 0));
|
|
424
424
|
}, [
|
|
425
425
|
I,
|
|
426
|
-
|
|
426
|
+
A,
|
|
427
427
|
$
|
|
428
428
|
]);
|
|
429
429
|
const _e = B(() => ct(a), [
|
|
430
430
|
a
|
|
431
|
-
]),
|
|
431
|
+
]), we = X(p);
|
|
432
432
|
P(() => {
|
|
433
|
-
const f =
|
|
434
|
-
|
|
433
|
+
const f = we.current;
|
|
434
|
+
we.current = p, !!p && (!f || !ae(f, p)) && g(void 0);
|
|
435
435
|
}, [
|
|
436
436
|
p
|
|
437
437
|
]);
|
|
@@ -450,16 +450,16 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
450
450
|
day: "numeric"
|
|
451
451
|
});
|
|
452
452
|
return Array.from({
|
|
453
|
-
length:
|
|
454
|
-
}, (
|
|
455
|
-
const W =
|
|
453
|
+
length: j
|
|
454
|
+
}, (se, be) => {
|
|
455
|
+
const W = te(h, be), Ie = !!p && ae(W, p), rt = ge(W) < f;
|
|
456
456
|
return {
|
|
457
457
|
key: rn(W),
|
|
458
458
|
date: W,
|
|
459
459
|
isSelected: Ie,
|
|
460
|
-
isAvailable: !
|
|
461
|
-
isDisabled: rt ||
|
|
462
|
-
isToday:
|
|
460
|
+
isAvailable: !V && !ee && !Ie && cn(W, $),
|
|
461
|
+
isDisabled: rt || ee && !Ie,
|
|
462
|
+
isToday: ae(W, f),
|
|
463
463
|
dayOfMonthLabel: O.format(W),
|
|
464
464
|
weekdayLabel: L.format(W),
|
|
465
465
|
label: R.format(W),
|
|
@@ -470,11 +470,11 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
470
470
|
h,
|
|
471
471
|
p,
|
|
472
472
|
$,
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
V,
|
|
474
|
+
ee,
|
|
475
475
|
a,
|
|
476
476
|
i
|
|
477
|
-
]), pe = de(I ?? void 0) || void 0, Ne = B(() =>
|
|
477
|
+
]), pe = de(I ?? void 0) || void 0, Ne = B(() => V || D ? [] : (A ?? []).slice(0, k).flatMap((f) => {
|
|
478
478
|
const { startDate: L, endDate: O } = f.slot ?? {};
|
|
479
479
|
if (!L || !O)
|
|
480
480
|
return [];
|
|
@@ -497,24 +497,24 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
497
497
|
}
|
|
498
498
|
];
|
|
499
499
|
}), [
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
A,
|
|
501
|
+
k,
|
|
502
|
+
V,
|
|
503
503
|
D,
|
|
504
504
|
a,
|
|
505
505
|
_,
|
|
506
506
|
pe
|
|
507
|
-
]),
|
|
507
|
+
]), ye = !D && !!(A != null && A.length) && (k || q) < A.length, Ae = h > He(/* @__PURE__ */ new Date(), _e), et = re(
|
|
508
508
|
async (f) => {
|
|
509
509
|
var L;
|
|
510
|
-
if (!(
|
|
510
|
+
if (!(ee || p && ae(f, p))) {
|
|
511
511
|
u(!0), b == null || b(void 0), n({
|
|
512
|
-
currentSlotBulkSize:
|
|
512
|
+
currentSlotBulkSize: q,
|
|
513
513
|
selectedDate: f,
|
|
514
514
|
availabilitySlots: void 0
|
|
515
515
|
}), c == null || c.report({
|
|
516
|
-
action:
|
|
517
|
-
component:
|
|
516
|
+
action: ne.CLICK,
|
|
517
|
+
component: J.DATE
|
|
518
518
|
});
|
|
519
519
|
try {
|
|
520
520
|
const O = await ((L = l == null ? void 0 : l.getAvailabilitySlots) == null ? void 0 : L.call(l, {
|
|
@@ -523,7 +523,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
523
523
|
selectedDate: f
|
|
524
524
|
}));
|
|
525
525
|
n({
|
|
526
|
-
currentSlotBulkSize:
|
|
526
|
+
currentSlotBulkSize: q,
|
|
527
527
|
selectedDate: f,
|
|
528
528
|
availabilitySlots: O
|
|
529
529
|
});
|
|
@@ -535,7 +535,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
535
535
|
},
|
|
536
536
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
537
537
|
[
|
|
538
|
-
|
|
538
|
+
ee,
|
|
539
539
|
p,
|
|
540
540
|
K,
|
|
541
541
|
_,
|
|
@@ -543,25 +543,25 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
543
543
|
b,
|
|
544
544
|
c
|
|
545
545
|
]
|
|
546
|
-
), ce =
|
|
546
|
+
), ce = X(0), tt = re(
|
|
547
547
|
async (f) => {
|
|
548
|
-
var
|
|
549
|
-
if (f < 0 && !
|
|
548
|
+
var se;
|
|
549
|
+
if (f < 0 && !Ae)
|
|
550
550
|
return;
|
|
551
|
-
const L = h, O =
|
|
551
|
+
const L = h, O = te(h, f * j);
|
|
552
552
|
if (g(O), s || r)
|
|
553
553
|
return;
|
|
554
554
|
const R = ++ce.current;
|
|
555
555
|
E(!0), c == null || c.report({
|
|
556
|
-
action:
|
|
557
|
-
component:
|
|
556
|
+
action: ne.CLICK,
|
|
557
|
+
component: J.PAGINATION
|
|
558
558
|
});
|
|
559
559
|
try {
|
|
560
|
-
const be = await ((
|
|
560
|
+
const be = await ((se = l == null ? void 0 : l.getAvailabilityDates) == null ? void 0 : se.call(l, {
|
|
561
561
|
serviceId: K,
|
|
562
562
|
timeZone: _,
|
|
563
563
|
fromDate: O,
|
|
564
|
-
toDate: sn(
|
|
564
|
+
toDate: sn(te(O, j - 1))
|
|
565
565
|
}));
|
|
566
566
|
R === ce.current && n({
|
|
567
567
|
availabilityDates: be
|
|
@@ -574,7 +574,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
574
574
|
},
|
|
575
575
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
576
576
|
[
|
|
577
|
-
|
|
577
|
+
Ae,
|
|
578
578
|
h,
|
|
579
579
|
s,
|
|
580
580
|
r,
|
|
@@ -583,15 +583,15 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
583
583
|
l,
|
|
584
584
|
c
|
|
585
585
|
]
|
|
586
|
-
), nt =
|
|
586
|
+
), nt = re(
|
|
587
587
|
(f) => {
|
|
588
|
-
const L = Ne.find((
|
|
588
|
+
const L = Ne.find((se) => se.key === f);
|
|
589
589
|
if (!L)
|
|
590
590
|
return;
|
|
591
591
|
const { startDate: O, endDate: R } = L;
|
|
592
592
|
c == null || c.report({
|
|
593
|
-
action:
|
|
594
|
-
component:
|
|
593
|
+
action: ne.CLICK,
|
|
594
|
+
component: J.SLOT,
|
|
595
595
|
startTime: new Date(O).valueOf(),
|
|
596
596
|
endTime: new Date(R).valueOf()
|
|
597
597
|
}), b == null || b({
|
|
@@ -607,30 +607,30 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
607
607
|
b,
|
|
608
608
|
c
|
|
609
609
|
]
|
|
610
|
-
), at =
|
|
611
|
-
if (!
|
|
610
|
+
), at = re(() => {
|
|
611
|
+
if (!ye)
|
|
612
612
|
return;
|
|
613
|
-
const f =
|
|
613
|
+
const f = k || q;
|
|
614
614
|
c == null || c.report({
|
|
615
|
-
action:
|
|
616
|
-
component:
|
|
617
|
-
}),
|
|
618
|
-
currentSlotBulkSize: f +
|
|
615
|
+
action: ne.CLICK,
|
|
616
|
+
component: J.SHOW_MORE
|
|
617
|
+
}), y(f), n({
|
|
618
|
+
currentSlotBulkSize: f + q
|
|
619
619
|
});
|
|
620
620
|
}, [
|
|
621
|
-
|
|
622
|
-
|
|
621
|
+
ye,
|
|
622
|
+
k,
|
|
623
623
|
c
|
|
624
|
-
]), ot =
|
|
624
|
+
]), ot = re(() => y(void 0), []), st = B(() => {
|
|
625
625
|
if (Se)
|
|
626
626
|
return i("form.appointment.empty-state.notification.text");
|
|
627
|
-
if (!
|
|
627
|
+
if (!V && !D && !(A != null && A.length))
|
|
628
628
|
return i("form.appointment.slots-not-found.text");
|
|
629
629
|
}, [
|
|
630
630
|
Se,
|
|
631
|
-
|
|
631
|
+
V,
|
|
632
632
|
D,
|
|
633
|
-
|
|
633
|
+
A == null ? void 0 : A.length,
|
|
634
634
|
i
|
|
635
635
|
]);
|
|
636
636
|
return {
|
|
@@ -641,16 +641,16 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
641
641
|
selectSlot: nt,
|
|
642
642
|
changeWeek: tt,
|
|
643
643
|
showMoreSlots: at,
|
|
644
|
-
canGoToPreviousWeek:
|
|
645
|
-
hasMoreSlots:
|
|
644
|
+
canGoToPreviousWeek: Ae,
|
|
645
|
+
hasMoreSlots: ye,
|
|
646
646
|
hasError: Se,
|
|
647
|
-
isLoading:
|
|
648
|
-
isRefetching:
|
|
647
|
+
isLoading: V,
|
|
648
|
+
isRefetching: ee,
|
|
649
649
|
isReloadingSlots: D,
|
|
650
|
-
weekRangeLabel: ln(h,
|
|
650
|
+
weekRangeLabel: ln(h, te(h, j - 1), a),
|
|
651
651
|
weekCaptionLabel: Gt({
|
|
652
652
|
startOfWeek: h,
|
|
653
|
-
endOfWeek:
|
|
653
|
+
endOfWeek: te(h, j - 1)
|
|
654
654
|
}, a),
|
|
655
655
|
selectedDateLabel: Xt({
|
|
656
656
|
selectedDate: p,
|
|
@@ -666,7 +666,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
666
666
|
showMoreSlotsLabel: i("form.appointment.show-more-slots.text"),
|
|
667
667
|
previousWeekLabel: i("form.appointment.accessibility.calendar.previous-week.aria-label"),
|
|
668
668
|
nextWeekLabel: i("form.appointment.accessibility.calendar.next-week.aria-label"),
|
|
669
|
-
pendingFocusIndex:
|
|
669
|
+
pendingFocusIndex: M,
|
|
670
670
|
consumePendingFocusIndex: ot
|
|
671
671
|
};
|
|
672
672
|
}, je = Ke(void 0), Qe = (e) => `${e}-timezone-note`, Je = (e) => `${e}-date-title`, F = () => {
|
|
@@ -675,7 +675,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
675
675
|
throw new Error("Appointment parts must be used inside an <Appointment> component");
|
|
676
676
|
return e;
|
|
677
677
|
}, Re = () => {
|
|
678
|
-
const { disabled: e, readOnly: t } =
|
|
678
|
+
const { disabled: e, readOnly: t } = ie();
|
|
679
679
|
return !!e || !!t;
|
|
680
680
|
}, C = ({ children: e, className: t }) => {
|
|
681
681
|
const { days: n, selectDate: a, weekRangeLabel: s } = F(), r = T(e, C.PreviousWeek), i = T(e, C.Heading), l = T(e, C.NextWeek), c = T(e, C.Day) ?? /* @__PURE__ */ o.createElement(C.Day, null), D = B(() => n.filter((d) => d.isSelected).map((d) => d.key), [
|
|
@@ -688,8 +688,8 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
688
688
|
return;
|
|
689
689
|
const [g] = [
|
|
690
690
|
...d
|
|
691
|
-
],
|
|
692
|
-
|
|
691
|
+
], M = n.find(({ key: y }) => y === g);
|
|
692
|
+
M && a(M.date);
|
|
693
693
|
};
|
|
694
694
|
return /* @__PURE__ */ o.createElement("div", {
|
|
695
695
|
className: t
|
|
@@ -705,7 +705,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
705
705
|
day: d
|
|
706
706
|
}))));
|
|
707
707
|
}, un = ({ children: e, className: t }) => {
|
|
708
|
-
const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel: s, nextWeekLabel: r } = F(), i = Re(), l =
|
|
708
|
+
const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel: s, nextWeekLabel: r } = F(), i = Re(), l = X(null), c = X(!1);
|
|
709
709
|
return P(() => {
|
|
710
710
|
var S, E, d;
|
|
711
711
|
if (a || !c.current)
|
|
@@ -719,7 +719,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
719
719
|
}, [
|
|
720
720
|
a,
|
|
721
721
|
r
|
|
722
|
-
]), /* @__PURE__ */ o.createElement(
|
|
722
|
+
]), /* @__PURE__ */ o.createElement(ve, {
|
|
723
723
|
ref: l,
|
|
724
724
|
className: t,
|
|
725
725
|
"aria-label": s,
|
|
@@ -730,7 +730,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
730
730
|
}, e ?? "‹");
|
|
731
731
|
}, dn = ({ children: e, className: t }) => {
|
|
732
732
|
const { changeWeek: n, nextWeekLabel: a } = F(), s = Re();
|
|
733
|
-
return /* @__PURE__ */ o.createElement(
|
|
733
|
+
return /* @__PURE__ */ o.createElement(ve, {
|
|
734
734
|
className: t,
|
|
735
735
|
"aria-label": a,
|
|
736
736
|
isDisabled: s,
|
|
@@ -751,7 +751,7 @@ const nn = "SLOT_UNAVAILABLE", an = (e) => {
|
|
|
751
751
|
}, a)));
|
|
752
752
|
}, Dn = ({ children: e, className: t, ...n }) => {
|
|
753
753
|
const { day: a } = n;
|
|
754
|
-
return /* @__PURE__ */ o.createElement(
|
|
754
|
+
return /* @__PURE__ */ o.createElement(vt, {
|
|
755
755
|
id: a.key,
|
|
756
756
|
className: t,
|
|
757
757
|
textValue: a.label,
|
|
@@ -768,39 +768,43 @@ C.Heading = fn;
|
|
|
768
768
|
C.NextWeek = dn;
|
|
769
769
|
C.Day = Dn;
|
|
770
770
|
const Ye = 'input[type="radio"]', fe = ({ children: e, className: t, ...n }) => {
|
|
771
|
-
const { hasTimezoneNote: a, hasDateTitle: s } = n, { slots: r, selectedSlotKey: i, selectSlot: l, selectedDateLabel: c, isReloadingSlots: D, timezoneLabel: u, pendingFocusIndex: S, consumePendingFocusIndex: E } = F(), { id: d, disabled: g, readOnly:
|
|
771
|
+
const { hasTimezoneNote: a, hasDateTitle: s } = n, { slots: r, selectedSlotKey: i, selectSlot: l, selectedDateLabel: c, isReloadingSlots: D, timezoneLabel: u, pendingFocusIndex: S, consumePendingFocusIndex: E } = F(), { id: d, disabled: g, readOnly: M, required: y, hasError: b } = ie(), { inputId: I, labelId: U, ariaDescribedBy: x } = le(), H = X(null), Y = T(e, fe.Slot) ?? /* @__PURE__ */ o.createElement(fe.Slot, null), oe = !!s && !!c, $ = [
|
|
772
772
|
x,
|
|
773
773
|
a && u ? Qe(I) : void 0
|
|
774
|
-
].filter(Boolean).join(" ") || void 0,
|
|
775
|
-
var
|
|
776
|
-
(
|
|
774
|
+
].filter(Boolean).join(" ") || void 0, w = (_, p) => {
|
|
775
|
+
var k, G, Z;
|
|
776
|
+
(Z = (G = (k = H.current) == null ? void 0 : k.querySelectorAll(Ye)) == null ? void 0 : G[_]) == null || Z.focus(p);
|
|
777
777
|
};
|
|
778
778
|
return ft(() => {
|
|
779
|
-
var G,
|
|
779
|
+
var G, Z;
|
|
780
780
|
if (!!((G = H.current) != null && G.querySelector(Ye))) {
|
|
781
|
-
|
|
781
|
+
w(0, {
|
|
782
|
+
preventScroll: !0
|
|
783
|
+
});
|
|
782
784
|
return;
|
|
783
785
|
}
|
|
784
|
-
const p = Array.from(((
|
|
785
|
-
|
|
786
|
+
const p = Array.from(((Z = document.getElementById(I)) == null ? void 0 : Z.querySelectorAll('[role="option"]')) ?? []), k = p.find((K) => K.getAttribute("aria-selected") === "true") ?? p.find((K) => K.getAttribute("aria-disabled") !== "true");
|
|
787
|
+
k == null || k.focus({
|
|
788
|
+
preventScroll: !0
|
|
789
|
+
});
|
|
786
790
|
}, d), P(() => {
|
|
787
|
-
S !== void 0 && (
|
|
791
|
+
S !== void 0 && (w(S), E());
|
|
788
792
|
}, [
|
|
789
793
|
S,
|
|
790
794
|
r.length
|
|
791
795
|
]), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
|
|
792
796
|
role: "status",
|
|
793
797
|
style: Ge
|
|
794
|
-
}, r.length > 0 ? c : void 0), /* @__PURE__ */ o.createElement(
|
|
798
|
+
}, r.length > 0 ? c : void 0), /* @__PURE__ */ o.createElement(kt, {
|
|
795
799
|
ref: H,
|
|
796
800
|
className: t,
|
|
797
801
|
value: i ?? null,
|
|
798
802
|
onChange: l,
|
|
799
803
|
isDisabled: g,
|
|
800
|
-
isReadOnly:
|
|
801
|
-
isRequired:
|
|
804
|
+
isReadOnly: M,
|
|
805
|
+
isRequired: y,
|
|
802
806
|
isInvalid: b,
|
|
803
|
-
"aria-labelledby":
|
|
807
|
+
"aria-labelledby": oe ? Je(I) : U,
|
|
804
808
|
"aria-describedby": $,
|
|
805
809
|
"data-refetch": D || void 0
|
|
806
810
|
}, r.map((_) => Ee(Y, {
|
|
@@ -812,13 +816,13 @@ const Ye = 'input[type="radio"]', fe = ({ children: e, className: t, ...n }) =>
|
|
|
812
816
|
return /* @__PURE__ */ o.createElement(Rt, {
|
|
813
817
|
value: a.key,
|
|
814
818
|
"aria-label": a.timeRange
|
|
815
|
-
}, /* @__PURE__ */ o.createElement(
|
|
819
|
+
}, /* @__PURE__ */ o.createElement(Mt, {
|
|
816
820
|
className: t
|
|
817
821
|
}, e ? e(a) : a.timeRange));
|
|
818
822
|
};
|
|
819
823
|
fe.Slot = En;
|
|
820
824
|
const m = ({ children: e, className: t }) => {
|
|
821
|
-
const n =
|
|
825
|
+
const n = ie(), { id: a, FieldLayout: s } = n, { labelId: r, inputId: i, ariaDescribedBy: l } = le(), c = Dt(Et.APPOINTMENT), D = B(() => ({
|
|
822
826
|
...n,
|
|
823
827
|
initialData: c,
|
|
824
828
|
inputId: i,
|
|
@@ -848,7 +852,7 @@ const m = ({ children: e, className: t }) => {
|
|
|
848
852
|
}, Sn = {
|
|
849
853
|
visibility: "hidden"
|
|
850
854
|
}, _n = ({ children: e, className: t }) => {
|
|
851
|
-
const { required: n, onFocus: a, onBlur: s } =
|
|
855
|
+
const { required: n, onFocus: a, onBlur: s } = ie(), { inputId: r, labelId: i, ariaDescribedBy: l } = le(), c = mn(), D = T(e, m.Loader), u = T(e, m.Notification), S = T(e, m.Dates), E = T(e, m.Timezone), d = T(e, m.Format), g = T(e, m.DateTitle), M = T(e, m.Slots), y = T(e, m.ShowMoreSlots);
|
|
852
856
|
return /* @__PURE__ */ o.createElement(je.Provider, {
|
|
853
857
|
value: c
|
|
854
858
|
}, /* @__PURE__ */ o.createElement(Ct, {
|
|
@@ -861,10 +865,10 @@ const m = ({ children: e, className: t }) => {
|
|
|
861
865
|
onBlur: s
|
|
862
866
|
}, D, c.hasError ? u : /* @__PURE__ */ o.createElement("div", {
|
|
863
867
|
style: c.isLoading ? Sn : void 0
|
|
864
|
-
}, S, E, d, g, Ee(
|
|
868
|
+
}, S, E, d, g, Ee(M, {
|
|
865
869
|
hasTimezoneNote: !!E,
|
|
866
870
|
hasDateTitle: !!g
|
|
867
|
-
}), u,
|
|
871
|
+
}), u, y)));
|
|
868
872
|
}, pn = ({ children: e, className: t }) => {
|
|
869
873
|
const { isLoading: n, isRefetching: a } = F();
|
|
870
874
|
return !n && !a ? null : /* @__PURE__ */ o.createElement("div", {
|
|
@@ -882,15 +886,15 @@ const m = ({ children: e, className: t }) => {
|
|
|
882
886
|
}, e ? e({
|
|
883
887
|
message: n
|
|
884
888
|
}) : n) : null;
|
|
885
|
-
},
|
|
886
|
-
const { timezoneLabel: n } = F(), { inputId: a } =
|
|
889
|
+
}, yn = ({ children: e, className: t }) => {
|
|
890
|
+
const { timezoneLabel: n } = F(), { inputId: a } = le();
|
|
887
891
|
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
888
892
|
id: Qe(a),
|
|
889
893
|
className: t
|
|
890
894
|
}, e ? e({
|
|
891
895
|
label: n
|
|
892
896
|
}) : n) : null;
|
|
893
|
-
},
|
|
897
|
+
}, An = ({ children: e, className: t }) => {
|
|
894
898
|
const { formatLabel: n } = F();
|
|
895
899
|
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
896
900
|
className: t
|
|
@@ -898,7 +902,7 @@ const m = ({ children: e, className: t }) => {
|
|
|
898
902
|
label: n
|
|
899
903
|
}) : n) : null;
|
|
900
904
|
}, bn = ({ children: e, className: t }) => {
|
|
901
|
-
const { selectedDateLabel: n } = F(), { inputId: a } =
|
|
905
|
+
const { selectedDateLabel: n } = F(), { inputId: a } = le();
|
|
902
906
|
return n ? /* @__PURE__ */ o.createElement("div", {
|
|
903
907
|
id: Je(a),
|
|
904
908
|
className: t
|
|
@@ -906,8 +910,8 @@ const m = ({ children: e, className: t }) => {
|
|
|
906
910
|
label: n
|
|
907
911
|
}) : n) : null;
|
|
908
912
|
}, In = ({ children: e, className: t }) => {
|
|
909
|
-
const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel: s } = F(), { disabled: r, readOnly: i } =
|
|
910
|
-
return n ? /* @__PURE__ */ o.createElement(
|
|
913
|
+
const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel: s } = F(), { disabled: r, readOnly: i } = ie();
|
|
914
|
+
return n ? /* @__PURE__ */ o.createElement(ve, {
|
|
911
915
|
className: t,
|
|
912
916
|
isDisabled: !!r || !!i,
|
|
913
917
|
onPress: a
|
|
@@ -919,23 +923,23 @@ m.Label = ht;
|
|
|
919
923
|
m.Loader = pn;
|
|
920
924
|
m.Notification = Nn;
|
|
921
925
|
m.Dates = C;
|
|
922
|
-
m.Timezone =
|
|
923
|
-
m.Format =
|
|
926
|
+
m.Timezone = yn;
|
|
927
|
+
m.Format = An;
|
|
924
928
|
m.DateTitle = bn;
|
|
925
929
|
m.Slots = fe;
|
|
926
930
|
m.ShowMoreSlots = In;
|
|
927
|
-
m.Description =
|
|
931
|
+
m.Description = wt;
|
|
928
932
|
m.Error = Ft;
|
|
929
|
-
const Ln = "_appointment_ig6bz_1", On = "_dates_ig6bz_5", gn = "_weekHeading_ig6bz_27", Tn = "_weekButton_ig6bz_37",
|
|
933
|
+
const Ln = "_appointment_ig6bz_1", On = "_dates_ig6bz_5", gn = "_weekHeading_ig6bz_27", Tn = "_weekButton_ig6bz_37", vn = "_previousWeek_ig6bz_69", kn = "_nextWeek_ig6bz_73", Rn = "_day_ig6bz_85", Mn = "_weekdayLabel_ig6bz_97", wn = "_dayNumber_ig6bz_110", Fn = "_indicator_ig6bz_114", hn = "_hint_ig6bz_137", Cn = "_slots_ig6bz_150", Wn = "_dateTitle_ig6bz_164", Bn = "_slot_ig6bz_150", zn = "_slotHover_ig6bz_206", Pn = "_slotSelected_ig6bz_214", Un = "_showMoreSlots_ig6bz_268", xn = "_loader_ig6bz_299", Hn = "_notification_ig6bz_335", N = {
|
|
930
934
|
appointment: Ln,
|
|
931
935
|
dates: On,
|
|
932
936
|
weekHeading: gn,
|
|
933
937
|
weekButton: Tn,
|
|
934
|
-
previousWeek:
|
|
935
|
-
nextWeek:
|
|
938
|
+
previousWeek: vn,
|
|
939
|
+
nextWeek: kn,
|
|
936
940
|
day: Rn,
|
|
937
|
-
weekdayLabel:
|
|
938
|
-
dayNumber:
|
|
941
|
+
weekdayLabel: Mn,
|
|
942
|
+
dayNumber: wn,
|
|
939
943
|
indicator: Fn,
|
|
940
944
|
hint: hn,
|
|
941
945
|
slots: Cn,
|
|
@@ -959,37 +963,37 @@ const Ln = "_appointment_ig6bz_1", On = "_dates_ig6bz_5", gn = "_weekHeading_ig6
|
|
|
959
963
|
moduleClasses: Kn
|
|
960
964
|
});
|
|
961
965
|
return /* @__PURE__ */ o.createElement(m, {
|
|
962
|
-
className:
|
|
966
|
+
className: v(St, N.appointment)
|
|
963
967
|
}, /* @__PURE__ */ o.createElement(m.Label, {
|
|
964
|
-
className:
|
|
968
|
+
className: v(_t, ue.label)
|
|
965
969
|
}, /* @__PURE__ */ o.createElement(m.Label.Required, {
|
|
966
|
-
className:
|
|
970
|
+
className: v(pt, ue.requiredMark)
|
|
967
971
|
})), /* @__PURE__ */ o.createElement(m.Loader, {
|
|
968
972
|
className: N.loader
|
|
969
973
|
}), /* @__PURE__ */ o.createElement(m.Dates, {
|
|
970
|
-
className:
|
|
974
|
+
className: v(Nt, N.dates)
|
|
971
975
|
}, /* @__PURE__ */ o.createElement(m.Dates.PreviousWeek, {
|
|
972
|
-
className:
|
|
976
|
+
className: v(me, N.weekButton, N.previousWeek)
|
|
973
977
|
}, /* @__PURE__ */ o.createElement(he, null)), /* @__PURE__ */ o.createElement(m.Dates.Heading, {
|
|
974
978
|
className: N.weekHeading
|
|
975
979
|
}), /* @__PURE__ */ o.createElement(m.Dates.NextWeek, {
|
|
976
|
-
className:
|
|
980
|
+
className: v(me, N.weekButton, N.nextWeek)
|
|
977
981
|
}, /* @__PURE__ */ o.createElement(he, null)), /* @__PURE__ */ o.createElement(m.Dates.Day, {
|
|
978
|
-
className:
|
|
982
|
+
className: v(me, Ce.day, N.day)
|
|
979
983
|
}, (t) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
|
|
980
984
|
className: N.weekdayLabel
|
|
981
985
|
}, t.weekdayLabel), /* @__PURE__ */ o.createElement("span", {
|
|
982
|
-
className:
|
|
986
|
+
className: v(Ce.dayNumber, N.dayNumber)
|
|
983
987
|
}, t.dayOfMonthLabel, /* @__PURE__ */ o.createElement("span", {
|
|
984
988
|
className: N.indicator
|
|
985
989
|
}))))), /* @__PURE__ */ o.createElement(m.Timezone, {
|
|
986
|
-
className:
|
|
990
|
+
className: v(We, N.hint)
|
|
987
991
|
}), /* @__PURE__ */ o.createElement(m.Format, {
|
|
988
|
-
className:
|
|
992
|
+
className: v(We, N.hint)
|
|
989
993
|
}), /* @__PURE__ */ o.createElement(m.DateTitle, {
|
|
990
|
-
className:
|
|
994
|
+
className: v(yt, N.dateTitle)
|
|
991
995
|
}), /* @__PURE__ */ o.createElement(m.Slots, {
|
|
992
|
-
className:
|
|
996
|
+
className: v(At, N.slots)
|
|
993
997
|
}, /* @__PURE__ */ o.createElement(m.Slots.Slot, {
|
|
994
998
|
className: ({ isSelected: t, isHovered: n, isFocused: a, isDisabled: s, isReadOnly: r }) => e({
|
|
995
999
|
isSelected: t,
|
|
@@ -998,11 +1002,11 @@ const Ln = "_appointment_ig6bz_1", On = "_dates_ig6bz_5", gn = "_weekHeading_ig6
|
|
|
998
1002
|
}, (t) => t.timeRange)), /* @__PURE__ */ o.createElement(m.Notification, {
|
|
999
1003
|
className: N.notification
|
|
1000
1004
|
}), /* @__PURE__ */ o.createElement(m.ShowMoreSlots, {
|
|
1001
|
-
className:
|
|
1005
|
+
className: v(bt, me, N.showMoreSlots)
|
|
1002
1006
|
}), /* @__PURE__ */ o.createElement(m.Error, {
|
|
1003
|
-
className:
|
|
1007
|
+
className: v(It, ue.error)
|
|
1004
1008
|
}, /* @__PURE__ */ o.createElement(lt, null), /* @__PURE__ */ o.createElement(m.Error.Text, null)), /* @__PURE__ */ o.createElement(m.Description, {
|
|
1005
|
-
className:
|
|
1009
|
+
className: v(Lt, ue.description)
|
|
1006
1010
|
}, Yn));
|
|
1007
1011
|
}, ca = () => /* @__PURE__ */ o.createElement($n, null);
|
|
1008
1012
|
export {
|