@wix/form-elements 0.0.0-stage → 1.54.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/LICENSE +21 -0
- package/README.md +118 -2
- package/dist/component/appointment-rac-DlOqbFoi.js +1005 -0
- package/dist/component/bookings-address-rac-CvK-P3df.js +6 -0
- package/dist/component/bookings-email-rac-9BEPTuox.js +6 -0
- package/dist/component/bookings-first-name-rac-BrU-BtPp.js +6 -0
- package/dist/component/bookings-header-rac-8NCL7fxp.js +8 -0
- package/dist/component/bookings-last-name-rac-DgLqZ1nS.js +6 -0
- package/dist/component/bookings-login-bar-rac-C2pzRMyt.js +74 -0
- package/dist/component/bookings-phone-rac-BrPBAo8B.js +6 -0
- package/dist/component/bookings-rich-text-rac-qpPsyIuc.js +8 -0
- package/dist/component/calling-country-codes-PyWuOTmF.js +243 -0
- package/dist/component/checkbox-field-rac-CaloY2Hs.js +625 -0
- package/dist/component/checkbox-group-field-headless-4HlJmarB.js +204 -0
- package/dist/component/checkbox-group-field-rac-B1tFZT3o.js +33 -0
- package/dist/component/checkbox-group-rac-C0SzN2Bx.js +6 -0
- package/dist/component/checkbox-rac-ssJIVvZI.js +6 -0
- package/dist/component/chevron-down-icon-CcpVm6B-.js +15 -0
- package/dist/component/contacts-address-rac-Dwf4yrGq.js +6 -0
- package/dist/component/contacts-birthdate-rac-C195rG5w.js +6 -0
- package/dist/component/contacts-company-rac-BHX6xZU8.js +6 -0
- package/dist/component/contacts-email-rac-CFY-m-r2.js +6 -0
- package/dist/component/contacts-first-name-rac-D23QFUGK.js +6 -0
- package/dist/component/contacts-last-name-rac-COuQB15p.js +6 -0
- package/dist/component/contacts-phone-rac-BfhY_I7p.js +6 -0
- package/dist/component/contacts-position-rac-D80_knc8.js +6 -0
- package/dist/component/contacts-subscribe-rac--NuPoBFm.js +13 -0
- package/dist/component/contacts-tax-id-rac-BURE313k.js +6 -0
- package/dist/component/custom-focus-class-_483Pkwp.js +4 -0
- package/dist/component/data-hooks-Dkw1pbRj.js +6 -0
- package/dist/component/date-availability-BQyNH-7j.js +49 -0
- package/dist/component/date-input-field-rac-BnFvhqe1.js +286 -0
- package/dist/component/date-input-rac-TLkITFRh.js +6 -0
- package/dist/component/date-picker-field-rac-BAFKYE1B.js +304 -0
- package/dist/component/date-picker-rac-uBJQkALE.js +6 -0
- package/dist/component/date-time-input-field-rac-DnOkBj7w.js +421 -0
- package/dist/component/date-time-input-rac-BxbWyK23.js +6 -0
- package/dist/component/default-limits-D7qVv_Hv.js +6 -0
- package/dist/component/dext-checkbox-group-rac-DnifcsEZ.js +18 -0
- package/dist/component/dext-checkbox-rac-D45Ok0J4.js +6 -0
- package/dist/component/dext-date-picker-rac-Cs47jywn.js +6 -0
- package/dist/component/dext-date-time-input-rac-UPwXpk2g.js +6 -0
- package/dist/component/dext-dropdown-rac-D18mhUDU.js +6 -0
- package/dist/component/dext-email-rac-B4frwTvA.js +6 -0
- package/dist/component/dext-number-input-rac-CoS-Fk59.js +6 -0
- package/dist/component/dext-phone-rac-DwR0JLia.js +6 -0
- package/dist/component/dext-radio-group-rac-DogWvoUg.js +18 -0
- package/dist/component/dext-rating-input-rac-C4NxeIto.js +6 -0
- package/dist/component/dext-tags-rac-DsEenrft.js +18 -0
- package/dist/component/dext-text-area-rac-Du-FqTqW.js +6 -0
- package/dist/component/dext-text-input-rac-DUE8JE9b.js +6 -0
- package/dist/component/dext-url-input-rac-Cn55pV9m.js +6 -0
- package/dist/component/donation-rac-Cjk_hFm1.js +305 -0
- package/dist/component/dropdown-field-headless-Dcy46MWj.js +84 -0
- package/dist/component/dropdown-field-rac-rMMPzKxL.js +32 -0
- package/dist/component/dropdown-rac-C6B8C8Yc.js +6 -0
- package/dist/component/ecom-address-rac-1wNixzip.js +6 -0
- package/dist/component/ecom-subscription-checkbox-rac-C5z68KHa.js +49 -0
- package/dist/component/email-input-field-rac-C7Wn2XVU.js +507 -0
- package/dist/component/error-icon-hZxQ6DEy.js +15 -0
- package/dist/component/events-repeater-rac-DTv4JD79.js +247 -0
- package/dist/component/events-rsvp-rac-cS7Mb04F.js +38 -0
- package/dist/component/field-error-headless-Dm5UCOBb.js +34 -0
- package/dist/component/field-label-headless-C7mDzdLq.js +52 -0
- package/dist/component/field-rac.module-DAPTqFDM.js +21 -0
- package/dist/component/fieldset-headless-CD3fds9J.js +54 -0
- package/dist/component/file-upload-rac-DeZvh7dy.js +484 -0
- package/dist/component/find-child-C60k4CxG.js +11 -0
- package/dist/component/fixed-payment-rac-D7t5DjVp.js +62 -0
- package/dist/component/form-DaOKiR16.js +8890 -0
- package/dist/component/form-element-classes-Bi-nNM8q.js +55 -0
- package/dist/component/form.css +1 -0
- package/dist/component/form.js +9 -0
- package/dist/component/format-currency-BwShJ9vM.js +44 -0
- package/dist/component/get-first-day-of-the-week-DvnsxYhQ.js +118 -0
- package/dist/component/header-field-rac-hJSXllPm.js +25 -0
- package/dist/component/header-rac-G_lsddOd.js +6 -0
- package/dist/component/headless-styles-CmcyA_pi.js +20 -0
- package/dist/component/helpers-HmkkXrh2.js +12 -0
- package/dist/component/image-choice-rac-BHyAKRDt.js +141 -0
- package/dist/component/index-CFW1VXFU.js +64 -0
- package/dist/component/index-CkCSQD3_.js +2290 -0
- package/dist/component/isObject-BAwJJxQ3.js +34 -0
- package/dist/component/messages_ar-BZXnU2Gj.js +3517 -0
- package/dist/component/messages_ar-L1BYLZbF.js +20 -0
- package/dist/component/messages_ar-PAHg01OB.js +299 -0
- package/dist/component/messages_bg-CO56qlOt.js +299 -0
- package/dist/component/messages_bg-CQcGl0Yi.js +20 -0
- package/dist/component/messages_bg-DgbMwIbv.js +3515 -0
- package/dist/component/messages_ca-BAHE5nuo.js +3515 -0
- package/dist/component/messages_ca-BRoHmzRw.js +20 -0
- package/dist/component/messages_ca-Bl6rZi_O.js +299 -0
- package/dist/component/messages_cs-BADd3t_h.js +3515 -0
- package/dist/component/messages_cs-CDyWDExk.js +298 -0
- package/dist/component/messages_cs-wn5UmrBw.js +20 -0
- package/dist/component/messages_da-BPnmb9Qb.js +20 -0
- package/dist/component/messages_da-BvVUWnBz.js +3515 -0
- package/dist/component/messages_da-DHlpaT4q.js +298 -0
- package/dist/component/messages_de-2czOmM8X.js +3515 -0
- package/dist/component/messages_de-BKgzIF1d.js +298 -0
- package/dist/component/messages_de-Bwx84N0O.js +20 -0
- package/dist/component/messages_el-BnuYMjcf.js +299 -0
- package/dist/component/messages_el-_D2RUBSU.js +20 -0
- package/dist/component/messages_el-qCyH12Uq.js +3515 -0
- package/dist/component/messages_en-BWaixPd6.js +3518 -0
- package/dist/component/messages_en-CBBcgtxs.js +296 -0
- package/dist/component/messages_en-DvSLxqKp.js +20 -0
- package/dist/component/messages_es-Cq6i2xci.js +3515 -0
- package/dist/component/messages_es-DlGCLaYi.js +298 -0
- package/dist/component/messages_es-rCKXnGf0.js +20 -0
- package/dist/component/messages_fi-B-ciZGqD.js +3515 -0
- package/dist/component/messages_fi-DzKva_Wq.js +299 -0
- package/dist/component/messages_fi-PCCXPo0O.js +20 -0
- package/dist/component/messages_fr-2im0dcYp.js +3515 -0
- package/dist/component/messages_fr-DMFilq1G.js +298 -0
- package/dist/component/messages_fr-DQa1dT9u.js +20 -0
- package/dist/component/messages_he-Bb1qTc2Y.js +299 -0
- package/dist/component/messages_he-BfIkDo1h.js +3515 -0
- package/dist/component/messages_he-DwIysfDp.js +20 -0
- package/dist/component/messages_hi-Bty6ytCh.js +3515 -0
- package/dist/component/messages_hi-C-6UHGbM.js +298 -0
- package/dist/component/messages_hi-DF1w6b6B.js +20 -0
- package/dist/component/messages_hr-BXzIzU3d.js +20 -0
- package/dist/component/messages_hr-CiU1ZVrx.js +3515 -0
- package/dist/component/messages_hr-tRSM9lmc.js +299 -0
- package/dist/component/messages_hu-ChzHFUtB.js +3515 -0
- package/dist/component/messages_hu-D86Taf9R.js +299 -0
- package/dist/component/messages_hu-Z9XpByCO.js +20 -0
- package/dist/component/messages_id-3952ilBE.js +20 -0
- package/dist/component/messages_id-CPuhTUYV.js +298 -0
- package/dist/component/messages_id-Ddr3ijST.js +3515 -0
- package/dist/component/messages_it-B-A1X4BZ.js +298 -0
- package/dist/component/messages_it-DnUTUabT.js +20 -0
- package/dist/component/messages_it-eY6GnuZC.js +3515 -0
- package/dist/component/messages_ja-B3PxHv2c.js +3515 -0
- package/dist/component/messages_ja-Ced6ZBxD.js +298 -0
- package/dist/component/messages_ja-Cg7CqBUL.js +20 -0
- package/dist/component/messages_ko-DBCjHG4c.js +3515 -0
- package/dist/component/messages_ko-PKIrqwPk.js +298 -0
- package/dist/component/messages_ko-zvhtZMGA.js +20 -0
- package/dist/component/messages_lt-DV3hdFsp.js +3515 -0
- package/dist/component/messages_lt-DywusvNm.js +20 -0
- package/dist/component/messages_lt-zxcCPHno.js +299 -0
- package/dist/component/messages_lv-BEowUv-S.js +299 -0
- package/dist/component/messages_lv-DggJE2f9.js +20 -0
- package/dist/component/messages_lv-hIonzpTs.js +3515 -0
- package/dist/component/messages_ms-Ca0m7bf7.js +20 -0
- package/dist/component/messages_ms-Cvypo0vi.js +299 -0
- package/dist/component/messages_ms-DoMzA8a3.js +3515 -0
- package/dist/component/messages_nl-CEmANR_r.js +3515 -0
- package/dist/component/messages_nl-CZR4TvNo.js +298 -0
- package/dist/component/messages_nl-DgVYmdO9.js +20 -0
- package/dist/component/messages_no-B2BBaGBH.js +298 -0
- package/dist/component/messages_no-DJfJSlDm.js +3515 -0
- package/dist/component/messages_no-hPkfRJQ9.js +20 -0
- package/dist/component/messages_pl-Bzph-WyD.js +20 -0
- package/dist/component/messages_pl-ChJVH7RO.js +3515 -0
- package/dist/component/messages_pl-rCMsbMbN.js +298 -0
- package/dist/component/messages_pt-Bv63V1uB.js +3515 -0
- package/dist/component/messages_pt-CBgCNF3T.js +20 -0
- package/dist/component/messages_pt-Cx0FF6uF.js +298 -0
- package/dist/component/messages_ro-BvLoD_wE.js +299 -0
- package/dist/component/messages_ro-CMzcu-9b.js +20 -0
- package/dist/component/messages_ro-PVRK7Gx4.js +3515 -0
- package/dist/component/messages_ru-8BI6MYA0.js +3515 -0
- package/dist/component/messages_ru-BhRKVmVC.js +298 -0
- package/dist/component/messages_ru-C_BaQo57.js +20 -0
- package/dist/component/messages_sk-Bgi_3583.js +3515 -0
- package/dist/component/messages_sk-CrsC7rOj.js +20 -0
- package/dist/component/messages_sk-CtF-ei23.js +299 -0
- package/dist/component/messages_sl-B5t-KKi8.js +299 -0
- package/dist/component/messages_sl-BFdYWVHd.js +3515 -0
- package/dist/component/messages_sl-NqfmyUP1.js +20 -0
- package/dist/component/messages_sv-Bd1CcY6G.js +3515 -0
- package/dist/component/messages_sv-DPRT-DpN.js +20 -0
- package/dist/component/messages_sv-bQwbNmjr.js +298 -0
- package/dist/component/messages_th-BauH9qdo.js +20 -0
- package/dist/component/messages_th-C_dL_PCq.js +298 -0
- package/dist/component/messages_th-DEWm01uD.js +3515 -0
- package/dist/component/messages_tl-CouXLNcW.js +299 -0
- package/dist/component/messages_tl-D2t9Y_ZC.js +3515 -0
- package/dist/component/messages_tl-UDZY8Wuk.js +20 -0
- package/dist/component/messages_tr-2-OHesob.js +3515 -0
- package/dist/component/messages_tr-CpsxYTDb.js +20 -0
- package/dist/component/messages_tr-DHXnlj_j.js +298 -0
- package/dist/component/messages_uk-CPK4y5lH.js +298 -0
- package/dist/component/messages_uk-DIuQ2HoD.js +3515 -0
- package/dist/component/messages_uk-gPkmA_ar.js +20 -0
- package/dist/component/messages_vi-CgxB4Ey0.js +20 -0
- package/dist/component/messages_vi-DZeFWgwp.js +3515 -0
- package/dist/component/messages_vi-Det8i7_V.js +298 -0
- package/dist/component/messages_zh-D53_A4N9.js +298 -0
- package/dist/component/messages_zh-O552w5dp.js +20 -0
- package/dist/component/messages_zh-nG7LNxIt.js +3515 -0
- package/dist/component/multiline-address-field-rac-CwLOzNF6.js +1574 -0
- package/dist/component/multiline-address-rac-C4JXBlFC.js +6 -0
- package/dist/component/non-modal-popover-DtIMXHbe.js +63 -0
- package/dist/component/number-input-field-rac-BOeiugCV.js +89 -0
- package/dist/component/number-input-rac-NqbFwW0d.js +6 -0
- package/dist/component/numeric-input-utils-CuBMi4-a.js +45 -0
- package/dist/component/options-layout-constants-DEfIEJWD.js +6 -0
- package/dist/component/options-rac.module-KM-VT_KY.js +7 -0
- package/dist/component/password-rac-DxCYgvu_.js +142 -0
- package/dist/component/payment-field-utils-DobiK5Xh.js +12 -0
- package/dist/component/payment-input-rac-C2aof0p0.js +137 -0
- package/dist/component/phone-input-field-rac-Cd7RFaoD.js +473 -0
- package/dist/component/phone-rac-4MQREqBG.js +6 -0
- package/dist/component/product-list-rac-CjoepDQ_.js +263 -0
- package/dist/component/quiz-radio-group-rac-CIwk7N3X.js +13 -0
- package/dist/component/radio-group-field-rac-DE2mnUHD.js +40 -0
- package/dist/component/radio-group-field-rac.module-DEP9BCiX.js +124 -0
- package/dist/component/radio-group-rac-XE6CeGnp.js +6 -0
- package/dist/component/rating-input-field-rac-BzAAMipp.js +130 -0
- package/dist/component/rating-input-rac-oIvpEVjK.js +6 -0
- package/dist/component/rich-content-rac.module-cis7mx3M.js +49 -0
- package/dist/component/rich-text-field-rac-CqkM22CI.js +22 -0
- package/dist/component/rich-text-rac-BKbz3TcX.js +6 -0
- package/dist/component/ricos-viewer-chunk-B4rfbgjA.js +5 -0
- package/dist/component/service-dropdown-rac-CfCMbT9d.js +142 -0
- package/dist/component/services-multi-choice-rac-F2h5gUOr.js +76 -0
- package/dist/component/signature-rac-CIRsmZhS.js +795 -0
- package/dist/component/submit-button-rac-BELGrClx.js +115 -0
- package/dist/component/tags-field-rac-B6Hg2XOI.js +201 -0
- package/dist/component/tags-rac-Dfv8VP7J.js +6 -0
- package/dist/component/text-area-field-rac-Bsd1V2Q3.js +69 -0
- package/dist/component/text-area-rac-BNVdI-Gq.js +6 -0
- package/dist/component/text-input-field-rac-DF9dD_KW.js +24 -0
- package/dist/component/text-input-headless-Dlao2R8f.js +44 -0
- package/dist/component/text-input-rac-C2p7E01b.js +6 -0
- package/dist/component/time-input-rac-90mLBZsX.js +152 -0
- package/dist/component/url-input-field-rac-bCEOlctr.js +71 -0
- package/dist/component/url-input-rac-D5o8b9gx.js +6 -0
- package/dist/component/use-invoke-callback-UH73A_J3.js +15 -0
- package/dist/component/use-service-options-base-DO5hy6mn.js +48 -0
- package/dist/component/use-synced-display-value-DcAxdn3M.js +19 -0
- package/dist/form.d.ts +6930 -0
- package/package.json +164 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import u, { forwardRef as f, useContext as i, useRef as p, useEffect as R, createContext as B } from "react";
|
|
2
|
+
import { useObjectRef as D, useInteractOutside as I } from "react-aria";
|
|
3
|
+
import { OverlayTriggerStateContext as P, useSlottedContext as S, PopoverContext as b, Popover as N, Button as T } from "react-aria-components";
|
|
4
|
+
const x = /* @__PURE__ */ B(null), k = (e) => e != null && e.matches("[aria-haspopup]") ? e : e == null ? void 0 : e.querySelector("[aria-haspopup]"), m = /* @__PURE__ */ f((e, r) => {
|
|
5
|
+
var l;
|
|
6
|
+
const t = D(r), n = i(P), o = (l = S(b)) == null ? void 0 : l.triggerRef, s = i(x), c = p(0), O = p(!1), a = n == null ? void 0 : n.isOpen;
|
|
7
|
+
R(() => {
|
|
8
|
+
if (!(!a || !t.current || !s))
|
|
9
|
+
return s.current += 1, () => {
|
|
10
|
+
s.current -= 1;
|
|
11
|
+
};
|
|
12
|
+
}, [
|
|
13
|
+
a,
|
|
14
|
+
t,
|
|
15
|
+
s
|
|
16
|
+
]);
|
|
17
|
+
const h = (d) => {
|
|
18
|
+
var C;
|
|
19
|
+
return !((C = k(o == null ? void 0 : o.current)) != null && C.contains(d));
|
|
20
|
+
};
|
|
21
|
+
return I({
|
|
22
|
+
ref: t,
|
|
23
|
+
isDisabled: !a,
|
|
24
|
+
onInteractOutsideStart: () => {
|
|
25
|
+
O.current = c.current > 0;
|
|
26
|
+
},
|
|
27
|
+
onInteractOutside: (d) => {
|
|
28
|
+
!O.current && h(d.target) && (n == null || n.close());
|
|
29
|
+
}
|
|
30
|
+
}), /* @__PURE__ */ u.createElement(x.Provider, {
|
|
31
|
+
value: c
|
|
32
|
+
}, /* @__PURE__ */ u.createElement(N, {
|
|
33
|
+
...e,
|
|
34
|
+
ref: t,
|
|
35
|
+
isNonModal: !0,
|
|
36
|
+
shouldCloseOnInteractOutside: h
|
|
37
|
+
}));
|
|
38
|
+
}), q = /* @__PURE__ */ f((e, r) => {
|
|
39
|
+
const t = i(P), n = (o) => {
|
|
40
|
+
var c;
|
|
41
|
+
(c = e.onPressStart) == null || c.call(e, o), o.pointerType !== "touch" && o.pointerType !== "keyboard" && (t != null && t.isOpen) && t.close();
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ u.createElement(T, {
|
|
44
|
+
...e,
|
|
45
|
+
ref: r,
|
|
46
|
+
onPressStart: n
|
|
47
|
+
});
|
|
48
|
+
}), v = /* @__PURE__ */ f((e, r) => {
|
|
49
|
+
const t = i(P), n = (o) => {
|
|
50
|
+
var s;
|
|
51
|
+
(s = e.onPress) == null || s.call(e, o), t != null && t.isOpen && t.close();
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ u.createElement(T, {
|
|
54
|
+
...e,
|
|
55
|
+
ref: r,
|
|
56
|
+
onPress: n
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
v as D,
|
|
61
|
+
m as N,
|
|
62
|
+
q as S
|
|
63
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { RicosViewer as v } from "@wix/ricos/viewer";
|
|
2
|
+
import m from "classnames";
|
|
3
|
+
import r, { useState as U, useCallback as H, useEffect as Q, useRef as $ } from "react";
|
|
4
|
+
import { NumberField as j, Input as z } from "react-aria-components";
|
|
5
|
+
import { ag as C, ad as S, aq as G, ai as J } from "./form-DaOKiR16.js";
|
|
6
|
+
import { f as d } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as K, E as W } from "./field-error-headless-Dm5UCOBb.js";
|
|
8
|
+
import { L as X } from "./field-label-headless-C7mDzdLq.js";
|
|
9
|
+
import { g as Y, c as Z } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
|
+
import { u as w } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
|
+
import { E as ee } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { s as i } from "./field-rac.module-DAPTqFDM.js";
|
|
13
|
+
import { r as re, H as te, q as ne, l as ae, h as se } from "./form-element-classes-Bi-nNM8q.js";
|
|
14
|
+
const e = ({ children: n }) => {
|
|
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: A } = S(), F = ((D = t == null ? void 0 : t.number) == null ? void 0 : D.multipleOf) || 1, q = (L = t == null ? void 0 : t.number) == null ? void 0 : L.maximum, y = (R = t == null ? void 0 : t.number) == null ? void 0 : R.minimum, g = _(s), [h, I] = U(g), M = w(b), T = d(n, e.Label), V = d(n, e.Input), x = d(n, e.Description), k = d(n, e.Error), B = H((N) => {
|
|
17
|
+
if (N === void 0 || Number.isNaN(N)) {
|
|
18
|
+
l(""), I(NaN);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const P = Y(F), O = Number(N.toFixed(P));
|
|
22
|
+
l(O), I(O);
|
|
23
|
+
}, [
|
|
24
|
+
F,
|
|
25
|
+
l
|
|
26
|
+
]);
|
|
27
|
+
return Q(() => {
|
|
28
|
+
I(_(s));
|
|
29
|
+
}, [
|
|
30
|
+
s
|
|
31
|
+
]), /* @__PURE__ */ r.createElement(u, {
|
|
32
|
+
fieldId: a,
|
|
33
|
+
renderLabel: () => T,
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
35
|
+
"aria-labelledby": A,
|
|
36
|
+
value: h,
|
|
37
|
+
onChange: B,
|
|
38
|
+
isDisabled: p,
|
|
39
|
+
isRequired: E,
|
|
40
|
+
isReadOnly: o,
|
|
41
|
+
isInvalid: c,
|
|
42
|
+
onBlur: M,
|
|
43
|
+
onFocus: f,
|
|
44
|
+
minValue: y ?? void 0,
|
|
45
|
+
maxValue: q ?? void 0
|
|
46
|
+
}, V),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, x)
|
|
48
|
+
});
|
|
49
|
+
}, le = ({ className: n }) => {
|
|
50
|
+
var c;
|
|
51
|
+
const { t: a } = G(), { inputId: s, ariaDescribedBy: l } = S(), { id: p, placeholder: E, validation: o, label: b, required: f } = C();
|
|
52
|
+
(c = o == null ? void 0 : o.number) != null && c.multipleOf;
|
|
53
|
+
const u = $(null);
|
|
54
|
+
return J(() => {
|
|
55
|
+
var t;
|
|
56
|
+
(t = u.current) == null || t.focus();
|
|
57
|
+
}, p), /* @__PURE__ */ r.createElement(z, {
|
|
58
|
+
ref: u,
|
|
59
|
+
id: s,
|
|
60
|
+
"aria-describedby": l,
|
|
61
|
+
"aria-label": b,
|
|
62
|
+
"aria-roledescription": a("field.number.aria-role-description"),
|
|
63
|
+
className: n,
|
|
64
|
+
inputMode: "decimal",
|
|
65
|
+
placeholder: E,
|
|
66
|
+
required: f
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
e.Label = X;
|
|
70
|
+
e.Input = le;
|
|
71
|
+
e.Description = K;
|
|
72
|
+
e.Error = W;
|
|
73
|
+
const _ = (n) => Z(n) ?? NaN, oe = ({ content: n, locale: a }) => /* @__PURE__ */ r.createElement(v, {
|
|
74
|
+
content: n,
|
|
75
|
+
locale: a
|
|
76
|
+
}), Le = () => /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
77
|
+
className: m(re, i.label)
|
|
78
|
+
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
79
|
+
className: m(te, i.requiredMark)
|
|
80
|
+
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
81
|
+
className: m(ne, i.input)
|
|
82
|
+
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
83
|
+
className: m(ae, i.error)
|
|
84
|
+
}, /* @__PURE__ */ r.createElement(ee, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
85
|
+
className: m(se, i.description)
|
|
86
|
+
}, oe));
|
|
87
|
+
export {
|
|
88
|
+
Le as N
|
|
89
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const c = (e) => `^-?\\d*(\\.\\d{0,${o(e)}})?$`, o = (e) => {
|
|
2
|
+
var n, t;
|
|
3
|
+
return ((t = (n = String(e).split(".")) == null ? void 0 : n[1]) == null ? void 0 : t.length) || 0;
|
|
4
|
+
}, l = (e, n, t, a) => {
|
|
5
|
+
if (e.trim() === "")
|
|
6
|
+
return {
|
|
7
|
+
validInput: "",
|
|
8
|
+
validNumber: void 0
|
|
9
|
+
};
|
|
10
|
+
const r = i(e);
|
|
11
|
+
return u(r, n) && r !== void 0 && r < Number.MAX_SAFE_INTEGER ? {
|
|
12
|
+
validInput: s(e, a),
|
|
13
|
+
validNumber: r
|
|
14
|
+
} : t ? {
|
|
15
|
+
validInput: t,
|
|
16
|
+
validNumber: i(t)
|
|
17
|
+
} : {
|
|
18
|
+
validInput: "",
|
|
19
|
+
validNumber: void 0
|
|
20
|
+
};
|
|
21
|
+
}, d = (e) => {
|
|
22
|
+
var n;
|
|
23
|
+
return e ? (n = Intl.NumberFormat(e).formatToParts(1.1).find((t) => t.type === "decimal")) == null ? void 0 : n.value : void 0;
|
|
24
|
+
}, s = (e, n) => {
|
|
25
|
+
const t = d(n);
|
|
26
|
+
return t ? e.replace(/[.,]/, t) : e;
|
|
27
|
+
}, u = (e, n) => {
|
|
28
|
+
const t = c(n);
|
|
29
|
+
return new RegExp(t).test(`${e}`);
|
|
30
|
+
}, m = (e = "", n) => {
|
|
31
|
+
const t = d(n);
|
|
32
|
+
return t && t !== "." && t !== "," && (e = e.replace(t, ".")), e.replace(",", ".");
|
|
33
|
+
}, i = (e) => {
|
|
34
|
+
if (e == null || e === "")
|
|
35
|
+
return;
|
|
36
|
+
const n = Number(m(String(e)));
|
|
37
|
+
return Number.isFinite(n) ? n : void 0;
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
l as a,
|
|
41
|
+
s as b,
|
|
42
|
+
i as c,
|
|
43
|
+
o as g,
|
|
44
|
+
m as t
|
|
45
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import e, { useState as w, useRef as N } from "react";
|
|
2
|
+
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
|
+
import d from "classnames";
|
|
4
|
+
import { TextField as x, Group as A, Input as B, Button as P } from "react-aria-components";
|
|
5
|
+
import { ag as p, ad as I, ai as V, aq as v } from "./form-DaOKiR16.js";
|
|
6
|
+
import { f as E, a as g } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as M, E as q } from "./field-error-headless-Dm5UCOBb.js";
|
|
8
|
+
import { L as k } from "./field-label-headless-C7mDzdLq.js";
|
|
9
|
+
import { E as U } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
+
import { H } from "./custom-focus-class-_483Pkwp.js";
|
|
11
|
+
import { s as u } from "./field-rac.module-DAPTqFDM.js";
|
|
12
|
+
import { r as j, H as W, q as Z, l as G, h as Q } from "./form-element-classes-Bi-nNM8q.js";
|
|
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 } = p(), { labelId: C } = I(), [F, L] = w(!1), R = E(r, t.Label), D = E(r, t.Control), T = E(r, t.Description), S = E(r, t.Error);
|
|
15
|
+
return /* @__PURE__ */ e.createElement(y, {
|
|
16
|
+
fieldId: i,
|
|
17
|
+
renderLabel: () => R,
|
|
18
|
+
renderInput: () => /* @__PURE__ */ e.createElement(x, {
|
|
19
|
+
"aria-labelledby": C,
|
|
20
|
+
value: s ?? "",
|
|
21
|
+
onChange: c,
|
|
22
|
+
isDisabled: l,
|
|
23
|
+
isReadOnly: m,
|
|
24
|
+
isRequired: n,
|
|
25
|
+
isInvalid: a,
|
|
26
|
+
onBlur: f,
|
|
27
|
+
onFocus: _,
|
|
28
|
+
className: o
|
|
29
|
+
}, g(D, {
|
|
30
|
+
isVisible: F,
|
|
31
|
+
onToggleVisibility: () => L((h) => !h)
|
|
32
|
+
})),
|
|
33
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, T, S)
|
|
34
|
+
});
|
|
35
|
+
}, $ = ({ children: r, className: o, ...i }) => {
|
|
36
|
+
const { isVisible: s, onToggleVisibility: c } = i, { disabled: l, hasError: m } = p(), n = E(r, t.Input), a = E(r, t.Toggle);
|
|
37
|
+
return /* @__PURE__ */ e.createElement(A, {
|
|
38
|
+
className: o,
|
|
39
|
+
isDisabled: l,
|
|
40
|
+
isInvalid: m
|
|
41
|
+
}, g(n, {
|
|
42
|
+
isVisible: s
|
|
43
|
+
}), g(a, {
|
|
44
|
+
isVisible: s,
|
|
45
|
+
onToggleVisibility: c
|
|
46
|
+
}));
|
|
47
|
+
}, z = ({ className: r, ...o }) => {
|
|
48
|
+
const { isVisible: i } = o, { id: s, placeholder: c } = p(), { inputId: l, ariaDescribedBy: m } = I(), n = N(null);
|
|
49
|
+
return V(() => {
|
|
50
|
+
var a;
|
|
51
|
+
(a = n.current) == null || a.focus();
|
|
52
|
+
}, s), /* @__PURE__ */ e.createElement(B, {
|
|
53
|
+
ref: n,
|
|
54
|
+
id: l,
|
|
55
|
+
type: i ? "text" : "password",
|
|
56
|
+
"aria-describedby": m,
|
|
57
|
+
className: r,
|
|
58
|
+
placeholder: c
|
|
59
|
+
});
|
|
60
|
+
}, J = ({ className: r, showPasswordTooltipText: o, hidePasswordTooltipText: i, children: s, ...c }) => {
|
|
61
|
+
const { isVisible: l, onToggleVisibility: m } = c, { disabled: n } = p(), a = l ? i : o;
|
|
62
|
+
return /* @__PURE__ */ e.createElement(P, {
|
|
63
|
+
type: "button",
|
|
64
|
+
isDisabled: n,
|
|
65
|
+
onPress: m,
|
|
66
|
+
"aria-label": a,
|
|
67
|
+
"aria-pressed": l,
|
|
68
|
+
className: r
|
|
69
|
+
}, s == null ? void 0 : s({
|
|
70
|
+
isVisible: l
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
t.Label = k;
|
|
74
|
+
t.Control = $;
|
|
75
|
+
t.Input = z;
|
|
76
|
+
t.Toggle = J;
|
|
77
|
+
t.Description = M;
|
|
78
|
+
t.Error = q;
|
|
79
|
+
const K = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
80
|
+
viewBox: "0 0 24 24",
|
|
81
|
+
width: "20",
|
|
82
|
+
height: "20",
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: "currentColor",
|
|
85
|
+
strokeWidth: "1.5",
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
...r
|
|
88
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
|
89
|
+
d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"
|
|
90
|
+
}), /* @__PURE__ */ e.createElement("circle", {
|
|
91
|
+
cx: "12",
|
|
92
|
+
cy: "12",
|
|
93
|
+
r: "3"
|
|
94
|
+
})), X = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
95
|
+
viewBox: "0 0 24 24",
|
|
96
|
+
width: "20",
|
|
97
|
+
height: "20",
|
|
98
|
+
fill: "none",
|
|
99
|
+
stroke: "currentColor",
|
|
100
|
+
strokeWidth: "1.5",
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
...r
|
|
103
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
|
104
|
+
d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"
|
|
105
|
+
}), /* @__PURE__ */ e.createElement("circle", {
|
|
106
|
+
cx: "12",
|
|
107
|
+
cy: "12",
|
|
108
|
+
r: "3"
|
|
109
|
+
}), /* @__PURE__ */ e.createElement("line", {
|
|
110
|
+
x1: "3",
|
|
111
|
+
y1: "21",
|
|
112
|
+
x2: "21",
|
|
113
|
+
y2: "3"
|
|
114
|
+
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15", b = {
|
|
115
|
+
control: Y,
|
|
116
|
+
toggleButton: ee
|
|
117
|
+
}, te = ({ content: r, locale: o }) => /* @__PURE__ */ e.createElement(O, {
|
|
118
|
+
content: r,
|
|
119
|
+
locale: o
|
|
120
|
+
}), re = () => {
|
|
121
|
+
const { t: r } = v();
|
|
122
|
+
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
123
|
+
className: d(j, u.label)
|
|
124
|
+
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
125
|
+
className: d(W, u.requiredMark)
|
|
126
|
+
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
127
|
+
className: d(Z, u.input, b.control)
|
|
128
|
+
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
129
|
+
className: d(u.innerInput, H)
|
|
130
|
+
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
131
|
+
className: b.toggleButton,
|
|
132
|
+
showPasswordTooltipText: r("forms.widget.modals.show-password-tooltip"),
|
|
133
|
+
hidePasswordTooltipText: r("forms.widget.modals.hide-password-tooltip")
|
|
134
|
+
}, ({ isVisible: o }) => o ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
135
|
+
className: d(G, u.error)
|
|
136
|
+
}, /* @__PURE__ */ e.createElement(U, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
137
|
+
className: d(Q, u.description)
|
|
138
|
+
}, te));
|
|
139
|
+
}, ge = () => /* @__PURE__ */ e.createElement(re, null);
|
|
140
|
+
export {
|
|
141
|
+
ge as PasswordRAC
|
|
142
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { b as d } from "./numeric-input-utils-CuBMi4-a.js";
|
|
2
|
+
const p = (o, a) => {
|
|
3
|
+
const l = o.replace(",", ".").match(/[\d.]+/);
|
|
4
|
+
if (!l)
|
|
5
|
+
return null;
|
|
6
|
+
const t = l[0], e = t.indexOf("."), i = e !== -1 && t.length > e + 2 ? t.substring(0, e + 3) : t, s = d(i, a), m = Number(s.replace(/,/g, "."));
|
|
7
|
+
return isNaN(m) ? null : s;
|
|
8
|
+
}, b = (o, a) => a != null && a.code ? o(`locale-dataset.currencies.${a == null ? void 0 : a.code}`) : (a == null ? void 0 : a.sign) || "";
|
|
9
|
+
export {
|
|
10
|
+
p as f,
|
|
11
|
+
b as g
|
|
12
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import r, { useCallback as V, useRef as j } from "react";
|
|
2
|
+
import { RicosViewer as w } from "@wix/ricos/viewer";
|
|
3
|
+
import i from "classnames";
|
|
4
|
+
import { TextField as z, Group as J, Input as K } from "react-aria-components";
|
|
5
|
+
import { ag as D, ad as S, aa as q, aq as W, ai as X } from "./form-DaOKiR16.js";
|
|
6
|
+
import { f as m } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as Y, E as Z } from "./field-error-headless-Dm5UCOBb.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-C7mDzdLq.js";
|
|
9
|
+
import { f as R, g as re } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
|
+
import { u as te } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
|
+
import { E as ne } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { H as ae } from "./custom-focus-class-_483Pkwp.js";
|
|
13
|
+
import { s as u } from "./field-rac.module-DAPTqFDM.js";
|
|
14
|
+
import { r as se, H as oe, q as le, l as ce, h as ie } from "./form-element-classes-Bi-nNM8q.js";
|
|
15
|
+
function ue(e, t) {
|
|
16
|
+
return {
|
|
17
|
+
productId: e.id,
|
|
18
|
+
price: t,
|
|
19
|
+
quantity: 1
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function h(e) {
|
|
23
|
+
if (e == null || e === "")
|
|
24
|
+
return;
|
|
25
|
+
const t = Number(String(e).replace(/,/g, "."));
|
|
26
|
+
return Number.isNaN(t) ? void 0 : t;
|
|
27
|
+
}
|
|
28
|
+
const n = ({ children: e }) => {
|
|
29
|
+
var O, g, A, P;
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: p, readOnly: d, required: y, hasError: b, onBlur: o, onFocus: f, FieldLayout: x, validation: _ } = D(), { labelId: M, prefixId: G } = S(), { regionalFormat: c } = q(), N = (A = (g = (O = _ == null ? void 0 : _.predefined) == null ? void 0 : O.paymentOptions) == null ? void 0 : g.products) == null ? void 0 : A[0], C = (P = a == null ? void 0 : a.at(0)) == null ? void 0 : P.price, [F, I] = te({
|
|
31
|
+
sourceValue: C,
|
|
32
|
+
format: (l) => R(String(l ?? ""), c),
|
|
33
|
+
regionalFormat: c
|
|
34
|
+
}), $ = V(() => {
|
|
35
|
+
const l = R(F, c);
|
|
36
|
+
I(l || ""), o == null || o();
|
|
37
|
+
}, [
|
|
38
|
+
F,
|
|
39
|
+
c,
|
|
40
|
+
o,
|
|
41
|
+
I
|
|
42
|
+
]), U = V((l) => {
|
|
43
|
+
I(l);
|
|
44
|
+
const L = h(R(l, c)), Q = h(C);
|
|
45
|
+
if (L !== Q) {
|
|
46
|
+
if (L === void 0) {
|
|
47
|
+
s(null);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
s([
|
|
51
|
+
ue(N, L)
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
}, [
|
|
55
|
+
s,
|
|
56
|
+
N,
|
|
57
|
+
c,
|
|
58
|
+
C,
|
|
59
|
+
I
|
|
60
|
+
]), B = m(e, n.Label), H = m(e, n.Input), k = m(e, n.Description), v = m(e, n.Error);
|
|
61
|
+
return /* @__PURE__ */ r.createElement(x, {
|
|
62
|
+
fieldId: t,
|
|
63
|
+
renderLabel: () => B,
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
65
|
+
"aria-labelledby": `${M} ${G}`,
|
|
66
|
+
value: a ? F : "",
|
|
67
|
+
onChange: U,
|
|
68
|
+
isDisabled: p,
|
|
69
|
+
isReadOnly: d,
|
|
70
|
+
isRequired: y,
|
|
71
|
+
isInvalid: b,
|
|
72
|
+
onBlur: $,
|
|
73
|
+
onFocus: f
|
|
74
|
+
}, H),
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, v, k)
|
|
76
|
+
});
|
|
77
|
+
}, E = ({ children: e, className: t }) => {
|
|
78
|
+
const { disabled: a, hasError: s } = D(), p = m(e, E.Currency), d = m(e, E.Value);
|
|
79
|
+
return /* @__PURE__ */ r.createElement(J, {
|
|
80
|
+
className: t,
|
|
81
|
+
isDisabled: a,
|
|
82
|
+
isInvalid: s
|
|
83
|
+
}, p, d);
|
|
84
|
+
}, me = ({ className: e }) => {
|
|
85
|
+
const { currency: t } = q(), { t: a } = W(), { prefixId: s } = S();
|
|
86
|
+
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
87
|
+
id: s,
|
|
88
|
+
"aria-hidden": !1,
|
|
89
|
+
"aria-label": re(a, t),
|
|
90
|
+
className: e
|
|
91
|
+
}, t.sign || t.code) : null;
|
|
92
|
+
}, pe = ({ className: e }) => {
|
|
93
|
+
const { id: t, placeholder: a, label: s } = D(), { inputId: p, labelId: d, prefixId: y, ariaDescribedBy: b } = S(), o = j(null);
|
|
94
|
+
return X(() => {
|
|
95
|
+
var f;
|
|
96
|
+
(f = o.current) == null || f.focus();
|
|
97
|
+
}, t), /* @__PURE__ */ r.createElement(K, {
|
|
98
|
+
ref: o,
|
|
99
|
+
id: p,
|
|
100
|
+
className: e,
|
|
101
|
+
placeholder: a,
|
|
102
|
+
"aria-label": s,
|
|
103
|
+
"aria-labelledby": `${d} ${y}`,
|
|
104
|
+
"aria-describedby": b,
|
|
105
|
+
autoComplete: "off"
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
E.Currency = me;
|
|
109
|
+
E.Value = pe;
|
|
110
|
+
n.Label = ee;
|
|
111
|
+
n.Input = E;
|
|
112
|
+
n.Description = Y;
|
|
113
|
+
n.Error = Z;
|
|
114
|
+
const de = "_inputGroup_vuy4u_1", Ee = "_currency_vuy4u_14", T = {
|
|
115
|
+
inputGroup: de,
|
|
116
|
+
currency: Ee
|
|
117
|
+
}, fe = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(w, {
|
|
118
|
+
content: e,
|
|
119
|
+
locale: t
|
|
120
|
+
}), Ie = () => /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
121
|
+
className: i(se, u.label)
|
|
122
|
+
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
123
|
+
className: i(oe, u.requiredMark)
|
|
124
|
+
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
125
|
+
className: i(le, u.input, T.inputGroup)
|
|
126
|
+
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
127
|
+
className: T.currency
|
|
128
|
+
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
129
|
+
className: i(u.innerInput, ae)
|
|
130
|
+
})), /* @__PURE__ */ r.createElement(n.Error, {
|
|
131
|
+
className: i(ce, u.error)
|
|
132
|
+
}, /* @__PURE__ */ r.createElement(ne, null), /* @__PURE__ */ r.createElement(n.Error.Text, null)), /* @__PURE__ */ r.createElement(n.Description, {
|
|
133
|
+
className: i(ie, u.description)
|
|
134
|
+
}, fe)), Ve = () => /* @__PURE__ */ r.createElement(Ie, null);
|
|
135
|
+
export {
|
|
136
|
+
Ve as PaymentInputRAC
|
|
137
|
+
};
|