@wix/form-elements 1.146.0 → 1.148.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-scUix9QX.js → appointment-rac-BNqXl3dq.js} +168 -164
- package/dist/component/{bookings-address-rac-CKemkJOO.js → bookings-address-rac-DzLf588z.js} +1 -1
- package/dist/component/{bookings-email-rac-CDqdhPAB.js → bookings-email-rac-BCNWH7ss.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DEy_7Hjb.js → bookings-first-name-rac-D36aHUOJ.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl4xy9lB.js → bookings-header-rac-CNr2y2ES.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsL9xQ1W.js → bookings-last-name-rac-yHE6ZIxr.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DkHYQ4No.js → bookings-login-bar-rac-C3weOc1i.js} +6 -6
- package/dist/component/{bookings-phone-rac-BoBiFwbV.js → bookings-phone-rac-CIo_ApRf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DZZnPKWA.js → bookings-rich-text-rac-rgKnvt57.js} +1 -1
- package/dist/component/{checkbox-field-rac-UgLmJxB-.js → checkbox-field-rac-CMaVxLNe.js} +9 -7
- package/dist/component/{checkbox-group-field-headless-C809nB0Q.js → checkbox-group-field-headless-XPtqS8Km.js} +68 -68
- package/dist/component/{checkbox-group-field-rac-u4i4wG21.js → checkbox-group-field-rac-C_58XfQt.js} +9 -9
- package/dist/component/{checkbox-group-rac-DBAQhSo3.js → checkbox-group-rac-FQrWViSh.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-6173wvuW.js → checkbox-indicator-module-classes-akWZsZNn.js} +1 -1
- package/dist/component/{checkbox-rac-FDQVsI5-.js → checkbox-rac-C5Lj2b1N.js} +1 -1
- package/dist/component/{contacts-address-rac-DnArylPa.js → contacts-address-rac-OhpLzD0X.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-C19jhGEO.js → contacts-birthdate-rac-Dnqq84ct.js} +1 -1
- package/dist/component/{contacts-company-rac-Dxs0hs_i.js → contacts-company-rac-DMnTF55t.js} +1 -1
- package/dist/component/{contacts-email-rac-D-H43L8r.js → contacts-email-rac-DmZhScW2.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DwV5NESk.js → contacts-first-name-rac-B6A4fuzK.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C5v2xurf.js → contacts-last-name-rac-DVz97lew.js} +1 -1
- package/dist/component/{contacts-phone-rac-D9a5x-xl.js → contacts-phone-rac-DV8aO0uS.js} +1 -1
- package/dist/component/{contacts-position-rac-DfsgOv-k.js → contacts-position-rac-BP_yBIE4.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-B-Hho0Kb.js → contacts-subscribe-rac-wmTprtLf.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-q6TQkB4b.js → contacts-tax-id-rac-CUEPBQye.js} +1 -1
- package/dist/component/{date-availability-CMDvf5VU.js → date-availability-BK_0gLRv.js} +1 -1
- package/dist/component/{date-input-field-rac-C1WLUct3.js → date-input-field-rac-BfWPvRnd.js} +84 -78
- package/dist/component/{date-input-rac-cNQ-nr4D.js → date-input-rac-B7vAMRBX.js} +1 -1
- package/dist/component/{date-picker-field-rac-mx11z-MO.js → date-picker-field-rac-CpDY4EkU.js} +111 -105
- package/dist/component/{date-picker-rac-DeTz17zC.js → date-picker-rac-BCswaZB1.js} +1 -1
- package/dist/component/{date-time-input-field-rac-feQ2E1eU.js → date-time-input-field-rac-D9w4eEa0.js} +135 -129
- package/dist/component/{date-time-input-rac-G0s0xP4v.js → date-time-input-rac-_im8-JRC.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BcTN1nJb.js → dext-checkbox-group-rac-Di7B1Wzv.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DX0TOrCO.js → dext-checkbox-rac-BPendOsP.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CpDp11oa.js → dext-date-picker-rac-_-Ig9Qn6.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BRvO8izU.js → dext-date-time-input-rac-dKFW87yu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DGZ4Yi_X.js → dext-dropdown-rac-Cpdpps7P.js} +1 -1
- package/dist/component/{dext-email-rac-B9YCFHB4.js → dext-email-rac-D4UmYH5m.js} +1 -1
- package/dist/component/{dext-number-input-rac-D890dBZf.js → dext-number-input-rac-DUetGnYJ.js} +1 -1
- package/dist/component/{dext-phone-rac-BAQftbXo.js → dext-phone-rac-Bsz_DAT9.js} +1 -1
- package/dist/component/dext-radio-group-rac-B_soj2FD.js +18 -0
- package/dist/component/{dext-rating-input-rac-BqQKVaHo.js → dext-rating-input-rac-cm40qt4O.js} +1 -1
- package/dist/component/{dext-tags-rac-zxxKcNUe.js → dext-tags-rac-D1ULx6t1.js} +2 -2
- package/dist/component/{dext-text-area-rac-Ctp9SwPg.js → dext-text-area-rac-IkL67rHB.js} +1 -1
- package/dist/component/{dext-text-input-rac-c_QMlyjr.js → dext-text-input-rac-DsYSTEL2.js} +1 -1
- package/dist/component/{dext-url-input-rac-96pv15aC.js → dext-url-input-rac-BKvEkpYu.js} +1 -1
- package/dist/component/{donation-rac-GEWKSLJY.js → donation-rac-CaCXMa-H.js} +87 -85
- package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-DcrQK8mL.js} +36 -34
- package/dist/component/{dropdown-field-rac-CCXfBmSc.js → dropdown-field-rac-CuGoz_6I.js} +9 -10
- package/dist/component/{dropdown-rac-CR7hswXE.js → dropdown-rac-rIe6ZqaZ.js} +1 -1
- package/dist/component/{ecom-address-rac-khMuxEFD.js → ecom-address-rac-DT0rzvvp.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CAi_AHpb.js → ecom-subscription-checkbox-rac-ZfbiME6e.js} +5 -5
- package/dist/component/{email-input-field-rac-B83mY2lg.js → email-input-field-rac-8Qn3yskh.js} +62 -62
- package/dist/component/{events-repeater-rac-ClEwXgmb.js → events-repeater-rac-DyHrMd3y.js} +25 -21
- package/dist/component/{events-rsvp-rac-BJ5q2SVR.js → events-rsvp-rac-CoL-euuc.js} +9 -9
- package/dist/component/{field-error-headless-CsYQCsiT.js → field-error-headless-RylIeqXr.js} +6 -6
- package/dist/component/{field-label-headless-Yg_1PMSg.js → field-label-headless-d3hZxIEc.js} +15 -15
- package/dist/component/field-rac.module-DP0lkkEv.js +25 -0
- package/dist/component/{file-upload-rac-DJsuI_lR.js → file-upload-rac-rXbabrgc.js} +172 -168
- package/dist/component/{fixed-payment-rac-BMFe9wxU.js → fixed-payment-rac-CaR7pXXA.js} +13 -13
- package/dist/component/{form-Bed4Kfz8.js → form-DhIEC3nB.js} +2309 -2308
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-DPQTrOSZ.js → header-field-rac-nELbyGjP.js} +4 -4
- package/dist/component/{header-rac-CzXsuLmE.js → header-rac-q80EQNmM.js} +1 -1
- package/dist/component/{image-choice-rac-R_4pbOSr.js → image-choice-rac-CLMiTQK0.js} +42 -42
- package/dist/component/{index-DZxHlvzt.js → index-C-jVrv9Y.js} +91 -91
- package/dist/component/{index-qSZCe_WC.js → index-DnLJzPM-.js} +2 -2
- package/dist/component/{isObjectLike-B-a5uaU-.js → isObjectLike-Bf577MHV.js} +15 -15
- package/dist/component/{multiline-address-field-rac-rv4IZZy_.js → multiline-address-field-rac-BVAv1w9F.js} +155 -137
- package/dist/component/{multiline-address-rac-DZ7cYtgn.js → multiline-address-rac-qMuUHA9U.js} +1 -1
- package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-B_vnBWFG.js} +24 -22
- package/dist/component/{number-input-rac-BeGn6qJR.js → number-input-rac-BPCIW8Fz.js} +1 -1
- package/dist/component/{password-rac-DfvhdsKG.js → password-rac-D72HG72u.js} +28 -26
- package/dist/component/{payment-input-rac-BmMfi5rf.js → payment-input-rac-DthVgsAi.js} +32 -30
- package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-XIPkH8Fb.js} +46 -46
- package/dist/component/{phone-rac-quZjJ08H.js → phone-rac-U94fCfer.js} +1 -1
- package/dist/component/{product-list-rac-Ci0KB7sN.js → product-list-rac-BRMGPyhr.js} +78 -78
- package/dist/component/{quiz-radio-group-rac--UUtGx2t.js → quiz-radio-group-rac-DafNzzgX.js} +1 -1
- package/dist/component/radio-button-module-classes-DtFlHID_.js +134 -0
- package/dist/component/{radio-group-field-rac-w8fHpFKJ.js → radio-group-field-rac-BXrYWjew.js} +13 -13
- package/dist/component/{radio-group-rac-jO8aghii.js → radio-group-rac-BNyFfQYV.js} +1 -1
- package/dist/component/{rating-input-field-rac-BRc2PtqE.js → rating-input-field-rac-KbkiVCZ7.js} +27 -27
- package/dist/component/{rating-input-rac-D9zs06xR.js → rating-input-rac-zT4vPkwP.js} +1 -1
- package/dist/component/{rich-content-rac.module-Cv3ZmD00.js → rich-content-rac.module-C0OQetct.js} +8 -8
- package/dist/component/{rich-text-field-rac-BmWuIfA8.js → rich-text-field-rac-T4NoShC0.js} +4 -4
- package/dist/component/{rich-text-rac-BnqnrvB1.js → rich-text-rac-m6VRCRZu.js} +1 -1
- package/dist/component/{service-dropdown-rac-Cl81KfJU.js → service-dropdown-rac-BFwKhL1l.js} +44 -45
- package/dist/component/{services-multi-choice-rac-sQ1NF9hY.js → services-multi-choice-rac-DjzcuRWv.js} +13 -13
- package/dist/component/{signature-rac-Huairu7V.js → signature-rac-B1LPKnIw.js} +281 -279
- package/dist/component/{submit-button-rac-Dpg7N0TG.js → submit-button-rac-Cz3PVtW4.js} +25 -25
- package/dist/component/{tags-field-rac-BQ8TEqXH.js → tags-field-rac-DzSoL__s.js} +82 -82
- package/dist/component/{tags-rac-CFOmyCCc.js → tags-rac-DMYJDrm-.js} +1 -1
- package/dist/component/{text-area-field-rac-DNiMa7d3.js → text-area-field-rac-SuMzBm-Q.js} +30 -28
- package/dist/component/{text-area-rac-kLFe-KbZ.js → text-area-rac-C-zmnJgt.js} +1 -1
- package/dist/component/{text-input-field-rac-CqENSUUX.js → text-input-field-rac-BmQlXTK9.js} +6 -6
- package/dist/component/text-input-headless-BsrjGTK4.js +47 -0
- package/dist/component/{text-input-rac-uYQEfOtE.js → text-input-rac-DhQFKG4h.js} +1 -1
- package/dist/component/time-input-rac-CRZZdbTI.js +161 -0
- package/dist/component/{url-input-field-rac-BioH7kuz.js → url-input-field-rac-D617Pvsf.js} +30 -28
- package/dist/component/{url-input-rac-D2VSSyqW.js → url-input-rac-CLvxaWZz.js} +1 -1
- package/dist/component/use-dropdown-trigger-class-name-C4uqTKFP.js +117 -0
- package/dist/component/{use-element-state-class-name-oiKCauK-.js → use-element-state-class-name-DJx-T0zf.js} +3 -3
- package/dist/component/use-hoverable-input-class-name-pwVZXwrY.js +25 -0
- package/dist/component/use-is-forced-open-dropdown-DBpm1D-o.js +48 -0
- package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-xHeVTve3.js} +6 -6
- package/dist/component/use-text-input-class-name-CrEjJ2Z8.js +6 -0
- package/dist/form.d.ts +5 -0
- package/package.json +2 -2
- package/dist/component/dext-radio-group-rac-CtEjnu_X.js +0 -18
- package/dist/component/field-rac.module-DfEb7pBp.js +0 -25
- package/dist/component/radio-button-module-classes-CqdBGknT.js +0 -132
- package/dist/component/text-input-headless-BdPkEeK2.js +0 -45
- package/dist/component/time-input-rac-BYoojlJ9.js +0 -159
- package/dist/component/use-dropdown-option-class-name-BEmvU-Gg.js +0 -115
- package/dist/component/use-dropdown-trigger-class-name-qj9skLWZ.js +0 -40
- package/dist/component/use-hoverable-input-class-name-BW3nCyhG.js +0 -25
- package/dist/component/use-text-input-class-name-BhQFcXYH.js +0 -6
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import n, { useMemo as
|
|
1
|
+
import n, { useMemo as x, useCallback as S, useRef as te } from "react";
|
|
2
2
|
import { RicosViewer as ne } from "@wix/ricos/viewer";
|
|
3
3
|
import L from "classnames";
|
|
4
4
|
import { ToggleButtonGroup as oe, TextField as re, Group as se, ToggleButton as ae, Input as le } from "react-aria-components";
|
|
5
5
|
import { debounce as ce } from "ts-debounce";
|
|
6
|
-
import {
|
|
7
|
-
import { f as
|
|
6
|
+
import { aE as K, bo as T, bl as P, by as ie, bg as H, bq as ue, S as me, a0 as de, w as pe, H as Ie, v as Ce, x as Ee } from "./form-DhIEC3nB.js";
|
|
7
|
+
import { f as y, a as F } from "./find-child-C60k4CxG.js";
|
|
8
8
|
import { a as Q } from "./format-currency-BwShJ9vM.js";
|
|
9
|
-
import { D as fe, E as
|
|
10
|
-
import { L as
|
|
11
|
-
import { F as
|
|
9
|
+
import { D as fe, E as ye } from "./field-error-headless-RylIeqXr.js";
|
|
10
|
+
import { L as Oe } from "./field-label-headless-d3hZxIEc.js";
|
|
11
|
+
import { F as be } from "./fieldset-headless-CD3fds9J.js";
|
|
12
12
|
import { a as _e, b as he } from "./numeric-input-utils-CuBMi4-a.js";
|
|
13
13
|
import { g as Ne } from "./payment-field-utils-DobiK5Xh.js";
|
|
14
14
|
import { u as ge } from "./use-synced-display-value-DcAxdn3M.js";
|
|
15
|
-
import { E as
|
|
16
|
-
import { s as v } from "./field-rac.module-
|
|
17
|
-
import { o as
|
|
18
|
-
import { u as Se } from "./use-element-state-class-name-
|
|
19
|
-
import { u as Le } from "./use-text-input-class-name-
|
|
15
|
+
import { E as Fe } from "./error-icon-hZxQ6DEy.js";
|
|
16
|
+
import { s as v } from "./field-rac.module-DP0lkkEv.js";
|
|
17
|
+
import { o as De } from "./options-rac.module-_THNq6Qq.js";
|
|
18
|
+
import { u as Se } from "./use-element-state-class-name-DJx-T0zf.js";
|
|
19
|
+
import { u as Le } from "./use-text-input-class-name-CrEjJ2Z8.js";
|
|
20
20
|
function ve(e, t) {
|
|
21
21
|
return e.reduce((o, r) => (o[r[t]] = r, o), {});
|
|
22
22
|
}
|
|
@@ -43,21 +43,21 @@ function Be(e, t) {
|
|
|
43
43
|
return (e == null ? void 0 : e.productId) === (t == null ? void 0 : t.id) ? String((e == null ? void 0 : e.price) ?? "") : "";
|
|
44
44
|
}
|
|
45
45
|
const s = ({ children: e }) => {
|
|
46
|
-
const { id: t, value: o, onChange: r, required: l, onBlur: i, onFocus: C, validation: u, addOther: E, addOtherPlaceholder:
|
|
46
|
+
const { id: t, value: o, onChange: r, required: l, onBlur: i, onFocus: C, validation: u, addOther: E, addOtherPlaceholder: d, FieldLayout: f } = T(), { inputId: c, labelId: p, ariaDescribedBy: b } = P(), { t: m } = ie(), { currency: g, regionalFormat: _ } = H(), O = o == null ? void 0 : o[0], D = x(() => {
|
|
47
47
|
var I, h;
|
|
48
48
|
return ((h = (I = u == null ? void 0 : u.predefined) == null ? void 0 : I.paymentOptions) == null ? void 0 : h.products) || [];
|
|
49
49
|
}, [
|
|
50
50
|
u
|
|
51
|
-
]), B =
|
|
52
|
-
|
|
53
|
-
]), a =
|
|
54
|
-
|
|
51
|
+
]), B = x(() => Re(D), [
|
|
52
|
+
D
|
|
53
|
+
]), a = x(() => E ? Pe(D) : void 0, [
|
|
54
|
+
D,
|
|
55
55
|
E
|
|
56
|
-
]), W = Be(
|
|
56
|
+
]), W = Be(O, a), [V, M] = ge({
|
|
57
57
|
sourceValue: W,
|
|
58
58
|
format: (I) => he(String(I ?? ""), _),
|
|
59
59
|
regionalFormat: _
|
|
60
|
-
}),
|
|
60
|
+
}), q = S((I) => {
|
|
61
61
|
const h = I === void 0 ? void 0 : B[I];
|
|
62
62
|
r(h ? [
|
|
63
63
|
Y(h, Te(h))
|
|
@@ -66,83 +66,83 @@ const s = ({ children: e }) => {
|
|
|
66
66
|
r,
|
|
67
67
|
B,
|
|
68
68
|
M
|
|
69
|
-
]),
|
|
69
|
+
]), k = S((I) => {
|
|
70
70
|
a && r(typeof I == "number" ? [
|
|
71
71
|
Y(a, String(I))
|
|
72
72
|
] : []);
|
|
73
73
|
}, [
|
|
74
74
|
r,
|
|
75
75
|
a
|
|
76
|
-
]),
|
|
77
|
-
|
|
76
|
+
]), w = x(() => ce(k, 500), [
|
|
77
|
+
k
|
|
78
78
|
]), j = S((I) => {
|
|
79
|
-
(
|
|
79
|
+
(O == null ? void 0 : O.productId) !== (a == null ? void 0 : a.id) && r(void 0);
|
|
80
80
|
const { validInput: h, validNumber: ee } = _e(I.target.value, Ae, V, _);
|
|
81
|
-
M(h),
|
|
81
|
+
M(h), w(ee);
|
|
82
82
|
}, [
|
|
83
83
|
_,
|
|
84
84
|
r,
|
|
85
|
-
|
|
85
|
+
O,
|
|
86
86
|
a,
|
|
87
87
|
V,
|
|
88
|
-
|
|
88
|
+
w,
|
|
89
89
|
M
|
|
90
|
-
]),
|
|
91
|
-
a != null && a.id &&
|
|
90
|
+
]), U = (O == null ? void 0 : O.productId) || null, z = S(() => {
|
|
91
|
+
a != null && a.id && U !== a.id && q(a.id);
|
|
92
92
|
}, [
|
|
93
93
|
a == null ? void 0 : a.id,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]), J =
|
|
94
|
+
U,
|
|
95
|
+
q
|
|
96
|
+
]), J = y(e, s.Label), G = y(e, s.Control), X = y(e, s.Description), Z = y(e, s.Error);
|
|
97
97
|
return /* @__PURE__ */ n.createElement(f, {
|
|
98
98
|
fieldId: t,
|
|
99
99
|
renderLabel: () => J,
|
|
100
|
-
renderInput: () => /* @__PURE__ */ n.createElement(
|
|
100
|
+
renderInput: () => /* @__PURE__ */ n.createElement(be, {
|
|
101
101
|
id: c,
|
|
102
|
-
ariaLabelledBy:
|
|
103
|
-
ariaDescribedBy:
|
|
102
|
+
ariaLabelledBy: p,
|
|
103
|
+
ariaDescribedBy: b,
|
|
104
104
|
required: l,
|
|
105
105
|
onBlur: i,
|
|
106
106
|
onFocus: C
|
|
107
|
-
},
|
|
107
|
+
}, G ? F(G, {
|
|
108
108
|
productsById: B,
|
|
109
|
-
selectedValue:
|
|
110
|
-
onSelectProduct:
|
|
109
|
+
selectedValue: U,
|
|
110
|
+
onSelectProduct: q,
|
|
111
111
|
addOther: E,
|
|
112
112
|
customAmount: V,
|
|
113
113
|
onCustomAmountInputChange: j,
|
|
114
114
|
currency: g,
|
|
115
115
|
t: m,
|
|
116
|
-
placeholder:
|
|
116
|
+
placeholder: d === void 0 ? m("donation.other-option.placeholder") : d,
|
|
117
117
|
customAmountProductId: a == null ? void 0 : a.id,
|
|
118
118
|
onFocusCustomInput: z
|
|
119
119
|
}) : null),
|
|
120
120
|
renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, Z, X)
|
|
121
121
|
});
|
|
122
122
|
}, Me = ({ children: e, className: t, ...o }) => {
|
|
123
|
-
const { productsById: r, selectedValue: l, onSelectProduct: i, addOther: C, customAmount: u, onCustomAmountInputChange: E, currency:
|
|
123
|
+
const { productsById: r, selectedValue: l, onSelectProduct: i, addOther: C, customAmount: u, onCustomAmountInputChange: E, currency: d, t: f, placeholder: c, customAmountProductId: p, onFocusCustomInput: b } = o, { hasError: m } = T(), g = y(e, s.Options), _ = y(e, s.OtherInput);
|
|
124
124
|
return /* @__PURE__ */ n.createElement("div", {
|
|
125
125
|
className: t,
|
|
126
126
|
"data-invalid": m
|
|
127
|
-
}, g ?
|
|
127
|
+
}, g ? F(g, {
|
|
128
128
|
productsById: r,
|
|
129
129
|
selectedValue: l,
|
|
130
130
|
onSelectProduct: i
|
|
131
|
-
}) : null, _ && C ?
|
|
131
|
+
}) : null, _ && C ? F(_, {
|
|
132
132
|
customAmount: u,
|
|
133
133
|
onCustomAmountInputChange: E,
|
|
134
|
-
currency:
|
|
134
|
+
currency: d,
|
|
135
135
|
t: f,
|
|
136
136
|
placeholder: c,
|
|
137
|
-
customAmountProductId:
|
|
138
|
-
onFocusCustomInput:
|
|
137
|
+
customAmountProductId: p,
|
|
138
|
+
onFocusCustomInput: b
|
|
139
139
|
}) : null);
|
|
140
|
-
},
|
|
141
|
-
const { productsById: r, selectedValue: l, onSelectProduct: i } = o, { options: C, numberOfColumns: u, disabled: E } = T(), { labelId:
|
|
140
|
+
}, $ = ({ children: e, className: t, ...o }) => {
|
|
141
|
+
const { productsById: r, selectedValue: l, onSelectProduct: i } = o, { options: C, numberOfColumns: u, disabled: E } = T(), { labelId: d } = P(), f = y(e, $.Option);
|
|
142
142
|
return /* @__PURE__ */ n.createElement(oe, {
|
|
143
143
|
className: t,
|
|
144
144
|
"data-columns": u,
|
|
145
|
-
"aria-labelledby":
|
|
145
|
+
"aria-labelledby": d,
|
|
146
146
|
selectionMode: "single",
|
|
147
147
|
selectedKeys: l ? [
|
|
148
148
|
l
|
|
@@ -153,34 +153,36 @@ const s = ({ children: e }) => {
|
|
|
153
153
|
isDisabled: E
|
|
154
154
|
}, C.map((c) => {
|
|
155
155
|
var m;
|
|
156
|
-
const
|
|
157
|
-
return
|
|
156
|
+
const p = r[c.value], b = (m = p == null ? void 0 : p.fixedPriceOptions) == null ? void 0 : m.price;
|
|
157
|
+
return F(f, {
|
|
158
158
|
key: c.value,
|
|
159
159
|
value: c.value,
|
|
160
|
-
price:
|
|
160
|
+
price: b || "0"
|
|
161
161
|
});
|
|
162
162
|
}));
|
|
163
163
|
}, R = ({ children: e, className: t, ...o }) => {
|
|
164
|
-
const { value: r, price: l } = o, { id: i, hasError: C } = T(), { currency: u, regionalFormat: E } =
|
|
164
|
+
const { value: r, price: l } = o, { id: i, hasError: C } = T(), { currency: u, regionalFormat: E } = H(), d = y(e, R.Value), f = y(e, R.Currency), { isCurrencyPrefixed: c } = Q({
|
|
165
165
|
amount: l,
|
|
166
166
|
currency: u == null ? void 0 : u.code,
|
|
167
167
|
locale: E
|
|
168
|
-
}),
|
|
168
|
+
}), p = te(null);
|
|
169
169
|
ue(() => {
|
|
170
170
|
var m;
|
|
171
|
-
(m =
|
|
171
|
+
(m = p.current) == null || m.focus({
|
|
172
|
+
preventScroll: !0
|
|
173
|
+
});
|
|
172
174
|
}, i);
|
|
173
|
-
const
|
|
175
|
+
const b = d ? F(d, {
|
|
174
176
|
price: l
|
|
175
177
|
}) : null;
|
|
176
178
|
return /* @__PURE__ */ n.createElement(ae, {
|
|
177
179
|
id: r,
|
|
178
180
|
className: t,
|
|
179
|
-
ref:
|
|
181
|
+
ref: p,
|
|
180
182
|
"data-invalid": C || void 0
|
|
181
|
-
}, /* @__PURE__ */ n.createElement(n.Fragment, null, c && f,
|
|
182
|
-
},
|
|
183
|
-
const { price: o } = t, { currency: r, regionalFormat: l } =
|
|
183
|
+
}, /* @__PURE__ */ n.createElement(n.Fragment, null, c && f, b, !c && f));
|
|
184
|
+
}, xe = ({ className: e, ...t }) => {
|
|
185
|
+
const { price: o } = t, { currency: r, regionalFormat: l } = H(), { value: i } = Q({
|
|
184
186
|
amount: o,
|
|
185
187
|
currency: r == null ? void 0 : r.code,
|
|
186
188
|
locale: l
|
|
@@ -188,43 +190,43 @@ const s = ({ children: e }) => {
|
|
|
188
190
|
return /* @__PURE__ */ n.createElement("span", {
|
|
189
191
|
className: e
|
|
190
192
|
}, i);
|
|
191
|
-
},
|
|
192
|
-
const { currency: t } =
|
|
193
|
+
}, He = ({ className: e }) => {
|
|
194
|
+
const { currency: t } = H();
|
|
193
195
|
return /* @__PURE__ */ n.createElement("span", {
|
|
194
196
|
className: e
|
|
195
197
|
}, (t == null ? void 0 : t.sign) || (t == null ? void 0 : t.code) || "");
|
|
196
198
|
};
|
|
197
|
-
R.Value =
|
|
198
|
-
R.Currency =
|
|
199
|
+
R.Value = xe;
|
|
200
|
+
R.Currency = He;
|
|
199
201
|
const A = ({ children: e, className: t, ...o }) => {
|
|
200
|
-
const { customAmount: r, onCustomAmountInputChange: l, currency: i, t: C, placeholder: u, customAmountProductId: E, onFocusCustomInput:
|
|
202
|
+
const { customAmount: r, onCustomAmountInputChange: l, currency: i, t: C, placeholder: u, customAmountProductId: E, onFocusCustomInput: d } = o, { disabled: f, hasError: c } = T(), { labelId: p, prefixId: b } = P(), m = y(e, A.Currency), g = y(e, A.Value), _ = S((D) => {
|
|
201
203
|
l({
|
|
202
204
|
target: {
|
|
203
|
-
value:
|
|
205
|
+
value: D
|
|
204
206
|
}
|
|
205
207
|
});
|
|
206
208
|
}, [
|
|
207
209
|
l
|
|
208
|
-
]),
|
|
209
|
-
|
|
210
|
+
]), O = S(() => {
|
|
211
|
+
d();
|
|
210
212
|
}, [
|
|
211
|
-
|
|
213
|
+
d
|
|
212
214
|
]);
|
|
213
215
|
return /* @__PURE__ */ n.createElement(re, {
|
|
214
|
-
"aria-labelledby": `${
|
|
216
|
+
"aria-labelledby": `${p} ${b}`,
|
|
215
217
|
value: r,
|
|
216
218
|
onChange: _,
|
|
217
|
-
onFocus:
|
|
219
|
+
onFocus: O,
|
|
218
220
|
isDisabled: f,
|
|
219
221
|
isInvalid: c
|
|
220
222
|
}, /* @__PURE__ */ n.createElement(se, {
|
|
221
223
|
className: t,
|
|
222
224
|
isDisabled: f,
|
|
223
225
|
isInvalid: c
|
|
224
|
-
}, r && i && m ?
|
|
226
|
+
}, r && i && m ? F(m, {
|
|
225
227
|
currency: i,
|
|
226
228
|
t: C
|
|
227
|
-
}) : null, g ?
|
|
229
|
+
}) : null, g ? F(g, {
|
|
228
230
|
placeholder: u,
|
|
229
231
|
customAmountProductId: E
|
|
230
232
|
}) : null));
|
|
@@ -236,7 +238,7 @@ const A = ({ children: e, className: t, ...o }) => {
|
|
|
236
238
|
"aria-label": Ne(r, o),
|
|
237
239
|
className: e
|
|
238
240
|
}, (o == null ? void 0 : o.sign) || (o == null ? void 0 : o.code) || "");
|
|
239
|
-
},
|
|
241
|
+
}, qe = ({ className: e, ...t }) => {
|
|
240
242
|
const { placeholder: o, customAmountProductId: r } = t, { ariaDescribedBy: l, labelId: i, prefixId: C } = P();
|
|
241
243
|
return /* @__PURE__ */ n.createElement(le, {
|
|
242
244
|
id: r,
|
|
@@ -249,20 +251,20 @@ const A = ({ children: e, className: t, ...o }) => {
|
|
|
249
251
|
});
|
|
250
252
|
};
|
|
251
253
|
A.Currency = Ve;
|
|
252
|
-
A.Value =
|
|
253
|
-
|
|
254
|
-
s.Label =
|
|
254
|
+
A.Value = qe;
|
|
255
|
+
$.Option = R;
|
|
256
|
+
s.Label = Oe;
|
|
255
257
|
s.Control = Me;
|
|
256
|
-
s.Options =
|
|
258
|
+
s.Options = $;
|
|
257
259
|
s.OtherInput = A;
|
|
258
260
|
s.Description = fe;
|
|
259
|
-
s.Error =
|
|
260
|
-
const
|
|
261
|
-
control:
|
|
262
|
-
option:
|
|
263
|
-
optionHover:
|
|
264
|
-
optionSelected:
|
|
265
|
-
optionCurrency:
|
|
261
|
+
s.Error = ye;
|
|
262
|
+
const Ue = "_control_1sfyd_1", $e = "_option_1sfyd_7", ke = "_optionHover_1sfyd_37", we = "_optionSelected_1sfyd_37", Ge = "_optionCurrency_1sfyd_90", Ye = "_otherInput_1sfyd_94", Ke = "_otherInputCurrency_1sfyd_116", N = {
|
|
263
|
+
control: Ue,
|
|
264
|
+
option: $e,
|
|
265
|
+
optionHover: ke,
|
|
266
|
+
optionSelected: we,
|
|
267
|
+
optionCurrency: Ge,
|
|
266
268
|
otherInput: Ye,
|
|
267
269
|
otherInputCurrency: Ke
|
|
268
270
|
}, Qe = ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(ne, {
|
|
@@ -280,11 +282,11 @@ const $e = "_control_n5tqu_1", ke = "_option_n5tqu_7", Ue = "_optionHover_n5tqu_
|
|
|
280
282
|
return /* @__PURE__ */ n.createElement(s, null, /* @__PURE__ */ n.createElement(s.Label, {
|
|
281
283
|
className: L(me, v.label)
|
|
282
284
|
}, /* @__PURE__ */ n.createElement(s.Label.Required, {
|
|
283
|
-
className: L(
|
|
285
|
+
className: L(de, v.requiredMark)
|
|
284
286
|
})), /* @__PURE__ */ n.createElement(s.Control, {
|
|
285
287
|
className: N.control
|
|
286
288
|
}, /* @__PURE__ */ n.createElement(s.Options, {
|
|
287
|
-
className: L(
|
|
289
|
+
className: L(pe, De.options, N.options)
|
|
288
290
|
}, /* @__PURE__ */ n.createElement(s.Options.Option, {
|
|
289
291
|
className: t
|
|
290
292
|
}, /* @__PURE__ */ n.createElement(s.Options.Option.Value, null), /* @__PURE__ */ n.createElement(s.Options.Option.Currency, {
|
|
@@ -297,7 +299,7 @@ const $e = "_control_n5tqu_1", ke = "_option_n5tqu_7", Ue = "_optionHover_n5tqu_
|
|
|
297
299
|
className: v.innerInput
|
|
298
300
|
}))), /* @__PURE__ */ n.createElement(s.Error, {
|
|
299
301
|
className: L(Ie, v.error)
|
|
300
|
-
}, /* @__PURE__ */ n.createElement(
|
|
302
|
+
}, /* @__PURE__ */ n.createElement(Fe, null), /* @__PURE__ */ n.createElement(s.Error.Text, null)), /* @__PURE__ */ n.createElement(s.Description, {
|
|
301
303
|
className: L(Ce, v.description)
|
|
302
304
|
}, Qe));
|
|
303
305
|
}, Ct = () => /* @__PURE__ */ n.createElement(je, null);
|
package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-DcrQK8mL.js}
RENAMED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import e, { useState as b, useCallback as g, useRef as _ } from "react";
|
|
2
|
-
import { UNSAFE_PortalProvider as
|
|
2
|
+
import { UNSAFE_PortalProvider as k } from "react-aria";
|
|
3
3
|
import { Select as M, SelectValue as H, ListBoxItem as U } from "react-aria-components";
|
|
4
|
-
import {
|
|
4
|
+
import { bo as E, bl as O, bq as Y } from "./form-DhIEC3nB.js";
|
|
5
5
|
import { f as d, a as F } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { D as j, E as z } from "./field-error-headless-
|
|
7
|
-
import { L as G } from "./field-label-headless-
|
|
6
|
+
import { D as j, E as z } from "./field-error-headless-RylIeqXr.js";
|
|
7
|
+
import { L as G } from "./field-label-headless-d3hZxIEc.js";
|
|
8
8
|
import { E as J, S as K, N as Q } from "./non-modal-popover-D-u13tmp.js";
|
|
9
|
-
import { a as W } from "./use-
|
|
10
|
-
import { V as X } from "./use-dropdown-
|
|
9
|
+
import { a as W } from "./use-is-forced-open-dropdown-DBpm1D-o.js";
|
|
10
|
+
import { V as X } from "./use-dropdown-trigger-class-name-C4uqTKFP.js";
|
|
11
11
|
const r = ({ children: n }) => {
|
|
12
|
-
const { id:
|
|
13
|
-
|
|
12
|
+
const { id: s, value: o, defaultValue: a, options: u = [], readOnly: l, onChange: t, placeholder: p, disabled: i, required: v, onBlur: L, onFocus: y, FieldLayout: C, hasError: D } = E(), [I, h] = b(!1), m = W(s), [P, S] = b(null), T = o && u.some((c) => (c.value ?? c.label) === o) ? o : a || null, { labelId: B } = O(), N = g((c) => {
|
|
13
|
+
l || t(typeof c == "string" ? c : null);
|
|
14
14
|
}, [
|
|
15
15
|
t,
|
|
16
|
-
|
|
17
|
-
]), V = g((c) => h(c && !i && !
|
|
16
|
+
l
|
|
17
|
+
]), V = g((c) => h(c && !i && !l), [
|
|
18
18
|
i,
|
|
19
|
-
|
|
20
|
-
]), R = d(n, r.Label), x = d(n, r.Trigger),
|
|
19
|
+
l
|
|
20
|
+
]), R = d(n, r.Label), x = d(n, r.Trigger), q = d(n, r.Options), w = d(n, r.Description), A = d(n, r.Error);
|
|
21
21
|
return /* @__PURE__ */ e.createElement(C, {
|
|
22
|
-
fieldId:
|
|
22
|
+
fieldId: s,
|
|
23
23
|
renderLabel: () => R,
|
|
24
24
|
renderInput: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
|
|
25
25
|
ref: S,
|
|
26
26
|
style: {
|
|
27
27
|
display: "contents"
|
|
28
28
|
}
|
|
29
|
-
}), /* @__PURE__ */ e.createElement(
|
|
29
|
+
}), /* @__PURE__ */ e.createElement(k, {
|
|
30
30
|
getContainer: () => P
|
|
31
31
|
}, /* @__PURE__ */ e.createElement(M, {
|
|
32
32
|
"aria-labelledby": B,
|
|
33
33
|
value: T,
|
|
34
|
-
isOpen: m || I && !i && !
|
|
34
|
+
isOpen: m || I && !i && !l,
|
|
35
35
|
onOpenChange: m ? void 0 : V,
|
|
36
36
|
onChange: N,
|
|
37
37
|
isDisabled: i,
|
|
@@ -40,45 +40,47 @@ const r = ({ children: n }) => {
|
|
|
40
40
|
placeholder: p || J,
|
|
41
41
|
onBlur: L,
|
|
42
42
|
onFocus: y
|
|
43
|
-
}, x, F(
|
|
43
|
+
}, x, F(q, {
|
|
44
44
|
isForcedOpen: m
|
|
45
45
|
})))),
|
|
46
46
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, A, w)
|
|
47
47
|
});
|
|
48
|
-
}, Z = ({ children: n, className:
|
|
49
|
-
const { inputId:
|
|
48
|
+
}, Z = ({ children: n, className: s }) => {
|
|
49
|
+
const { inputId: o, ariaDescribedBy: a } = O(), { id: u, hasError: l, isLoading: t } = E(), p = _(null);
|
|
50
50
|
return Y(() => {
|
|
51
51
|
var i;
|
|
52
|
-
(i = p.current) == null || i.focus(
|
|
52
|
+
(i = p.current) == null || i.focus({
|
|
53
|
+
preventScroll: !0
|
|
54
|
+
});
|
|
53
55
|
}, u), /* @__PURE__ */ e.createElement(K, {
|
|
54
56
|
ref: p,
|
|
55
|
-
id:
|
|
56
|
-
"aria-describedby":
|
|
57
|
-
className:
|
|
58
|
-
"data-invalid":
|
|
57
|
+
id: o,
|
|
58
|
+
"aria-describedby": a,
|
|
59
|
+
className: s,
|
|
60
|
+
"data-invalid": l || void 0,
|
|
59
61
|
"data-loading": t || void 0
|
|
60
62
|
}, /* @__PURE__ */ e.createElement(H, null), n);
|
|
61
|
-
}, f = ({ children: n, className:
|
|
62
|
-
const { isForcedOpen:
|
|
63
|
+
}, f = ({ children: n, className: s, ...o }) => {
|
|
64
|
+
const { isForcedOpen: a } = o, { options: u = [] } = E(), l = d(n, f.Option);
|
|
63
65
|
return /* @__PURE__ */ e.createElement(Q, {
|
|
64
|
-
className:
|
|
66
|
+
className: s,
|
|
65
67
|
containerPadding: 0,
|
|
66
68
|
offset: 0
|
|
67
69
|
}, /* @__PURE__ */ e.createElement(X, {
|
|
68
|
-
isForcedOpen:
|
|
69
|
-
autoFocus:
|
|
70
|
-
}, u.map((t) => F(
|
|
70
|
+
isForcedOpen: a,
|
|
71
|
+
autoFocus: a ? !1 : void 0
|
|
72
|
+
}, u.map((t) => F(l, {
|
|
71
73
|
key: t.value ?? t.label,
|
|
72
74
|
value: t.value ?? t.label,
|
|
73
75
|
label: t.label
|
|
74
76
|
}))));
|
|
75
|
-
}, $ = ({ className: n, ...
|
|
76
|
-
const { value:
|
|
77
|
+
}, $ = ({ className: n, ...s }) => {
|
|
78
|
+
const { value: o, label: a } = s;
|
|
77
79
|
return /* @__PURE__ */ e.createElement(U, {
|
|
78
80
|
className: n,
|
|
79
|
-
id:
|
|
80
|
-
textValue:
|
|
81
|
-
},
|
|
81
|
+
id: o,
|
|
82
|
+
textValue: a
|
|
83
|
+
}, a);
|
|
82
84
|
};
|
|
83
85
|
f.Option = $;
|
|
84
86
|
r.Label = G;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { RicosViewer as m } from "@wix/ricos/viewer";
|
|
2
2
|
import a from "classnames";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { D as r } from "./dropdown-field-headless-
|
|
4
|
+
import { D as r } from "./dropdown-field-headless-DcrQK8mL.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
|
-
import { s as o } from "./field-rac.module-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const C = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(m, {
|
|
8
|
+
import { s as o } from "./field-rac.module-DP0lkkEv.js";
|
|
9
|
+
import { S as i, a0 as p, y as E, H as D, v as _ } from "./form-DhIEC3nB.js";
|
|
10
|
+
import { a as O, u as R } from "./use-dropdown-trigger-class-name-C4uqTKFP.js";
|
|
11
|
+
const S = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(m, {
|
|
13
12
|
content: t,
|
|
14
13
|
locale: s
|
|
15
|
-
}),
|
|
16
|
-
const t =
|
|
14
|
+
}), w = () => {
|
|
15
|
+
const t = O(o.dropdownTrigger), s = R(c);
|
|
17
16
|
return /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
|
|
18
17
|
className: a(i, o.label)
|
|
19
18
|
}, /* @__PURE__ */ e.createElement(r.Label.Required, {
|
|
@@ -30,8 +29,8 @@ const C = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(m, {
|
|
|
30
29
|
className: a(D, o.error)
|
|
31
30
|
}, /* @__PURE__ */ e.createElement(l, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
|
|
32
31
|
className: a(_, o.description)
|
|
33
|
-
},
|
|
32
|
+
}, S));
|
|
34
33
|
};
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
w as D
|
|
37
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o, { useMemo as n } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
const
|
|
2
|
+
import { bo as a, by as c, aq as i } from "./form-DhIEC3nB.js";
|
|
3
|
+
import { C as l } from "./checkbox-field-rac-CMaVxLNe.js";
|
|
4
|
+
const p = (e) => ({
|
|
5
5
|
nodes: [
|
|
6
6
|
{
|
|
7
7
|
paragraphData: {
|
|
@@ -25,7 +25,7 @@ const l = (e) => ({
|
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}), u = () => {
|
|
28
|
-
const e = a(), { t } = c(), r = n(() =>
|
|
28
|
+
const e = a(), { t } = c(), r = n(() => p(t), [
|
|
29
29
|
t
|
|
30
30
|
]), s = {
|
|
31
31
|
...e,
|
|
@@ -35,7 +35,7 @@ const l = (e) => ({
|
|
|
35
35
|
value: {
|
|
36
36
|
v2: s
|
|
37
37
|
}
|
|
38
|
-
}, /* @__PURE__ */ o.createElement(
|
|
38
|
+
}, /* @__PURE__ */ o.createElement(l, null));
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
41
|
u as EcomSubscriptionCheckboxRAC
|