@wix/form-elements 1.80.0 → 1.81.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-BYisg594.js → appointment-rac-DmwbqZse.js} +82 -82
- package/dist/component/{bookings-address-rac-CsILj67y.js → bookings-address-rac-RCzVU87c.js} +1 -1
- package/dist/component/{bookings-email-rac-CVmAPK_5.js → bookings-email-rac-Df_Wte1_.js} +1 -1
- package/dist/component/{bookings-first-name-rac-Dh41-RQ_.js → bookings-first-name-rac-BmdRGYxF.js} +1 -1
- package/dist/component/{bookings-header-rac-B6Fgfiz5.js → bookings-header-rac-DewQWtkZ.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CuY8aaXv.js → bookings-last-name-rac-DmmNBuqy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-B8JBcGs8.js → bookings-login-bar-rac-QskvFo0C.js} +5 -5
- package/dist/component/{bookings-phone-rac-Bspc3F7g.js → bookings-phone-rac-7wn8IXna.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-B1o0ZcfK.js → bookings-rich-text-rac-B5nk0BlD.js} +1 -1
- package/dist/component/{checkbox-field-rac-thaR4lXB.js → checkbox-field-rac-BnVNfYWL.js} +5 -5
- package/dist/component/{checkbox-group-field-headless-DryeaW7l.js → checkbox-group-field-headless-Bx5Y-RMP.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-CJfbT13O.js → checkbox-group-field-rac-CZW28rj5.js} +7 -7
- package/dist/component/{checkbox-group-rac-BwI7UHzO.js → checkbox-group-rac-B20t8dTB.js} +1 -1
- package/dist/component/{checkbox-rac-HRTKCRY4.js → checkbox-rac-ifC6qSE8.js} +1 -1
- package/dist/component/{contacts-address-rac-BIn9plXb.js → contacts-address-rac-XJRKvPlp.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-oGP8bO3I.js → contacts-birthdate-rac-CKYESrPO.js} +1 -1
- package/dist/component/{contacts-company-rac-ChdjTt8-.js → contacts-company-rac-BXwEeb0p.js} +1 -1
- package/dist/component/{contacts-email-rac-BUluFo-o.js → contacts-email-rac-D8Yspo_m.js} +1 -1
- package/dist/component/{contacts-first-name-rac-tmboINSq.js → contacts-first-name-rac-mvCGP1LJ.js} +1 -1
- package/dist/component/{contacts-last-name-rac-BaD5OBVf.js → contacts-last-name-rac-Clg9RXal.js} +1 -1
- package/dist/component/{contacts-phone-rac-BoX2-IEP.js → contacts-phone-rac-qEwjhByI.js} +1 -1
- package/dist/component/{contacts-position-rac-BNDskehr.js → contacts-position-rac-Bh8fvf2M.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CVaQG4Qy.js → contacts-subscribe-rac-DEQ2XkZo.js} +2 -2
- package/dist/component/{contacts-tax-id-rac-Dxgxcv7c.js → contacts-tax-id-rac-0DUZ4tJz.js} +1 -1
- package/dist/component/{date-availability-BbrBYxgL.js → date-availability-2ek2RtXx.js} +1 -1
- package/dist/component/{date-input-field-rac-oibxt2dz.js → date-input-field-rac-Bp4SQB-t.js} +29 -29
- package/dist/component/{date-input-rac-h2vrPoah.js → date-input-rac-CYsJcMe5.js} +1 -1
- package/dist/component/{date-picker-field-rac-Cr9PMglz.js → date-picker-field-rac-BGQvnSYI.js} +9 -9
- package/dist/component/{date-picker-rac-8BOHRpaJ.js → date-picker-rac-BVncggYR.js} +1 -1
- package/dist/component/{date-time-input-field-rac-C7CZ4i6-.js → date-time-input-field-rac-B1mggelc.js} +33 -33
- package/dist/component/{date-time-input-rac-BARK1BJc.js → date-time-input-rac-DzdCno0L.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-CWc0W-zr.js → dext-checkbox-group-rac-CNCpeolD.js} +2 -2
- package/dist/component/{dext-checkbox-rac-NKcTYwpg.js → dext-checkbox-rac-BYDQ58Mo.js} +1 -1
- package/dist/component/{dext-date-picker-rac-SllyCpYt.js → dext-date-picker-rac-aYYk8Nrl.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-JT9Pa7TG.js → dext-date-time-input-rac-v2v974p5.js} +1 -1
- package/dist/component/{dext-dropdown-rac-aBU9t_U4.js → dext-dropdown-rac-C846KZCe.js} +1 -1
- package/dist/component/{dext-email-rac-DKoJiyjE.js → dext-email-rac-izjbfME9.js} +1 -1
- package/dist/component/{dext-number-input-rac-BHkzAyzd.js → dext-number-input-rac-CnOFsD7l.js} +1 -1
- package/dist/component/{dext-phone-rac-Ou-fxcN5.js → dext-phone-rac-D8GMXD88.js} +1 -1
- package/dist/component/{dext-radio-group-rac-CH0WlRsF.js → dext-radio-group-rac-BtiyGCRh.js} +2 -2
- package/dist/component/{dext-rating-input-rac-D_jXx_VN.js → dext-rating-input-rac-BHJ1kitb.js} +1 -1
- package/dist/component/{dext-tags-rac-DBaT-lQT.js → dext-tags-rac-CvNjwS5R.js} +2 -2
- package/dist/component/{dext-text-area-rac-DWcCktYi.js → dext-text-area-rac-X5L0Q3sC.js} +1 -1
- package/dist/component/{dext-text-input-rac-CBX2wgW-.js → dext-text-input-rac-swkyAJqC.js} +1 -1
- package/dist/component/{dext-url-input-rac-DaqWDzIt.js → dext-url-input-rac-BYlXOAkz.js} +1 -1
- package/dist/component/donation-rac-CDWLBZZM.js +318 -0
- package/dist/component/{dropdown-field-headless-D7mOjVEJ.js → dropdown-field-headless-JJzbZvps.js} +3 -3
- package/dist/component/{dropdown-field-rac-DsRuMFo4.js → dropdown-field-rac-BodpIQ9Q.js} +5 -5
- package/dist/component/{dropdown-rac-8Fe66UGi.js → dropdown-rac-Bfbxxx9k.js} +1 -1
- package/dist/component/{ecom-address-rac-DbR_WEgu.js → ecom-address-rac-BCnsL5tr.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-ByQsK79_.js → ecom-subscription-checkbox-rac-CNSdI_ty.js} +3 -3
- package/dist/component/{email-input-field-rac-BS0bFS0-.js → email-input-field-rac-Btaa4O5T.js} +48 -48
- package/dist/component/{events-repeater-rac-xhXarOw_.js → events-repeater-rac-xBwqJddt.js} +10 -10
- package/dist/component/{events-rsvp-rac-BLq-ro2E.js → events-rsvp-rac-D90PwkHd.js} +3 -3
- package/dist/component/{field-error-headless-C7IUibkK.js → field-error-headless-BErhh9GG.js} +1 -1
- package/dist/component/{field-label-headless-BQFy2iAr.js → field-label-headless-BGyK-5xW.js} +1 -1
- package/dist/component/{file-upload-rac-B84R44Bt.js → file-upload-rac-MxH3CVml.js} +21 -21
- package/dist/component/{fixed-payment-rac-D7Asu-Ws.js → fixed-payment-rac-DpBA9irF.js} +10 -10
- package/dist/component/{form-element-classes-BuM-vthE.js → form-element-classes-jC8D0LnK.js} +77 -63
- package/dist/component/{form-BmioUKtQ.js → form-f0tqdMye.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CN5SyZpH.js → header-field-rac-BXxFqu9u.js} +3 -3
- package/dist/component/{header-rac-B9ITu2YO.js → header-rac-BN70esac.js} +1 -1
- package/dist/component/image-choice-rac-DLBGIBXL.js +158 -0
- package/dist/component/{index-3q1aCLZ8.js → index-BvB-uE1H.js} +2 -2
- package/dist/component/{index-CvWMG1x1.js → index-DXLEHYlA.js} +4 -4
- package/dist/component/{isObjectLike-xDv2bEeI.js → isObjectLike-BYOX5XY4.js} +1 -1
- package/dist/component/{multiline-address-field-rac-BLDqei5I.js → multiline-address-field-rac-fcQYnPlO.js} +52 -52
- package/dist/component/{multiline-address-rac-Dy9Km8P8.js → multiline-address-rac-D82Gbj3n.js} +1 -1
- package/dist/component/{number-input-field-rac-Dxu4WHzh.js → number-input-field-rac-B0-4Rz3w.js} +16 -16
- package/dist/component/{number-input-rac-hHEmwPao.js → number-input-rac-Bnsvb-SO.js} +1 -1
- package/dist/component/{password-rac-CEylicEt.js → password-rac-BdBjFa8y.js} +15 -15
- package/dist/component/{payment-input-rac-bvK_YQ78.js → payment-input-rac-DkAGOvaF.js} +18 -18
- package/dist/component/{phone-input-field-rac-CqYNWmiA.js → phone-input-field-rac-Ce_wuE46.js} +54 -54
- package/dist/component/{phone-rac-C72xrPL6.js → phone-rac-DslINtcH.js} +1 -1
- package/dist/component/{product-list-rac-DbftZgIh.js → product-list-rac-C4P_SOyG.js} +25 -25
- package/dist/component/{quiz-radio-group-rac-Bkg5poft.js → quiz-radio-group-rac-noy4fmD8.js} +2 -2
- package/dist/component/{radio-button-module-classes-Do4JmHrh.js → radio-button-module-classes-DXQ1UlmI.js} +3 -3
- package/dist/component/{radio-group-field-rac-BkoqJYp4.js → radio-group-field-rac-CYBDq7R1.js} +5 -5
- package/dist/component/{radio-group-rac-BGp1iRNt.js → radio-group-rac-CGHQFyJY.js} +1 -1
- package/dist/component/{rating-input-field-rac-Bozwq2E7.js → rating-input-field-rac-elaferlI.js} +18 -18
- package/dist/component/{rating-input-rac-Cxha4VPg.js → rating-input-rac-fnOtTKN8.js} +1 -1
- package/dist/component/{rich-content-rac.module-ZXCfVPY-.js → rich-content-rac.module-DbwuwQeo.js} +1 -1
- package/dist/component/{rich-text-field-rac-Ct4KowMZ.js → rich-text-field-rac-DtcQC8zU.js} +3 -3
- package/dist/component/{rich-text-rac-Cek5wjXa.js → rich-text-rac-CuT97sby.js} +1 -1
- package/dist/component/{service-dropdown-rac-B3K93XxF.js → service-dropdown-rac-rk2tzikX.js} +24 -24
- package/dist/component/{services-multi-choice-rac-2RTQqyG6.js → services-multi-choice-rac-BMQyF_xs.js} +7 -7
- package/dist/component/{signature-rac-BIbRkW1j.js → signature-rac-DeV9C6ta.js} +41 -41
- package/dist/component/{submit-button-rac-DofUaqHk.js → submit-button-rac-BpN-FYtM.js} +2 -2
- package/dist/component/tags-field-rac-ByC9DnyH.js +217 -0
- package/dist/component/{tags-rac-DuMX91gd.js → tags-rac-Dabz4jHd.js} +1 -1
- package/dist/component/{text-area-field-rac-BbHdTAJP.js → text-area-field-rac-CtSa8XW_.js} +14 -14
- package/dist/component/{text-area-rac-B9lDzZAb.js → text-area-rac-CDLF-_56.js} +1 -1
- package/dist/component/{text-input-field-rac-B_csZjOh.js → text-input-field-rac-C6fQYKhI.js} +5 -5
- package/dist/component/{text-input-headless-CVOWyi55.js → text-input-headless-BwVLU9cp.js} +3 -3
- package/dist/component/{text-input-rac-DowwSRpa.js → text-input-rac-CoGTzfo1.js} +1 -1
- package/dist/component/{time-input-rac-D9SXITBr.js → time-input-rac-DQDupKTA.js} +17 -17
- package/dist/component/{url-input-field-rac-BxT0Lgly.js → url-input-field-rac-4T8gcMHH.js} +8 -8
- package/dist/component/{url-input-rac-GX9rvIJd.js → url-input-rac-_d6XRdKX.js} +1 -1
- package/dist/component/{use-element-state-class-name-nCwOVSGM.js → use-element-state-class-name-BqmaTba3.js} +1 -1
- package/dist/component/{use-service-options-base-BO3Ackpl.js → use-service-options-base-CRgxxz7b.js} +1 -1
- package/package.json +2 -2
- package/dist/component/donation-rac-D1rcPi17.js +0 -307
- package/dist/component/image-choice-rac-9ncRxwZd.js +0 -146
- package/dist/component/tags-field-rac-DTOthwA5.js +0 -206
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import r from "react";
|
|
2
|
-
import { ai as e, h as o } from "./form-
|
|
3
|
-
import { T as s } from "./tags-field-rac-
|
|
2
|
+
import { ai as e, h as o } from "./form-f0tqdMye.js";
|
|
3
|
+
import { T as s } from "./tags-field-rac-ByC9DnyH.js";
|
|
4
4
|
import { b as a } from "./default-limits-D7qVv_Hv.js";
|
|
5
5
|
const l = () => {
|
|
6
6
|
const t = {
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import n, { useMemo as x, useCallback as S, useRef as oe } from "react";
|
|
2
|
+
import { RicosViewer as re } from "@wix/ricos/viewer";
|
|
3
|
+
import g from "classnames";
|
|
4
|
+
import { RadioGroup as se, RadioField as G, RadioButton as Y, TextField as ae, Group as le, Input as ie } from "react-aria-components";
|
|
5
|
+
import { debounce as ce } from "ts-debounce";
|
|
6
|
+
import { P as Q, ai as v, af as B, as as ue, ab as A, ak as me } from "./form-f0tqdMye.js";
|
|
7
|
+
import { f, a as y } from "./find-child-C60k4CxG.js";
|
|
8
|
+
import { a as W } from "./format-currency-BwShJ9vM.js";
|
|
9
|
+
import { D as pe, E as de } from "./field-error-headless-BErhh9GG.js";
|
|
10
|
+
import { L as Ie } from "./field-label-headless-BGyK-5xW.js";
|
|
11
|
+
import { N as Ce } from "./options-layout-constants-DEfIEJWD.js";
|
|
12
|
+
import { a as Ee, b as fe } from "./numeric-input-utils-CuBMi4-a.js";
|
|
13
|
+
import { g as Oe } from "./payment-field-utils-DobiK5Xh.js";
|
|
14
|
+
import { u as he } from "./use-synced-display-value-DcAxdn3M.js";
|
|
15
|
+
import { E as _e } from "./error-icon-hZxQ6DEy.js";
|
|
16
|
+
import { s as D } from "./field-rac.module-ColNPUt0.js";
|
|
17
|
+
import { y as be, O as ye, j as Ne, x as Fe, o as ge, i as De, k as Se } from "./form-element-classes-jC8D0LnK.js";
|
|
18
|
+
import { o as Le } from "./options-rac.module-KM-VT_KY.js";
|
|
19
|
+
import { u as Re } from "./use-element-state-class-name-BqmaTba3.js";
|
|
20
|
+
function ve(e, t) {
|
|
21
|
+
return e.reduce((o, r) => (o[r[t]] = r, o), {});
|
|
22
|
+
}
|
|
23
|
+
function Ae(e) {
|
|
24
|
+
return ve(e, "id");
|
|
25
|
+
}
|
|
26
|
+
const je = 0.01;
|
|
27
|
+
function Me(e) {
|
|
28
|
+
var t;
|
|
29
|
+
return ((t = e == null ? void 0 : e.fixedPriceOptions) == null ? void 0 : t.price) || "0";
|
|
30
|
+
}
|
|
31
|
+
function z(e, t) {
|
|
32
|
+
const o = Number(t || "0");
|
|
33
|
+
return {
|
|
34
|
+
productId: e.id,
|
|
35
|
+
price: e.priceType === Q.DYNAMIC_PRICE ? o : String(o),
|
|
36
|
+
quantity: 1
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function Pe(e) {
|
|
40
|
+
return e.find((t) => t.priceType === Q.DYNAMIC_PRICE);
|
|
41
|
+
}
|
|
42
|
+
function Te(e, t) {
|
|
43
|
+
return (e == null ? void 0 : e.productId) === (t == null ? void 0 : t.id) ? String((e == null ? void 0 : e.price) ?? "") : "";
|
|
44
|
+
}
|
|
45
|
+
function xe(e, t, o) {
|
|
46
|
+
const r = (t == null ? void 0 : t.productId) === e ? void 0 : e, a = r ? o[r] : void 0;
|
|
47
|
+
return a ? [
|
|
48
|
+
z(a, Me(a))
|
|
49
|
+
] : [];
|
|
50
|
+
}
|
|
51
|
+
const s = ({ children: e }) => {
|
|
52
|
+
const { id: t, value: o, onChange: r, disabled: a, required: m, onBlur: p, onFocus: h, validation: c, addOther: u, addOtherPlaceholder: i, FieldLayout: I, hasError: O } = v(), { labelId: _ } = B(), { t: C } = ue(), { currency: j, regionalFormat: N } = A(), d = o == null ? void 0 : o[0], F = x(() => {
|
|
53
|
+
var E, T;
|
|
54
|
+
return ((T = (E = c == null ? void 0 : c.predefined) == null ? void 0 : E.paymentOptions) == null ? void 0 : T.products) || [];
|
|
55
|
+
}, [
|
|
56
|
+
c
|
|
57
|
+
]), M = x(() => Ae(F), [
|
|
58
|
+
F
|
|
59
|
+
]), l = x(() => u ? Pe(F) : void 0, [
|
|
60
|
+
F,
|
|
61
|
+
u
|
|
62
|
+
]), J = Te(d, l), [U, P] = he({
|
|
63
|
+
sourceValue: J,
|
|
64
|
+
format: (E) => fe(String(E ?? ""), N),
|
|
65
|
+
regionalFormat: N
|
|
66
|
+
}), k = S((E) => {
|
|
67
|
+
r(xe(E, d, M)), P("");
|
|
68
|
+
}, [
|
|
69
|
+
r,
|
|
70
|
+
M,
|
|
71
|
+
d,
|
|
72
|
+
P
|
|
73
|
+
]), H = S((E) => {
|
|
74
|
+
l && r(typeof E == "number" ? [
|
|
75
|
+
z(l, String(E))
|
|
76
|
+
] : []);
|
|
77
|
+
}, [
|
|
78
|
+
r,
|
|
79
|
+
l
|
|
80
|
+
]), $ = x(() => ce(H, 500), [
|
|
81
|
+
H
|
|
82
|
+
]), K = S((E) => {
|
|
83
|
+
(d == null ? void 0 : d.productId) !== (l == null ? void 0 : l.id) && r(void 0);
|
|
84
|
+
const { validInput: T, validNumber: ne } = Ee(E.target.value, je, U, N);
|
|
85
|
+
P(T), $(ne);
|
|
86
|
+
}, [
|
|
87
|
+
N,
|
|
88
|
+
r,
|
|
89
|
+
d,
|
|
90
|
+
l,
|
|
91
|
+
U,
|
|
92
|
+
$,
|
|
93
|
+
P
|
|
94
|
+
]), q = (d == null ? void 0 : d.productId) || null, X = S(() => {
|
|
95
|
+
l != null && l.id && q !== l.id && k(l.id);
|
|
96
|
+
}, [
|
|
97
|
+
l == null ? void 0 : l.id,
|
|
98
|
+
q,
|
|
99
|
+
k
|
|
100
|
+
]), Z = f(e, s.Label), V = f(e, s.Control), ee = f(e, s.Description), te = f(e, s.Error);
|
|
101
|
+
return /* @__PURE__ */ n.createElement(I, {
|
|
102
|
+
fieldId: t,
|
|
103
|
+
renderLabel: () => Z,
|
|
104
|
+
renderInput: () => /* @__PURE__ */ n.createElement(se, {
|
|
105
|
+
"aria-labelledby": _,
|
|
106
|
+
value: q,
|
|
107
|
+
onChange: k,
|
|
108
|
+
isDisabled: a,
|
|
109
|
+
isInvalid: O,
|
|
110
|
+
isRequired: m,
|
|
111
|
+
onBlur: p,
|
|
112
|
+
onFocus: h
|
|
113
|
+
}, V ? y(V, {
|
|
114
|
+
productsById: M,
|
|
115
|
+
addOther: u,
|
|
116
|
+
customAmount: U,
|
|
117
|
+
onCustomAmountInputChange: K,
|
|
118
|
+
currency: j,
|
|
119
|
+
t: C,
|
|
120
|
+
placeholder: i === void 0 ? C("donation.other-option.placeholder") : i,
|
|
121
|
+
customAmountProductId: l == null ? void 0 : l.id,
|
|
122
|
+
onFocusCustomInput: X
|
|
123
|
+
}) : null),
|
|
124
|
+
renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, te, ee)
|
|
125
|
+
});
|
|
126
|
+
}, Be = ({ children: e, className: t, ...o }) => {
|
|
127
|
+
const { productsById: r, addOther: a, customAmount: m, onCustomAmountInputChange: p, currency: h, t: c, placeholder: u, customAmountProductId: i, onFocusCustomInput: I } = o, { hasError: O } = v(), _ = f(e, s.Options), C = f(e, s.OtherInput);
|
|
128
|
+
return /* @__PURE__ */ n.createElement("div", {
|
|
129
|
+
className: t,
|
|
130
|
+
"data-invalid": O
|
|
131
|
+
}, _ ? y(_, {
|
|
132
|
+
productsById: r
|
|
133
|
+
}) : null, a && i && /* @__PURE__ */ n.createElement(G, {
|
|
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__ */ n.createElement(Y, {
|
|
147
|
+
"aria-label": c("donation.other-option.label", "Custom amount")
|
|
148
|
+
}, c("donation.other-option.label", "Custom amount"))), C && a ? y(C, {
|
|
149
|
+
customAmount: m,
|
|
150
|
+
onCustomAmountInputChange: p,
|
|
151
|
+
currency: h,
|
|
152
|
+
t: c,
|
|
153
|
+
placeholder: u,
|
|
154
|
+
customAmountProductId: i,
|
|
155
|
+
onFocusCustomInput: I
|
|
156
|
+
}) : null);
|
|
157
|
+
}, w = ({ children: e, className: t, ...o }) => {
|
|
158
|
+
const { productsById: r } = o, { options: a, numberOfColumns: m } = v(), { isMobile: p } = A(), h = f(e, w.Option), c = p ? Ce.ONE : m;
|
|
159
|
+
return /* @__PURE__ */ n.createElement("div", {
|
|
160
|
+
className: t,
|
|
161
|
+
"data-columns": c
|
|
162
|
+
}, a.map((u) => {
|
|
163
|
+
var O;
|
|
164
|
+
const i = r[u.value], I = (O = i == null ? void 0 : i.fixedPriceOptions) == null ? void 0 : O.price;
|
|
165
|
+
return y(h, {
|
|
166
|
+
key: u.value,
|
|
167
|
+
value: u.value,
|
|
168
|
+
price: I || "0"
|
|
169
|
+
});
|
|
170
|
+
}));
|
|
171
|
+
}, L = ({ children: e, className: t, ...o }) => {
|
|
172
|
+
const { value: r, price: a } = o, { id: m } = v(), { currency: p, regionalFormat: h } = A(), c = f(e, L.Value), u = f(e, L.Currency), { isCurrencyPrefixed: i } = W({
|
|
173
|
+
amount: a,
|
|
174
|
+
currency: p == null ? void 0 : p.code,
|
|
175
|
+
locale: h
|
|
176
|
+
}), I = oe(null);
|
|
177
|
+
me(() => {
|
|
178
|
+
var _, C;
|
|
179
|
+
(C = (_ = I.current) == null ? void 0 : _.querySelector("input")) == null || C.focus();
|
|
180
|
+
}, m);
|
|
181
|
+
const O = c ? y(c, {
|
|
182
|
+
price: a
|
|
183
|
+
}) : null;
|
|
184
|
+
return /* @__PURE__ */ n.createElement(G, {
|
|
185
|
+
value: r
|
|
186
|
+
}, /* @__PURE__ */ n.createElement(Y, {
|
|
187
|
+
className: t,
|
|
188
|
+
ref: I
|
|
189
|
+
}, /* @__PURE__ */ n.createElement(n.Fragment, null, i && u, O, !i && u)));
|
|
190
|
+
}, Ue = ({ className: e, ...t }) => {
|
|
191
|
+
const { price: o } = t, { currency: r, regionalFormat: a } = A(), { value: m } = W({
|
|
192
|
+
amount: o,
|
|
193
|
+
currency: r == null ? void 0 : r.code,
|
|
194
|
+
locale: a
|
|
195
|
+
});
|
|
196
|
+
return /* @__PURE__ */ n.createElement("span", {
|
|
197
|
+
className: e
|
|
198
|
+
}, m);
|
|
199
|
+
}, ke = ({ className: e }) => {
|
|
200
|
+
const { currency: t } = A();
|
|
201
|
+
return /* @__PURE__ */ n.createElement("span", {
|
|
202
|
+
className: e
|
|
203
|
+
}, (t == null ? void 0 : t.sign) || (t == null ? void 0 : t.code) || "");
|
|
204
|
+
};
|
|
205
|
+
L.Value = Ue;
|
|
206
|
+
L.Currency = ke;
|
|
207
|
+
const R = ({ children: e, className: t, ...o }) => {
|
|
208
|
+
const { customAmount: r, onCustomAmountInputChange: a, currency: m, t: p, placeholder: h, customAmountProductId: c, onFocusCustomInput: u } = o, { disabled: i, hasError: I } = v(), { labelId: O, prefixId: _ } = B(), C = f(e, R.Currency), j = f(e, R.Value), N = S((F) => {
|
|
209
|
+
a({
|
|
210
|
+
target: {
|
|
211
|
+
value: F
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}, [
|
|
215
|
+
a
|
|
216
|
+
]), d = S(() => {
|
|
217
|
+
u();
|
|
218
|
+
}, [
|
|
219
|
+
u
|
|
220
|
+
]);
|
|
221
|
+
return /* @__PURE__ */ n.createElement(ae, {
|
|
222
|
+
"aria-labelledby": `${O} ${_}`,
|
|
223
|
+
value: r,
|
|
224
|
+
onChange: N,
|
|
225
|
+
onFocus: d,
|
|
226
|
+
isDisabled: i,
|
|
227
|
+
isInvalid: I
|
|
228
|
+
}, /* @__PURE__ */ n.createElement(le, {
|
|
229
|
+
className: t,
|
|
230
|
+
isDisabled: i,
|
|
231
|
+
isInvalid: I
|
|
232
|
+
}, r && m && C ? y(C, {
|
|
233
|
+
currency: m,
|
|
234
|
+
t: p
|
|
235
|
+
}) : null, j ? y(j, {
|
|
236
|
+
placeholder: h,
|
|
237
|
+
customAmountProductId: c
|
|
238
|
+
}) : null));
|
|
239
|
+
}, qe = ({ className: e, ...t }) => {
|
|
240
|
+
const { currency: o, t: r } = t, { prefixId: a } = B();
|
|
241
|
+
return /* @__PURE__ */ n.createElement("span", {
|
|
242
|
+
id: a,
|
|
243
|
+
"aria-hidden": !1,
|
|
244
|
+
"aria-label": Oe(r, o),
|
|
245
|
+
className: e
|
|
246
|
+
}, (o == null ? void 0 : o.sign) || (o == null ? void 0 : o.code) || "");
|
|
247
|
+
}, we = ({ className: e, ...t }) => {
|
|
248
|
+
const { placeholder: o, customAmountProductId: r } = t, { ariaDescribedBy: a, labelId: m, prefixId: p } = B();
|
|
249
|
+
return /* @__PURE__ */ n.createElement(ie, {
|
|
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
|
+
R.Currency = qe;
|
|
260
|
+
R.Value = we;
|
|
261
|
+
w.Option = L;
|
|
262
|
+
s.Label = Ie;
|
|
263
|
+
s.Control = Be;
|
|
264
|
+
s.Options = w;
|
|
265
|
+
s.OtherInput = R;
|
|
266
|
+
s.Description = pe;
|
|
267
|
+
s.Error = de;
|
|
268
|
+
const He = "_control_1jl2j_1", $e = "_options_1jl2j_7", Ve = "_option_1jl2j_7", Ge = "_optionHover_1jl2j_43", Ye = "_optionSelected_1jl2j_43", Qe = "_optionCurrency_1jl2j_93", We = "_otherInput_1jl2j_97", ze = "_otherInputCurrency_1jl2j_116", b = {
|
|
269
|
+
control: He,
|
|
270
|
+
options: $e,
|
|
271
|
+
option: Ve,
|
|
272
|
+
optionHover: Ge,
|
|
273
|
+
optionSelected: Ye,
|
|
274
|
+
optionCurrency: Qe,
|
|
275
|
+
otherInput: We,
|
|
276
|
+
otherInputCurrency: ze
|
|
277
|
+
}, Je = ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(re, {
|
|
278
|
+
content: e,
|
|
279
|
+
locale: t
|
|
280
|
+
}), Ke = {
|
|
281
|
+
base: b.option,
|
|
282
|
+
selected: b.optionSelected,
|
|
283
|
+
hover: b.optionHover
|
|
284
|
+
}, Xe = () => {
|
|
285
|
+
const e = Re({
|
|
286
|
+
globalClasses: Se,
|
|
287
|
+
moduleClasses: Ke
|
|
288
|
+
});
|
|
289
|
+
return /* @__PURE__ */ n.createElement(s, null, /* @__PURE__ */ n.createElement(s.Label, {
|
|
290
|
+
className: g(be, D.label)
|
|
291
|
+
}, /* @__PURE__ */ n.createElement(s.Label.Required, {
|
|
292
|
+
className: g(ye, D.requiredMark)
|
|
293
|
+
})), /* @__PURE__ */ n.createElement(s.Control, {
|
|
294
|
+
className: b.control
|
|
295
|
+
}, /* @__PURE__ */ n.createElement(s.Options, {
|
|
296
|
+
className: g(Ne, Le.options, b.options)
|
|
297
|
+
}, /* @__PURE__ */ n.createElement(s.Options.Option, {
|
|
298
|
+
className: ({ isSelected: t, isHovered: o }) => e({
|
|
299
|
+
isSelected: t,
|
|
300
|
+
isHovered: o
|
|
301
|
+
})
|
|
302
|
+
}, /* @__PURE__ */ n.createElement(s.Options.Option.Value, null), /* @__PURE__ */ n.createElement(s.Options.Option.Currency, {
|
|
303
|
+
className: b.optionCurrency
|
|
304
|
+
}))), /* @__PURE__ */ n.createElement(s.OtherInput, {
|
|
305
|
+
className: g(Fe, D.input, b.otherInput)
|
|
306
|
+
}, /* @__PURE__ */ n.createElement(s.OtherInput.Currency, {
|
|
307
|
+
className: b.otherInputCurrency
|
|
308
|
+
}), /* @__PURE__ */ n.createElement(s.OtherInput.Value, {
|
|
309
|
+
className: D.innerInput
|
|
310
|
+
}))), /* @__PURE__ */ n.createElement(s.Error, {
|
|
311
|
+
className: g(ge, D.error)
|
|
312
|
+
}, /* @__PURE__ */ n.createElement(_e, null), /* @__PURE__ */ n.createElement(s.Error.Text, null)), /* @__PURE__ */ n.createElement(s.Description, {
|
|
313
|
+
className: g(De, D.description)
|
|
314
|
+
}, Je));
|
|
315
|
+
}, Ot = () => /* @__PURE__ */ n.createElement(Xe, null);
|
|
316
|
+
export {
|
|
317
|
+
Ot as DonationRAC
|
|
318
|
+
};
|
package/dist/component/{dropdown-field-headless-D7mOjVEJ.js → dropdown-field-headless-JJzbZvps.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import e, { useState as E, useCallback as g, useRef as q } from "react";
|
|
2
2
|
import { UNSAFE_PortalProvider as A } from "react-aria";
|
|
3
3
|
import { Select as w, SelectValue as M, ListBox as U, ListBoxItem as _ } from "react-aria-components";
|
|
4
|
-
import { ai as p, af as b, ak as j } from "./form-
|
|
4
|
+
import { ai as p, af as b, ak as j } from "./form-f0tqdMye.js";
|
|
5
5
|
import { f as d, a as z } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { D as G, E as H } from "./field-error-headless-
|
|
7
|
-
import { L as J } from "./field-label-headless-
|
|
6
|
+
import { D as G, E as H } from "./field-error-headless-BErhh9GG.js";
|
|
7
|
+
import { L as J } from "./field-label-headless-BGyK-5xW.js";
|
|
8
8
|
import { S as K, N as Q } from "./non-modal-popover-DtIMXHbe.js";
|
|
9
9
|
const n = ({ children: t }) => {
|
|
10
10
|
const { id: o, value: r, defaultValue: l, options: a = [], readOnly: s, onChange: u, placeholder: m, disabled: i, required: v, onBlur: O, onFocus: y, FieldLayout: F, hasError: C } = p(), [D, L] = E(!1), [h, I] = E(null), B = r && a.some((c) => (c.value ?? c.label) === r) ? r : l || null, { labelId: N } = b(), P = g((c) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RicosViewer as m } from "@wix/ricos/viewer";
|
|
2
2
|
import t from "classnames";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { D as o } from "./dropdown-field-headless-
|
|
4
|
+
import { D as o } from "./dropdown-field-headless-JJzbZvps.js";
|
|
5
5
|
import { C as n } from "./chevron-down-icon-CcpVm6B-.js";
|
|
6
6
|
import { E as l } from "./error-icon-hZxQ6DEy.js";
|
|
7
7
|
import { H as c } from "./custom-focus-class-_483Pkwp.js";
|
|
8
8
|
import { s as r } from "./field-rac.module-ColNPUt0.js";
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
9
|
+
import { y as i, O as E, x as p, A as _, o as S, i as O } from "./form-element-classes-jC8D0LnK.js";
|
|
10
|
+
const R = ({ content: a, locale: s }) => /* @__PURE__ */ e.createElement(m, {
|
|
11
11
|
content: a,
|
|
12
12
|
locale: s
|
|
13
13
|
}), u = () => /* @__PURE__ */ e.createElement(o, null, /* @__PURE__ */ e.createElement(o.Label, {
|
|
@@ -25,8 +25,8 @@ const D = ({ content: a, locale: s }) => /* @__PURE__ */ e.createElement(m, {
|
|
|
25
25
|
})), /* @__PURE__ */ e.createElement(o.Error, {
|
|
26
26
|
className: t(S, r.error)
|
|
27
27
|
}, /* @__PURE__ */ e.createElement(l, null), /* @__PURE__ */ e.createElement(o.Error.Text, null)), /* @__PURE__ */ e.createElement(o.Description, {
|
|
28
|
-
className: t(
|
|
29
|
-
},
|
|
28
|
+
className: t(O, r.description)
|
|
29
|
+
}, R));
|
|
30
30
|
export {
|
|
31
31
|
u as D
|
|
32
32
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o, { useMemo as a } from "react";
|
|
2
|
-
import { ai as n, as as c, h as i } from "./form-
|
|
3
|
-
import { C } from "./checkbox-field-rac-
|
|
4
|
-
import {
|
|
2
|
+
import { ai as n, as as c, h as i } from "./form-f0tqdMye.js";
|
|
3
|
+
import { C } from "./checkbox-field-rac-BnVNfYWL.js";
|
|
4
|
+
import { m as l, n as m, l as p } from "./form-element-classes-jC8D0LnK.js";
|
|
5
5
|
const _ = (e) => ({
|
|
6
6
|
nodes: [
|
|
7
7
|
{
|