@wix/form-elements 1.224.0 → 1.225.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-UcRjJTHp.js → appointment-rac-DfglpMHC.js} +5 -5
- package/dist/component/{bookings-address-rac-DDjZGEhk.js → bookings-address-rac-BsAUAgUH.js} +1 -1
- package/dist/component/{bookings-email-rac-Dy2vh3dy.js → bookings-email-rac-DL0Q3omz.js} +1 -1
- package/dist/component/{bookings-first-name-rac-fDHMNznn.js → bookings-first-name-rac-C3eHsd6U.js} +1 -1
- package/dist/component/{bookings-header-rac-DLOeNNQf.js → bookings-header-rac-YVCqWtfu.js} +1 -1
- package/dist/component/{bookings-last-name-rac-Bx19ROVT.js → bookings-last-name-rac-BzBQBIMy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-8FbvPiv1.js → bookings-login-bar-rac-MJvhVfsH.js} +1 -1
- package/dist/component/{bookings-phone-rac-CvPQgtvq.js → bookings-phone-rac-BTEB2Mzf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CO8bHRpD.js → bookings-rich-text-rac-BopQG6gV.js} +1 -1
- package/dist/component/calendar-icon-DOeHn3jt.js +19 -0
- package/dist/component/{checkbox-field-rac-tzsGw10P.js → checkbox-field-rac-NvQt_qcN.js} +6 -6
- package/dist/component/{checkbox-group-field-headless-CL18dpkq.js → checkbox-group-field-headless-CwLaBukh.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-BmbxaprJ.js → checkbox-group-field-rac-BKQhos1K.js} +6 -6
- package/dist/component/{checkbox-group-rac-shsbUvRc.js → checkbox-group-rac-DMeC2rsZ.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-DOxE4UQg.js → checkbox-indicator-module-classes-Cozvs_kk.js} +1 -1
- package/dist/component/{checkbox-rac-CobYYayd.js → checkbox-rac-Dea1HbEL.js} +1 -1
- package/dist/component/{contacts-address-rac-BoDqJCi1.js → contacts-address-rac-B64jiofc.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-GAujbm-z.js → contacts-birthdate-rac-CM4GjTBV.js} +1 -1
- package/dist/component/{contacts-company-rac-CLcEz04V.js → contacts-company-rac-DTf9dwuR.js} +1 -1
- package/dist/component/{contacts-email-rac-D9q7TJwy.js → contacts-email-rac-B2vhNF_y.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BAecbeNQ.js → contacts-first-name-rac-C5ywHnnX.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Ccrw8BDa.js → contacts-last-name-rac-C2JbeG_J.js} +1 -1
- package/dist/component/{contacts-phone-rac-DA2N033V.js → contacts-phone-rac-Dm0PS175.js} +1 -1
- package/dist/component/{contacts-position-rac-0lAd-nCW.js → contacts-position-rac-t6bWP1Yh.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DB2ssF-E.js → contacts-subscribe-rac-D5EWQfGj.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B-Sn92Ho.js → contacts-tax-id-rac-CXqezyXg.js} +1 -1
- package/dist/component/{date-availability-CtfWLvii.js → date-availability-CtrbZvl3.js} +1 -1
- package/dist/component/date-input-field-rac-CPLAqaMS.js +365 -0
- package/dist/component/{date-input-rac-BnWwBe2i.js → date-input-rac-DjQc-F8G.js} +1 -1
- package/dist/component/date-picker-field-rac-pA2HwauY.js +386 -0
- package/dist/component/{date-picker-rac-BhI6jOQE.js → date-picker-rac-B6M3C8dN.js} +1 -1
- package/dist/component/date-time-input-field-rac-Qz6g31Eu.js +507 -0
- package/dist/component/{date-time-input-rac-DAbopLQt.js → date-time-input-rac-D7bS3bUX.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-D_HLv0tP.js → dext-checkbox-group-rac-caVwDBtB.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BnBTlqEI.js → dext-checkbox-rac-CMxPnPT3.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Co_yfhuz.js → dext-date-picker-rac-5WBCluMk.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BSpUehb2.js → dext-date-time-input-rac-C5d1PKMu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DPApx74L.js → dext-dropdown-rac-BPeVs1gI.js} +1 -1
- package/dist/component/{dext-email-rac-Dns6jFl4.js → dext-email-rac-BTXfUaaY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DfN-xRID.js → dext-number-input-rac-DJt_dDVj.js} +1 -1
- package/dist/component/{dext-phone-rac-b5Ix3aTQ.js → dext-phone-rac-DDtneNPi.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BAwIkDsJ.js → dext-radio-group-rac-DzLW_As4.js} +2 -2
- package/dist/component/{dext-rating-input-rac-mwQpCQUI.js → dext-rating-input-rac-0wwq1TR3.js} +1 -1
- package/dist/component/{dext-tags-rac-BGmElgw8.js → dext-tags-rac-Cj7nIZWu.js} +2 -2
- package/dist/component/{dext-text-area-rac-DN5HPqdg.js → dext-text-area-rac-D4Ej9MYY.js} +1 -1
- package/dist/component/{dext-text-input-rac-DEyDRhQ2.js → dext-text-input-rac-DgqBl2cb.js} +1 -1
- package/dist/component/{dext-url-input-rac-B1o3BAZE.js → dext-url-input-rac-CH-5gGxA.js} +1 -1
- package/dist/component/dismiss-icon-ejA47noY.js +69 -0
- package/dist/component/{donation-rac-Dp6PmATz.js → donation-rac-BwpE1YTR.js} +6 -6
- package/dist/component/dropdown-field-rac-CeywMN1E.js +40 -0
- package/dist/component/{dropdown-rac-eqQW-Z9k.js → dropdown-rac-DiXJLvXK.js} +1 -1
- package/dist/component/{ecom-address-rac-Q02N1v6i.js → ecom-address-rac-MD0hbW1w.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CmqVje9n.js → ecom-subscription-checkbox-rac-BssVeeXB.js} +2 -2
- package/dist/component/{email-input-field-rac-HmrdF3g7.js → email-input-field-rac-BXoueQNf.js} +4 -4
- package/dist/component/{events-repeater-rac-BSML2My0.js → events-repeater-rac-fm6lHaJ2.js} +6 -6
- package/dist/component/{events-rsvp-rac-0pI3cb2e.js → events-rsvp-rac-QV9f5chX.js} +4 -4
- package/dist/component/{field-error-headless-B3U_Gymg.js → field-error-headless-BIzDViIC.js} +1 -1
- package/dist/component/{field-label-headless-Cyy9_5qJ.js → field-label-headless-D_ubs4wp.js} +1 -1
- package/dist/component/field-rac.module-D0QzJXUv.js +32 -0
- package/dist/component/{file-upload-rac-hR9TZqk2.js → file-upload-rac-Csmt20hK.js} +5 -5
- package/dist/component/{fixed-payment-rac-CghZp6bR.js → fixed-payment-rac-BXr53Q8H.js} +4 -4
- package/dist/component/{form-BmSV4tOz.js → form-Dnq7LxSl.js} +1701 -1688
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C7LDm89o.js → header-field-rac-9750XSxD.js} +2 -2
- package/dist/component/{header-rac-BNNzF5wQ.js → header-rac-DGSENeOk.js} +1 -1
- package/dist/component/{image-choice-rac-DLgxkKIZ.js → image-choice-rac-HX8H18Z3.js} +5 -5
- package/dist/component/{index-Dg8Fefid.js → index-pgW3uSoZ.js} +2 -2
- package/dist/component/{index-B8ObIJtL.js → index-vs-qkVQt.js} +4 -4
- package/dist/component/{isObjectLike-oBQcCfqW.js → isObjectLike-DoUrU0Hj.js} +1 -1
- package/dist/component/multiline-address-field-rac-B3gKz3u_.js +1818 -0
- package/dist/component/{multiline-address-rac-8MZkKfqY.js → multiline-address-rac-BBign7ot.js} +1 -1
- package/dist/component/native-select-BbxBpe3S.js +32 -0
- package/dist/component/{number-input-field-rac-Dmp8pNIq.js → number-input-field-rac-CO6DG443.js} +5 -5
- package/dist/component/{number-input-rac-2cN_bN_s.js → number-input-rac-C_Ndaqs4.js} +1 -1
- package/dist/component/{password-rac-CFdC1hoi.js → password-rac-pq-CaSkt.js} +5 -5
- package/dist/component/{payment-input-rac-BWElGzuv.js → payment-input-rac-Dco8O86k.js} +5 -5
- package/dist/component/phone-input-field-rac-BmcADPkC.js +558 -0
- package/dist/component/{phone-rac-CE9-90C3.js → phone-rac-B3aFMUMq.js} +1 -1
- package/dist/component/{product-list-rac-QU7Ocwvy.js → product-list-rac-Cw21coVk.js} +6 -6
- package/dist/component/{quiz-radio-group-rac-Hm7B7RlU.js → quiz-radio-group-rac-ChkNtxix.js} +1 -1
- package/dist/component/{radio-button-module-classes-CcGF7N_Y.js → radio-button-module-classes-BtiG6yqb.js} +3 -3
- package/dist/component/{radio-group-field-rac-Bk1JBBts.js → radio-group-field-rac-6SefZCE6.js} +5 -5
- package/dist/component/{radio-group-rac-D_YZnpID.js → radio-group-rac-BRhOFR2j.js} +1 -1
- package/dist/component/{rating-input-field-rac-zvA6QBGo.js → rating-input-field-rac-DaVnkb6k.js} +5 -5
- package/dist/component/{rating-input-rac-CXVQUoi-.js → rating-input-rac-B-2pZ61H.js} +1 -1
- package/dist/component/{rich-content-rac.module-CnZ4lMBG.js → rich-content-rac.module-C6LD--Ql.js} +1 -1
- package/dist/component/{rich-text-field-rac-DYQgVXdV.js → rich-text-field-rac-C-rfA6pQ.js} +2 -2
- package/dist/component/{rich-text-rac-Dk8396e-.js → rich-text-rac-1s5CGO8u.js} +1 -1
- package/dist/component/service-dropdown-rac-Bcr83doj.js +150 -0
- package/dist/component/{services-multi-choice-rac-D1RiVaLW.js → services-multi-choice-rac-C9nSuz9x.js} +7 -7
- package/dist/component/{signature-rac-DcGKMX84.js → signature-rac-pgob6vV_.js} +5 -5
- package/dist/component/{submit-button-rac-DbMxQlNH.js → submit-button-rac-CzcFB8hM.js} +2 -2
- package/dist/component/{tags-field-rac-Bi4lKutL.js → tags-field-rac-BBFxSNch.js} +6 -6
- package/dist/component/{tags-rac-DDCPnT8M.js → tags-rac-DkwugVvK.js} +1 -1
- package/dist/component/{text-area-field-rac-cre_K0MD.js → text-area-field-rac-DHT-fc0i.js} +5 -5
- package/dist/component/{text-area-rac-61wsMj-j.js → text-area-rac-cTq-i-bf.js} +1 -1
- package/dist/component/{text-input-field-rac-CV5_ba0x.js → text-input-field-rac-D3v-e_5R.js} +4 -4
- package/dist/component/{text-input-headless-kRv3KpSL.js → text-input-headless-B-DwvpWg.js} +3 -3
- package/dist/component/{text-input-rac-CwqZ6NXO.js → text-input-rac-CpG9qt33.js} +1 -1
- package/dist/component/time-input-rac-iL1G8Uwo.js +212 -0
- package/dist/component/to-native-time-Co_gOLkc.js +9 -0
- package/dist/component/{url-input-field-rac-C1JL_m6D.js → url-input-field-rac-1P81rK_4.js} +5 -5
- package/dist/component/{url-input-rac-C1CiGrCn.js → url-input-rac-D9c0BJKG.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-COGEk5d6.js → use-dropdown-option-class-name-CyC7rDCE.js} +3 -3
- package/dist/component/use-dropdown-trigger-class-name-BvRCjLXG.js +137 -0
- package/dist/component/{use-element-state-class-name-pSOX0Y0p.js → use-element-state-class-name-Cpdx_lRm.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-DGEpOAdi.js → use-hoverable-input-class-name-zEk2Vnct.js} +3 -3
- package/dist/component/{use-is-forced-open-dropdown-DPG1e5E9.js → use-is-forced-open-dropdown-_YI6RNG3.js} +1 -1
- package/dist/component/use-native-mobile-input-Czyhb-0V.js +31 -0
- package/dist/component/use-native-state-class-name-B0m2ghbS.js +18 -0
- package/dist/component/{use-service-options-base-BgIZ94V9.js → use-service-options-base-CbFG_r1u.js} +1 -1
- package/dist/component/use-text-input-class-name-CL-b4_Ph.js +6 -0
- package/package.json +3 -2
- package/dist/component/date-input-field-rac-CiAaOiYY.js +0 -309
- package/dist/component/date-picker-field-rac-Dg-chlTL.js +0 -320
- package/dist/component/date-time-input-field-rac-CbDvEPIp.js +0 -441
- package/dist/component/dropdown-field-rac-DY3GGJgP.js +0 -36
- package/dist/component/field-rac.module-DcyJyi2B.js +0 -25
- package/dist/component/multiline-address-field-rac-CgH7lDce.js +0 -1738
- package/dist/component/phone-input-field-rac-CsJGw_OE.js +0 -520
- package/dist/component/service-dropdown-rac-BSXYuBPJ.js +0 -145
- package/dist/component/time-input-rac-DuQar6zW.js +0 -161
- package/dist/component/use-dropdown-trigger-class-name-D6c-3Lyw.js +0 -98
- package/dist/component/use-text-input-class-name-BcbHdFV-.js +0 -6
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { RicosViewer as ce } from "@wix/ricos/viewer";
|
|
2
|
+
import N from "classnames";
|
|
3
|
+
import e, { useState as $, useCallback as J, useRef as A, useId as ie, Children as me, isValidElement as ue, useContext as de, useMemo as w } from "react";
|
|
4
|
+
import { D as v, bN as S, bK as W, bF as q, bP as Z, bY as ge, X as Ee, am as pe, H as fe, M as Ce, I as De, G } from "./form-Dnq7LxSl.js";
|
|
5
|
+
import { parseDate as ye } from "@internationalized/date";
|
|
6
|
+
import { UNSAFE_PortalProvider as Ne, mergeProps as ve } from "react-aria";
|
|
7
|
+
import { I18nProvider as be, DatePicker as Ie, DatePickerStateContext as he, Group as Se, DateInput as _e, DateSegment as Te, Calendar as Pe, CalendarMonthPicker as Oe, CalendarYearPicker as Fe, CalendarGrid as Le, Dialog as Ae, CalendarCell as Re, Button as ee, Select as te, SelectValue as ae, ListBox as re, ListBoxItem as ne } from "react-aria-components";
|
|
8
|
+
import { g as ke, c as j } from "./calendar.module-BMUyMVja.js";
|
|
9
|
+
import { f as E, a as h } from "./find-child-C60k4CxG.js";
|
|
10
|
+
import { D as Me, E as xe } from "./field-error-headless-BIzDViIC.js";
|
|
11
|
+
import { L as Be } from "./field-label-headless-D_ubs4wp.js";
|
|
12
|
+
import { u as Ye, a as Ve, N as Ue, D as we } from "./dismiss-icon-ejA47noY.js";
|
|
13
|
+
import { u as Ke, N as We } from "./use-native-mobile-input-Czyhb-0V.js";
|
|
14
|
+
import { D as qe, N as H, S as le } from "./non-modal-popover-D-u13tmp.js";
|
|
15
|
+
import { t as He, C as Q } from "./calendar-icon-DOeHn3jt.js";
|
|
16
|
+
import { a as $e } from "./use-is-forced-open-dropdown-_YI6RNG3.js";
|
|
17
|
+
import { u as Ge } from "./use-native-state-class-name-B0m2ghbS.js";
|
|
18
|
+
import { i as je } from "./date-availability-CtrbZvl3.js";
|
|
19
|
+
import { C as K } from "./chevron-down-icon-CcpVm6B-.js";
|
|
20
|
+
import { E as Qe } from "./error-icon-hZxQ6DEy.js";
|
|
21
|
+
import { H as Xe } from "./custom-focus-class-_483Pkwp.js";
|
|
22
|
+
import { s as g } from "./field-rac.module-D0QzJXUv.js";
|
|
23
|
+
import { u as X } from "./use-hoverable-input-class-name-zEk2Vnct.js";
|
|
24
|
+
const oe = [
|
|
25
|
+
v.SUNDAY,
|
|
26
|
+
v.MONDAY,
|
|
27
|
+
v.TUESDAY,
|
|
28
|
+
v.WEDNESDAY,
|
|
29
|
+
v.THURSDAY,
|
|
30
|
+
v.FRIDAY,
|
|
31
|
+
v.SATURDAY
|
|
32
|
+
], ze = {
|
|
33
|
+
availableDays: oe
|
|
34
|
+
}, Je = (t) => {
|
|
35
|
+
if (!t)
|
|
36
|
+
return !1;
|
|
37
|
+
const { availableDays: a, availableDates: l, unavailableDates: n } = t;
|
|
38
|
+
return !!a && !oe.every((s) => a.includes(s)) || !!(l != null && l.length) || !!(n != null && n.length);
|
|
39
|
+
}, Ze = ({ className: t, ...a }) => {
|
|
40
|
+
const { id: l, text: n } = a;
|
|
41
|
+
return /* @__PURE__ */ e.createElement("span", {
|
|
42
|
+
id: l,
|
|
43
|
+
className: t,
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}, n);
|
|
46
|
+
}, et = () => {
|
|
47
|
+
const { availability: t } = S();
|
|
48
|
+
return Ke() && !Je(t);
|
|
49
|
+
}, r = ({ children: t }) => {
|
|
50
|
+
const { id: a, value: l, onChange: n, disabled: i, required: s, onBlur: d, onFocus: o, FieldLayout: m, hasError: u, readOnly: C } = S(), { labelId: D } = W(), { regionalFormat: _ } = q(), [c, T] = $(null), [P, F] = $(!1), y = $e(a), R = et(), k = J((f) => {
|
|
51
|
+
const se = ut(f);
|
|
52
|
+
n(se);
|
|
53
|
+
}, [
|
|
54
|
+
n
|
|
55
|
+
]), M = E(t, r.Label), x = E(t, r.Control), B = E(t, r.Calendar), O = E(t, r.Description), L = E(t, r.Error), Y = E(t, r.NativeDate), V = mt(l), U = R ? Y : /* @__PURE__ */ e.createElement(be, {
|
|
56
|
+
locale: _
|
|
57
|
+
}, /* @__PURE__ */ e.createElement("div", {
|
|
58
|
+
ref: T,
|
|
59
|
+
style: {
|
|
60
|
+
display: "contents"
|
|
61
|
+
}
|
|
62
|
+
}), /* @__PURE__ */ e.createElement(Ne, {
|
|
63
|
+
getContainer: () => c
|
|
64
|
+
}, /* @__PURE__ */ e.createElement(Ie, {
|
|
65
|
+
"aria-labelledby": D,
|
|
66
|
+
value: V,
|
|
67
|
+
onChange: k,
|
|
68
|
+
isDisabled: i,
|
|
69
|
+
isInvalid: u,
|
|
70
|
+
isReadOnly: C,
|
|
71
|
+
isRequired: s,
|
|
72
|
+
onBlur: d,
|
|
73
|
+
onFocus: o,
|
|
74
|
+
isOpen: y || P,
|
|
75
|
+
onOpenChange: y ? void 0 : F
|
|
76
|
+
}, x, h(B, {
|
|
77
|
+
isForcedOpen: y
|
|
78
|
+
}))));
|
|
79
|
+
return /* @__PURE__ */ e.createElement(m, {
|
|
80
|
+
fieldId: a,
|
|
81
|
+
renderLabel: () => M,
|
|
82
|
+
renderInput: () => U,
|
|
83
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, L, O)
|
|
84
|
+
});
|
|
85
|
+
}, tt = ({ children: t, className: a }) => {
|
|
86
|
+
const { inputId: l, ariaDescribedBy: n } = W(), { hasError: i, disabled: s, readOnly: d } = S(), o = de(he), m = J((u) => {
|
|
87
|
+
if (!o || o.isOpen || s || d)
|
|
88
|
+
return;
|
|
89
|
+
const C = u.target;
|
|
90
|
+
if (C.closest("button"))
|
|
91
|
+
return;
|
|
92
|
+
const D = C.closest("[data-type]");
|
|
93
|
+
D && D.getAttribute("data-type") !== "literal" || o.setOpen(!0);
|
|
94
|
+
}, [
|
|
95
|
+
o,
|
|
96
|
+
s,
|
|
97
|
+
d
|
|
98
|
+
]);
|
|
99
|
+
return /* @__PURE__ */ e.createElement(Se, {
|
|
100
|
+
id: l,
|
|
101
|
+
"aria-describedby": n,
|
|
102
|
+
className: a,
|
|
103
|
+
"data-invalid": i,
|
|
104
|
+
onClick: m
|
|
105
|
+
}, t);
|
|
106
|
+
}, at = ({ className: t }) => {
|
|
107
|
+
const { id: a, placeholder: l } = S(), { regionalFormat: n } = q(), i = A(null), s = A(!1);
|
|
108
|
+
Z(() => {
|
|
109
|
+
var o;
|
|
110
|
+
(o = i.current) == null || o.focus({
|
|
111
|
+
preventScroll: !0
|
|
112
|
+
});
|
|
113
|
+
}, a);
|
|
114
|
+
const d = w(() => dt(n), [
|
|
115
|
+
n
|
|
116
|
+
]);
|
|
117
|
+
return /* @__PURE__ */ e.createElement(_e, {
|
|
118
|
+
className: t,
|
|
119
|
+
"data-placeholder-hidden": !l || void 0
|
|
120
|
+
}, (o) => {
|
|
121
|
+
const m = o.type === d && o.isPlaceholder && !!l;
|
|
122
|
+
return /* @__PURE__ */ e.createElement(Te, {
|
|
123
|
+
segment: o,
|
|
124
|
+
"data-first-segment": m || void 0,
|
|
125
|
+
ref: (u) => {
|
|
126
|
+
if (!u && s.current) {
|
|
127
|
+
i.current = null, s.current = !1;
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (u && !s.current) {
|
|
131
|
+
i.current = u, s.current = !0;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, (u) => !u.isPlaceholder || !l ? u.text : m ? l : u.text);
|
|
136
|
+
});
|
|
137
|
+
}, rt = ({ children: t, className: a }) => /* @__PURE__ */ e.createElement(qe, {
|
|
138
|
+
className: a
|
|
139
|
+
}, t), p = ({ children: t, className: a, ...l }) => {
|
|
140
|
+
const { isForcedOpen: n } = l, { regionalFormat: i } = q(), { availability: s } = S(), d = w(() => ke(i), [
|
|
141
|
+
i
|
|
142
|
+
]), o = w(() => (c) => {
|
|
143
|
+
const T = new Date(c.year, c.month - 1, c.day);
|
|
144
|
+
return !je(T, s || ze);
|
|
145
|
+
}, [
|
|
146
|
+
s
|
|
147
|
+
]), m = E(t, p.Day) ?? /* @__PURE__ */ e.createElement(p.Day, null), u = E(t, p.PreviousTrigger), C = E(t, p.NextTrigger), D = E(t, p.MonthTrigger), _ = E(t, p.YearTrigger);
|
|
148
|
+
return /* @__PURE__ */ e.createElement(H, {
|
|
149
|
+
className: a,
|
|
150
|
+
containerPadding: 0
|
|
151
|
+
}, /* @__PURE__ */ e.createElement(nt, {
|
|
152
|
+
isForcedOpen: n
|
|
153
|
+
}, /* @__PURE__ */ e.createElement(Pe, {
|
|
154
|
+
autoFocus: n ? !1 : void 0,
|
|
155
|
+
firstDayOfWeek: gt(d),
|
|
156
|
+
isDateUnavailable: o
|
|
157
|
+
}, /* @__PURE__ */ e.createElement("header", null, u, /* @__PURE__ */ e.createElement(Oe, null, (c) => h(D, {
|
|
158
|
+
ariaLabel: c["aria-label"],
|
|
159
|
+
selectedKey: c.value,
|
|
160
|
+
onSelectionChange: c.onChange,
|
|
161
|
+
items: c.items,
|
|
162
|
+
popoverClassName: a
|
|
163
|
+
})), /* @__PURE__ */ e.createElement(Fe, {
|
|
164
|
+
visibleYears: 100
|
|
165
|
+
}, (c) => h(_, {
|
|
166
|
+
ariaLabel: c["aria-label"],
|
|
167
|
+
selectedKey: c.value,
|
|
168
|
+
onSelectionChange: c.onChange,
|
|
169
|
+
items: c.items,
|
|
170
|
+
popoverClassName: a
|
|
171
|
+
})), C), /* @__PURE__ */ e.createElement(Le, {
|
|
172
|
+
weekdayStyle: "short"
|
|
173
|
+
}, (c) => h(m, {
|
|
174
|
+
date: c
|
|
175
|
+
})))));
|
|
176
|
+
}, nt = ({ isForcedOpen: t, children: a }) => t ? /* @__PURE__ */ e.createElement("div", {
|
|
177
|
+
role: "dialog"
|
|
178
|
+
}, a) : /* @__PURE__ */ e.createElement(Ae, null, a), lt = ({ children: t, className: a, ...l }) => {
|
|
179
|
+
const { date: n } = l;
|
|
180
|
+
return /* @__PURE__ */ e.createElement(Re, {
|
|
181
|
+
className: a,
|
|
182
|
+
date: n
|
|
183
|
+
}, t);
|
|
184
|
+
}, ot = ({ children: t, className: a }) => /* @__PURE__ */ e.createElement(ee, {
|
|
185
|
+
slot: "previous",
|
|
186
|
+
className: a
|
|
187
|
+
}, t), st = ({ children: t, className: a }) => /* @__PURE__ */ e.createElement(ee, {
|
|
188
|
+
slot: "next",
|
|
189
|
+
className: a
|
|
190
|
+
}, t), ct = ({ children: t, className: a, ...l }) => {
|
|
191
|
+
const { ariaLabel: n, selectedKey: i, onSelectionChange: s, items: d, popoverClassName: o } = l;
|
|
192
|
+
return /* @__PURE__ */ e.createElement(te, {
|
|
193
|
+
"aria-label": n,
|
|
194
|
+
selectedKey: i,
|
|
195
|
+
onSelectionChange: s
|
|
196
|
+
}, /* @__PURE__ */ e.createElement(le, {
|
|
197
|
+
className: a
|
|
198
|
+
}, /* @__PURE__ */ e.createElement(ae, null), t), /* @__PURE__ */ e.createElement(H, {
|
|
199
|
+
className: o,
|
|
200
|
+
containerPadding: 0
|
|
201
|
+
}, /* @__PURE__ */ e.createElement(re, {
|
|
202
|
+
items: d
|
|
203
|
+
}, (m) => /* @__PURE__ */ e.createElement(ne, {
|
|
204
|
+
id: m.id
|
|
205
|
+
}, m.formatted))));
|
|
206
|
+
}, it = ({ children: t, className: a, ...l }) => {
|
|
207
|
+
const { ariaLabel: n, selectedKey: i, onSelectionChange: s, items: d, popoverClassName: o } = l;
|
|
208
|
+
return /* @__PURE__ */ e.createElement(te, {
|
|
209
|
+
"aria-label": n,
|
|
210
|
+
selectedKey: i,
|
|
211
|
+
onSelectionChange: s
|
|
212
|
+
}, /* @__PURE__ */ e.createElement(le, {
|
|
213
|
+
className: a
|
|
214
|
+
}, /* @__PURE__ */ e.createElement(ae, null), t), /* @__PURE__ */ e.createElement(H, {
|
|
215
|
+
className: o,
|
|
216
|
+
containerPadding: 0
|
|
217
|
+
}, /* @__PURE__ */ e.createElement(re, {
|
|
218
|
+
items: d
|
|
219
|
+
}, (m) => /* @__PURE__ */ e.createElement(ne, {
|
|
220
|
+
id: m.id
|
|
221
|
+
}, m.formatted))));
|
|
222
|
+
};
|
|
223
|
+
p.Day = lt;
|
|
224
|
+
p.PreviousTrigger = ot;
|
|
225
|
+
p.NextTrigger = st;
|
|
226
|
+
p.MonthTrigger = ct;
|
|
227
|
+
p.YearTrigger = it;
|
|
228
|
+
const b = ({ className: t, children: a }) => {
|
|
229
|
+
const { id: l, value: n, onChange: i, required: s, disabled: d, readOnly: o, hasError: m, placeholder: u, onBlur: C, onFocus: D } = S(), { inputId: _, labelId: c, ariaDescribedBy: T } = W(), P = A(null), F = A(null);
|
|
230
|
+
Z(() => {
|
|
231
|
+
var f;
|
|
232
|
+
(f = P.current) == null || f.focus({
|
|
233
|
+
preventScroll: !0
|
|
234
|
+
});
|
|
235
|
+
}, l);
|
|
236
|
+
const y = He(n), { announcement: R, announceCleared: k } = Ye(!!y), M = !!y && !s && !d && !o, x = E(a, b.Clear), B = E(a, b.Placeholder), O = y ? "" : u, L = ie(), Y = me.map(a, (f) => /* @__PURE__ */ ue(f) && (f.type === b.Clear || f.type === b.Placeholder) ? null : f), { className: V, stateProps: U } = Ge(t);
|
|
237
|
+
return /* @__PURE__ */ e.createElement(We, {
|
|
238
|
+
ref: F,
|
|
239
|
+
groupLabelId: c,
|
|
240
|
+
announcement: R
|
|
241
|
+
}, /* @__PURE__ */ e.createElement(Ve, {
|
|
242
|
+
ref: P,
|
|
243
|
+
type: "date",
|
|
244
|
+
id: _,
|
|
245
|
+
className: V,
|
|
246
|
+
...ve(U, {
|
|
247
|
+
onFocus: D,
|
|
248
|
+
onBlur: C
|
|
249
|
+
}),
|
|
250
|
+
"aria-labelledby": c,
|
|
251
|
+
"aria-describedby": [
|
|
252
|
+
T,
|
|
253
|
+
O && L
|
|
254
|
+
].filter(Boolean).join(" ") || void 0,
|
|
255
|
+
"aria-invalid": m || void 0,
|
|
256
|
+
value: y,
|
|
257
|
+
onChange: (f) => i(f || null),
|
|
258
|
+
disabled: d,
|
|
259
|
+
readOnly: o,
|
|
260
|
+
required: s
|
|
261
|
+
}), Y, O ? h(B, {
|
|
262
|
+
id: L,
|
|
263
|
+
text: O
|
|
264
|
+
}) : null, M ? h(x, {
|
|
265
|
+
input: P,
|
|
266
|
+
control: F,
|
|
267
|
+
labelId: c,
|
|
268
|
+
onClear: () => {
|
|
269
|
+
i(null), k();
|
|
270
|
+
}
|
|
271
|
+
}) : null);
|
|
272
|
+
};
|
|
273
|
+
b.Clear = Ue;
|
|
274
|
+
b.Placeholder = Ze;
|
|
275
|
+
r.Label = Be;
|
|
276
|
+
r.NativeDate = b;
|
|
277
|
+
r.Control = tt;
|
|
278
|
+
r.Input = at;
|
|
279
|
+
r.Trigger = rt;
|
|
280
|
+
r.Calendar = p;
|
|
281
|
+
r.Description = Me;
|
|
282
|
+
r.Error = xe;
|
|
283
|
+
function mt(t) {
|
|
284
|
+
if (!t)
|
|
285
|
+
return null;
|
|
286
|
+
try {
|
|
287
|
+
return ye(t);
|
|
288
|
+
} catch {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function ut(t) {
|
|
293
|
+
if (!t)
|
|
294
|
+
return null;
|
|
295
|
+
const a = String(t.year).padStart(4, "0"), l = String(t.month).padStart(2, "0"), n = String(t.day).padStart(2, "0");
|
|
296
|
+
return `${a}-${l}-${n}`;
|
|
297
|
+
}
|
|
298
|
+
function dt(t) {
|
|
299
|
+
var a;
|
|
300
|
+
try {
|
|
301
|
+
return ((a = new Intl.DateTimeFormat(t, {
|
|
302
|
+
year: "numeric",
|
|
303
|
+
month: "2-digit",
|
|
304
|
+
day: "2-digit"
|
|
305
|
+
}).formatToParts(/* @__PURE__ */ new Date()).find((n) => n.type !== "literal")) == null ? void 0 : a.type) ?? "month";
|
|
306
|
+
} catch {
|
|
307
|
+
return "month";
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function gt(t) {
|
|
311
|
+
return [
|
|
312
|
+
"sun",
|
|
313
|
+
"mon",
|
|
314
|
+
"tue",
|
|
315
|
+
"wed",
|
|
316
|
+
"thu",
|
|
317
|
+
"fri",
|
|
318
|
+
"sat"
|
|
319
|
+
][t] || "mon";
|
|
320
|
+
}
|
|
321
|
+
const Et = "_control_1le52_1", pt = "_segments_1le52_14", ft = "_trigger_1le52_72", Ct = "_calendarPopover_1le52_103 _textOnFillOptions_vf5u1_8", Dt = "_calendarDay_1le52_246", yt = "_dayNumber_1le52_253", I = {
|
|
322
|
+
control: Et,
|
|
323
|
+
segments: pt,
|
|
324
|
+
trigger: ft,
|
|
325
|
+
calendarPopover: Ct,
|
|
326
|
+
calendarDay: Dt,
|
|
327
|
+
dayNumber: yt
|
|
328
|
+
}, Nt = ({ content: t, locale: a }) => /* @__PURE__ */ e.createElement(ce, {
|
|
329
|
+
content: t,
|
|
330
|
+
locale: a
|
|
331
|
+
}), vt = {
|
|
332
|
+
left: 90,
|
|
333
|
+
right: -90
|
|
334
|
+
}, z = ({ direction: t }) => /* @__PURE__ */ e.createElement(K, {
|
|
335
|
+
style: {
|
|
336
|
+
transform: `rotate(${vt[t]}deg)`
|
|
337
|
+
}
|
|
338
|
+
}), Ht = () => {
|
|
339
|
+
const { t } = ge(), a = X(G, [
|
|
340
|
+
I.control
|
|
341
|
+
]), l = X(G, [
|
|
342
|
+
g.nativeInput,
|
|
343
|
+
g.nativeWithLeadingIcon
|
|
344
|
+
]);
|
|
345
|
+
return /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
|
|
346
|
+
className: N(Ee, g.label)
|
|
347
|
+
}, /* @__PURE__ */ e.createElement(r.Label.Required, {
|
|
348
|
+
className: N(pe, g.requiredMark)
|
|
349
|
+
})), /* @__PURE__ */ e.createElement(r.Control, {
|
|
350
|
+
className: a
|
|
351
|
+
}, /* @__PURE__ */ e.createElement(r.Trigger, {
|
|
352
|
+
className: I.trigger
|
|
353
|
+
}, /* @__PURE__ */ e.createElement(Q, null)), /* @__PURE__ */ e.createElement(r.Input, {
|
|
354
|
+
className: I.segments
|
|
355
|
+
})), /* @__PURE__ */ e.createElement(r.NativeDate, {
|
|
356
|
+
className: l
|
|
357
|
+
}, /* @__PURE__ */ e.createElement(Q, {
|
|
358
|
+
className: N(g.nativeDecoration, g.nativeLeadingIcon)
|
|
359
|
+
}), /* @__PURE__ */ e.createElement(r.NativeDate.Placeholder, {
|
|
360
|
+
className: g.nativePlaceholder
|
|
361
|
+
}), /* @__PURE__ */ e.createElement(r.NativeDate.Clear, {
|
|
362
|
+
className: g.nativeClearButton,
|
|
363
|
+
"aria-label": t("date-picker.a11y.clear-button")
|
|
364
|
+
}, /* @__PURE__ */ e.createElement(we, null))), /* @__PURE__ */ e.createElement(r.Calendar, {
|
|
365
|
+
className: N(fe, g.selectPopover, I.calendarPopover)
|
|
366
|
+
}, /* @__PURE__ */ e.createElement(r.Calendar.PreviousTrigger, null, /* @__PURE__ */ e.createElement(z, {
|
|
367
|
+
direction: "left"
|
|
368
|
+
})), /* @__PURE__ */ e.createElement(r.Calendar.MonthTrigger, null, /* @__PURE__ */ e.createElement(K, {
|
|
369
|
+
className: g.dropdownIcon
|
|
370
|
+
})), /* @__PURE__ */ e.createElement(r.Calendar.YearTrigger, null, /* @__PURE__ */ e.createElement(K, {
|
|
371
|
+
className: g.dropdownIcon
|
|
372
|
+
})), /* @__PURE__ */ e.createElement(r.Calendar.NextTrigger, null, /* @__PURE__ */ e.createElement(z, {
|
|
373
|
+
direction: "right"
|
|
374
|
+
})), /* @__PURE__ */ e.createElement(r.Calendar.Day, {
|
|
375
|
+
className: N(Xe, j.day, I.calendarDay)
|
|
376
|
+
}, ({ formattedDate: n }) => /* @__PURE__ */ e.createElement("span", {
|
|
377
|
+
className: N(j.dayNumber, I.dayNumber)
|
|
378
|
+
}, n))), /* @__PURE__ */ e.createElement(r.Error, {
|
|
379
|
+
className: N(Ce, g.error)
|
|
380
|
+
}, /* @__PURE__ */ e.createElement(Qe, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
|
|
381
|
+
className: N(De, g.description)
|
|
382
|
+
}, Nt));
|
|
383
|
+
};
|
|
384
|
+
export {
|
|
385
|
+
Ht as D
|
|
386
|
+
};
|