@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
package/dist/component/{number-input-field-rac-CwUoIbM8.js → number-input-field-rac-DW1SjB-Z.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RicosViewer as v } from "@wix/ricos/viewer";
|
|
2
2
|
import m from "classnames";
|
|
3
|
-
import r, { useState as
|
|
4
|
-
import { NumberField as
|
|
5
|
-
import { ai as C, af as S, as as H, ak as J } from "./form-
|
|
3
|
+
import r, { useState as Q, useCallback as U, useEffect as z, useRef as $ } from "react";
|
|
4
|
+
import { NumberField as j, Input as G } from "react-aria-components";
|
|
5
|
+
import { ai as C, af as S, as as H, ak as J } from "./form-BpHElSwH.js";
|
|
6
6
|
import { f as d } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as K, E as W } from "./field-error-headless-
|
|
8
|
-
import { L as X } from "./field-label-headless-
|
|
7
|
+
import { D as K, E as W } from "./field-error-headless-C5ZsFUKv.js";
|
|
8
|
+
import { L as X } from "./field-label-headless-CS5OYsiI.js";
|
|
9
9
|
import { g as Y, c as Z } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
10
|
import { u as w } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ee } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
-
import { s as i } from "./field-rac.module-
|
|
13
|
-
import { z as re,
|
|
12
|
+
import { s as i } from "./field-rac.module-DjmaTYkc.js";
|
|
13
|
+
import { z as re, Q as te, y as ne, p as ae, i as se } from "./form-element-classes-BXNs5k3q.js";
|
|
14
14
|
const e = ({ children: n }) => {
|
|
15
15
|
var D, L, R;
|
|
16
|
-
const { id: a, value: s, onChange: l, disabled: p, required: E, readOnly: o, onBlur: b, onFocus: f, FieldLayout: u, hasError: c, validation: t } = C(), { labelId: y } = S(), F = ((D = t == null ? void 0 : t.number) == null ? void 0 : D.multipleOf) || 1, A = (L = t == null ? void 0 : t.number) == null ? void 0 : L.maximum,
|
|
16
|
+
const { id: a, value: s, onChange: l, disabled: p, required: E, readOnly: o, onBlur: b, onFocus: f, FieldLayout: u, hasError: c, validation: t } = C(), { labelId: y } = S(), F = ((D = t == null ? void 0 : t.number) == null ? void 0 : D.multipleOf) || 1, A = (L = t == null ? void 0 : t.number) == null ? void 0 : L.maximum, M = (R = t == null ? void 0 : t.number) == null ? void 0 : R.minimum, T = _(s), [V, I] = Q(T), g = w(b), h = d(n, e.Label), k = d(n, e.Input), q = d(n, e.Description), x = d(n, e.Error), B = U((N) => {
|
|
17
17
|
if (N === void 0 || Number.isNaN(N)) {
|
|
18
18
|
l(""), I(NaN);
|
|
19
19
|
return;
|
|
@@ -30,27 +30,27 @@ const e = ({ children: n }) => {
|
|
|
30
30
|
s
|
|
31
31
|
]), /* @__PURE__ */ r.createElement(u, {
|
|
32
32
|
fieldId: a,
|
|
33
|
-
renderLabel: () =>
|
|
34
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
33
|
+
renderLabel: () => h,
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
35
35
|
"aria-labelledby": y,
|
|
36
|
-
value:
|
|
36
|
+
value: V,
|
|
37
37
|
onChange: B,
|
|
38
38
|
isDisabled: p,
|
|
39
39
|
isRequired: E,
|
|
40
40
|
isReadOnly: o,
|
|
41
41
|
isInvalid: c,
|
|
42
|
-
onBlur:
|
|
42
|
+
onBlur: g,
|
|
43
43
|
onFocus: f,
|
|
44
|
-
minValue:
|
|
44
|
+
minValue: M ?? void 0,
|
|
45
45
|
maxValue: A ?? void 0
|
|
46
|
-
},
|
|
47
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, x,
|
|
46
|
+
}, k),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, x, q)
|
|
48
48
|
});
|
|
49
49
|
}, le = ({ className: n }) => {
|
|
50
50
|
var c;
|
|
51
51
|
const { t: a } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: p, placeholder: E, validation: o, label: b, required: f } = C();
|
|
52
52
|
(c = o == null ? void 0 : o.number) != null && c.multipleOf;
|
|
53
|
-
const u =
|
|
53
|
+
const u = $(null);
|
|
54
54
|
return J(() => {
|
|
55
55
|
var t;
|
|
56
56
|
(t = u.current) == null || t.focus();
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e, { useState as h, useRef as N } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { ai as
|
|
4
|
+
import { ai as E, af as I, ak as x, as as A } from "./form-BpHElSwH.js";
|
|
5
5
|
import { TextField as B, Group as P, Input as V, Button as v } from "react-aria-components";
|
|
6
|
-
import { f as
|
|
7
|
-
import { D as M, E as k } from "./field-error-headless-
|
|
8
|
-
import { L as q } from "./field-label-headless-
|
|
6
|
+
import { f as p, a as g } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as M, E as k } from "./field-error-headless-C5ZsFUKv.js";
|
|
8
|
+
import { L as q } from "./field-label-headless-CS5OYsiI.js";
|
|
9
9
|
import { E as U } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { H as j } from "./custom-focus-class-_483Pkwp.js";
|
|
11
|
-
import { s as u } from "./field-rac.module-
|
|
12
|
-
import { z as H,
|
|
11
|
+
import { s as u } from "./field-rac.module-DjmaTYkc.js";
|
|
12
|
+
import { z as H, Q, y as W, p as Z, i as z } from "./form-element-classes-BXNs5k3q.js";
|
|
13
13
|
const t = ({ children: r, className: o }) => {
|
|
14
|
-
const { id: i, value: s, onChange: c, disabled: l, readOnly: m, required: n, hasError: a, onBlur: f, onFocus: _, FieldLayout: y } =
|
|
14
|
+
const { id: i, value: s, onChange: c, disabled: l, readOnly: m, required: n, hasError: a, onBlur: f, onFocus: _, FieldLayout: y } = E(), { labelId: C } = I(), [F, L] = h(!1), R = p(r, t.Label), D = p(r, t.Control), T = p(r, t.Description), S = p(r, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(y, {
|
|
16
16
|
fieldId: i,
|
|
17
|
-
renderLabel: () =>
|
|
17
|
+
renderLabel: () => R,
|
|
18
18
|
renderInput: () => /* @__PURE__ */ e.createElement(B, {
|
|
19
|
-
"aria-labelledby":
|
|
19
|
+
"aria-labelledby": C,
|
|
20
20
|
value: s ?? "",
|
|
21
21
|
onChange: c,
|
|
22
22
|
isDisabled: l,
|
|
@@ -27,13 +27,13 @@ const t = ({ children: r, className: o }) => {
|
|
|
27
27
|
onFocus: _,
|
|
28
28
|
className: o
|
|
29
29
|
}, g(D, {
|
|
30
|
-
isVisible:
|
|
31
|
-
onToggleVisibility: () =>
|
|
30
|
+
isVisible: F,
|
|
31
|
+
onToggleVisibility: () => L((w) => !w)
|
|
32
32
|
})),
|
|
33
33
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, T, S)
|
|
34
34
|
});
|
|
35
|
-
},
|
|
36
|
-
const { isVisible: s, onToggleVisibility: c } = i, { disabled: l, hasError: m } =
|
|
35
|
+
}, G = ({ children: r, className: o, ...i }) => {
|
|
36
|
+
const { isVisible: s, onToggleVisibility: c } = i, { disabled: l, hasError: m } = E(), n = p(r, t.Input), a = p(r, t.Toggle);
|
|
37
37
|
return /* @__PURE__ */ e.createElement(P, {
|
|
38
38
|
className: o,
|
|
39
39
|
isDisabled: l,
|
|
@@ -45,7 +45,7 @@ const t = ({ children: r, className: o }) => {
|
|
|
45
45
|
onToggleVisibility: c
|
|
46
46
|
}));
|
|
47
47
|
}, $ = ({ className: r, ...o }) => {
|
|
48
|
-
const { isVisible: i } = o, { id: s, placeholder: c } =
|
|
48
|
+
const { isVisible: i } = o, { id: s, placeholder: c } = E(), { inputId: l, ariaDescribedBy: m } = I(), n = N(null);
|
|
49
49
|
return x(() => {
|
|
50
50
|
var a;
|
|
51
51
|
(a = n.current) == null || a.focus();
|
|
@@ -58,7 +58,7 @@ const t = ({ children: r, className: o }) => {
|
|
|
58
58
|
placeholder: c
|
|
59
59
|
});
|
|
60
60
|
}, J = ({ className: r, showPasswordTooltipText: o, hidePasswordTooltipText: i, children: s, ...c }) => {
|
|
61
|
-
const { isVisible: l, onToggleVisibility: m } = c, { disabled: n } =
|
|
61
|
+
const { isVisible: l, onToggleVisibility: m } = c, { disabled: n } = E(), a = l ? i : o;
|
|
62
62
|
return /* @__PURE__ */ e.createElement(v, {
|
|
63
63
|
type: "button",
|
|
64
64
|
isDisabled: n,
|
|
@@ -71,7 +71,7 @@ const t = ({ children: r, className: o }) => {
|
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
73
|
t.Label = q;
|
|
74
|
-
t.Control =
|
|
74
|
+
t.Control = G;
|
|
75
75
|
t.Input = $;
|
|
76
76
|
t.Toggle = J;
|
|
77
77
|
t.Description = M;
|
|
@@ -122,9 +122,9 @@ const K = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
122
122
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
123
123
|
className: d(H, u.label)
|
|
124
124
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
125
|
-
className: d(
|
|
125
|
+
className: d(Q, u.requiredMark)
|
|
126
126
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
127
|
-
className: d(
|
|
127
|
+
className: d(W, u.input, b.control)
|
|
128
128
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
129
129
|
className: d(u.innerInput, j)
|
|
130
130
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
@@ -132,9 +132,9 @@ const K = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
132
132
|
showPasswordTooltipText: r("forms.widget.modals.show-password-tooltip"),
|
|
133
133
|
hidePasswordTooltipText: r("forms.widget.modals.hide-password-tooltip")
|
|
134
134
|
}, ({ isVisible: o }) => o ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
135
|
-
className: d(
|
|
135
|
+
className: d(Z, u.error)
|
|
136
136
|
}, /* @__PURE__ */ e.createElement(U, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
137
|
-
className: d(
|
|
137
|
+
className: d(z, u.description)
|
|
138
138
|
}, te));
|
|
139
139
|
}, ge = () => /* @__PURE__ */ e.createElement(re, null);
|
|
140
140
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import r, { useCallback as V, useRef as z } from "react";
|
|
2
|
-
import { RicosViewer as
|
|
2
|
+
import { RicosViewer as j } from "@wix/ricos/viewer";
|
|
3
3
|
import i from "classnames";
|
|
4
4
|
import { TextField as w, Group as J, Input as K } from "react-aria-components";
|
|
5
|
-
import { ai as D, af as S, ab as x, as as W, ak as X } from "./form-
|
|
5
|
+
import { ai as D, af as S, ab as x, as as W, ak as X } from "./form-BpHElSwH.js";
|
|
6
6
|
import { f as m } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as Y, E as Z } from "./field-error-headless-
|
|
8
|
-
import { L as ee } from "./field-label-headless-
|
|
7
|
+
import { D as Y, E as Z } from "./field-error-headless-C5ZsFUKv.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-CS5OYsiI.js";
|
|
9
9
|
import { f as R, g as re } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
10
|
import { u as te } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
11
|
import { E as ne } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { H as ae } from "./custom-focus-class-_483Pkwp.js";
|
|
13
|
-
import { s as u } from "./field-rac.module-
|
|
14
|
-
import { z as se,
|
|
13
|
+
import { s as u } from "./field-rac.module-DjmaTYkc.js";
|
|
14
|
+
import { z as se, Q as oe, y as le, p as ce, i as ie } from "./form-element-classes-BXNs5k3q.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -41,8 +41,8 @@ const n = ({ children: e }) => {
|
|
|
41
41
|
I
|
|
42
42
|
]), U = V((l) => {
|
|
43
43
|
I(l);
|
|
44
|
-
const L = h(R(l, c)),
|
|
45
|
-
if (L !==
|
|
44
|
+
const L = h(R(l, c)), Q = h(C);
|
|
45
|
+
if (L !== Q) {
|
|
46
46
|
if (L === void 0) {
|
|
47
47
|
s(null);
|
|
48
48
|
return;
|
|
@@ -114,7 +114,7 @@ n.Error = Z;
|
|
|
114
114
|
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", T = {
|
|
115
115
|
inputGroup: de,
|
|
116
116
|
currency: fe
|
|
117
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
117
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(j, {
|
|
118
118
|
content: e,
|
|
119
119
|
locale: t
|
|
120
120
|
}), Ie = () => /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
package/dist/component/{phone-input-field-rac-uHxR3ozd.js → phone-input-field-rac-BYAnwk5h.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
2
|
import b from "classnames";
|
|
3
|
-
import t, { useMemo as B, useState as
|
|
4
|
-
import { a2 as Ee, as as P, ab as ne, ar as fe, ai as M, af as oe, ak as he } from "./form-
|
|
3
|
+
import t, { useMemo as B, useState as V, useRef as v, useEffect as w, useCallback as Z, createContext as te, useContext as q } from "react";
|
|
4
|
+
import { a2 as Ee, as as P, ab as ne, ar as fe, ai as M, af as oe, ak as he } from "./form-BpHElSwH.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as ge } from "react-aria";
|
|
6
|
-
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as
|
|
6
|
+
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as j, DialogTrigger as Le, Select as Ie, Input as ae, ListBox as ve, Autocomplete as Pe } from "react-aria-components";
|
|
7
7
|
import { f as h, a as ce } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as Fe, E as De } from "./field-error-headless-
|
|
9
|
-
import { L as Re } from "./field-label-headless-
|
|
8
|
+
import { D as Fe, E as De } from "./field-error-headless-C5ZsFUKv.js";
|
|
9
|
+
import { L as Re } from "./field-label-headless-CS5OYsiI.js";
|
|
10
10
|
import { N as xe, S as Be } from "./non-modal-popover-DtIMXHbe.js";
|
|
11
11
|
import { u as Me } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
12
|
import se, { AsYouType as $e, isValidPhoneNumber as Ae, isSupportedCountry as Te } from "libphonenumber-js";
|
|
@@ -15,8 +15,8 @@ import { C as W } from "./calling-country-codes-PyWuOTmF.js";
|
|
|
15
15
|
import { C as we } from "./chevron-down-icon-CcpVm6B-.js";
|
|
16
16
|
import { E as Ue } from "./error-icon-hZxQ6DEy.js";
|
|
17
17
|
import { H as J } from "./custom-focus-class-_483Pkwp.js";
|
|
18
|
-
import { s as _ } from "./field-rac.module-
|
|
19
|
-
import { z as ke,
|
|
18
|
+
import { s as _ } from "./field-rac.module-DjmaTYkc.js";
|
|
19
|
+
import { z as ke, Q as Ve, y as qe, B as ze, p as Ge, i as He } from "./form-element-classes-BXNs5k3q.js";
|
|
20
20
|
function X(e) {
|
|
21
21
|
const n = e ? se(e) : void 0, r = n == null ? void 0 : n.country;
|
|
22
22
|
if (r)
|
|
@@ -56,10 +56,10 @@ function Ye() {
|
|
|
56
56
|
n
|
|
57
57
|
]);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ke(e, n) {
|
|
60
60
|
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Qe(e, n) {
|
|
63
63
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
64
64
|
return !!(k(r, n) || k(o, n) || k(a, n));
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ function k(e, n) {
|
|
|
67
67
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
68
68
|
}
|
|
69
69
|
function Ze({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
70
|
-
const [a, c] =
|
|
70
|
+
const [a, c] = V(e || ""), l = v(U(e ?? null) ?? ""), [u, i] = V(n);
|
|
71
71
|
fe(() => {
|
|
72
72
|
c(""), l.current = "", i(n), o("");
|
|
73
73
|
});
|
|
@@ -119,12 +119,12 @@ function Ze({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
const le = /* @__PURE__ */ te(null), N = () => {
|
|
122
|
-
const e =
|
|
122
|
+
const e = q(le);
|
|
123
123
|
if (!e)
|
|
124
124
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
125
125
|
return e;
|
|
126
126
|
}, ue = /* @__PURE__ */ te(null), G = () => {
|
|
127
|
-
const e =
|
|
127
|
+
const e = q(ue);
|
|
128
128
|
if (!e)
|
|
129
129
|
throw new Error("Option sub-components must be used within Option component");
|
|
130
130
|
return e;
|
|
@@ -144,7 +144,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
144
144
|
});
|
|
145
145
|
}, s = ({ children: e }) => {
|
|
146
146
|
var I, L;
|
|
147
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = M(), [u, i] =
|
|
147
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = M(), [u, i] = V(null), m = (L = (I = l == null ? void 0 : l.string) == null ? void 0 : I.phoneOptions) == null ? void 0 : L.allowedCountryCodes, C = Ye(), p = B(() => Ke(C, m), [
|
|
148
148
|
C,
|
|
149
149
|
m
|
|
150
150
|
]), d = B(() => p.map((x) => x.shortCountryCode), [
|
|
@@ -186,7 +186,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
186
186
|
className: n,
|
|
187
187
|
"data-invalid": a || void 0
|
|
188
188
|
}, e);
|
|
189
|
-
},
|
|
189
|
+
}, je = ({ className: e }) => {
|
|
190
190
|
const { selectedCountryCode: n, countries: r } = N(), o = r.find((a) => a.shortCountryCode === n);
|
|
191
191
|
return o ? /* @__PURE__ */ t.createElement(H, {
|
|
192
192
|
className: e,
|
|
@@ -198,7 +198,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
198
198
|
className: n
|
|
199
199
|
}, e);
|
|
200
200
|
};
|
|
201
|
-
Y.Flag =
|
|
201
|
+
Y.Flag = je;
|
|
202
202
|
Y.EmptyState = We;
|
|
203
203
|
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
204
204
|
const { triggerRef: l, optionsRef: u } = c, { popoverContainer: i } = N(), m = h(e, g.Search), C = /* @__PURE__ */ t.createElement(ie, null, e);
|
|
@@ -215,7 +215,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
215
215
|
"aria-label": r
|
|
216
216
|
}, C) : C));
|
|
217
217
|
}, Je = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...c }) => {
|
|
218
|
-
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m =
|
|
218
|
+
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m = q(be);
|
|
219
219
|
return /* @__PURE__ */ t.createElement(_e, {
|
|
220
220
|
className: r,
|
|
221
221
|
isDismissable: !0
|
|
@@ -253,7 +253,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
253
253
|
return a ? /* @__PURE__ */ t.createElement(Pe, {
|
|
254
254
|
filter: (u, i, m) => {
|
|
255
255
|
const C = r.find((p) => p.shortCountryCode === m.key);
|
|
256
|
-
return !!C &&
|
|
256
|
+
return !!C && Qe(C, i);
|
|
257
257
|
}
|
|
258
258
|
}, a, l) : l;
|
|
259
259
|
};
|
|
@@ -336,13 +336,13 @@ const tt = ({ className: e }) => {
|
|
|
336
336
|
a.current || (a.current = !0, C == null || C());
|
|
337
337
|
},
|
|
338
338
|
onBlur: (L) => {
|
|
339
|
-
var
|
|
339
|
+
var K, Q;
|
|
340
340
|
const x = L.relatedTarget;
|
|
341
|
-
!((
|
|
341
|
+
!((K = r.current) != null && K.contains(x)) && !((Q = o.current) != null && Q.contains(x)) && (a.current = !1, d());
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
if (S.length === 1)
|
|
345
|
-
return /* @__PURE__ */ t.createElement(
|
|
345
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
346
346
|
ref: r,
|
|
347
347
|
className: n,
|
|
348
348
|
isDisabled: c,
|
|
@@ -355,7 +355,7 @@ const tt = ({ className: e }) => {
|
|
|
355
355
|
triggerRef: r,
|
|
356
356
|
optionsRef: o
|
|
357
357
|
}));
|
|
358
|
-
return /* @__PURE__ */ t.createElement(
|
|
358
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
359
359
|
ref: r,
|
|
360
360
|
className: n,
|
|
361
361
|
isDisabled: c,
|
|
@@ -420,7 +420,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
420
420
|
}), _t = () => /* @__PURE__ */ t.createElement("span", {
|
|
421
421
|
className: E.chevron,
|
|
422
422
|
"aria-hidden": "true"
|
|
423
|
-
}, /* @__PURE__ */ t.createElement(we, null)),
|
|
423
|
+
}, /* @__PURE__ */ t.createElement(we, null)), Vt = () => {
|
|
424
424
|
const { t: e } = P(), { isMobile: n, PortalContainer: r } = ne(), o = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
425
425
|
className: E.countrySearchContainer,
|
|
426
426
|
"aria-label": e("field.phone.country-search-input.aria-label")
|
|
@@ -441,9 +441,9 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
441
441
|
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
442
442
|
className: b(ke, _.label)
|
|
443
443
|
}, /* @__PURE__ */ t.createElement(s.Label.Required, {
|
|
444
|
-
className: b(
|
|
444
|
+
className: b(Ve, _.requiredMark)
|
|
445
445
|
})), /* @__PURE__ */ t.createElement(s.Control, {
|
|
446
|
-
className: b(
|
|
446
|
+
className: b(qe, _.input, E.control)
|
|
447
447
|
}, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
448
448
|
className: E.countryButton
|
|
449
449
|
}, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
@@ -469,5 +469,5 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
469
469
|
}, bt));
|
|
470
470
|
};
|
|
471
471
|
export {
|
|
472
|
-
|
|
472
|
+
Vt as P
|
|
473
473
|
};
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import t, { useMemo as H, useCallback as x, useRef as B } from "react";
|
|
2
|
+
import { RicosViewer as K } from "@wix/ricos/viewer";
|
|
3
|
+
import _ from "classnames";
|
|
4
|
+
import { CheckboxField as $, CheckboxButton as X, NumberField as j, Group as J, Button as U, Input as W } from "react-aria-components";
|
|
5
|
+
import { ai as M, af as Y, ab as w, as as Z, ak as ee } from "./form-BpHElSwH.js";
|
|
6
|
+
import { f as b, a as I } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { L as te, g as ne } from "./field-label-headless-CS5OYsiI.js";
|
|
8
|
+
import { f as ae } from "./format-currency-BwShJ9vM.js";
|
|
9
|
+
import { D as oe, E as re } from "./field-error-headless-C5ZsFUKv.js";
|
|
10
|
+
import { F as le } from "./fieldset-headless-CD3fds9J.js";
|
|
11
|
+
import { a as se, C as ie } from "./checkbox-indicator-module-classes-BcScu147.js";
|
|
12
|
+
import { g as ce } from "./payment-field-utils-DobiK5Xh.js";
|
|
13
|
+
import { E as ue } from "./error-icon-hZxQ6DEy.js";
|
|
14
|
+
import { s as T } from "./field-rac.module-DjmaTYkc.js";
|
|
15
|
+
import { z as me, Q as pe, C as de, G as Ee, E as ye, y as fe, p as _e, i as Ie, D as be } from "./form-element-classes-BXNs5k3q.js";
|
|
16
|
+
import { o as Q } from "./options-rac.module-KM-VT_KY.js";
|
|
17
|
+
import { u as Oe } from "./use-element-state-class-name-CC65g9mT.js";
|
|
18
|
+
var Le = /* @__PURE__ */ (function(e) {
|
|
19
|
+
return e.crop = "CROP", e.fit = "FIT", e;
|
|
20
|
+
})({}), k = /* @__PURE__ */ (function(e) {
|
|
21
|
+
return e.oneByOne = "one-by-one", e.onlyOne = "only-one", e.many = "many", e;
|
|
22
|
+
})({});
|
|
23
|
+
function Ce({ maxItems: e, products: a } = {}) {
|
|
24
|
+
return e === 1 ? k.onlyOne : a != null && a.length && a.every((l) => {
|
|
25
|
+
var n;
|
|
26
|
+
return typeof ((n = l.quantityLimit) == null ? void 0 : n.maximum) > "u";
|
|
27
|
+
}) ? k.many : k.oneByOne;
|
|
28
|
+
}
|
|
29
|
+
const o = ({ children: e }) => {
|
|
30
|
+
var D;
|
|
31
|
+
const { id: a, value: l, onChange: n, disabled: r, readOnly: c, required: y, onBlur: O, onFocus: s, hasError: u, validation: m, FieldLayout: p } = M(), { inputId: q, labelId: N, ariaDescribedBy: h } = Y(), f = b(e, o.Label), g = b(e, o.Options), v = b(e, o.Description), L = b(e, o.Error), i = H(() => l || [], [
|
|
32
|
+
l
|
|
33
|
+
]), A = Ce((D = m == null ? void 0 : m.predefined) == null ? void 0 : D.paymentOptions) === k.many, F = x((S, R) => {
|
|
34
|
+
const d = i.filter((G) => G.productId !== S.productId), z = R ? [
|
|
35
|
+
...d,
|
|
36
|
+
S
|
|
37
|
+
] : d;
|
|
38
|
+
n == null || n(z);
|
|
39
|
+
}, [
|
|
40
|
+
i,
|
|
41
|
+
n
|
|
42
|
+
]);
|
|
43
|
+
return /* @__PURE__ */ t.createElement(p, {
|
|
44
|
+
fieldId: a,
|
|
45
|
+
renderLabel: () => f,
|
|
46
|
+
renderInput: () => /* @__PURE__ */ t.createElement(le, {
|
|
47
|
+
id: q,
|
|
48
|
+
ariaLabelledBy: N,
|
|
49
|
+
ariaDescribedBy: h,
|
|
50
|
+
required: y,
|
|
51
|
+
onBlur: O,
|
|
52
|
+
onFocus: s
|
|
53
|
+
}, g ? I(g, {
|
|
54
|
+
allowMany: A,
|
|
55
|
+
productValues: i,
|
|
56
|
+
onProductChange: F,
|
|
57
|
+
disabled: r,
|
|
58
|
+
readOnly: c,
|
|
59
|
+
hasError: u
|
|
60
|
+
}) : null),
|
|
61
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, L, v)
|
|
62
|
+
});
|
|
63
|
+
}, V = ({ children: e, className: a, ...l }) => {
|
|
64
|
+
const { allowMany: n, productValues: r, onProductChange: c, disabled: y, readOnly: O, hasError: s } = l, { options: u, validation: m, imageResize: p } = M(), { currency: q } = w(), { t: N } = Z(), h = b(e, o.Option);
|
|
65
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
66
|
+
className: a
|
|
67
|
+
}, u == null ? void 0 : u.map((f, g) => {
|
|
68
|
+
var C, A, F, D, S;
|
|
69
|
+
const v = ((S = (D = (F = (A = (C = m == null ? void 0 : m.predefined) == null ? void 0 : C.paymentOptions) == null ? void 0 : A.products) == null ? void 0 : F.find((R) => R.id === f.value)) == null ? void 0 : D.fixedPriceOptions) == null ? void 0 : S.price) || "0", L = ce(N, q), i = r.find((R) => R.productId === f.value);
|
|
70
|
+
return I(h, {
|
|
71
|
+
key: f.id || f.value || f.label,
|
|
72
|
+
option: f,
|
|
73
|
+
price: v,
|
|
74
|
+
quantity: i == null ? void 0 : i.quantity,
|
|
75
|
+
isSelected: !!i,
|
|
76
|
+
allowMany: n,
|
|
77
|
+
onProductChange: c,
|
|
78
|
+
disabled: y,
|
|
79
|
+
readOnly: O,
|
|
80
|
+
hasError: s,
|
|
81
|
+
currencyAriaLabel: L,
|
|
82
|
+
imageResize: p,
|
|
83
|
+
isFirst: g === 0
|
|
84
|
+
});
|
|
85
|
+
}));
|
|
86
|
+
}, E = ({ children: e, className: a, ...l }) => {
|
|
87
|
+
const { option: n, price: r, quantity: c = 0, isSelected: y, allowMany: O, onProductChange: s, disabled: u, readOnly: m, hasError: p, currencyAriaLabel: q, imageResize: N, isFirst: h } = l, { id: f } = M(), g = B(null), v = B(null), L = b(e, E.Image), i = b(e, E.Label), C = b(e, E.Price), A = b(e, E.Input), F = b(e, E.Quantity);
|
|
88
|
+
ee(() => {
|
|
89
|
+
var d;
|
|
90
|
+
h && ((d = g.current ?? v.current) == null || d.focus({
|
|
91
|
+
preventScroll: !0
|
|
92
|
+
}));
|
|
93
|
+
}, f);
|
|
94
|
+
const D = x((d) => {
|
|
95
|
+
s({
|
|
96
|
+
productId: n.value,
|
|
97
|
+
price: r,
|
|
98
|
+
quantity: 1
|
|
99
|
+
}, d);
|
|
100
|
+
}, [
|
|
101
|
+
s,
|
|
102
|
+
n.value,
|
|
103
|
+
r
|
|
104
|
+
]), S = x((d) => {
|
|
105
|
+
s({
|
|
106
|
+
productId: n.value,
|
|
107
|
+
price: r,
|
|
108
|
+
quantity: d
|
|
109
|
+
}, d > 0);
|
|
110
|
+
}, [
|
|
111
|
+
s,
|
|
112
|
+
n.value,
|
|
113
|
+
r
|
|
114
|
+
]), R = `${n.label} ${q} ${r}`;
|
|
115
|
+
return O ? /* @__PURE__ */ t.createElement("div", {
|
|
116
|
+
className: a,
|
|
117
|
+
"data-hook": "product"
|
|
118
|
+
}, L ? I(L, {
|
|
119
|
+
option: n,
|
|
120
|
+
imageResize: N
|
|
121
|
+
}) : null, i ? I(i, {
|
|
122
|
+
label: n.label
|
|
123
|
+
}) : null, C ? I(C, {
|
|
124
|
+
price: r
|
|
125
|
+
}) : null, F ? I(F, {
|
|
126
|
+
quantity: c,
|
|
127
|
+
onQuantityChange: S,
|
|
128
|
+
disabled: u,
|
|
129
|
+
readOnly: m,
|
|
130
|
+
hasError: p,
|
|
131
|
+
ariaLabel: R,
|
|
132
|
+
inputRef: h ? v : void 0
|
|
133
|
+
}) : null) : /* @__PURE__ */ t.createElement($, {
|
|
134
|
+
isSelected: y,
|
|
135
|
+
onChange: D,
|
|
136
|
+
isDisabled: u,
|
|
137
|
+
isReadOnly: m,
|
|
138
|
+
isInvalid: p,
|
|
139
|
+
"aria-label": R
|
|
140
|
+
}, /* @__PURE__ */ t.createElement(X, {
|
|
141
|
+
ref: g,
|
|
142
|
+
className: a,
|
|
143
|
+
"data-hook": "product"
|
|
144
|
+
}, ({ isHovered: d }) => /* @__PURE__ */ t.createElement(t.Fragment, null, L ? I(L, {
|
|
145
|
+
option: n,
|
|
146
|
+
imageResize: N
|
|
147
|
+
}) : null, i ? I(i, {
|
|
148
|
+
label: n.label
|
|
149
|
+
}) : null, C ? I(C, {
|
|
150
|
+
price: r
|
|
151
|
+
}) : null, I(A, {
|
|
152
|
+
isSelected: y,
|
|
153
|
+
isHovered: d
|
|
154
|
+
}))));
|
|
155
|
+
}, Re = ({ className: e, ...a }) => {
|
|
156
|
+
var s;
|
|
157
|
+
const { option: l, imageResize: n } = a, r = (s = l.media) == null ? void 0 : s.image;
|
|
158
|
+
if (!r)
|
|
159
|
+
return null;
|
|
160
|
+
const c = n === Le.fit, y = ne(r, 96, 96, c ? "fit" : "fill");
|
|
161
|
+
if (!y)
|
|
162
|
+
return null;
|
|
163
|
+
const O = r.altText || l.label || "";
|
|
164
|
+
return /* @__PURE__ */ t.createElement("img", {
|
|
165
|
+
className: e,
|
|
166
|
+
src: y,
|
|
167
|
+
alt: O,
|
|
168
|
+
"data-fit": c ? "contain" : "cover",
|
|
169
|
+
"data-hook": "product-image"
|
|
170
|
+
});
|
|
171
|
+
}, ge = ({ className: e, ...a }) => {
|
|
172
|
+
const { label: l } = a;
|
|
173
|
+
return /* @__PURE__ */ t.createElement("span", {
|
|
174
|
+
className: e,
|
|
175
|
+
"data-hook": "product-label"
|
|
176
|
+
}, l || "");
|
|
177
|
+
}, Fe = ({ className: e, ...a }) => {
|
|
178
|
+
const { price: l } = a, { currency: n, regionalFormat: r } = w(), c = ae({
|
|
179
|
+
amount: l,
|
|
180
|
+
currency: n == null ? void 0 : n.code,
|
|
181
|
+
locale: r
|
|
182
|
+
});
|
|
183
|
+
return /* @__PURE__ */ t.createElement("span", {
|
|
184
|
+
className: e,
|
|
185
|
+
"data-hook": "product-price"
|
|
186
|
+
}, c);
|
|
187
|
+
}, De = ({ className: e, ...a }) => {
|
|
188
|
+
const { quantity: l, onQuantityChange: n, disabled: r, readOnly: c, hasError: y, ariaLabel: O, inputRef: s } = a, u = x((p) => {
|
|
189
|
+
n(p < 0 ? 0 : p);
|
|
190
|
+
}, [
|
|
191
|
+
n
|
|
192
|
+
]), m = x((p) => {
|
|
193
|
+
p.key === "Home" && (p.preventDefault(), u(0));
|
|
194
|
+
}, [
|
|
195
|
+
u
|
|
196
|
+
]);
|
|
197
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
198
|
+
value: l,
|
|
199
|
+
onChange: u,
|
|
200
|
+
minValue: 0,
|
|
201
|
+
step: 1,
|
|
202
|
+
isDisabled: r,
|
|
203
|
+
isReadOnly: c,
|
|
204
|
+
isInvalid: y,
|
|
205
|
+
"aria-label": O,
|
|
206
|
+
className: e,
|
|
207
|
+
"data-hook": "product-quantity"
|
|
208
|
+
}, /* @__PURE__ */ t.createElement(J, {
|
|
209
|
+
onKeyDown: m
|
|
210
|
+
}, /* @__PURE__ */ t.createElement(U, {
|
|
211
|
+
slot: "decrement"
|
|
212
|
+
}, "-"), /* @__PURE__ */ t.createElement(W, {
|
|
213
|
+
ref: s
|
|
214
|
+
}), /* @__PURE__ */ t.createElement(U, {
|
|
215
|
+
slot: "increment"
|
|
216
|
+
}, "+")));
|
|
217
|
+
};
|
|
218
|
+
E.Image = Re;
|
|
219
|
+
E.Label = ge;
|
|
220
|
+
E.Price = Fe;
|
|
221
|
+
E.Input = se;
|
|
222
|
+
E.Quantity = De;
|
|
223
|
+
V.Option = E;
|
|
224
|
+
o.Label = te;
|
|
225
|
+
o.Options = V;
|
|
226
|
+
o.Option = E;
|
|
227
|
+
o.Description = oe;
|
|
228
|
+
o.Error = re;
|
|
229
|
+
const Se = "_options_11x4v_1", Pe = "_option_11x4v_1", Ne = "_optionInput_11x4v_21", he = "_optionImage_11x4v_32", ve = "_optionLabel_11x4v_66", Ae = "_optionPrice_11x4v_73", Te = "_quantity_11x4v_87", P = {
|
|
230
|
+
options: Se,
|
|
231
|
+
option: Pe,
|
|
232
|
+
optionInput: Ne,
|
|
233
|
+
optionImage: he,
|
|
234
|
+
optionLabel: ve,
|
|
235
|
+
optionPrice: Ae,
|
|
236
|
+
quantity: Te
|
|
237
|
+
}, qe = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(K, {
|
|
238
|
+
content: e,
|
|
239
|
+
locale: a
|
|
240
|
+
}), xe = () => {
|
|
241
|
+
const e = Oe({
|
|
242
|
+
globalClasses: be,
|
|
243
|
+
moduleClasses: ie
|
|
244
|
+
});
|
|
245
|
+
return /* @__PURE__ */ t.createElement(o, null, /* @__PURE__ */ t.createElement(o.Label, {
|
|
246
|
+
className: _(me, T.label)
|
|
247
|
+
}, /* @__PURE__ */ t.createElement(o.Label.Required, {
|
|
248
|
+
className: _(pe, T.requiredMark)
|
|
249
|
+
})), /* @__PURE__ */ t.createElement(o.Options, {
|
|
250
|
+
className: _(de, Q.options, P.options)
|
|
251
|
+
}, /* @__PURE__ */ t.createElement(o.Option, {
|
|
252
|
+
className: _(T.checkbox, P.option)
|
|
253
|
+
}, /* @__PURE__ */ t.createElement(o.Option.Image, {
|
|
254
|
+
className: P.optionImage
|
|
255
|
+
}), /* @__PURE__ */ t.createElement(o.Option.Label, {
|
|
256
|
+
className: _(Ee, Q.optionLabel, P.optionLabel)
|
|
257
|
+
}), /* @__PURE__ */ t.createElement(o.Option.Price, {
|
|
258
|
+
className: _(ye, P.optionPrice)
|
|
259
|
+
}), /* @__PURE__ */ t.createElement(o.Option.Input, {
|
|
260
|
+
className: (a) => _(e(a), P.optionInput)
|
|
261
|
+
}), /* @__PURE__ */ t.createElement(o.Option.Quantity, {
|
|
262
|
+
className: _(fe, T.inputGroup, P.quantity)
|
|
263
|
+
}))), /* @__PURE__ */ t.createElement(o.Error, {
|
|
264
|
+
className: _(_e, T.error)
|
|
265
|
+
}, /* @__PURE__ */ t.createElement(ue, null), /* @__PURE__ */ t.createElement(o.Error.Text, null)), /* @__PURE__ */ t.createElement(o.Description, {
|
|
266
|
+
className: _(Ie, T.description)
|
|
267
|
+
}, qe));
|
|
268
|
+
}, Ze = () => /* @__PURE__ */ t.createElement(xe, null);
|
|
269
|
+
export {
|
|
270
|
+
Ze as ProductListRAC
|
|
271
|
+
};
|
package/dist/component/{quiz-radio-group-rac-CPGS0LEb.js → quiz-radio-group-rac-Dhk7nkzb.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from "react";
|
|
2
|
-
import { R } from "./radio-group-field-rac-
|
|
3
|
-
import {
|
|
2
|
+
import { R } from "./radio-group-field-rac-DdlyQ3m6.js";
|
|
3
|
+
import { J as o, I as r, H as O } from "./form-element-classes-BXNs5k3q.js";
|
|
4
4
|
const t = () => /* @__PURE__ */ _.createElement(R, {
|
|
5
5
|
classes: {
|
|
6
6
|
container: O,
|