@wix/form-elements 1.168.0 → 1.170.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-BbXyKTd7.js → appointment-rac-DZ0SFXmL.js} +83 -83
- package/dist/component/{bookings-address-rac-VJkR_U9L.js → bookings-address-rac-BW9grc77.js} +1 -1
- package/dist/component/{bookings-email-rac-_EupwXpQ.js → bookings-email-rac-D8gMaAfB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DTZixHYj.js → bookings-first-name-rac-CAjcs7b6.js} +1 -1
- package/dist/component/{bookings-header-rac-BKbKTv5g.js → bookings-header-rac-BhKZ1kku.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BDy860-C.js → bookings-last-name-rac-DpsMDuU0.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DgNP-YNZ.js → bookings-login-bar-rac-BVdWmKS8.js} +3 -3
- package/dist/component/{bookings-phone-rac-B_I6n96b.js → bookings-phone-rac-DsqNi2mI.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-prYPbIiz.js → bookings-rich-text-rac-elM4Ne3f.js} +1 -1
- package/dist/component/{checkbox-field-rac-C-4PXuxG.js → checkbox-field-rac-BU4E73fD.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-D16bAcaq.js → checkbox-group-field-headless-6yJdIbP2.js} +41 -41
- package/dist/component/{checkbox-group-field-rac-GUQ5dO_s.js → checkbox-group-field-rac-CojbCWSF.js} +4 -4
- package/dist/component/{checkbox-group-rac-Bl6xL5-H.js → checkbox-group-rac-3qUVUc-C.js} +1 -1
- package/dist/component/{checkbox-rac-Blg0KVyP.js → checkbox-rac-DwbTapd_.js} +1 -1
- package/dist/component/{contacts-address-rac-BfOhCAj8.js → contacts-address-rac-BL7XDZuP.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DYBvDh62.js → contacts-birthdate-rac-DeJYIHAg.js} +1 -1
- package/dist/component/{contacts-company-rac-DIJr7zjA.js → contacts-company-rac-BeImf5uc.js} +1 -1
- package/dist/component/{contacts-email-rac-DjmqELhC.js → contacts-email-rac-CtacwrZ0.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DGNll7gw.js → contacts-first-name-rac-CAdOqOOA.js} +1 -1
- package/dist/component/{contacts-last-name-rac-BJ8AZYQN.js → contacts-last-name-rac-Db9mHzCW.js} +1 -1
- package/dist/component/{contacts-phone-rac-BC-QtpEN.js → contacts-phone-rac-W0OLEbzL.js} +1 -1
- package/dist/component/{contacts-position-rac-BQia__74.js → contacts-position-rac-CV4Ibt4Z.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CTFptz01.js → contacts-subscribe-rac-CQ3Q1pjZ.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-Cy72Jouc.js → contacts-tax-id-rac-Dux-pk6r.js} +1 -1
- package/dist/component/{date-availability-BC6updcS.js → date-availability-RkX-Qw7G.js} +1 -1
- package/dist/component/date-input-field-rac-CYCT6qoa.js +309 -0
- package/dist/component/{date-input-rac-KkRyWRP_.js → date-input-rac-BkYZ7q_o.js} +1 -1
- package/dist/component/{date-picker-field-rac-BLWVJbTJ.js → date-picker-field-rac-eMidYtsl.js} +31 -31
- package/dist/component/{date-picker-rac-DKCQza7v.js → date-picker-rac-D23rxZcF.js} +1 -1
- package/dist/component/{date-time-input-field-rac-CZxZW6fz.js → date-time-input-field-rac-BjIj4dXQ.js} +111 -111
- package/dist/component/{date-time-input-rac-DQ-iBwmr.js → date-time-input-rac-BSGAdk9L.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-kp1Jbwt-.js → dext-checkbox-group-rac-Xmb5IKrb.js} +2 -2
- package/dist/component/{dext-checkbox-rac-CBm9cRUz.js → dext-checkbox-rac-2eA7y0ld.js} +1 -1
- package/dist/component/{dext-date-picker-rac-DsVKWsRy.js → dext-date-picker-rac-CmLxVGGT.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-CO26-8Qo.js → dext-date-time-input-rac-Cd9nwSjb.js} +1 -1
- package/dist/component/{dext-dropdown-rac-eRzu2C-y.js → dext-dropdown-rac-BKdQ0nGS.js} +1 -1
- package/dist/component/{dext-email-rac-DDrZzE_G.js → dext-email-rac-07zDPxyf.js} +1 -1
- package/dist/component/{dext-number-input-rac-Dj7sInLk.js → dext-number-input-rac-DRvGuppY.js} +1 -1
- package/dist/component/{dext-phone-rac-g8M77F7m.js → dext-phone-rac-CKtTVjFg.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BjhygC0R.js → dext-radio-group-rac-BsBmMufq.js} +2 -2
- package/dist/component/{dext-rating-input-rac-BraNjvyA.js → dext-rating-input-rac-CcFSTAIh.js} +1 -1
- package/dist/component/{dext-tags-rac-B5mAIuDi.js → dext-tags-rac-CCTDlCvX.js} +2 -2
- package/dist/component/{dext-text-area-rac-D_YBnaWi.js → dext-text-area-rac-Cif8po9h.js} +1 -1
- package/dist/component/{dext-text-input-rac-BzeWH1jv.js → dext-text-input-rac-2118X4iF.js} +1 -1
- package/dist/component/{dext-url-input-rac-Cn0h_vx3.js → dext-url-input-rac-DDImGkQe.js} +1 -1
- package/dist/component/{donation-rac-CQRdHxWh.js → donation-rac-Dnylss1d.js} +103 -103
- package/dist/component/{dropdown-field-rac-C7LL0W5Z.js → dropdown-field-rac-DDI4ZgZH.js} +3 -3
- package/dist/component/{dropdown-rac-Nb2VyJ0x.js → dropdown-rac-DX0Z3R_8.js} +1 -1
- package/dist/component/{ecom-address-rac-_c2YIIwg.js → ecom-address-rac-D9MeEQsk.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-Bma7TAVj.js → ecom-subscription-checkbox-rac-DKJ9j5dj.js} +2 -2
- package/dist/component/{email-input-field-rac-2E2tEaS5.js → email-input-field-rac-DaKrmlwe.js} +55 -55
- package/dist/component/{events-repeater-rac-COWHYBFD.js → events-repeater-rac-DWrOLT0Y.js} +45 -45
- package/dist/component/{events-rsvp-rac-CXp8j19Y.js → events-rsvp-rac-YBTR1tR0.js} +6 -6
- package/dist/component/{field-error-headless-S-ugOQQX.js → field-error-headless-jksFrezt.js} +10 -10
- package/dist/component/{field-label-headless-_n4I0_tX.js → field-label-headless-BBvJAVxI.js} +10 -10
- package/dist/component/{file-upload-rac-DCH_iwDg.js → file-upload-rac-CgdmfUZG.js} +168 -168
- package/dist/component/{fixed-payment-rac-CYkKJUfM.js → fixed-payment-rac-v6rKwzFs.js} +13 -13
- package/dist/component/{form-jK8ezTss.js → form-BsiK682r.js} +530 -502
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DnbjI6W5.js → header-field-rac-BuXybl7K.js} +6 -6
- package/dist/component/{header-rac-DKUICrni.js → header-rac-CDyaLosW.js} +1 -1
- package/dist/component/{image-choice-rac-B_9ponST.js → image-choice-rac-BRlMroBw.js} +41 -41
- package/dist/component/{index-BxdMzOvN.js → index-BanOeCAF.js} +242 -236
- package/dist/component/{index-ZYnsxY-a.js → index-y9URYGEE.js} +6 -6
- package/dist/component/{isObjectLike-BW-9QEQl.js → isObjectLike-BG9nJ-rx.js} +7 -7
- package/dist/component/{multiline-address-field-rac-k-P0ijWG.js → multiline-address-field-rac-DRAkxI1l.js} +342 -342
- package/dist/component/{multiline-address-rac-Bbn9mNDa.js → multiline-address-rac-JjTzWsEb.js} +1 -1
- package/dist/component/{number-input-field-rac--lom-B_X.js → number-input-field-rac-QrouG7Hv.js} +22 -22
- package/dist/component/{number-input-rac-Bhbd6T9S.js → number-input-rac-DGmE7cLv.js} +1 -1
- package/dist/component/{password-rac-BV_uTHb3.js → password-rac-DeyY228m.js} +28 -28
- package/dist/component/{payment-input-rac-cawyGN_t.js → payment-input-rac-DmIennLi.js} +45 -45
- package/dist/component/{phone-input-field-rac-CsElHRto.js → phone-input-field-rac-F7e74TGA.js} +76 -76
- package/dist/component/{phone-rac-XrHN5Nko.js → phone-rac-CQfB2CQD.js} +1 -1
- package/dist/component/{product-list-rac-cxv_xz7K.js → product-list-rac--GGG8vvO.js} +62 -62
- package/dist/component/{quiz-radio-group-rac-DGaxOPE1.js → quiz-radio-group-rac-DF2C2vNq.js} +1 -1
- package/dist/component/{radio-button-module-classes-Xv2Jn01x.js → radio-button-module-classes-DmpNo6F2.js} +17 -17
- package/dist/component/{radio-group-field-rac-DgGqgTql.js → radio-group-field-rac-BGcPYfKO.js} +6 -6
- package/dist/component/{radio-group-rac-Bh0E-oe1.js → radio-group-rac-CqysUMCE.js} +1 -1
- package/dist/component/{rating-input-field-rac-C3YLV971.js → rating-input-field-rac-D-ei917Y.js} +24 -24
- package/dist/component/{rating-input-rac-CfcC5EUh.js → rating-input-rac-a9zJ74fw.js} +1 -1
- package/dist/component/{rich-content-rac.module-DUjzLGtX.js → rich-content-rac.module-CvyLVlXL.js} +5 -5
- package/dist/component/{rich-text-field-rac-BmguoJhk.js → rich-text-field-rac-vf19nvyw.js} +7 -7
- package/dist/component/{rich-text-rac-BWhHcq25.js → rich-text-rac-Cx_wpoxC.js} +1 -1
- package/dist/component/{service-dropdown-rac-C5oX-ql7.js → service-dropdown-rac-DITzKQxd.js} +26 -26
- package/dist/component/{services-multi-choice-rac-C1fem9NB.js → services-multi-choice-rac-BtisN0Aq.js} +11 -11
- package/dist/component/{signature-rac-BtHqiWj1.js → signature-rac-DUeIoS5O.js} +226 -226
- package/dist/component/{submit-button-rac-OYeKJFF8.js → submit-button-rac-C8h6zeTw.js} +36 -36
- package/dist/component/{tags-field-rac-kA2RSijL.js → tags-field-rac-CjFuiB0n.js} +51 -51
- package/dist/component/{tags-rac-B_2qCZGu.js → tags-rac-BO7rwyLl.js} +1 -1
- package/dist/component/{text-area-field-rac-DeO609Mv.js → text-area-field-rac-CgUx3nQ0.js} +23 -23
- package/dist/component/{text-area-rac-BAQFBOZd.js → text-area-rac-WgXYXIaf.js} +1 -1
- package/dist/component/{text-input-field-rac-CCcKwuLZ.js → text-input-field-rac-DaxWFha-.js} +6 -6
- package/dist/component/{text-input-headless-D8-jkaYm.js → text-input-headless-hjuRJTZN.js} +6 -6
- package/dist/component/{text-input-rac-BVcgjj8g.js → text-input-rac-BzumrJBj.js} +1 -1
- package/dist/component/{time-input-rac-BYctyHgU.js → time-input-rac-2FEkpQ7M.js} +18 -18
- package/dist/component/{url-input-field-rac-COC9qgcs.js → url-input-field-rac-BZ9f8D8I.js} +26 -26
- package/dist/component/{url-input-rac-BZXLh0Ej.js → url-input-rac-D-AVlxkD.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BTltqRl1.js → use-dropdown-option-class-name-DwAAtzgX.js} +11 -11
- package/dist/component/{use-dropdown-trigger-class-name-BjJZfl3i.js → use-dropdown-trigger-class-name-D-6n9YVG.js} +18 -18
- package/dist/component/{use-element-state-class-name-CkT6Ga8t.js → use-element-state-class-name-C5auxwhj.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-BkoSr6tr.js → use-hoverable-input-class-name-Nd2jqfz4.js} +2 -2
- package/dist/component/use-is-forced-open-dropdown-CKaHhCqp.js +64 -0
- package/dist/component/{use-service-options-base-Wp8RZ4Z8.js → use-service-options-base-CvluFheT.js} +3 -3
- package/dist/component/use-text-input-class-name-DGTlYJxC.js +6 -0
- package/dist/form.d.ts +19 -0
- package/package.json +2 -2
- package/dist/component/date-input-field-rac-b_T1yf8D.js +0 -309
- package/dist/component/use-is-forced-open-dropdown-fo_NCnSk.js +0 -53
- package/dist/component/use-text-input-class-name-DS7i03Gk.js +0 -6
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { RicosViewer as ne } from "@wix/ricos/viewer";
|
|
2
|
+
import _ from "classnames";
|
|
3
|
+
import t, { useMemo as N, useState as z, useCallback as x, useRef as H } from "react";
|
|
4
|
+
import { UNSAFE_PortalProvider as re } from "react-aria";
|
|
5
|
+
import { ListBoxItem as se, Select as oe, TextField as q, SelectValue as le, Input as K } from "react-aria-components";
|
|
6
|
+
import { bK as D, bH as X, bC as U, bf as Q, bs as W, b2 as s, bU as M, b9 as ce, bg as ie, bz as me, bM as V, u as de, X as ue, al as pe, w as Y, x as Ee, M as be, I as fe, v as _e, y as Ie, z as $ } from "./form-BsiK682r.js";
|
|
7
|
+
import { f as p, a as B } from "./find-child-C60k4CxG.js";
|
|
8
|
+
import { g as De } from "./helpers-HmkkXrh2.js";
|
|
9
|
+
import { D as Oe, E as ge } from "./field-error-headless-jksFrezt.js";
|
|
10
|
+
import { L as he } from "./field-label-headless-BBvJAVxI.js";
|
|
11
|
+
import { F as Ne } from "./fieldset-headless-CD3fds9J.js";
|
|
12
|
+
import { N as Le, E as ye, S as Ce } from "./non-modal-popover-D-u13tmp.js";
|
|
13
|
+
import { u as Fe } from "./use-is-forced-open-dropdown-CKaHhCqp.js";
|
|
14
|
+
import { V as Te, a as Ae } from "./use-dropdown-option-class-name-DwAAtzgX.js";
|
|
15
|
+
import { C as Me } from "./chevron-down-icon-CcpVm6B-.js";
|
|
16
|
+
import { E as Re } from "./error-icon-hZxQ6DEy.js";
|
|
17
|
+
import { H as Pe } from "./custom-focus-class-_483Pkwp.js";
|
|
18
|
+
import { s as b } from "./field-rac.module-ts2t4WUO.js";
|
|
19
|
+
import { u as v } from "./use-hoverable-input-class-name-Nd2jqfz4.js";
|
|
20
|
+
const Se = {
|
|
21
|
+
[s.MONTH]: "bday-month",
|
|
22
|
+
[s.DAY]: "bday-day",
|
|
23
|
+
[s.YEAR]: "bday-year"
|
|
24
|
+
}, w = (e, a) => e === "bday" ? Se[a] : void 0, n = ({ children: e, className: a }) => {
|
|
25
|
+
const { id: r, required: o, onBlur: l, onFocus: c, FieldLayout: m } = D(), { inputId: i, labelId: d, ariaDescribedBy: u } = X(), { regionalFormat: E } = U(), f = N(() => Q(E).filter(W).map((S) => S.toUpperCase()), [
|
|
26
|
+
E
|
|
27
|
+
]), y = p(e, n.Label), R = p(e, n.Description), P = p(e, n.Error), O = {
|
|
28
|
+
[s.MONTH]: p(e, n.Month),
|
|
29
|
+
[s.DAY]: p(e, n.Day),
|
|
30
|
+
[s.YEAR]: p(e, n.Year)
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ t.createElement(m, {
|
|
33
|
+
fieldId: r,
|
|
34
|
+
renderLabel: () => B(y, {
|
|
35
|
+
as: "div"
|
|
36
|
+
}),
|
|
37
|
+
renderInput: () => /* @__PURE__ */ t.createElement(Ne, {
|
|
38
|
+
id: i,
|
|
39
|
+
ariaLabelledBy: d,
|
|
40
|
+
ariaDescribedBy: u,
|
|
41
|
+
required: o,
|
|
42
|
+
onBlur: l,
|
|
43
|
+
onFocus: c,
|
|
44
|
+
className: a
|
|
45
|
+
}, O[f[0]], O[f[1]], O[f[2]]),
|
|
46
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, P, R)
|
|
47
|
+
});
|
|
48
|
+
}, g = ({ children: e, className: a }) => {
|
|
49
|
+
const { id: r, disabled: o, readOnly: l, showDateLabels: c, hidePlaceholder: m, autoComplete: i } = D(), { labelId: d } = h(s.MONTH), { partValue: u, partError: E, onPartChange: f } = L(s.MONTH), { t: y } = M(), [R, P] = z(!1), O = Fe(r), [S, j] = z(null), G = m ? ye : y("field.date.placeholder.month"), J = x((T) => {
|
|
50
|
+
l || f(typeof T == "string" ? T : "");
|
|
51
|
+
}, [
|
|
52
|
+
f,
|
|
53
|
+
l
|
|
54
|
+
]), Z = x((T) => {
|
|
55
|
+
P(T && !l);
|
|
56
|
+
}, [
|
|
57
|
+
l
|
|
58
|
+
]), ee = p(e, g.Label), te = p(e, g.Trigger), ae = p(e, g.Options);
|
|
59
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
60
|
+
className: a,
|
|
61
|
+
"data-date-field": !0
|
|
62
|
+
}, c ? ee : null, /* @__PURE__ */ t.createElement("div", {
|
|
63
|
+
ref: j,
|
|
64
|
+
style: {
|
|
65
|
+
display: "contents"
|
|
66
|
+
}
|
|
67
|
+
}), /* @__PURE__ */ t.createElement(re, {
|
|
68
|
+
getContainer: () => S
|
|
69
|
+
}, /* @__PURE__ */ t.createElement(oe, {
|
|
70
|
+
autoComplete: w(i, s.MONTH),
|
|
71
|
+
"aria-labelledby": c ? d : void 0,
|
|
72
|
+
value: u || null,
|
|
73
|
+
onChange: J,
|
|
74
|
+
isDisabled: o,
|
|
75
|
+
isInvalid: E,
|
|
76
|
+
placeholder: G,
|
|
77
|
+
isOpen: O || R,
|
|
78
|
+
onOpenChange: O ? void 0 : Z
|
|
79
|
+
}, te, B(ae, {
|
|
80
|
+
isForcedOpen: O
|
|
81
|
+
}))));
|
|
82
|
+
}, Ye = ({ className: e }) => /* @__PURE__ */ t.createElement(k, {
|
|
83
|
+
datePart: s.MONTH,
|
|
84
|
+
className: e
|
|
85
|
+
}), ve = ({ children: e, className: a }) => {
|
|
86
|
+
const { id: r, readOnly: o } = D(), { inputId: l } = h(s.MONTH), { partError: c, isFirstPart: m } = L(s.MONTH), i = H(null);
|
|
87
|
+
return V(() => {
|
|
88
|
+
var d;
|
|
89
|
+
m && ((d = i.current) == null || d.focus({
|
|
90
|
+
preventScroll: !0
|
|
91
|
+
}));
|
|
92
|
+
}, r), /* @__PURE__ */ t.createElement(Ce, {
|
|
93
|
+
ref: i,
|
|
94
|
+
id: l,
|
|
95
|
+
className: a,
|
|
96
|
+
"data-hook": s.MONTH,
|
|
97
|
+
"data-invalid": c || void 0,
|
|
98
|
+
"data-readonly": o || void 0
|
|
99
|
+
}, /* @__PURE__ */ t.createElement(le, null), e);
|
|
100
|
+
}, A = ({ children: e, className: a, ...r }) => {
|
|
101
|
+
const { isForcedOpen: o } = r, { language: l } = U(), c = N(() => De(l), [
|
|
102
|
+
l
|
|
103
|
+
]), m = p(e, A.Option) ?? /* @__PURE__ */ t.createElement(A.Option, null);
|
|
104
|
+
return /* @__PURE__ */ t.createElement(Le, {
|
|
105
|
+
className: a,
|
|
106
|
+
containerPadding: 0,
|
|
107
|
+
offset: 0
|
|
108
|
+
}, /* @__PURE__ */ t.createElement(Te, {
|
|
109
|
+
isForcedOpen: o,
|
|
110
|
+
autoFocus: o ? !1 : void 0
|
|
111
|
+
}, c.map((i, d) => B(m, {
|
|
112
|
+
key: String(d + 1),
|
|
113
|
+
value: String(d + 1),
|
|
114
|
+
label: i
|
|
115
|
+
}))));
|
|
116
|
+
}, xe = ({ className: e, ...a }) => {
|
|
117
|
+
const { value: r, label: o } = a;
|
|
118
|
+
return /* @__PURE__ */ t.createElement(se, {
|
|
119
|
+
className: e,
|
|
120
|
+
id: r,
|
|
121
|
+
textValue: o
|
|
122
|
+
}, o);
|
|
123
|
+
};
|
|
124
|
+
g.Label = Ye;
|
|
125
|
+
g.Trigger = ve;
|
|
126
|
+
g.Options = A;
|
|
127
|
+
A.Option = xe;
|
|
128
|
+
const C = ({ children: e, className: a }) => {
|
|
129
|
+
const { disabled: r, readOnly: o, showDateLabels: l } = D(), { labelId: c } = h(s.DAY), { partValue: m, partError: i, onPartChange: d } = L(s.DAY), u = p(e, C.Label), E = p(e, C.Input);
|
|
130
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
131
|
+
className: a,
|
|
132
|
+
"data-date-field": !0
|
|
133
|
+
}, l && u, /* @__PURE__ */ t.createElement(q, {
|
|
134
|
+
"aria-labelledby": l ? c : void 0,
|
|
135
|
+
value: m,
|
|
136
|
+
onChange: d,
|
|
137
|
+
isDisabled: r,
|
|
138
|
+
isReadOnly: o,
|
|
139
|
+
isInvalid: i
|
|
140
|
+
}, E));
|
|
141
|
+
}, He = ({ className: e }) => /* @__PURE__ */ t.createElement(k, {
|
|
142
|
+
datePart: s.DAY,
|
|
143
|
+
className: e
|
|
144
|
+
}), Ue = ({ className: e }) => {
|
|
145
|
+
const { id: a, hidePlaceholder: r, autoComplete: o } = D(), { inputId: l } = h(s.DAY), { isFirstPart: c } = L(s.DAY), { t: m } = M(), i = H(null), d = r ? void 0 : m("field.date.placeholder.day");
|
|
146
|
+
return V(() => {
|
|
147
|
+
var u;
|
|
148
|
+
c && ((u = i.current) == null || u.focus({
|
|
149
|
+
preventScroll: !0
|
|
150
|
+
}));
|
|
151
|
+
}, a), /* @__PURE__ */ t.createElement(K, {
|
|
152
|
+
ref: i,
|
|
153
|
+
id: l,
|
|
154
|
+
className: e,
|
|
155
|
+
placeholder: d,
|
|
156
|
+
autoComplete: w(o, s.DAY),
|
|
157
|
+
maxLength: 2,
|
|
158
|
+
inputMode: "numeric",
|
|
159
|
+
"data-hook": s.DAY
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
C.Label = He;
|
|
163
|
+
C.Input = Ue;
|
|
164
|
+
const F = ({ children: e, className: a }) => {
|
|
165
|
+
const { disabled: r, readOnly: o, showDateLabels: l } = D(), { labelId: c } = h(s.YEAR), { partValue: m, partError: i, onPartChange: d } = L(s.YEAR), u = p(e, F.Label), E = p(e, F.Input);
|
|
166
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
167
|
+
className: a,
|
|
168
|
+
"data-date-field": !0
|
|
169
|
+
}, l && u, /* @__PURE__ */ t.createElement(q, {
|
|
170
|
+
"aria-labelledby": l ? c : void 0,
|
|
171
|
+
value: m,
|
|
172
|
+
onChange: d,
|
|
173
|
+
isDisabled: r,
|
|
174
|
+
isReadOnly: o,
|
|
175
|
+
isInvalid: i
|
|
176
|
+
}, E));
|
|
177
|
+
}, Ve = ({ className: e }) => /* @__PURE__ */ t.createElement(k, {
|
|
178
|
+
datePart: s.YEAR,
|
|
179
|
+
className: e
|
|
180
|
+
}), Be = ({ className: e }) => {
|
|
181
|
+
const { id: a, hidePlaceholder: r, autoComplete: o } = D(), { inputId: l } = h(s.YEAR), { isFirstPart: c } = L(s.YEAR), { t: m } = M(), i = H(null), d = r ? void 0 : m("field.date.placeholder.year");
|
|
182
|
+
return V(() => {
|
|
183
|
+
var u;
|
|
184
|
+
c && ((u = i.current) == null || u.focus({
|
|
185
|
+
preventScroll: !0
|
|
186
|
+
}));
|
|
187
|
+
}, a), /* @__PURE__ */ t.createElement(K, {
|
|
188
|
+
ref: i,
|
|
189
|
+
id: l,
|
|
190
|
+
className: e,
|
|
191
|
+
placeholder: d,
|
|
192
|
+
autoComplete: w(o, s.YEAR),
|
|
193
|
+
maxLength: 4,
|
|
194
|
+
inputMode: "numeric",
|
|
195
|
+
"data-hook": s.YEAR
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
F.Label = Ve;
|
|
199
|
+
F.Input = Be;
|
|
200
|
+
n.Label = he;
|
|
201
|
+
n.Month = g;
|
|
202
|
+
n.Day = C;
|
|
203
|
+
n.Year = F;
|
|
204
|
+
n.Description = Oe;
|
|
205
|
+
n.Error = ge;
|
|
206
|
+
function h(e) {
|
|
207
|
+
const { inputId: a } = X();
|
|
208
|
+
return N(() => {
|
|
209
|
+
const r = e.toLowerCase();
|
|
210
|
+
return {
|
|
211
|
+
inputId: `${a}-${r}-input`,
|
|
212
|
+
labelId: `${a}-${r}-label`
|
|
213
|
+
};
|
|
214
|
+
}, [
|
|
215
|
+
a,
|
|
216
|
+
e
|
|
217
|
+
]);
|
|
218
|
+
}
|
|
219
|
+
function L(e) {
|
|
220
|
+
const { value: a, onChange: r, hasError: o = !1 } = D(), { regionalFormat: l } = U(), c = N(() => ce(a ?? ""), [
|
|
221
|
+
a
|
|
222
|
+
]), m = N(() => ie(o, a ?? ""), [
|
|
223
|
+
a,
|
|
224
|
+
o
|
|
225
|
+
]), i = c[e] || "", d = x((E) => {
|
|
226
|
+
const f = me(E, e, c);
|
|
227
|
+
r(f);
|
|
228
|
+
}, [
|
|
229
|
+
r,
|
|
230
|
+
c,
|
|
231
|
+
e
|
|
232
|
+
]), u = N(() => Q(l).filter(W).map((y) => y.toUpperCase())[0] === e, [
|
|
233
|
+
l,
|
|
234
|
+
e
|
|
235
|
+
]);
|
|
236
|
+
return {
|
|
237
|
+
partValue: i,
|
|
238
|
+
partError: m[e],
|
|
239
|
+
onPartChange: d,
|
|
240
|
+
isFirstPart: u
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function k({ datePart: e, className: a }) {
|
|
244
|
+
const { inputId: r, labelId: o } = h(e), { t: l } = M(), c = `field.date.label.${e.toLowerCase()}`, m = l(c);
|
|
245
|
+
return /* @__PURE__ */ t.createElement("label", {
|
|
246
|
+
id: o,
|
|
247
|
+
htmlFor: r,
|
|
248
|
+
className: a
|
|
249
|
+
}, m);
|
|
250
|
+
}
|
|
251
|
+
const we = "_fields_b2cgx_1", ke = "_month_b2cgx_10", ze = "_day_b2cgx_11", $e = "_year_b2cgx_12", qe = "_dayInput_b2cgx_28", Ke = "_yearInput_b2cgx_29", Xe = "_monthTrigger_b2cgx_33", Qe = "_monthOption_b2cgx_53", I = {
|
|
252
|
+
fields: we,
|
|
253
|
+
month: ke,
|
|
254
|
+
day: ze,
|
|
255
|
+
year: $e,
|
|
256
|
+
dayInput: qe,
|
|
257
|
+
yearInput: Ke,
|
|
258
|
+
monthTrigger: Xe,
|
|
259
|
+
monthOption: Qe
|
|
260
|
+
}, We = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(ne, {
|
|
261
|
+
content: e,
|
|
262
|
+
locale: a
|
|
263
|
+
}), bt = () => {
|
|
264
|
+
const e = v(_e, [
|
|
265
|
+
I.monthTrigger
|
|
266
|
+
]), a = Ae(Ie, I.monthOption, Pe), r = v($, [
|
|
267
|
+
I.dayInput
|
|
268
|
+
]), o = v($, [
|
|
269
|
+
I.yearInput
|
|
270
|
+
]);
|
|
271
|
+
return /* @__PURE__ */ t.createElement(n, {
|
|
272
|
+
className: _(de, I.fields)
|
|
273
|
+
}, /* @__PURE__ */ t.createElement(n.Label, {
|
|
274
|
+
className: _(ue, b.label)
|
|
275
|
+
}, /* @__PURE__ */ t.createElement(n.Label.Required, {
|
|
276
|
+
className: _(pe, b.requiredMark)
|
|
277
|
+
})), /* @__PURE__ */ t.createElement(n.Month, {
|
|
278
|
+
className: I.month
|
|
279
|
+
}, /* @__PURE__ */ t.createElement(n.Month.Label, {
|
|
280
|
+
className: _(Y, b.label)
|
|
281
|
+
}), /* @__PURE__ */ t.createElement(n.Month.Trigger, {
|
|
282
|
+
className: e
|
|
283
|
+
}, /* @__PURE__ */ t.createElement(Me, {
|
|
284
|
+
className: b.dropdownIcon
|
|
285
|
+
})), /* @__PURE__ */ t.createElement(n.Month.Options, {
|
|
286
|
+
className: _(Ee, b.selectPopover, b.dropdownPopover)
|
|
287
|
+
}, /* @__PURE__ */ t.createElement(n.Month.Options.Option, {
|
|
288
|
+
className: a
|
|
289
|
+
}))), /* @__PURE__ */ t.createElement(n.Day, {
|
|
290
|
+
className: I.day
|
|
291
|
+
}, /* @__PURE__ */ t.createElement(n.Day.Label, {
|
|
292
|
+
className: _(Y, b.label)
|
|
293
|
+
}), /* @__PURE__ */ t.createElement(n.Day.Input, {
|
|
294
|
+
className: r
|
|
295
|
+
})), /* @__PURE__ */ t.createElement(n.Year, {
|
|
296
|
+
className: I.year
|
|
297
|
+
}, /* @__PURE__ */ t.createElement(n.Year.Label, {
|
|
298
|
+
className: _(Y, b.label)
|
|
299
|
+
}), /* @__PURE__ */ t.createElement(n.Year.Input, {
|
|
300
|
+
className: o
|
|
301
|
+
})), /* @__PURE__ */ t.createElement(n.Error, {
|
|
302
|
+
className: _(be, b.error)
|
|
303
|
+
}, /* @__PURE__ */ t.createElement(Re, null), /* @__PURE__ */ t.createElement(n.Error.Text, null)), /* @__PURE__ */ t.createElement(n.Description, {
|
|
304
|
+
className: _(fe, b.description)
|
|
305
|
+
}, We));
|
|
306
|
+
};
|
|
307
|
+
export {
|
|
308
|
+
bt as D
|
|
309
|
+
};
|
package/dist/component/{date-picker-field-rac-BLWVJbTJ.js → date-picker-field-rac-eMidYtsl.js}
RENAMED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
1
|
+
import { RicosViewer as J } from "@wix/ricos/viewer";
|
|
2
2
|
import p from "classnames";
|
|
3
|
-
import e, { useState as L, useCallback as k, useContext as ee, useRef as
|
|
3
|
+
import e, { useState as L, useCallback as k, useContext as ee, useRef as P, useMemo as v } from "react";
|
|
4
4
|
import { parseDate as te } from "@internationalized/date";
|
|
5
5
|
import { UNSAFE_PortalProvider as re } from "react-aria";
|
|
6
6
|
import { I18nProvider as ae, DatePicker as ne, DatePickerStateContext as le, Group as oe, DateInput as se, DateSegment as ce, Calendar as ie, CalendarMonthPicker as me, CalendarYearPicker as de, CalendarGrid as ue, Dialog as ge, CalendarCell as Ee, Button as M, Select as x, SelectValue as Y, ListBox as w, ListBoxItem as B } from "react-aria-components";
|
|
7
|
-
import { D as f,
|
|
8
|
-
import { g as he, c as
|
|
7
|
+
import { D as f, bK as h, bH as U, bC as F, bM as pe, X as fe, al as De, H as Ce, M as ye, I as Se, G as _e } from "./form-BsiK682r.js";
|
|
8
|
+
import { g as he, c as A } from "./calendar.module-BMUyMVja.js";
|
|
9
9
|
import { f as E, a as _ } from "./find-child-C60k4CxG.js";
|
|
10
|
-
import { D as Ne, E as Te } from "./field-error-headless-
|
|
11
|
-
import { L as be } from "./field-label-headless-
|
|
10
|
+
import { D as Ne, E as Te } from "./field-error-headless-jksFrezt.js";
|
|
11
|
+
import { L as be } from "./field-label-headless-BBvJAVxI.js";
|
|
12
12
|
import { D as ve, N as O, S as V } from "./non-modal-popover-D-u13tmp.js";
|
|
13
|
-
import {
|
|
14
|
-
import { i as Fe } from "./date-availability-
|
|
13
|
+
import { a as Ie } from "./use-is-forced-open-dropdown-CKaHhCqp.js";
|
|
14
|
+
import { i as Fe } from "./date-availability-RkX-Qw7G.js";
|
|
15
15
|
import { C as I } from "./chevron-down-icon-CcpVm6B-.js";
|
|
16
16
|
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
17
17
|
import { H as Le } from "./custom-focus-class-_483Pkwp.js";
|
|
18
18
|
import { s as D } from "./field-rac.module-ts2t4WUO.js";
|
|
19
|
-
import { u as
|
|
20
|
-
const
|
|
19
|
+
import { u as Pe } from "./use-hoverable-input-class-name-Nd2jqfz4.js";
|
|
20
|
+
const Ae = [
|
|
21
21
|
f.SUNDAY,
|
|
22
22
|
f.MONDAY,
|
|
23
23
|
f.TUESDAY,
|
|
@@ -26,14 +26,14 @@ const Pe = [
|
|
|
26
26
|
f.FRIDAY,
|
|
27
27
|
f.SATURDAY
|
|
28
28
|
], Re = {
|
|
29
|
-
availableDays:
|
|
29
|
+
availableDays: Ae
|
|
30
30
|
}, a = ({ children: t }) => {
|
|
31
|
-
const { id: r, value: l, onChange: n, disabled: i, required: c, onBlur: u, onFocus: o, FieldLayout: m, hasError: d, readOnly: C } = h(), { labelId: y } = U(), { regionalFormat: N } = F(), [s, T] = L(null), [K,
|
|
32
|
-
const
|
|
33
|
-
n(
|
|
31
|
+
const { id: r, value: l, onChange: n, disabled: i, required: c, onBlur: u, onFocus: o, FieldLayout: m, hasError: d, readOnly: C } = h(), { labelId: y } = U(), { regionalFormat: N } = F(), [s, T] = L(null), [K, H] = L(!1), b = Ie(r), W = k((Z) => {
|
|
32
|
+
const z = We(Z);
|
|
33
|
+
n(z);
|
|
34
34
|
}, [
|
|
35
35
|
n
|
|
36
|
-
]), $ = E(t, a.Label), q = E(t, a.Control), G = E(t, a.Calendar), j = E(t, a.Description),
|
|
36
|
+
]), $ = E(t, a.Label), q = E(t, a.Control), G = E(t, a.Calendar), j = E(t, a.Description), Q = E(t, a.Error), X = He(l);
|
|
37
37
|
return /* @__PURE__ */ e.createElement(m, {
|
|
38
38
|
fieldId: r,
|
|
39
39
|
renderLabel: () => $,
|
|
@@ -48,8 +48,8 @@ const Pe = [
|
|
|
48
48
|
getContainer: () => s
|
|
49
49
|
}, /* @__PURE__ */ e.createElement(ne, {
|
|
50
50
|
"aria-labelledby": y,
|
|
51
|
-
value:
|
|
52
|
-
onChange:
|
|
51
|
+
value: X,
|
|
52
|
+
onChange: W,
|
|
53
53
|
isDisabled: i,
|
|
54
54
|
isInvalid: d,
|
|
55
55
|
isReadOnly: C,
|
|
@@ -57,11 +57,11 @@ const Pe = [
|
|
|
57
57
|
onBlur: u,
|
|
58
58
|
onFocus: o,
|
|
59
59
|
isOpen: b || K,
|
|
60
|
-
onOpenChange: b ? void 0 :
|
|
60
|
+
onOpenChange: b ? void 0 : H
|
|
61
61
|
}, q, _(G, {
|
|
62
62
|
isForcedOpen: b
|
|
63
63
|
})))),
|
|
64
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
64
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, Q, j)
|
|
65
65
|
});
|
|
66
66
|
}, ke = ({ children: t, className: r }) => {
|
|
67
67
|
const { inputId: l, ariaDescribedBy: n } = U(), { hasError: i, disabled: c, readOnly: u } = h(), o = ee(le), m = k((d) => {
|
|
@@ -85,7 +85,7 @@ const Pe = [
|
|
|
85
85
|
onClick: m
|
|
86
86
|
}, t);
|
|
87
87
|
}, Me = ({ className: t }) => {
|
|
88
|
-
const { id: r, placeholder: l } = h(), { regionalFormat: n } = F(), i =
|
|
88
|
+
const { id: r, placeholder: l } = h(), { regionalFormat: n } = F(), i = P(null), c = P(!1);
|
|
89
89
|
pe(() => {
|
|
90
90
|
var o;
|
|
91
91
|
(o = i.current) == null || o.focus({
|
|
@@ -213,7 +213,7 @@ a.Trigger = xe;
|
|
|
213
213
|
a.Calendar = g;
|
|
214
214
|
a.Description = Ne;
|
|
215
215
|
a.Error = Te;
|
|
216
|
-
function
|
|
216
|
+
function He(t) {
|
|
217
217
|
if (!t)
|
|
218
218
|
return null;
|
|
219
219
|
try {
|
|
@@ -222,7 +222,7 @@ function We(t) {
|
|
|
222
222
|
return null;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function We(t) {
|
|
226
226
|
if (!t)
|
|
227
227
|
return null;
|
|
228
228
|
const r = String(t.year).padStart(4, "0"), l = String(t.month).padStart(2, "0"), n = String(t.day).padStart(2, "0");
|
|
@@ -264,14 +264,14 @@ const Ge = (t) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
264
264
|
strokeWidth: "1.5",
|
|
265
265
|
strokeLinecap: "round",
|
|
266
266
|
strokeLinejoin: "round"
|
|
267
|
-
})), je = "_control_1le52_1",
|
|
267
|
+
})), je = "_control_1le52_1", Qe = "_segments_1le52_14", Xe = "_trigger_1le52_72", Ze = "_calendarPopover_1le52_103 _textOnFillOptions_vf5u1_8", ze = "_calendarDay_1le52_246", Je = "_dayNumber_1le52_253", S = {
|
|
268
268
|
control: je,
|
|
269
|
-
segments:
|
|
270
|
-
trigger:
|
|
269
|
+
segments: Qe,
|
|
270
|
+
trigger: Xe,
|
|
271
271
|
calendarPopover: Ze,
|
|
272
|
-
calendarDay:
|
|
273
|
-
dayNumber:
|
|
274
|
-
}, et = ({ content: t, locale: r }) => /* @__PURE__ */ e.createElement(
|
|
272
|
+
calendarDay: ze,
|
|
273
|
+
dayNumber: Je
|
|
274
|
+
}, et = ({ content: t, locale: r }) => /* @__PURE__ */ e.createElement(J, {
|
|
275
275
|
content: t,
|
|
276
276
|
locale: r
|
|
277
277
|
}), tt = {
|
|
@@ -282,7 +282,7 @@ const Ge = (t) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
282
282
|
transform: `rotate(${tt[t]}deg)`
|
|
283
283
|
}
|
|
284
284
|
}), _t = () => {
|
|
285
|
-
const t =
|
|
285
|
+
const t = Pe(_e, [
|
|
286
286
|
S.control
|
|
287
287
|
]);
|
|
288
288
|
return /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(a.Label, {
|
|
@@ -306,9 +306,9 @@ const Ge = (t) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
306
306
|
})), /* @__PURE__ */ e.createElement(a.Calendar.NextTrigger, null, /* @__PURE__ */ e.createElement(R, {
|
|
307
307
|
direction: "right"
|
|
308
308
|
})), /* @__PURE__ */ e.createElement(a.Calendar.Day, {
|
|
309
|
-
className: p(Le,
|
|
309
|
+
className: p(Le, A.day, S.calendarDay)
|
|
310
310
|
}, ({ formattedDate: r }) => /* @__PURE__ */ e.createElement("span", {
|
|
311
|
-
className: p(
|
|
311
|
+
className: p(A.dayNumber, S.dayNumber)
|
|
312
312
|
}, r))), /* @__PURE__ */ e.createElement(a.Error, {
|
|
313
313
|
className: p(ye, D.error)
|
|
314
314
|
}, /* @__PURE__ */ e.createElement(Oe, null), /* @__PURE__ */ e.createElement(a.Error.Text, null)), /* @__PURE__ */ e.createElement(a.Description, {
|