@wix/form-elements 0.0.0-stage → 1.53.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/LICENSE +21 -0
- package/README.md +118 -2
- package/dist/component/appointment-rac-Qa4fzPC_.js +1005 -0
- package/dist/component/bookings-address-rac-D9M-ozbl.js +6 -0
- package/dist/component/bookings-email-rac-BsQBkcmz.js +6 -0
- package/dist/component/bookings-first-name-rac-B3Ttwrj1.js +6 -0
- package/dist/component/bookings-header-rac-D1SGpqGf.js +8 -0
- package/dist/component/bookings-last-name-rac-B9O--4tU.js +6 -0
- package/dist/component/bookings-login-bar-rac-CHzNCOWx.js +74 -0
- package/dist/component/bookings-phone-rac-DhCGxcEU.js +6 -0
- package/dist/component/bookings-rich-text-rac-CftLqeZI.js +8 -0
- package/dist/component/calling-country-codes-PyWuOTmF.js +243 -0
- package/dist/component/checkbox-field-rac-B4NsTbRK.js +625 -0
- package/dist/component/checkbox-group-field-headless-qntvm5XF.js +204 -0
- package/dist/component/checkbox-group-field-rac-DwHc_GX9.js +33 -0
- package/dist/component/checkbox-group-rac-C1L8G1Y6.js +6 -0
- package/dist/component/checkbox-rac-DfbwQtOy.js +6 -0
- package/dist/component/chevron-down-icon-CcpVm6B-.js +15 -0
- package/dist/component/contacts-address-rac-Bstl5CRy.js +6 -0
- package/dist/component/contacts-birthdate-rac-DA4ijdaj.js +6 -0
- package/dist/component/contacts-company-rac-m0NA2GWU.js +6 -0
- package/dist/component/contacts-email-rac-DPVSYPew.js +6 -0
- package/dist/component/contacts-first-name-rac-C-JRqRzG.js +6 -0
- package/dist/component/contacts-last-name-rac-COBf-dyW.js +6 -0
- package/dist/component/contacts-phone-rac-Cw70dW7b.js +6 -0
- package/dist/component/contacts-position-rac-CMz19BR-.js +6 -0
- package/dist/component/contacts-subscribe-rac-KpLlwquo.js +13 -0
- package/dist/component/contacts-tax-id-rac-_uTLfEkF.js +6 -0
- package/dist/component/custom-focus-class-_483Pkwp.js +4 -0
- package/dist/component/data-hooks-Dkw1pbRj.js +6 -0
- package/dist/component/date-availability-DPHhHaFW.js +49 -0
- package/dist/component/date-input-field-rac-BrdGNXKw.js +286 -0
- package/dist/component/date-input-rac-D93biRsl.js +6 -0
- package/dist/component/date-picker-field-rac-ByhJ3Koo.js +304 -0
- package/dist/component/date-picker-rac-CuwcuCmJ.js +6 -0
- package/dist/component/date-time-input-field-rac-DY1u3LS6.js +421 -0
- package/dist/component/date-time-input-rac-BuGAMm_l.js +6 -0
- package/dist/component/default-limits-D7qVv_Hv.js +6 -0
- package/dist/component/dext-checkbox-group-rac-C3jCmtB7.js +18 -0
- package/dist/component/dext-checkbox-rac-dOvFH4gX.js +6 -0
- package/dist/component/dext-date-picker-rac-Bq6xFRoL.js +6 -0
- package/dist/component/dext-date-time-input-rac-9BE7wXiZ.js +6 -0
- package/dist/component/dext-dropdown-rac-j2ACAxk6.js +6 -0
- package/dist/component/dext-email-rac-CLoZGIl3.js +6 -0
- package/dist/component/dext-number-input-rac-D8IxqGdJ.js +6 -0
- package/dist/component/dext-phone-rac-B2Y-Ou4W.js +6 -0
- package/dist/component/dext-radio-group-rac-C88xnXTc.js +18 -0
- package/dist/component/dext-rating-input-rac-BArLS_bA.js +6 -0
- package/dist/component/dext-tags-rac-B9tKb852.js +18 -0
- package/dist/component/dext-text-area-rac-cBh24v0g.js +6 -0
- package/dist/component/dext-text-input-rac-B75yIKQa.js +6 -0
- package/dist/component/dext-url-input-rac-Da6T681p.js +6 -0
- package/dist/component/donation-rac-A0HtRtbH.js +305 -0
- package/dist/component/dropdown-field-headless-CYpFgZ3H.js +84 -0
- package/dist/component/dropdown-field-rac-B5emHw3_.js +32 -0
- package/dist/component/dropdown-rac-CRj3gKMe.js +6 -0
- package/dist/component/ecom-address-rac-ClBWgRGU.js +6 -0
- package/dist/component/ecom-subscription-checkbox-rac-DLvoidqP.js +49 -0
- package/dist/component/email-input-field-rac-Dq1HVu3Y.js +507 -0
- package/dist/component/error-icon-hZxQ6DEy.js +15 -0
- package/dist/component/events-repeater-rac-BwbNXM88.js +247 -0
- package/dist/component/events-rsvp-rac-BzVK7JNO.js +38 -0
- package/dist/component/field-error-headless-D40GACk4.js +34 -0
- package/dist/component/field-label-headless-Beq2Tn6V.js +52 -0
- package/dist/component/field-rac.module-DXfwku6m.js +21 -0
- package/dist/component/fieldset-headless-CD3fds9J.js +54 -0
- package/dist/component/file-upload-rac-BHqXPy1r.js +484 -0
- package/dist/component/find-child-C60k4CxG.js +11 -0
- package/dist/component/fixed-payment-rac-CSmY8yrQ.js +62 -0
- package/dist/component/form-Dn-MrArr.js +8890 -0
- package/dist/component/form-element-classes-Bi-nNM8q.js +55 -0
- package/dist/component/form.css +1 -0
- package/dist/component/form.js +9 -0
- package/dist/component/format-currency-BwShJ9vM.js +44 -0
- package/dist/component/get-first-day-of-the-week-DvnsxYhQ.js +118 -0
- package/dist/component/header-field-rac-DlUZ8kEf.js +25 -0
- package/dist/component/header-rac-CKAFxlLV.js +6 -0
- package/dist/component/headless-styles-CmcyA_pi.js +20 -0
- package/dist/component/helpers-HmkkXrh2.js +12 -0
- package/dist/component/image-choice-rac-DHtMOk8B.js +141 -0
- package/dist/component/index-0TWILUAM.js +64 -0
- package/dist/component/index-DS4A9cSk.js +2290 -0
- package/dist/component/isObject-BAwJJxQ3.js +34 -0
- package/dist/component/messages_ar-BZXnU2Gj.js +3517 -0
- package/dist/component/messages_ar-L1BYLZbF.js +20 -0
- package/dist/component/messages_ar-PAHg01OB.js +299 -0
- package/dist/component/messages_bg-CO56qlOt.js +299 -0
- package/dist/component/messages_bg-CQcGl0Yi.js +20 -0
- package/dist/component/messages_bg-DgbMwIbv.js +3515 -0
- package/dist/component/messages_ca-BAHE5nuo.js +3515 -0
- package/dist/component/messages_ca-BRoHmzRw.js +20 -0
- package/dist/component/messages_ca-Bl6rZi_O.js +299 -0
- package/dist/component/messages_cs-BADd3t_h.js +3515 -0
- package/dist/component/messages_cs-CDyWDExk.js +298 -0
- package/dist/component/messages_cs-wn5UmrBw.js +20 -0
- package/dist/component/messages_da-BPnmb9Qb.js +20 -0
- package/dist/component/messages_da-BvVUWnBz.js +3515 -0
- package/dist/component/messages_da-DHlpaT4q.js +298 -0
- package/dist/component/messages_de-2czOmM8X.js +3515 -0
- package/dist/component/messages_de-BKgzIF1d.js +298 -0
- package/dist/component/messages_de-Bwx84N0O.js +20 -0
- package/dist/component/messages_el-BnuYMjcf.js +299 -0
- package/dist/component/messages_el-_D2RUBSU.js +20 -0
- package/dist/component/messages_el-qCyH12Uq.js +3515 -0
- package/dist/component/messages_en-BWaixPd6.js +3518 -0
- package/dist/component/messages_en-CBBcgtxs.js +296 -0
- package/dist/component/messages_en-DvSLxqKp.js +20 -0
- package/dist/component/messages_es-Cq6i2xci.js +3515 -0
- package/dist/component/messages_es-DlGCLaYi.js +298 -0
- package/dist/component/messages_es-rCKXnGf0.js +20 -0
- package/dist/component/messages_fi-B-ciZGqD.js +3515 -0
- package/dist/component/messages_fi-DzKva_Wq.js +299 -0
- package/dist/component/messages_fi-PCCXPo0O.js +20 -0
- package/dist/component/messages_fr-2im0dcYp.js +3515 -0
- package/dist/component/messages_fr-DMFilq1G.js +298 -0
- package/dist/component/messages_fr-DQa1dT9u.js +20 -0
- package/dist/component/messages_he-Bb1qTc2Y.js +299 -0
- package/dist/component/messages_he-BfIkDo1h.js +3515 -0
- package/dist/component/messages_he-DwIysfDp.js +20 -0
- package/dist/component/messages_hi-Bty6ytCh.js +3515 -0
- package/dist/component/messages_hi-C-6UHGbM.js +298 -0
- package/dist/component/messages_hi-DF1w6b6B.js +20 -0
- package/dist/component/messages_hr-BXzIzU3d.js +20 -0
- package/dist/component/messages_hr-CiU1ZVrx.js +3515 -0
- package/dist/component/messages_hr-tRSM9lmc.js +299 -0
- package/dist/component/messages_hu-ChzHFUtB.js +3515 -0
- package/dist/component/messages_hu-D86Taf9R.js +299 -0
- package/dist/component/messages_hu-Z9XpByCO.js +20 -0
- package/dist/component/messages_id-3952ilBE.js +20 -0
- package/dist/component/messages_id-CPuhTUYV.js +298 -0
- package/dist/component/messages_id-Ddr3ijST.js +3515 -0
- package/dist/component/messages_it-B-A1X4BZ.js +298 -0
- package/dist/component/messages_it-DnUTUabT.js +20 -0
- package/dist/component/messages_it-eY6GnuZC.js +3515 -0
- package/dist/component/messages_ja-B3PxHv2c.js +3515 -0
- package/dist/component/messages_ja-Ced6ZBxD.js +298 -0
- package/dist/component/messages_ja-Cg7CqBUL.js +20 -0
- package/dist/component/messages_ko-DBCjHG4c.js +3515 -0
- package/dist/component/messages_ko-PKIrqwPk.js +298 -0
- package/dist/component/messages_ko-zvhtZMGA.js +20 -0
- package/dist/component/messages_lt-DV3hdFsp.js +3515 -0
- package/dist/component/messages_lt-DywusvNm.js +20 -0
- package/dist/component/messages_lt-zxcCPHno.js +299 -0
- package/dist/component/messages_lv-BEowUv-S.js +299 -0
- package/dist/component/messages_lv-DggJE2f9.js +20 -0
- package/dist/component/messages_lv-hIonzpTs.js +3515 -0
- package/dist/component/messages_ms-Ca0m7bf7.js +20 -0
- package/dist/component/messages_ms-Cvypo0vi.js +299 -0
- package/dist/component/messages_ms-DoMzA8a3.js +3515 -0
- package/dist/component/messages_nl-CEmANR_r.js +3515 -0
- package/dist/component/messages_nl-CZR4TvNo.js +298 -0
- package/dist/component/messages_nl-DgVYmdO9.js +20 -0
- package/dist/component/messages_no-B2BBaGBH.js +298 -0
- package/dist/component/messages_no-DJfJSlDm.js +3515 -0
- package/dist/component/messages_no-hPkfRJQ9.js +20 -0
- package/dist/component/messages_pl-Bzph-WyD.js +20 -0
- package/dist/component/messages_pl-ChJVH7RO.js +3515 -0
- package/dist/component/messages_pl-rCMsbMbN.js +298 -0
- package/dist/component/messages_pt-Bv63V1uB.js +3515 -0
- package/dist/component/messages_pt-CBgCNF3T.js +20 -0
- package/dist/component/messages_pt-Cx0FF6uF.js +298 -0
- package/dist/component/messages_ro-BvLoD_wE.js +299 -0
- package/dist/component/messages_ro-CMzcu-9b.js +20 -0
- package/dist/component/messages_ro-PVRK7Gx4.js +3515 -0
- package/dist/component/messages_ru-8BI6MYA0.js +3515 -0
- package/dist/component/messages_ru-BhRKVmVC.js +298 -0
- package/dist/component/messages_ru-C_BaQo57.js +20 -0
- package/dist/component/messages_sk-Bgi_3583.js +3515 -0
- package/dist/component/messages_sk-CrsC7rOj.js +20 -0
- package/dist/component/messages_sk-CtF-ei23.js +299 -0
- package/dist/component/messages_sl-B5t-KKi8.js +299 -0
- package/dist/component/messages_sl-BFdYWVHd.js +3515 -0
- package/dist/component/messages_sl-NqfmyUP1.js +20 -0
- package/dist/component/messages_sv-Bd1CcY6G.js +3515 -0
- package/dist/component/messages_sv-DPRT-DpN.js +20 -0
- package/dist/component/messages_sv-bQwbNmjr.js +298 -0
- package/dist/component/messages_th-BauH9qdo.js +20 -0
- package/dist/component/messages_th-C_dL_PCq.js +298 -0
- package/dist/component/messages_th-DEWm01uD.js +3515 -0
- package/dist/component/messages_tl-CouXLNcW.js +299 -0
- package/dist/component/messages_tl-D2t9Y_ZC.js +3515 -0
- package/dist/component/messages_tl-UDZY8Wuk.js +20 -0
- package/dist/component/messages_tr-2-OHesob.js +3515 -0
- package/dist/component/messages_tr-CpsxYTDb.js +20 -0
- package/dist/component/messages_tr-DHXnlj_j.js +298 -0
- package/dist/component/messages_uk-CPK4y5lH.js +298 -0
- package/dist/component/messages_uk-DIuQ2HoD.js +3515 -0
- package/dist/component/messages_uk-gPkmA_ar.js +20 -0
- package/dist/component/messages_vi-CgxB4Ey0.js +20 -0
- package/dist/component/messages_vi-DZeFWgwp.js +3515 -0
- package/dist/component/messages_vi-Det8i7_V.js +298 -0
- package/dist/component/messages_zh-D53_A4N9.js +298 -0
- package/dist/component/messages_zh-O552w5dp.js +20 -0
- package/dist/component/messages_zh-nG7LNxIt.js +3515 -0
- package/dist/component/multiline-address-field-rac-C0PUrp9n.js +1574 -0
- package/dist/component/multiline-address-rac-BuIrCxJO.js +6 -0
- package/dist/component/non-modal-popover-DtIMXHbe.js +63 -0
- package/dist/component/number-input-field-rac-DY3hBv5k.js +89 -0
- package/dist/component/number-input-rac-LU2RRhXv.js +6 -0
- package/dist/component/numeric-input-utils-CuBMi4-a.js +45 -0
- package/dist/component/options-layout-constants-DEfIEJWD.js +6 -0
- package/dist/component/options-rac.module-KM-VT_KY.js +7 -0
- package/dist/component/password-rac-CKUa-xXB.js +142 -0
- package/dist/component/payment-field-utils-DobiK5Xh.js +12 -0
- package/dist/component/payment-input-rac-4-nB0Dtf.js +137 -0
- package/dist/component/phone-input-field-rac-D-WSiybW.js +473 -0
- package/dist/component/phone-rac-CHpAV4y9.js +6 -0
- package/dist/component/product-list-rac-43aeb4bH.js +263 -0
- package/dist/component/quiz-radio-group-rac-CIp82PU6.js +13 -0
- package/dist/component/radio-group-field-rac-Ctu5L43b.js +40 -0
- package/dist/component/radio-group-field-rac.module-xWCK2zEh.js +124 -0
- package/dist/component/radio-group-rac-C2z9k9zW.js +6 -0
- package/dist/component/rating-input-field-rac-FGf61_-a.js +130 -0
- package/dist/component/rating-input-rac-B4_5V8X4.js +6 -0
- package/dist/component/rich-content-rac.module-DuFIPLXP.js +49 -0
- package/dist/component/rich-text-field-rac-B1PbdTgi.js +22 -0
- package/dist/component/rich-text-rac-D1PDXRg5.js +6 -0
- package/dist/component/ricos-viewer-chunk-B4rfbgjA.js +5 -0
- package/dist/component/service-dropdown-rac-DIFcHwYR.js +142 -0
- package/dist/component/services-multi-choice-rac-BVgZsVc2.js +76 -0
- package/dist/component/signature-rac-DoznfA7u.js +795 -0
- package/dist/component/submit-button-rac-DQFhhUWx.js +115 -0
- package/dist/component/tags-field-rac-F3yYmtiN.js +201 -0
- package/dist/component/tags-rac-BkJ8931D.js +6 -0
- package/dist/component/text-area-field-rac-BQXCdqvK.js +69 -0
- package/dist/component/text-area-rac-CI4idsCI.js +6 -0
- package/dist/component/text-input-field-rac-Di3rvMr8.js +24 -0
- package/dist/component/text-input-headless-BFldUMDr.js +44 -0
- package/dist/component/text-input-rac-v2DSKy7B.js +6 -0
- package/dist/component/time-input-rac-CcbyfeiV.js +152 -0
- package/dist/component/url-input-field-rac-CcMmHuDT.js +71 -0
- package/dist/component/url-input-rac-DtbctKi2.js +6 -0
- package/dist/component/use-invoke-callback-UH73A_J3.js +15 -0
- package/dist/component/use-service-options-base-Cr8hJp01.js +48 -0
- package/dist/component/use-synced-display-value-DcAxdn3M.js +19 -0
- package/dist/form.d.ts +6930 -0
- package/package.json +164 -3
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { RicosViewer as X } from "@wix/ricos/viewer";
|
|
2
|
+
import E from "classnames";
|
|
3
|
+
import t, { useMemo as g, useState as x, useCallback as w, useRef as B } from "react";
|
|
4
|
+
import { ag as D, ad as U, aa as A, H as k, a0 as q, r as i, aq as P, w as Z, J as ee, a7 as te, ai as V } from "./form-Dn-MrArr.js";
|
|
5
|
+
import { UNSAFE_PortalProvider as ae } from "react-aria";
|
|
6
|
+
import { ListBoxItem as ne, ListBox as re, Select as oe, TextField as $, SelectValue as se, Input as z } from "react-aria-components";
|
|
7
|
+
import { f as p, a as J } from "./find-child-C60k4CxG.js";
|
|
8
|
+
import { g as le } from "./helpers-HmkkXrh2.js";
|
|
9
|
+
import { D as ce, E as ie } from "./field-error-headless-D40GACk4.js";
|
|
10
|
+
import { L as me } from "./field-label-headless-Beq2Tn6V.js";
|
|
11
|
+
import { F as de } from "./fieldset-headless-CD3fds9J.js";
|
|
12
|
+
import { N as ue, S as pe } from "./non-modal-popover-DtIMXHbe.js";
|
|
13
|
+
import { C as Ee } from "./chevron-down-icon-CcpVm6B-.js";
|
|
14
|
+
import { E as be } from "./error-icon-hZxQ6DEy.js";
|
|
15
|
+
import { H as fe } from "./custom-focus-class-_483Pkwp.js";
|
|
16
|
+
import { s as u } from "./field-rac.module-DXfwku6m.js";
|
|
17
|
+
import { r as R, H as he, q as H, u as Ie, l as De, h as ye } from "./form-element-classes-Bi-nNM8q.js";
|
|
18
|
+
const n = ({ children: e, className: a }) => {
|
|
19
|
+
const { id: r, required: o, onBlur: s, onFocus: c, FieldLayout: l } = D(), { inputId: d, labelId: m, ariaDescribedBy: f } = U(), { regionalFormat: b } = A(), I = g(() => k(b).filter(q).map((v) => v.toUpperCase()), [
|
|
20
|
+
b
|
|
21
|
+
]), O = p(e, n.Label), T = p(e, n.Description), Y = p(e, n.Error), N = {
|
|
22
|
+
[i.MONTH]: p(e, n.Month),
|
|
23
|
+
[i.DAY]: p(e, n.Day),
|
|
24
|
+
[i.YEAR]: p(e, n.Year)
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ t.createElement(l, {
|
|
27
|
+
fieldId: r,
|
|
28
|
+
renderLabel: () => J(O, {
|
|
29
|
+
as: "div"
|
|
30
|
+
}),
|
|
31
|
+
renderInput: () => /* @__PURE__ */ t.createElement(de, {
|
|
32
|
+
id: d,
|
|
33
|
+
ariaLabelledBy: m,
|
|
34
|
+
ariaDescribedBy: f,
|
|
35
|
+
required: o,
|
|
36
|
+
onBlur: s,
|
|
37
|
+
onFocus: c,
|
|
38
|
+
className: a
|
|
39
|
+
}, N[I[0]], N[I[1]], N[I[2]]),
|
|
40
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, Y, T)
|
|
41
|
+
});
|
|
42
|
+
}, y = ({ children: e, className: a }) => {
|
|
43
|
+
const { disabled: r, readOnly: o, showDateLabels: s, hidePlaceholder: c } = D(), { labelId: l } = _(i.MONTH), { partValue: d, partError: m, onPartChange: f } = L(i.MONTH), { t: b } = P(), [I, O] = x(!1), [T, Y] = x(null), N = c ? void 0 : b("field.date.placeholder.month"), v = w((M) => {
|
|
44
|
+
o || f(typeof M == "string" ? M : "");
|
|
45
|
+
}, [
|
|
46
|
+
f,
|
|
47
|
+
o
|
|
48
|
+
]), K = w((M) => {
|
|
49
|
+
O(M && !o);
|
|
50
|
+
}, [
|
|
51
|
+
o
|
|
52
|
+
]), Q = p(e, y.Label), G = p(e, y.Trigger), W = p(e, y.Options);
|
|
53
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
54
|
+
className: a,
|
|
55
|
+
"data-date-field": !0
|
|
56
|
+
}, s ? Q : null, /* @__PURE__ */ t.createElement("div", {
|
|
57
|
+
ref: Y,
|
|
58
|
+
style: {
|
|
59
|
+
display: "contents"
|
|
60
|
+
}
|
|
61
|
+
}), /* @__PURE__ */ t.createElement(ae, {
|
|
62
|
+
getContainer: () => T
|
|
63
|
+
}, /* @__PURE__ */ t.createElement(oe, {
|
|
64
|
+
"aria-labelledby": s ? l : void 0,
|
|
65
|
+
value: d || null,
|
|
66
|
+
onChange: v,
|
|
67
|
+
isDisabled: r,
|
|
68
|
+
isInvalid: m,
|
|
69
|
+
placeholder: N,
|
|
70
|
+
isOpen: I,
|
|
71
|
+
onOpenChange: K
|
|
72
|
+
}, G, W)));
|
|
73
|
+
}, _e = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
|
|
74
|
+
datePart: i.MONTH,
|
|
75
|
+
className: e
|
|
76
|
+
}), ge = ({ children: e, className: a }) => {
|
|
77
|
+
const { id: r, readOnly: o } = D(), { inputId: s } = _(i.MONTH), { partError: c, isFirstPart: l } = L(i.MONTH), d = B(null);
|
|
78
|
+
return V(() => {
|
|
79
|
+
var m;
|
|
80
|
+
l && ((m = d.current) == null || m.focus());
|
|
81
|
+
}, r), /* @__PURE__ */ t.createElement(pe, {
|
|
82
|
+
ref: d,
|
|
83
|
+
id: s,
|
|
84
|
+
className: a,
|
|
85
|
+
"data-hook": i.MONTH,
|
|
86
|
+
"data-invalid": c || void 0,
|
|
87
|
+
"data-readonly": o || void 0
|
|
88
|
+
}, /* @__PURE__ */ t.createElement(se, null), e);
|
|
89
|
+
}, S = ({ children: e, className: a }) => {
|
|
90
|
+
const { language: r } = A(), o = g(() => le(r), [
|
|
91
|
+
r
|
|
92
|
+
]), s = p(e, S.Option) ?? /* @__PURE__ */ t.createElement(S.Option, null);
|
|
93
|
+
return /* @__PURE__ */ t.createElement(ue, {
|
|
94
|
+
className: a,
|
|
95
|
+
containerPadding: 0,
|
|
96
|
+
offset: 0
|
|
97
|
+
}, /* @__PURE__ */ t.createElement(re, null, o.map((c, l) => J(s, {
|
|
98
|
+
key: String(l + 1),
|
|
99
|
+
value: String(l + 1),
|
|
100
|
+
label: c
|
|
101
|
+
}))));
|
|
102
|
+
}, Le = ({ className: e, ...a }) => {
|
|
103
|
+
const { value: r, label: o } = a;
|
|
104
|
+
return /* @__PURE__ */ t.createElement(ne, {
|
|
105
|
+
className: e,
|
|
106
|
+
id: r,
|
|
107
|
+
textValue: o
|
|
108
|
+
}, o);
|
|
109
|
+
};
|
|
110
|
+
y.Label = _e;
|
|
111
|
+
y.Trigger = ge;
|
|
112
|
+
y.Options = S;
|
|
113
|
+
S.Option = Le;
|
|
114
|
+
const F = ({ children: e, className: a }) => {
|
|
115
|
+
const { disabled: r, readOnly: o, showDateLabels: s } = D(), { labelId: c } = _(i.DAY), { partValue: l, partError: d, onPartChange: m } = L(i.DAY), f = p(e, F.Label), b = p(e, F.Input);
|
|
116
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
117
|
+
className: a,
|
|
118
|
+
"data-date-field": !0
|
|
119
|
+
}, s && f, /* @__PURE__ */ t.createElement($, {
|
|
120
|
+
"aria-labelledby": s ? c : void 0,
|
|
121
|
+
value: l,
|
|
122
|
+
onChange: m,
|
|
123
|
+
isDisabled: r,
|
|
124
|
+
isReadOnly: o,
|
|
125
|
+
isInvalid: d
|
|
126
|
+
}, b));
|
|
127
|
+
}, Oe = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
|
|
128
|
+
datePart: i.DAY,
|
|
129
|
+
className: e
|
|
130
|
+
}), Ne = ({ className: e }) => {
|
|
131
|
+
const { id: a, hidePlaceholder: r } = D(), { inputId: o } = _(i.DAY), { isFirstPart: s } = L(i.DAY), { t: c } = P(), l = B(null), d = r ? void 0 : c("field.date.placeholder.day");
|
|
132
|
+
return V(() => {
|
|
133
|
+
var m;
|
|
134
|
+
s && ((m = l.current) == null || m.focus());
|
|
135
|
+
}, a), /* @__PURE__ */ t.createElement(z, {
|
|
136
|
+
ref: l,
|
|
137
|
+
id: o,
|
|
138
|
+
className: e,
|
|
139
|
+
placeholder: d,
|
|
140
|
+
maxLength: 2,
|
|
141
|
+
inputMode: "numeric",
|
|
142
|
+
"data-hook": i.DAY
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
F.Label = Oe;
|
|
146
|
+
F.Input = Ne;
|
|
147
|
+
const C = ({ children: e, className: a }) => {
|
|
148
|
+
const { disabled: r, readOnly: o, showDateLabels: s } = D(), { labelId: c } = _(i.YEAR), { partValue: l, partError: d, onPartChange: m } = L(i.YEAR), f = p(e, C.Label), b = p(e, C.Input);
|
|
149
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
150
|
+
className: a,
|
|
151
|
+
"data-date-field": !0
|
|
152
|
+
}, s && f, /* @__PURE__ */ t.createElement($, {
|
|
153
|
+
"aria-labelledby": s ? c : void 0,
|
|
154
|
+
value: l,
|
|
155
|
+
onChange: m,
|
|
156
|
+
isDisabled: r,
|
|
157
|
+
isReadOnly: o,
|
|
158
|
+
isInvalid: d
|
|
159
|
+
}, b));
|
|
160
|
+
}, Fe = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
|
|
161
|
+
datePart: i.YEAR,
|
|
162
|
+
className: e
|
|
163
|
+
}), Ce = ({ className: e }) => {
|
|
164
|
+
const { id: a, hidePlaceholder: r } = D(), { inputId: o } = _(i.YEAR), { isFirstPart: s } = L(i.YEAR), { t: c } = P(), l = B(null), d = r ? void 0 : c("field.date.placeholder.year");
|
|
165
|
+
return V(() => {
|
|
166
|
+
var m;
|
|
167
|
+
s && ((m = l.current) == null || m.focus());
|
|
168
|
+
}, a), /* @__PURE__ */ t.createElement(z, {
|
|
169
|
+
ref: l,
|
|
170
|
+
id: o,
|
|
171
|
+
className: e,
|
|
172
|
+
placeholder: d,
|
|
173
|
+
maxLength: 4,
|
|
174
|
+
inputMode: "numeric",
|
|
175
|
+
"data-hook": i.YEAR
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
C.Label = Fe;
|
|
179
|
+
C.Input = Ce;
|
|
180
|
+
n.Label = me;
|
|
181
|
+
n.Month = y;
|
|
182
|
+
n.Day = F;
|
|
183
|
+
n.Year = C;
|
|
184
|
+
n.Description = ce;
|
|
185
|
+
n.Error = ie;
|
|
186
|
+
function _(e) {
|
|
187
|
+
const { inputId: a } = U();
|
|
188
|
+
return g(() => {
|
|
189
|
+
const r = e.toLowerCase();
|
|
190
|
+
return {
|
|
191
|
+
inputId: `${a}-${r}-input`,
|
|
192
|
+
labelId: `${a}-${r}-label`
|
|
193
|
+
};
|
|
194
|
+
}, [
|
|
195
|
+
a,
|
|
196
|
+
e
|
|
197
|
+
]);
|
|
198
|
+
}
|
|
199
|
+
function L(e) {
|
|
200
|
+
const { value: a, onChange: r, hasError: o = !1 } = D(), { regionalFormat: s } = A(), c = g(() => Z(a ?? ""), [
|
|
201
|
+
a
|
|
202
|
+
]), l = g(() => ee(o, a ?? ""), [
|
|
203
|
+
a,
|
|
204
|
+
o
|
|
205
|
+
]), d = c[e] || "", m = w((b) => {
|
|
206
|
+
const I = te(b, e, c);
|
|
207
|
+
r(I);
|
|
208
|
+
}, [
|
|
209
|
+
r,
|
|
210
|
+
c,
|
|
211
|
+
e
|
|
212
|
+
]), f = g(() => k(s).filter(q).map((O) => O.toUpperCase())[0] === e, [
|
|
213
|
+
s,
|
|
214
|
+
e
|
|
215
|
+
]);
|
|
216
|
+
return {
|
|
217
|
+
partValue: d,
|
|
218
|
+
partError: l[e],
|
|
219
|
+
onPartChange: m,
|
|
220
|
+
isFirstPart: f
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function j({ datePart: e, className: a }) {
|
|
224
|
+
const { inputId: r, labelId: o } = _(e), { t: s } = P(), c = `field.date.label.${e.toLowerCase()}`, l = s(c);
|
|
225
|
+
return /* @__PURE__ */ t.createElement("label", {
|
|
226
|
+
id: o,
|
|
227
|
+
htmlFor: r,
|
|
228
|
+
className: a
|
|
229
|
+
}, l);
|
|
230
|
+
}
|
|
231
|
+
const Me = "_fields_12ojb_1", Re = "_month_12ojb_9", Se = "_day_12ojb_10", Ae = "_year_12ojb_11", Pe = "_mobile_12ojb_25", Te = "_dayInput_12ojb_37", Ye = "_yearInput_12ojb_38", ve = "_monthTrigger_12ojb_42", He = "_monthOption_12ojb_62", h = {
|
|
232
|
+
fields: Me,
|
|
233
|
+
month: Re,
|
|
234
|
+
day: Se,
|
|
235
|
+
year: Ae,
|
|
236
|
+
mobile: Pe,
|
|
237
|
+
dayInput: Te,
|
|
238
|
+
yearInput: Ye,
|
|
239
|
+
monthTrigger: ve,
|
|
240
|
+
monthOption: He
|
|
241
|
+
}, we = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(X, {
|
|
242
|
+
content: e,
|
|
243
|
+
locale: a
|
|
244
|
+
}), tt = () => {
|
|
245
|
+
const { isMobile: e } = A();
|
|
246
|
+
return /* @__PURE__ */ t.createElement(n, {
|
|
247
|
+
className: E(h.fields, {
|
|
248
|
+
[h.mobile]: e
|
|
249
|
+
})
|
|
250
|
+
}, /* @__PURE__ */ t.createElement(n.Label, {
|
|
251
|
+
className: E(R, u.label)
|
|
252
|
+
}, /* @__PURE__ */ t.createElement(n.Label.Required, {
|
|
253
|
+
className: E(he, u.requiredMark)
|
|
254
|
+
})), /* @__PURE__ */ t.createElement(n.Month, {
|
|
255
|
+
className: h.month
|
|
256
|
+
}, /* @__PURE__ */ t.createElement(n.Month.Label, {
|
|
257
|
+
className: E(R, u.label)
|
|
258
|
+
}), /* @__PURE__ */ t.createElement(n.Month.Trigger, {
|
|
259
|
+
className: E(H, u.input, h.monthTrigger)
|
|
260
|
+
}, /* @__PURE__ */ t.createElement(Ee, {
|
|
261
|
+
className: u.dropdownIcon
|
|
262
|
+
})), /* @__PURE__ */ t.createElement(n.Month.Options, {
|
|
263
|
+
className: E(Ie, u.selectPopover, u.dropdownPopover)
|
|
264
|
+
}, /* @__PURE__ */ t.createElement(n.Month.Options.Option, {
|
|
265
|
+
className: E(u.selectOption, h.monthOption, fe)
|
|
266
|
+
}))), /* @__PURE__ */ t.createElement(n.Day, {
|
|
267
|
+
className: h.day
|
|
268
|
+
}, /* @__PURE__ */ t.createElement(n.Day.Label, {
|
|
269
|
+
className: E(R, u.label)
|
|
270
|
+
}), /* @__PURE__ */ t.createElement(n.Day.Input, {
|
|
271
|
+
className: E(H, u.input, h.dayInput)
|
|
272
|
+
})), /* @__PURE__ */ t.createElement(n.Year, {
|
|
273
|
+
className: h.year
|
|
274
|
+
}, /* @__PURE__ */ t.createElement(n.Year.Label, {
|
|
275
|
+
className: E(R, u.label)
|
|
276
|
+
}), /* @__PURE__ */ t.createElement(n.Year.Input, {
|
|
277
|
+
className: E(H, u.input, h.yearInput)
|
|
278
|
+
})), /* @__PURE__ */ t.createElement(n.Error, {
|
|
279
|
+
className: E(De, u.error)
|
|
280
|
+
}, /* @__PURE__ */ t.createElement(be, null), /* @__PURE__ */ t.createElement(n.Error.Text, null)), /* @__PURE__ */ t.createElement(n.Description, {
|
|
281
|
+
className: E(ye, u.description)
|
|
282
|
+
}, we));
|
|
283
|
+
};
|
|
284
|
+
export {
|
|
285
|
+
tt as D
|
|
286
|
+
};
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { RicosViewer as G } from "@wix/ricos/viewer";
|
|
2
|
+
import y from "classnames";
|
|
3
|
+
import e, { useState as Q, useCallback as F, useContext as Z, useRef as L, useMemo as _ } from "react";
|
|
4
|
+
import { D, ag as v, ad as A, aa as S, ai as z } from "./form-Dn-MrArr.js";
|
|
5
|
+
import { parseDate as J } from "@internationalized/date";
|
|
6
|
+
import { UNSAFE_PortalProvider as X } from "react-aria";
|
|
7
|
+
import { I18nProvider as ee, DatePicker as te, DatePickerStateContext as re, Group as ae, DateInput as ne, DateSegment as oe, Dialog as le, Calendar as se, CalendarMonthPicker as ce, CalendarYearPicker as ie, CalendarGrid as me, CalendarCell as ue, Button as R, Select as O, SelectValue as x, ListBox as M, ListBoxItem as k } from "react-aria-components";
|
|
8
|
+
import { g as de } from "./get-first-day-of-the-week-DvnsxYhQ.js";
|
|
9
|
+
import { f as E, a as b } from "./find-child-C60k4CxG.js";
|
|
10
|
+
import { D as ge, E as Ee } from "./field-error-headless-D40GACk4.js";
|
|
11
|
+
import { L as pe } from "./field-label-headless-Beq2Tn6V.js";
|
|
12
|
+
import { D as De, N as I, S as w } from "./non-modal-popover-DtIMXHbe.js";
|
|
13
|
+
import { i as fe } from "./date-availability-DPHhHaFW.js";
|
|
14
|
+
import { C as N } from "./chevron-down-icon-CcpVm6B-.js";
|
|
15
|
+
import { E as Ce } from "./error-icon-hZxQ6DEy.js";
|
|
16
|
+
import { s as p } from "./field-rac.module-DXfwku6m.js";
|
|
17
|
+
import { r as ye, H as he, q as ve, u as Se, l as Te, h as be } from "./form-element-classes-Bi-nNM8q.js";
|
|
18
|
+
const _e = [
|
|
19
|
+
D.SUNDAY,
|
|
20
|
+
D.MONDAY,
|
|
21
|
+
D.TUESDAY,
|
|
22
|
+
D.WEDNESDAY,
|
|
23
|
+
D.THURSDAY,
|
|
24
|
+
D.FRIDAY,
|
|
25
|
+
D.SATURDAY
|
|
26
|
+
], Ne = {
|
|
27
|
+
availableDays: _e
|
|
28
|
+
}, a = ({ children: t }) => {
|
|
29
|
+
const { id: r, value: n, onChange: l, disabled: i, required: c, onBlur: d, onFocus: o, FieldLayout: m, hasError: u, readOnly: f } = v(), { labelId: C } = A(), { regionalFormat: s } = S(), [T, Y] = Q(null), B = F((H) => {
|
|
30
|
+
const j = ke(H);
|
|
31
|
+
l(j);
|
|
32
|
+
}, [
|
|
33
|
+
l
|
|
34
|
+
]), q = E(t, a.Label), V = E(t, a.Control), U = E(t, a.Calendar), W = E(t, a.Description), K = E(t, a.Error), $ = Me(n);
|
|
35
|
+
return /* @__PURE__ */ e.createElement(m, {
|
|
36
|
+
fieldId: r,
|
|
37
|
+
renderLabel: () => q,
|
|
38
|
+
renderInput: () => /* @__PURE__ */ e.createElement(ee, {
|
|
39
|
+
locale: s
|
|
40
|
+
}, /* @__PURE__ */ e.createElement("div", {
|
|
41
|
+
ref: Y,
|
|
42
|
+
style: {
|
|
43
|
+
display: "contents"
|
|
44
|
+
}
|
|
45
|
+
}), /* @__PURE__ */ e.createElement(X, {
|
|
46
|
+
getContainer: () => T
|
|
47
|
+
}, /* @__PURE__ */ e.createElement(te, {
|
|
48
|
+
"aria-labelledby": C,
|
|
49
|
+
value: $,
|
|
50
|
+
onChange: B,
|
|
51
|
+
isDisabled: i,
|
|
52
|
+
isInvalid: u,
|
|
53
|
+
isReadOnly: f,
|
|
54
|
+
isRequired: c,
|
|
55
|
+
onBlur: d,
|
|
56
|
+
onFocus: o
|
|
57
|
+
}, V, U))),
|
|
58
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, K, W)
|
|
59
|
+
});
|
|
60
|
+
}, Ie = ({ children: t, className: r }) => {
|
|
61
|
+
const { inputId: n, ariaDescribedBy: l } = A(), { hasError: i, disabled: c, readOnly: d } = v(), o = Z(re), m = F((u) => {
|
|
62
|
+
if (!o || o.isOpen || c || d)
|
|
63
|
+
return;
|
|
64
|
+
const f = u.target;
|
|
65
|
+
if (f.closest("button"))
|
|
66
|
+
return;
|
|
67
|
+
const C = f.closest("[data-type]");
|
|
68
|
+
C && C.getAttribute("data-type") !== "literal" || o.setOpen(!0);
|
|
69
|
+
}, [
|
|
70
|
+
o,
|
|
71
|
+
c,
|
|
72
|
+
d
|
|
73
|
+
]);
|
|
74
|
+
return /* @__PURE__ */ e.createElement(ae, {
|
|
75
|
+
id: n,
|
|
76
|
+
"aria-describedby": l,
|
|
77
|
+
className: r,
|
|
78
|
+
"data-invalid": i,
|
|
79
|
+
onPointerDownCapture: m
|
|
80
|
+
}, t);
|
|
81
|
+
}, Le = ({ className: t }) => {
|
|
82
|
+
const { id: r, placeholder: n } = v(), { regionalFormat: l } = S(), i = L(null), c = L(!1);
|
|
83
|
+
z(() => {
|
|
84
|
+
var o;
|
|
85
|
+
(o = i.current) == null || o.focus();
|
|
86
|
+
}, r);
|
|
87
|
+
const d = _(() => we(l), [
|
|
88
|
+
l
|
|
89
|
+
]);
|
|
90
|
+
return /* @__PURE__ */ e.createElement(ne, {
|
|
91
|
+
className: t
|
|
92
|
+
}, (o) => {
|
|
93
|
+
const m = o.type === d && o.isPlaceholder && !!n;
|
|
94
|
+
return /* @__PURE__ */ e.createElement(oe, {
|
|
95
|
+
segment: o,
|
|
96
|
+
"data-first-segment": m || void 0,
|
|
97
|
+
ref: (u) => {
|
|
98
|
+
if (!u && c.current) {
|
|
99
|
+
i.current = null, c.current = !1;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (u && !c.current) {
|
|
103
|
+
i.current = u, c.current = !0;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, (u) => !u.isPlaceholder || !n ? u.text : m ? n : u.text);
|
|
108
|
+
});
|
|
109
|
+
}, Pe = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(De, {
|
|
110
|
+
className: r
|
|
111
|
+
}, t), g = ({ children: t, className: r }) => {
|
|
112
|
+
const { regionalFormat: n, isMobile: l } = S(), { availability: i } = v(), c = _(() => de(n), [
|
|
113
|
+
n
|
|
114
|
+
]), d = _(() => (s) => {
|
|
115
|
+
const T = new Date(s.year, s.month - 1, s.day);
|
|
116
|
+
return !fe(T, i || Ne);
|
|
117
|
+
}, [
|
|
118
|
+
i
|
|
119
|
+
]), o = E(t, g.Day) ?? /* @__PURE__ */ e.createElement(g.Day, null), m = E(t, g.PreviousTrigger), u = E(t, g.NextTrigger), f = E(t, g.MonthTrigger), C = E(t, g.YearTrigger);
|
|
120
|
+
return /* @__PURE__ */ e.createElement(I, {
|
|
121
|
+
className: r,
|
|
122
|
+
containerPadding: 0
|
|
123
|
+
}, /* @__PURE__ */ e.createElement(le, null, /* @__PURE__ */ e.createElement(se, {
|
|
124
|
+
firstDayOfWeek: Ye(c),
|
|
125
|
+
isDateUnavailable: d
|
|
126
|
+
}, /* @__PURE__ */ e.createElement("header", null, m, /* @__PURE__ */ e.createElement(ce, null, (s) => b(f, {
|
|
127
|
+
ariaLabel: s["aria-label"],
|
|
128
|
+
selectedKey: s.value,
|
|
129
|
+
onSelectionChange: s.onChange,
|
|
130
|
+
items: s.items,
|
|
131
|
+
popoverClassName: r
|
|
132
|
+
})), /* @__PURE__ */ e.createElement(ie, {
|
|
133
|
+
visibleYears: 100
|
|
134
|
+
}, (s) => b(C, {
|
|
135
|
+
ariaLabel: s["aria-label"],
|
|
136
|
+
selectedKey: s.value,
|
|
137
|
+
onSelectionChange: s.onChange,
|
|
138
|
+
items: s.items,
|
|
139
|
+
popoverClassName: r
|
|
140
|
+
})), u), /* @__PURE__ */ e.createElement(me, {
|
|
141
|
+
weekdayStyle: l ? "narrow" : "short"
|
|
142
|
+
}, (s) => b(o, {
|
|
143
|
+
date: s
|
|
144
|
+
})))));
|
|
145
|
+
}, Fe = ({ className: t, ...r }) => {
|
|
146
|
+
const { date: n } = r;
|
|
147
|
+
return /* @__PURE__ */ e.createElement(ue, {
|
|
148
|
+
className: t,
|
|
149
|
+
date: n
|
|
150
|
+
});
|
|
151
|
+
}, Ae = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(R, {
|
|
152
|
+
slot: "previous",
|
|
153
|
+
className: r
|
|
154
|
+
}, t), Re = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(R, {
|
|
155
|
+
slot: "next",
|
|
156
|
+
className: r
|
|
157
|
+
}, t), Oe = ({ children: t, className: r, ...n }) => {
|
|
158
|
+
const { ariaLabel: l, selectedKey: i, onSelectionChange: c, items: d, popoverClassName: o } = n;
|
|
159
|
+
return /* @__PURE__ */ e.createElement(O, {
|
|
160
|
+
"aria-label": l,
|
|
161
|
+
selectedKey: i,
|
|
162
|
+
onSelectionChange: c
|
|
163
|
+
}, /* @__PURE__ */ e.createElement(w, {
|
|
164
|
+
className: r
|
|
165
|
+
}, /* @__PURE__ */ e.createElement(x, null), t), /* @__PURE__ */ e.createElement(I, {
|
|
166
|
+
className: o,
|
|
167
|
+
containerPadding: 0
|
|
168
|
+
}, /* @__PURE__ */ e.createElement(M, {
|
|
169
|
+
items: d
|
|
170
|
+
}, (m) => /* @__PURE__ */ e.createElement(k, {
|
|
171
|
+
id: m.id
|
|
172
|
+
}, m.formatted))));
|
|
173
|
+
}, xe = ({ children: t, className: r, ...n }) => {
|
|
174
|
+
const { ariaLabel: l, selectedKey: i, onSelectionChange: c, items: d, popoverClassName: o } = n;
|
|
175
|
+
return /* @__PURE__ */ e.createElement(O, {
|
|
176
|
+
"aria-label": l,
|
|
177
|
+
selectedKey: i,
|
|
178
|
+
onSelectionChange: c
|
|
179
|
+
}, /* @__PURE__ */ e.createElement(w, {
|
|
180
|
+
className: r
|
|
181
|
+
}, /* @__PURE__ */ e.createElement(x, null), t), /* @__PURE__ */ e.createElement(I, {
|
|
182
|
+
className: o,
|
|
183
|
+
containerPadding: 0
|
|
184
|
+
}, /* @__PURE__ */ e.createElement(M, {
|
|
185
|
+
items: d
|
|
186
|
+
}, (m) => /* @__PURE__ */ e.createElement(k, {
|
|
187
|
+
id: m.id
|
|
188
|
+
}, m.formatted))));
|
|
189
|
+
};
|
|
190
|
+
g.Day = Fe;
|
|
191
|
+
g.PreviousTrigger = Ae;
|
|
192
|
+
g.NextTrigger = Re;
|
|
193
|
+
g.MonthTrigger = Oe;
|
|
194
|
+
g.YearTrigger = xe;
|
|
195
|
+
a.Label = pe;
|
|
196
|
+
a.Control = Ie;
|
|
197
|
+
a.Input = Le;
|
|
198
|
+
a.Trigger = Pe;
|
|
199
|
+
a.Calendar = g;
|
|
200
|
+
a.Description = ge;
|
|
201
|
+
a.Error = Ee;
|
|
202
|
+
function Me(t) {
|
|
203
|
+
if (!t)
|
|
204
|
+
return null;
|
|
205
|
+
try {
|
|
206
|
+
return J(t);
|
|
207
|
+
} catch {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function ke(t) {
|
|
212
|
+
if (!t)
|
|
213
|
+
return null;
|
|
214
|
+
const r = String(t.year).padStart(4, "0"), n = String(t.month).padStart(2, "0"), l = String(t.day).padStart(2, "0");
|
|
215
|
+
return `${r}-${n}-${l}`;
|
|
216
|
+
}
|
|
217
|
+
function we(t) {
|
|
218
|
+
var r;
|
|
219
|
+
try {
|
|
220
|
+
return ((r = new Intl.DateTimeFormat(t, {
|
|
221
|
+
year: "numeric",
|
|
222
|
+
month: "2-digit",
|
|
223
|
+
day: "2-digit"
|
|
224
|
+
}).formatToParts(/* @__PURE__ */ new Date()).find((l) => l.type !== "literal")) == null ? void 0 : r.type) ?? "month";
|
|
225
|
+
} catch {
|
|
226
|
+
return "month";
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function Ye(t) {
|
|
230
|
+
return [
|
|
231
|
+
"sun",
|
|
232
|
+
"mon",
|
|
233
|
+
"tue",
|
|
234
|
+
"wed",
|
|
235
|
+
"thu",
|
|
236
|
+
"fri",
|
|
237
|
+
"sat"
|
|
238
|
+
][t] || "mon";
|
|
239
|
+
}
|
|
240
|
+
const Be = (t) => /* @__PURE__ */ e.createElement("svg", {
|
|
241
|
+
viewBox: "0 0 24 24",
|
|
242
|
+
fill: "none",
|
|
243
|
+
width: 14,
|
|
244
|
+
height: 14,
|
|
245
|
+
"aria-hidden": "true",
|
|
246
|
+
...t
|
|
247
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
|
248
|
+
d: "M7 2v2M17 2v2M3 8h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z",
|
|
249
|
+
stroke: "currentColor",
|
|
250
|
+
strokeWidth: "1.5",
|
|
251
|
+
strokeLinecap: "round",
|
|
252
|
+
strokeLinejoin: "round"
|
|
253
|
+
})), qe = "_control_1xqv5_1", Ve = "_segments_1xqv5_14", Ue = "_trigger_1xqv5_65", We = "_calendarPopover_1xqv5_96", Ke = "_calendarDay_1xqv5_219", $e = "_mobile_1xqv5_262", h = {
|
|
254
|
+
control: qe,
|
|
255
|
+
segments: Ve,
|
|
256
|
+
trigger: Ue,
|
|
257
|
+
calendarPopover: We,
|
|
258
|
+
calendarDay: Ke,
|
|
259
|
+
mobile: $e
|
|
260
|
+
}, He = ({ content: t, locale: r }) => /* @__PURE__ */ e.createElement(G, {
|
|
261
|
+
content: t,
|
|
262
|
+
locale: r
|
|
263
|
+
}), je = {
|
|
264
|
+
left: 90,
|
|
265
|
+
right: -90
|
|
266
|
+
}, P = ({ direction: t }) => /* @__PURE__ */ e.createElement(N, {
|
|
267
|
+
style: {
|
|
268
|
+
transform: `rotate(${je[t]}deg)`
|
|
269
|
+
}
|
|
270
|
+
}), ut = () => {
|
|
271
|
+
const { isMobile: t } = S();
|
|
272
|
+
return /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(a.Label, {
|
|
273
|
+
className: y(ye, p.label)
|
|
274
|
+
}, /* @__PURE__ */ e.createElement(a.Label.Required, {
|
|
275
|
+
className: y(he, p.requiredMark)
|
|
276
|
+
})), /* @__PURE__ */ e.createElement(a.Control, {
|
|
277
|
+
className: y(ve, p.input, h.control)
|
|
278
|
+
}, /* @__PURE__ */ e.createElement(a.Trigger, {
|
|
279
|
+
className: h.trigger
|
|
280
|
+
}, /* @__PURE__ */ e.createElement(Be, null)), /* @__PURE__ */ e.createElement(a.Input, {
|
|
281
|
+
className: h.segments
|
|
282
|
+
})), /* @__PURE__ */ e.createElement(a.Calendar, {
|
|
283
|
+
className: y(Se, p.selectPopover, h.calendarPopover, {
|
|
284
|
+
[h.mobile]: t
|
|
285
|
+
})
|
|
286
|
+
}, /* @__PURE__ */ e.createElement(a.Calendar.PreviousTrigger, null, /* @__PURE__ */ e.createElement(P, {
|
|
287
|
+
direction: "left"
|
|
288
|
+
})), /* @__PURE__ */ e.createElement(a.Calendar.MonthTrigger, null, /* @__PURE__ */ e.createElement(N, {
|
|
289
|
+
className: p.dropdownIcon
|
|
290
|
+
})), /* @__PURE__ */ e.createElement(a.Calendar.YearTrigger, null, /* @__PURE__ */ e.createElement(N, {
|
|
291
|
+
className: p.dropdownIcon
|
|
292
|
+
})), /* @__PURE__ */ e.createElement(a.Calendar.NextTrigger, null, /* @__PURE__ */ e.createElement(P, {
|
|
293
|
+
direction: "right"
|
|
294
|
+
})), /* @__PURE__ */ e.createElement(a.Calendar.Day, {
|
|
295
|
+
className: h.calendarDay
|
|
296
|
+
})), /* @__PURE__ */ e.createElement(a.Error, {
|
|
297
|
+
className: y(Te, p.error)
|
|
298
|
+
}, /* @__PURE__ */ e.createElement(Ce, null), /* @__PURE__ */ e.createElement(a.Error.Text, null)), /* @__PURE__ */ e.createElement(a.Description, {
|
|
299
|
+
className: y(be, p.description)
|
|
300
|
+
}, He));
|
|
301
|
+
};
|
|
302
|
+
export {
|
|
303
|
+
ut as D
|
|
304
|
+
};
|