@wix/form-elements 1.74.0 → 1.76.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-BQsFMmBg.js +1016 -0
- package/dist/component/{bookings-address-rac-BcrkXf63.js → bookings-address-rac-AJNyTdok.js} +1 -1
- package/dist/component/{bookings-email-rac-DYq5RxOP.js → bookings-email-rac-BHZ0MFgI.js} +1 -1
- package/dist/component/{bookings-first-name-rac-ZJ_sQ-01.js → bookings-first-name-rac-Bw5FuWNX.js} +1 -1
- package/dist/component/{bookings-header-rac-Cv8kl01f.js → bookings-header-rac-C1M2Pg1f.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BmnulSZ6.js → bookings-last-name-rac-DKkPY0CO.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-Bdi4xs9y.js → bookings-login-bar-rac-P6pziSl1.js} +2 -2
- package/dist/component/{bookings-phone-rac-C8DjSzUY.js → bookings-phone-rac-CiOZWKHz.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DYu011oy.js → bookings-rich-text-rac-D9ZComtY.js} +1 -1
- package/dist/component/{checkbox-field-rac-BH3yEE5j.js → checkbox-field-rac-4zG3Sf1c.js} +328 -320
- package/dist/component/checkbox-group-field-headless-DN2aNw9g.js +205 -0
- package/dist/component/checkbox-group-field-rac-B1qhet83.js +41 -0
- package/dist/component/{checkbox-group-rac-CgW0DnhX.js → checkbox-group-rac-DGsE7xGu.js} +1 -1
- package/dist/component/checkbox-indicator-module-classes-BcScu147.js +17 -0
- package/dist/component/{checkbox-rac-DOAYMMsi.js → checkbox-rac-CFWQW9_K.js} +1 -1
- package/dist/component/{contacts-address-rac-DXJa4J_k.js → contacts-address-rac-G5ZH3Odo.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-CVsuRq3B.js → contacts-birthdate-rac-C7TDUfT0.js} +1 -1
- package/dist/component/{contacts-company-rac-b2bwHSNC.js → contacts-company-rac-8queUhWT.js} +1 -1
- package/dist/component/{contacts-email-rac-DMPcpQ1c.js → contacts-email-rac-CYOs5N_I.js} +1 -1
- package/dist/component/{contacts-first-name-rac-CL2BsHuJ.js → contacts-first-name-rac-D8Goc_Ym.js} +1 -1
- package/dist/component/{contacts-last-name-rac-hdBsWaqb.js → contacts-last-name-rac-lBmtuEnr.js} +1 -1
- package/dist/component/{contacts-phone-rac-DQF6aV9B.js → contacts-phone-rac-DSUWUNBX.js} +1 -1
- package/dist/component/{contacts-position-rac-CVX-WCfx.js → contacts-position-rac-wA-aw5Id.js} +1 -1
- package/dist/component/contacts-subscribe-rac-CAbBbFxZ.js +13 -0
- package/dist/component/{contacts-tax-id-rac-0KTXvF81.js → contacts-tax-id-rac-BpjVM1Ye.js} +1 -1
- package/dist/component/{date-availability-DBljhBgO.js → date-availability-CeiMjrtD.js} +1 -1
- package/dist/component/{date-input-field-rac-CfflD2Ar.js → date-input-field-rac-CVaajAFM.js} +30 -30
- package/dist/component/{date-input-rac-fQclCKoa.js → date-input-rac-DhEzawuM.js} +1 -1
- package/dist/component/{date-picker-field-rac-BSmFOaH-.js → date-picker-field-rac-1Q6yyNmK.js} +35 -35
- package/dist/component/{date-picker-rac-D7I3ramu.js → date-picker-rac-BCGtmXMJ.js} +1 -1
- package/dist/component/{date-time-input-field-rac-vjZDQ_Fp.js → date-time-input-field-rac-Dd-HNgKP.js} +35 -35
- package/dist/component/{date-time-input-rac-CDbS0VZR.js → date-time-input-rac-CsCWEsH5.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BBiPt6_a.js → dext-checkbox-group-rac-CauN5uuV.js} +2 -2
- package/dist/component/{dext-checkbox-rac-Cqp--0SO.js → dext-checkbox-rac-q-g9gDnw.js} +1 -1
- package/dist/component/{dext-date-picker-rac-5Wft0w9m.js → dext-date-picker-rac-CZT3dTLv.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-Bbs7bgtn.js → dext-date-time-input-rac-DVUoZZbX.js} +1 -1
- package/dist/component/{dext-dropdown-rac-CSvhtqbc.js → dext-dropdown-rac-GRltutt5.js} +1 -1
- package/dist/component/{dext-email-rac-BoLeXqyI.js → dext-email-rac-74Y8S9GA.js} +1 -1
- package/dist/component/{dext-number-input-rac-DzaJYTSz.js → dext-number-input-rac-CF9d_GTl.js} +1 -1
- package/dist/component/{dext-phone-rac-BagPg_CT.js → dext-phone-rac-DObx_gOd.js} +1 -1
- package/dist/component/{dext-radio-group-rac-B5HSQt7a.js → dext-radio-group-rac-CzU9KX5_.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DrtaAf-E.js → dext-rating-input-rac-BjRwwgXr.js} +1 -1
- package/dist/component/{dext-tags-rac-Cg4jJ4jr.js → dext-tags-rac-Vif4x1yF.js} +2 -2
- package/dist/component/{dext-text-area-rac-C_t-W7lk.js → dext-text-area-rac-DmZwl_ax.js} +1 -1
- package/dist/component/{dext-text-input-rac-ChvV21Jf.js → dext-text-input-rac-B6FVbjUM.js} +1 -1
- package/dist/component/{dext-url-input-rac-DclbSYTr.js → dext-url-input-rac-17Dj3ICM.js} +1 -1
- package/dist/component/donation-rac-bgHep0Xi.js +307 -0
- package/dist/component/{dropdown-field-headless-CTZ-zGqZ.js → dropdown-field-headless-BGfJ1FyZ.js} +3 -3
- package/dist/component/{dropdown-field-rac-C1KVtxwv.js → dropdown-field-rac-DGiysJQY.js} +7 -7
- package/dist/component/{dropdown-rac-CkkDEDje.js → dropdown-rac-FHjz8fKp.js} +1 -1
- package/dist/component/{ecom-address-rac-BOuugSxX.js → ecom-address-rac-DSbpf4z8.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-IZeMlljb.js → ecom-subscription-checkbox-rac-DiZWNwnt.js} +6 -6
- package/dist/component/{email-input-field-rac-CNzmm1j7.js → email-input-field-rac-BQKK2O7L.js} +44 -44
- package/dist/component/events-repeater-rac-Dudnyhal.js +255 -0
- package/dist/component/{events-rsvp-rac-BmjboAco.js → events-rsvp-rac-008H5Ska.js} +3 -3
- package/dist/component/{field-error-headless-DQZ5XAdn.js → field-error-headless-C5ZsFUKv.js} +1 -1
- package/dist/component/{field-label-headless-DoxfHHaj.js → field-label-headless-CS5OYsiI.js} +1 -1
- package/dist/component/field-rac.module-DjmaTYkc.js +23 -0
- package/dist/component/{file-upload-rac-YEQ7uXhm.js → file-upload-rac-bQ2QOO8Q.js} +48 -48
- package/dist/component/{fixed-payment-rac-DDufIQBT.js → fixed-payment-rac-B6FvXoCU.js} +17 -17
- package/dist/component/{form-C6WwBcGP.js → form-BpHElSwH.js} +69 -69
- package/dist/component/form-element-classes-BXNs5k3q.js +119 -0
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DGfjrjQC.js → header-field-rac-D4UYcmok.js} +3 -3
- package/dist/component/{header-rac-C_JE2cTg.js → header-rac-KavPiBdn.js} +1 -1
- package/dist/component/{image-choice-rac-LDLPQwrN.js → image-choice-rac-BJQqBhBD.js} +35 -36
- package/dist/component/{index-CIOoaQ8Z.js → index-RSEYrQef.js} +2 -2
- package/dist/component/{index-C2srcuHD.js → index-Y8iTxLat.js} +4 -4
- package/dist/component/{isObjectLike-E5QfEa1u.js → isObjectLike-jwHec4Ap.js} +1 -1
- package/dist/component/{multiline-address-field-rac-Biyj2tIN.js → multiline-address-field-rac-D4Ibno80.js} +110 -110
- package/dist/component/{multiline-address-rac-BCqCvG7a.js → multiline-address-rac-CrTSjzBN.js} +1 -1
- package/dist/component/{number-input-field-rac-CwUoIbM8.js → number-input-field-rac-DW1SjB-Z.js} +16 -16
- package/dist/component/{number-input-rac-CdYdTDem.js → number-input-rac-CdE_hRbA.js} +1 -1
- package/dist/component/{password-rac-D62npVHY.js → password-rac-BCxl5mMQ.js} +20 -20
- package/dist/component/{payment-input-rac-D4u-3vcW.js → payment-input-rac-DmO4s4ue.js} +9 -9
- package/dist/component/{phone-input-field-rac-uHxR3ozd.js → phone-input-field-rac-BYAnwk5h.js} +25 -25
- package/dist/component/{phone-rac-Bf99_BGi.js → phone-rac-gS4k9Yn8.js} +1 -1
- package/dist/component/product-list-rac-CO0o3yOg.js +271 -0
- package/dist/component/{quiz-radio-group-rac-CPGS0LEb.js → quiz-radio-group-rac-Dhk7nkzb.js} +2 -2
- package/dist/component/{radio-group-field-rac-BWpTNAbO.js → radio-group-field-rac-DdlyQ3m6.js} +3 -3
- package/dist/component/{radio-group-field-rac.module-WxU5zxvM.js → radio-group-field-rac.module-emin6sSc.js} +3 -3
- package/dist/component/{radio-group-rac-dA4WZ1Vj.js → radio-group-rac-B-9q91fJ.js} +1 -1
- package/dist/component/{rating-input-field-rac-CJnFsBvH.js → rating-input-field-rac-VDaJKq-n.js} +27 -28
- package/dist/component/{rating-input-rac-DXVYozFV.js → rating-input-rac-BVO62LmE.js} +1 -1
- package/dist/component/{rich-content-rac.module-DkKwzJS7.js → rich-content-rac.module-CdiaAjxG.js} +1 -1
- package/dist/component/{rich-text-field-rac-8FWCRrpb.js → rich-text-field-rac-C4RrbyEX.js} +3 -3
- package/dist/component/{rich-text-rac-OeM_mPRy.js → rich-text-rac-BG376ww9.js} +1 -1
- package/dist/component/{service-dropdown-rac-mvUMpcS_.js → service-dropdown-rac-Dy6-OpVR.js} +18 -18
- package/dist/component/services-multi-choice-rac-BKW9MP_b.js +84 -0
- package/dist/component/{signature-rac-D44U9Uyp.js → signature-rac-Cxgixp4o.js} +56 -56
- package/dist/component/{submit-button-rac-BqtcgVAn.js → submit-button-rac-BqPJ7WPI.js} +2 -2
- package/dist/component/{tags-field-rac-CemsTKWz.js → tags-field-rac-wwqpztG7.js} +36 -37
- package/dist/component/{tags-rac-fVjCf6qo.js → tags-rac-DUxITYxU.js} +1 -1
- package/dist/component/{text-area-field-rac-BPciZlZb.js → text-area-field-rac-Cen6O33S.js} +16 -16
- package/dist/component/{text-area-rac-CRTORdZM.js → text-area-rac-CRlO56GA.js} +1 -1
- package/dist/component/{text-input-field-rac-CvFoWlRN.js → text-input-field-rac-CbnKn03g.js} +6 -6
- package/dist/component/{text-input-headless-BQ3TWU9G.js → text-input-headless-C_NTJmLe.js} +3 -3
- package/dist/component/{text-input-rac-DSFkEmob.js → text-input-rac-DvwV7Igm.js} +1 -1
- package/dist/component/{time-input-rac-CGgs7ncp.js → time-input-rac-TSEXiODs.js} +15 -15
- package/dist/component/{url-input-field-rac-CqvgTc-F.js → url-input-field-rac-Cxgh9T8s.js} +20 -20
- package/dist/component/{url-input-rac-C45KOwnr.js → url-input-rac-DNw-Jg1U.js} +1 -1
- package/dist/component/use-element-state-class-name-CC65g9mT.js +15 -0
- package/dist/component/{use-service-options-base-D4Zl-iGW.js → use-service-options-base-EFrxTpGm.js} +1 -1
- package/package.json +2 -2
- package/dist/component/appointment-rac-Bze1s2XD.js +0 -1005
- package/dist/component/checkbox-group-field-headless-D_GG5LHM.js +0 -210
- package/dist/component/checkbox-group-field-rac-Cj7Erubs.js +0 -41
- package/dist/component/contacts-subscribe-rac-Dl1ot9qw.js +0 -13
- package/dist/component/donation-rac-FYQIMm5m.js +0 -308
- package/dist/component/events-repeater-rac-CMV0Lmwz.js +0 -247
- package/dist/component/field-rac.module-Cac83bU5.js +0 -21
- package/dist/component/form-element-classes-DDKCTFQj.js +0 -65
- package/dist/component/form-element-keys-D0sEdpFo.js +0 -8
- package/dist/component/product-list-rac-iRf6Ra7i.js +0 -263
- package/dist/component/services-multi-choice-rac-DrgUrn_N.js +0 -76
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import r, { useMemo as F, useCallback as _, useRef as H, useState as w, useEffect as U } from "react";
|
|
2
|
-
import { CheckboxGroup as W, CheckboxField as A, CheckboxButton as j, TextField as z, Input as J } from "react-aria-components";
|
|
3
|
-
import { debounce as K } from "ts-debounce";
|
|
4
|
-
import { ai as N, af as Q, as as X, ab as Y, ak as Z } from "./form-C6WwBcGP.js";
|
|
5
|
-
import { f as L, a as k } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { D as ee, E as te } from "./field-error-headless-DQZ5XAdn.js";
|
|
7
|
-
import { L as ne } from "./field-label-headless-DoxfHHaj.js";
|
|
8
|
-
import { F as ae } from "./fieldset-headless-CD3fds9J.js";
|
|
9
|
-
import { N as se } from "./options-layout-constants-DEfIEJWD.js";
|
|
10
|
-
const R = "Other", le = (e, t) => e.some((l) => !t.includes(l)), B = (e, t) => e.length > 0 && le(e, t), oe = (e, t) => {
|
|
11
|
-
const l = t == null ? void 0 : t("add-other.default-other-option-label");
|
|
12
|
-
return e || l || R;
|
|
13
|
-
}, P = (e, t) => {
|
|
14
|
-
const a = t ? t.length + 2 : 0;
|
|
15
|
-
return (e.find((c) => c.startsWith(`${t}: `)) || "").slice(a);
|
|
16
|
-
}, D = (e) => e.map((t) => t.value ?? t.label), v = ({ children: e }) => {
|
|
17
|
-
const t = N(), { id: l, value: a, onChange: n, disabled: c, required: u, onBlur: I, onFocus: p, hasError: b, FieldLayout: i } = t, { inputId: f, labelId: d, ariaDescribedBy: o } = Q(), O = L(e, v.Label), h = L(e, v.Options), g = L(e, v.Description), C = L(e, v.Error), s = F(() => a || [], [
|
|
18
|
-
a
|
|
19
|
-
]), E = _((V) => {
|
|
20
|
-
n == null || n(V);
|
|
21
|
-
}, [
|
|
22
|
-
n
|
|
23
|
-
]);
|
|
24
|
-
return /* @__PURE__ */ r.createElement(i, {
|
|
25
|
-
fieldId: l,
|
|
26
|
-
renderLabel: () => O,
|
|
27
|
-
renderInput: () => /* @__PURE__ */ r.createElement(ae, {
|
|
28
|
-
id: f,
|
|
29
|
-
ariaLabelledBy: d,
|
|
30
|
-
ariaDescribedBy: o,
|
|
31
|
-
required: u,
|
|
32
|
-
onBlur: I,
|
|
33
|
-
onFocus: p
|
|
34
|
-
}, /* @__PURE__ */ r.createElement(W, {
|
|
35
|
-
"aria-labelledby": d,
|
|
36
|
-
value: s,
|
|
37
|
-
onChange: E,
|
|
38
|
-
isDisabled: c,
|
|
39
|
-
isRequired: u,
|
|
40
|
-
isInvalid: b
|
|
41
|
-
}, h)),
|
|
42
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, C, g)
|
|
43
|
-
});
|
|
44
|
-
}, $ = ({ children: e, className: t }) => {
|
|
45
|
-
const l = N(), { id: a, options: n, addOther: c, addOtherLabel: u, numberOfColumns: I } = l, { t: p } = X(), { isMobile: b } = Y(), i = L(e, $.Option), f = oe(u, p), d = b ? se.ONE : I;
|
|
46
|
-
return /* @__PURE__ */ r.createElement("div", {
|
|
47
|
-
className: t,
|
|
48
|
-
"data-columns": d
|
|
49
|
-
}, n == null ? void 0 : n.map((o, O) => {
|
|
50
|
-
const h = o.value ?? o.label;
|
|
51
|
-
return k(i, {
|
|
52
|
-
key: o.id || o.label,
|
|
53
|
-
value: h,
|
|
54
|
-
label: o.label,
|
|
55
|
-
isFirst: O === 0,
|
|
56
|
-
fieldId: a
|
|
57
|
-
});
|
|
58
|
-
}), c && k(i, {
|
|
59
|
-
key: R,
|
|
60
|
-
value: R,
|
|
61
|
-
label: f,
|
|
62
|
-
isOther: !0
|
|
63
|
-
}));
|
|
64
|
-
}, re = ({ className: e, ...t }) => {
|
|
65
|
-
const l = t;
|
|
66
|
-
return /* @__PURE__ */ r.createElement("div", {
|
|
67
|
-
"aria-hidden": "true",
|
|
68
|
-
className: typeof e == "function" ? e(l) : e
|
|
69
|
-
});
|
|
70
|
-
}, ce = ({ className: e, ...t }) => {
|
|
71
|
-
const { label: l } = t;
|
|
72
|
-
return /* @__PURE__ */ r.createElement("span", {
|
|
73
|
-
className: e
|
|
74
|
-
}, l);
|
|
75
|
-
}, x = ({ children: e, className: t, ...l }) => {
|
|
76
|
-
const { value: a, label: n, isFirst: c = !1, isOther: u = !1, fieldId: I } = l, p = N(), { value: b, onChange: i, disabled: f, readOnly: d, hasError: o, options: O } = p, h = H(null);
|
|
77
|
-
Z(() => {
|
|
78
|
-
var m;
|
|
79
|
-
c && ((m = h.current) == null || m.focus({
|
|
80
|
-
preventScroll: !0
|
|
81
|
-
}));
|
|
82
|
-
}, I);
|
|
83
|
-
const g = L(e, x.Label), C = L(e, x.Input), s = F(() => b || [], [
|
|
84
|
-
b
|
|
85
|
-
]), E = F(() => u ? s.find((m) => m === n || m.startsWith(`${n}: `)) || n : a, [
|
|
86
|
-
u,
|
|
87
|
-
s,
|
|
88
|
-
n,
|
|
89
|
-
a
|
|
90
|
-
]), V = _((m) => {
|
|
91
|
-
if (!u)
|
|
92
|
-
return;
|
|
93
|
-
const y = D(O || []), S = s.filter((G) => y.includes(G)), q = m ? [
|
|
94
|
-
...S,
|
|
95
|
-
n
|
|
96
|
-
] : S;
|
|
97
|
-
i == null || i(q);
|
|
98
|
-
}, [
|
|
99
|
-
u,
|
|
100
|
-
n,
|
|
101
|
-
i,
|
|
102
|
-
O,
|
|
103
|
-
s
|
|
104
|
-
]);
|
|
105
|
-
return /* @__PURE__ */ r.createElement(A, {
|
|
106
|
-
value: E,
|
|
107
|
-
onChange: u ? V : void 0,
|
|
108
|
-
isDisabled: f,
|
|
109
|
-
isReadOnly: d,
|
|
110
|
-
isInvalid: o
|
|
111
|
-
}, /* @__PURE__ */ r.createElement(j, {
|
|
112
|
-
ref: h,
|
|
113
|
-
className: t,
|
|
114
|
-
"data-hook": `checkbox-${n}`
|
|
115
|
-
}, ({ isSelected: m, isHovered: y }) => /* @__PURE__ */ r.createElement(r.Fragment, null, k(C, {
|
|
116
|
-
isSelected: m,
|
|
117
|
-
isHovered: y
|
|
118
|
-
}), k(g, {
|
|
119
|
-
label: n
|
|
120
|
-
}))));
|
|
121
|
-
};
|
|
122
|
-
x.Label = ce;
|
|
123
|
-
x.Input = re;
|
|
124
|
-
const M = ({ children: e, ...t }) => {
|
|
125
|
-
const { value: l, label: a, isFirst: n = !1, isOther: c = !1, fieldId: u } = t, I = N(), { value: p, onChange: b, options: i, addOtherPlaceholder: f, otherInputCharacterLimit: d, disabled: o, readOnly: O, hasError: h } = I, g = L(e, x), C = L(e, T), s = F(() => p || [], [
|
|
126
|
-
p
|
|
127
|
-
]), E = F(() => {
|
|
128
|
-
if (!c)
|
|
129
|
-
return !1;
|
|
130
|
-
const V = D(i || []);
|
|
131
|
-
return B(s, V);
|
|
132
|
-
}, [
|
|
133
|
-
c,
|
|
134
|
-
s,
|
|
135
|
-
i
|
|
136
|
-
]);
|
|
137
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, k(g, {
|
|
138
|
-
value: l,
|
|
139
|
-
label: a,
|
|
140
|
-
isFirst: n,
|
|
141
|
-
isOther: c,
|
|
142
|
-
fieldId: u
|
|
143
|
-
}), c && E && k(C, {
|
|
144
|
-
fieldValue: s,
|
|
145
|
-
onChange: b,
|
|
146
|
-
label: a,
|
|
147
|
-
placeholder: f,
|
|
148
|
-
maxLength: d,
|
|
149
|
-
disabled: o,
|
|
150
|
-
readOnly: O,
|
|
151
|
-
hasError: h,
|
|
152
|
-
ariaLabel: a,
|
|
153
|
-
addOtherLabel: a,
|
|
154
|
-
options: i
|
|
155
|
-
}));
|
|
156
|
-
}, T = ({ className: e, inputClassName: t, ...l }) => {
|
|
157
|
-
const { fieldValue: a, onChange: n, label: c, placeholder: u, maxLength: I, disabled: p, readOnly: b, hasError: i, ariaLabel: f, addOtherLabel: d, options: o } = l, [O, h] = w(() => {
|
|
158
|
-
const s = D(o || []);
|
|
159
|
-
return B(a, s) ? P(a, d) : "";
|
|
160
|
-
});
|
|
161
|
-
U(() => {
|
|
162
|
-
const s = D(o || []), E = B(a, s);
|
|
163
|
-
h(E ? P(a, d) : "");
|
|
164
|
-
}, [
|
|
165
|
-
a,
|
|
166
|
-
o,
|
|
167
|
-
d
|
|
168
|
-
]);
|
|
169
|
-
const g = F(() => K((s) => {
|
|
170
|
-
const E = D(o || []), V = a.filter((S) => E.includes(S)), m = s ? `${d}: ${s}` : c, y = [
|
|
171
|
-
...V,
|
|
172
|
-
m
|
|
173
|
-
];
|
|
174
|
-
n(y);
|
|
175
|
-
}, 500), [
|
|
176
|
-
n,
|
|
177
|
-
o,
|
|
178
|
-
a,
|
|
179
|
-
d,
|
|
180
|
-
c
|
|
181
|
-
]), C = _((s) => {
|
|
182
|
-
h(s), g(s);
|
|
183
|
-
}, [
|
|
184
|
-
g
|
|
185
|
-
]);
|
|
186
|
-
return /* @__PURE__ */ r.createElement(z, {
|
|
187
|
-
"aria-label": f,
|
|
188
|
-
value: O,
|
|
189
|
-
onChange: C,
|
|
190
|
-
isDisabled: p,
|
|
191
|
-
isReadOnly: b,
|
|
192
|
-
isInvalid: i,
|
|
193
|
-
className: e
|
|
194
|
-
}, /* @__PURE__ */ r.createElement(J, {
|
|
195
|
-
className: t,
|
|
196
|
-
placeholder: u,
|
|
197
|
-
maxLength: I,
|
|
198
|
-
"aria-label": f
|
|
199
|
-
}));
|
|
200
|
-
};
|
|
201
|
-
v.Label = ne;
|
|
202
|
-
v.Options = $;
|
|
203
|
-
$.Option = M;
|
|
204
|
-
M.Checkbox = x;
|
|
205
|
-
M.OtherInput = T;
|
|
206
|
-
v.Description = ee;
|
|
207
|
-
v.Error = te;
|
|
208
|
-
export {
|
|
209
|
-
v as C
|
|
210
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as l } from "@wix/ricos/viewer";
|
|
2
|
-
import a from "classnames";
|
|
3
|
-
import e from "react";
|
|
4
|
-
import { ac as m } from "./form-C6WwBcGP.js";
|
|
5
|
-
import { C as t } from "./checkbox-group-field-headless-D_GG5LHM.js";
|
|
6
|
-
import { E as _ } from "./error-icon-hZxQ6DEy.js";
|
|
7
|
-
import { s as r } from "./field-rac.module-Cac83bU5.js";
|
|
8
|
-
import { z as c, R as O, a as C, b as i, c as p, d as R, e as L, y as I, q as S, j as D } from "./form-element-classes-DDKCTFQj.js";
|
|
9
|
-
import { C as F } from "./form-element-keys-D0sEdpFo.js";
|
|
10
|
-
import { o as n } from "./options-rac.module-KM-VT_KY.js";
|
|
11
|
-
const N = ({ content: o, locale: s }) => /* @__PURE__ */ e.createElement(l, {
|
|
12
|
-
content: o,
|
|
13
|
-
locale: s
|
|
14
|
-
}), k = () => {
|
|
15
|
-
const o = m(F);
|
|
16
|
-
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
17
|
-
className: a(c, r.label)
|
|
18
|
-
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
19
|
-
className: a(O, r.requiredMark)
|
|
20
|
-
})), /* @__PURE__ */ e.createElement(t.Options, {
|
|
21
|
-
className: a(C, n.options)
|
|
22
|
-
}, /* @__PURE__ */ e.createElement(t.Options.Option, null, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox, {
|
|
23
|
-
className: r.checkbox
|
|
24
|
-
}, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Input, {
|
|
25
|
-
className: ({ isSelected: s, isHovered: E }) => a(i, r.checkboxInput, o, {
|
|
26
|
-
[R]: s,
|
|
27
|
-
[p]: E
|
|
28
|
-
})
|
|
29
|
-
}), /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Label, {
|
|
30
|
-
className: a(L, n.optionLabel)
|
|
31
|
-
})), /* @__PURE__ */ e.createElement(t.Options.Option.OtherInput, {
|
|
32
|
-
inputClassName: a(I, r.input)
|
|
33
|
-
}))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
34
|
-
className: a(S, r.error)
|
|
35
|
-
}, /* @__PURE__ */ e.createElement(_, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
36
|
-
className: a(D, r.description)
|
|
37
|
-
}, N));
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
k as C
|
|
41
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import C from "react";
|
|
2
|
-
import { C as _ } from "./checkbox-field-rac-BH3yEE5j.js";
|
|
3
|
-
import { Z as e, _ as o, Y as r } from "./form-element-classes-DDKCTFQj.js";
|
|
4
|
-
const a = () => /* @__PURE__ */ C.createElement(_, {
|
|
5
|
-
classes: {
|
|
6
|
-
container: r,
|
|
7
|
-
label: o,
|
|
8
|
-
control: e
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
a as ContactsSubscribeRAC
|
|
13
|
-
};
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import t, { useMemo as B, useCallback as L, useRef as oe } from "react";
|
|
2
|
-
import { RicosViewer as re } from "@wix/ricos/viewer";
|
|
3
|
-
import y from "classnames";
|
|
4
|
-
import { P as G, ai as A, af as j, as as se, ab as v, ak as ae, ac as le } from "./form-C6WwBcGP.js";
|
|
5
|
-
import { RadioGroup as ie, RadioField as z, RadioButton as H, TextField as ce, Group as ue, Input as me } from "react-aria-components";
|
|
6
|
-
import { debounce as pe } from "ts-debounce";
|
|
7
|
-
import { f, a as N } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { a as K } from "./format-currency-BwShJ9vM.js";
|
|
9
|
-
import { D as de, E as Ee } from "./field-error-headless-DQZ5XAdn.js";
|
|
10
|
-
import { L as Ie } from "./field-label-headless-DoxfHHaj.js";
|
|
11
|
-
import { N as Ce } from "./options-layout-constants-DEfIEJWD.js";
|
|
12
|
-
import { a as fe, b as Oe } from "./numeric-input-utils-CuBMi4-a.js";
|
|
13
|
-
import { g as _e } from "./payment-field-utils-DobiK5Xh.js";
|
|
14
|
-
import { u as he } from "./use-synced-display-value-DcAxdn3M.js";
|
|
15
|
-
import { E as ye } from "./error-icon-hZxQ6DEy.js";
|
|
16
|
-
import { s as D } from "./field-rac.module-Cac83bU5.js";
|
|
17
|
-
import { z as Ne, R as be, k as Fe, l as De, m as ge, y as Le, q as Re, j as Se } from "./form-element-classes-DDKCTFQj.js";
|
|
18
|
-
import { D as Ae } from "./form-element-keys-D0sEdpFo.js";
|
|
19
|
-
import { o as ve } from "./options-rac.module-KM-VT_KY.js";
|
|
20
|
-
function Te(e, n) {
|
|
21
|
-
return e.reduce((o, r) => (o[r[n]] = r, o), {});
|
|
22
|
-
}
|
|
23
|
-
function Me(e) {
|
|
24
|
-
return Te(e, "id");
|
|
25
|
-
}
|
|
26
|
-
const Pe = 0.01;
|
|
27
|
-
function xe(e) {
|
|
28
|
-
var n;
|
|
29
|
-
return ((n = e == null ? void 0 : e.fixedPriceOptions) == null ? void 0 : n.price) || "0";
|
|
30
|
-
}
|
|
31
|
-
function Q(e, n) {
|
|
32
|
-
const o = Number(n || "0");
|
|
33
|
-
return {
|
|
34
|
-
productId: e.id,
|
|
35
|
-
price: e.priceType === G.DYNAMIC_PRICE ? o : String(o),
|
|
36
|
-
quantity: 1
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function Be(e) {
|
|
40
|
-
return e.find((n) => n.priceType === G.DYNAMIC_PRICE);
|
|
41
|
-
}
|
|
42
|
-
function je(e, n) {
|
|
43
|
-
return (e == null ? void 0 : e.productId) === (n == null ? void 0 : n.id) ? String((e == null ? void 0 : e.price) ?? "") : "";
|
|
44
|
-
}
|
|
45
|
-
function qe(e, n, o) {
|
|
46
|
-
const r = (n == null ? void 0 : n.productId) === e ? void 0 : e, a = r ? o[r] : void 0;
|
|
47
|
-
return a ? [
|
|
48
|
-
Q(a, xe(a))
|
|
49
|
-
] : [];
|
|
50
|
-
}
|
|
51
|
-
const s = ({ children: e }) => {
|
|
52
|
-
const { id: n, value: o, onChange: r, disabled: a, required: m, onBlur: p, onFocus: _, validation: c, addOther: u, addOtherPlaceholder: i, FieldLayout: E, hasError: O } = A(), { labelId: h } = j(), { t: I } = se(), { currency: T, regionalFormat: b } = v(), d = o == null ? void 0 : o[0], F = B(() => {
|
|
53
|
-
var C, x;
|
|
54
|
-
return ((x = (C = c == null ? void 0 : c.predefined) == null ? void 0 : C.paymentOptions) == null ? void 0 : x.products) || [];
|
|
55
|
-
}, [
|
|
56
|
-
c
|
|
57
|
-
]), M = B(() => Me(F), [
|
|
58
|
-
F
|
|
59
|
-
]), l = B(() => u ? Be(F) : void 0, [
|
|
60
|
-
F,
|
|
61
|
-
u
|
|
62
|
-
]), W = je(d, l), [q, P] = he({
|
|
63
|
-
sourceValue: W,
|
|
64
|
-
format: (C) => Oe(String(C ?? ""), b),
|
|
65
|
-
regionalFormat: b
|
|
66
|
-
}), k = L((C) => {
|
|
67
|
-
r(qe(C, d, M)), P("");
|
|
68
|
-
}, [
|
|
69
|
-
r,
|
|
70
|
-
M,
|
|
71
|
-
d,
|
|
72
|
-
P
|
|
73
|
-
]), $ = L((C) => {
|
|
74
|
-
l && r(typeof C == "number" ? [
|
|
75
|
-
Q(l, String(C))
|
|
76
|
-
] : []);
|
|
77
|
-
}, [
|
|
78
|
-
r,
|
|
79
|
-
l
|
|
80
|
-
]), V = B(() => pe($, 500), [
|
|
81
|
-
$
|
|
82
|
-
]), J = L((C) => {
|
|
83
|
-
(d == null ? void 0 : d.productId) !== (l == null ? void 0 : l.id) && r(void 0);
|
|
84
|
-
const { validInput: x, validNumber: te } = fe(C.target.value, Pe, q, b);
|
|
85
|
-
P(x), V(te);
|
|
86
|
-
}, [
|
|
87
|
-
b,
|
|
88
|
-
r,
|
|
89
|
-
d,
|
|
90
|
-
l,
|
|
91
|
-
q,
|
|
92
|
-
V,
|
|
93
|
-
P
|
|
94
|
-
]), w = (d == null ? void 0 : d.productId) || null, X = L(() => {
|
|
95
|
-
l != null && l.id && w !== l.id && k(l.id);
|
|
96
|
-
}, [
|
|
97
|
-
l == null ? void 0 : l.id,
|
|
98
|
-
w,
|
|
99
|
-
k
|
|
100
|
-
]), Z = f(e, s.Label), Y = f(e, s.Control), ee = f(e, s.Description), ne = f(e, s.Error);
|
|
101
|
-
return /* @__PURE__ */ t.createElement(E, {
|
|
102
|
-
fieldId: n,
|
|
103
|
-
renderLabel: () => Z,
|
|
104
|
-
renderInput: () => /* @__PURE__ */ t.createElement(ie, {
|
|
105
|
-
"aria-labelledby": h,
|
|
106
|
-
value: w,
|
|
107
|
-
onChange: k,
|
|
108
|
-
isDisabled: a,
|
|
109
|
-
isInvalid: O,
|
|
110
|
-
isRequired: m,
|
|
111
|
-
onBlur: p,
|
|
112
|
-
onFocus: _
|
|
113
|
-
}, Y ? N(Y, {
|
|
114
|
-
productsById: M,
|
|
115
|
-
addOther: u,
|
|
116
|
-
customAmount: q,
|
|
117
|
-
onCustomAmountInputChange: J,
|
|
118
|
-
currency: T,
|
|
119
|
-
t: I,
|
|
120
|
-
placeholder: i === void 0 ? I("donation.other-option.placeholder") : i,
|
|
121
|
-
customAmountProductId: l == null ? void 0 : l.id,
|
|
122
|
-
onFocusCustomInput: X
|
|
123
|
-
}) : null),
|
|
124
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, ne, ee)
|
|
125
|
-
});
|
|
126
|
-
}, ke = ({ children: e, className: n, ...o }) => {
|
|
127
|
-
const { productsById: r, addOther: a, customAmount: m, onCustomAmountInputChange: p, currency: _, t: c, placeholder: u, customAmountProductId: i, onFocusCustomInput: E } = o, { hasError: O } = A(), h = f(e, s.Options), I = f(e, s.OtherInput);
|
|
128
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
129
|
-
className: n,
|
|
130
|
-
"data-invalid": O
|
|
131
|
-
}, h ? N(h, {
|
|
132
|
-
productsById: r
|
|
133
|
-
}) : null, a && i && /* @__PURE__ */ t.createElement(z, {
|
|
134
|
-
value: i,
|
|
135
|
-
style: {
|
|
136
|
-
position: "absolute",
|
|
137
|
-
width: "1px",
|
|
138
|
-
height: "1px",
|
|
139
|
-
padding: "0",
|
|
140
|
-
margin: "-1px",
|
|
141
|
-
overflow: "hidden",
|
|
142
|
-
clip: "rect(0, 0, 0, 0)",
|
|
143
|
-
whiteSpace: "nowrap",
|
|
144
|
-
border: "0"
|
|
145
|
-
}
|
|
146
|
-
}, /* @__PURE__ */ t.createElement(H, {
|
|
147
|
-
"aria-label": c("donation.other-option.label", "Custom amount")
|
|
148
|
-
}, c("donation.other-option.label", "Custom amount"))), I && a ? N(I, {
|
|
149
|
-
customAmount: m,
|
|
150
|
-
onCustomAmountInputChange: p,
|
|
151
|
-
currency: _,
|
|
152
|
-
t: c,
|
|
153
|
-
placeholder: u,
|
|
154
|
-
customAmountProductId: i,
|
|
155
|
-
onFocusCustomInput: E
|
|
156
|
-
}) : null);
|
|
157
|
-
}, U = ({ children: e, className: n, ...o }) => {
|
|
158
|
-
const { productsById: r } = o, { options: a, numberOfColumns: m } = A(), { isMobile: p } = v(), _ = f(e, U.Option), c = p ? Ce.ONE : m;
|
|
159
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
160
|
-
className: n,
|
|
161
|
-
"data-columns": c
|
|
162
|
-
}, a.map((u) => {
|
|
163
|
-
var O;
|
|
164
|
-
const i = r[u.value], E = (O = i == null ? void 0 : i.fixedPriceOptions) == null ? void 0 : O.price;
|
|
165
|
-
return N(_, {
|
|
166
|
-
key: u.value,
|
|
167
|
-
value: u.value,
|
|
168
|
-
price: E || "0"
|
|
169
|
-
});
|
|
170
|
-
}));
|
|
171
|
-
}, R = ({ children: e, className: n, ...o }) => {
|
|
172
|
-
const { value: r, price: a } = o, { id: m } = A(), { currency: p, regionalFormat: _ } = v(), c = f(e, R.Value), u = f(e, R.Currency), { isCurrencyPrefixed: i } = K({
|
|
173
|
-
amount: a,
|
|
174
|
-
currency: p == null ? void 0 : p.code,
|
|
175
|
-
locale: _
|
|
176
|
-
}), E = oe(null);
|
|
177
|
-
ae(() => {
|
|
178
|
-
var h, I;
|
|
179
|
-
(I = (h = E.current) == null ? void 0 : h.querySelector("input")) == null || I.focus();
|
|
180
|
-
}, m);
|
|
181
|
-
const O = c ? N(c, {
|
|
182
|
-
price: a
|
|
183
|
-
}) : null;
|
|
184
|
-
return /* @__PURE__ */ t.createElement(z, {
|
|
185
|
-
value: r
|
|
186
|
-
}, /* @__PURE__ */ t.createElement(H, {
|
|
187
|
-
className: n,
|
|
188
|
-
ref: E
|
|
189
|
-
}, /* @__PURE__ */ t.createElement(t.Fragment, null, i && u, O, !i && u)));
|
|
190
|
-
}, we = ({ className: e, ...n }) => {
|
|
191
|
-
const { price: o } = n, { currency: r, regionalFormat: a } = v(), { value: m } = K({
|
|
192
|
-
amount: o,
|
|
193
|
-
currency: r == null ? void 0 : r.code,
|
|
194
|
-
locale: a
|
|
195
|
-
});
|
|
196
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
197
|
-
className: e
|
|
198
|
-
}, m);
|
|
199
|
-
}, Ue = ({ className: e }) => {
|
|
200
|
-
const { currency: n } = v();
|
|
201
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
202
|
-
className: e
|
|
203
|
-
}, (n == null ? void 0 : n.sign) || (n == null ? void 0 : n.code) || "");
|
|
204
|
-
};
|
|
205
|
-
R.Value = we;
|
|
206
|
-
R.Currency = Ue;
|
|
207
|
-
const S = ({ children: e, className: n, ...o }) => {
|
|
208
|
-
const { customAmount: r, onCustomAmountInputChange: a, currency: m, t: p, placeholder: _, customAmountProductId: c, onFocusCustomInput: u } = o, { disabled: i, hasError: E } = A(), { labelId: O, prefixId: h } = j(), I = f(e, S.Currency), T = f(e, S.Value), b = L((F) => {
|
|
209
|
-
a({
|
|
210
|
-
target: {
|
|
211
|
-
value: F
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}, [
|
|
215
|
-
a
|
|
216
|
-
]), d = L(() => {
|
|
217
|
-
u();
|
|
218
|
-
}, [
|
|
219
|
-
u
|
|
220
|
-
]);
|
|
221
|
-
return /* @__PURE__ */ t.createElement(ce, {
|
|
222
|
-
"aria-labelledby": `${O} ${h}`,
|
|
223
|
-
value: r,
|
|
224
|
-
onChange: b,
|
|
225
|
-
onFocus: d,
|
|
226
|
-
isDisabled: i,
|
|
227
|
-
isInvalid: E
|
|
228
|
-
}, /* @__PURE__ */ t.createElement(ue, {
|
|
229
|
-
className: n,
|
|
230
|
-
isDisabled: i,
|
|
231
|
-
isInvalid: E
|
|
232
|
-
}, r && m && I ? N(I, {
|
|
233
|
-
currency: m,
|
|
234
|
-
t: p
|
|
235
|
-
}) : null, T ? N(T, {
|
|
236
|
-
placeholder: _,
|
|
237
|
-
customAmountProductId: c
|
|
238
|
-
}) : null));
|
|
239
|
-
}, $e = ({ className: e, ...n }) => {
|
|
240
|
-
const { currency: o, t: r } = n, { prefixId: a } = j();
|
|
241
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
242
|
-
id: a,
|
|
243
|
-
"aria-hidden": !1,
|
|
244
|
-
"aria-label": _e(r, o),
|
|
245
|
-
className: e
|
|
246
|
-
}, (o == null ? void 0 : o.sign) || (o == null ? void 0 : o.code) || "");
|
|
247
|
-
}, Ve = ({ className: e, ...n }) => {
|
|
248
|
-
const { placeholder: o, customAmountProductId: r } = n, { ariaDescribedBy: a, labelId: m, prefixId: p } = j();
|
|
249
|
-
return /* @__PURE__ */ t.createElement(me, {
|
|
250
|
-
id: r,
|
|
251
|
-
"aria-labelledby": `${m} ${p}`,
|
|
252
|
-
"aria-describedby": a,
|
|
253
|
-
placeholder: o,
|
|
254
|
-
inputMode: "decimal",
|
|
255
|
-
autoComplete: "off",
|
|
256
|
-
className: e
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
S.Currency = $e;
|
|
260
|
-
S.Value = Ve;
|
|
261
|
-
U.Option = R;
|
|
262
|
-
s.Label = Ie;
|
|
263
|
-
s.Control = ke;
|
|
264
|
-
s.Options = U;
|
|
265
|
-
s.OtherInput = S;
|
|
266
|
-
s.Description = de;
|
|
267
|
-
s.Error = Ee;
|
|
268
|
-
const Ye = "_control_141js_1", Ge = "_options_141js_7", ze = "_option_141js_7", He = "_optionCurrency_141js_89", Ke = "_otherInput_141js_93", Qe = "_otherInputCurrency_141js_112", g = {
|
|
269
|
-
control: Ye,
|
|
270
|
-
options: Ge,
|
|
271
|
-
option: ze,
|
|
272
|
-
optionCurrency: He,
|
|
273
|
-
otherInput: Ke,
|
|
274
|
-
otherInputCurrency: Qe
|
|
275
|
-
}, We = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(re, {
|
|
276
|
-
content: e,
|
|
277
|
-
locale: n
|
|
278
|
-
}), Je = () => {
|
|
279
|
-
const e = le(Ae);
|
|
280
|
-
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
281
|
-
className: y(Ne, D.label)
|
|
282
|
-
}, /* @__PURE__ */ t.createElement(s.Label.Required, {
|
|
283
|
-
className: y(be, D.requiredMark)
|
|
284
|
-
})), /* @__PURE__ */ t.createElement(s.Control, {
|
|
285
|
-
className: g.control
|
|
286
|
-
}, /* @__PURE__ */ t.createElement(s.Options, {
|
|
287
|
-
className: y(Fe, ve.options, g.options)
|
|
288
|
-
}, /* @__PURE__ */ t.createElement(s.Options.Option, {
|
|
289
|
-
className: ({ isSelected: n }) => y(De, g.option, e, {
|
|
290
|
-
[ge]: n
|
|
291
|
-
})
|
|
292
|
-
}, /* @__PURE__ */ t.createElement(s.Options.Option.Value, null), /* @__PURE__ */ t.createElement(s.Options.Option.Currency, {
|
|
293
|
-
className: g.optionCurrency
|
|
294
|
-
}))), /* @__PURE__ */ t.createElement(s.OtherInput, {
|
|
295
|
-
className: y(Le, D.input, g.otherInput)
|
|
296
|
-
}, /* @__PURE__ */ t.createElement(s.OtherInput.Currency, {
|
|
297
|
-
className: g.otherInputCurrency
|
|
298
|
-
}), /* @__PURE__ */ t.createElement(s.OtherInput.Value, {
|
|
299
|
-
className: D.innerInput
|
|
300
|
-
}))), /* @__PURE__ */ t.createElement(s.Error, {
|
|
301
|
-
className: y(Re, D.error)
|
|
302
|
-
}, /* @__PURE__ */ t.createElement(ye, null), /* @__PURE__ */ t.createElement(s.Error.Text, null)), /* @__PURE__ */ t.createElement(s.Description, {
|
|
303
|
-
className: y(Se, D.description)
|
|
304
|
-
}, We));
|
|
305
|
-
}, On = () => /* @__PURE__ */ t.createElement(Je, null);
|
|
306
|
-
export {
|
|
307
|
-
On as DonationRAC
|
|
308
|
-
};
|