@wix/form-elements 1.107.0 → 1.108.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-D2F4vgf1.js → appointment-rac-ZAp8oWbK.js} +289 -290
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-x-Az7vHf.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-MoF_CaqB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CWh3Rb0M.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-BVTiXUWk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-kXRRlyHl.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-C4Zr6kXE.js} +23 -24
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-2rz1m_xi.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-BEjGypQw.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-DwEQLIaz.js} +66 -67
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-BsOww_QB.js} +37 -37
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-DTcZcVS6.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-DQsML-pW.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-irEBBOxP.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-B5bSAYrm.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-DyScj8f4.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-C5X9-jXa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-B0vkfmrS.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Cfil3U_e.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac-CtPLE-7-.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-YkzsAoBZ.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BS4j8QC-.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-z_9VsEZL.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-WFkmKyZv.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-NN3rxosk.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-mdhEC3oq.js} +88 -89
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CGciuoTx.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CRZVODfF.js} +90 -91
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-Bfbvjy8W.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-TDWBXZ44.js} +76 -77
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-DY0qdSix.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BFGM7SOt.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DPZvTeUZ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-Xd5kojsQ.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-C0RIdxJW.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-D1m8vJvm.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-BC81RFYY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-Z_ih9FfX.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-s3BOnXuI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CL3jcezs.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-wz1EyP5b.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-BY4Rf2BP.js} +2 -2
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-DRJzlsq8.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-BGcRNNAi.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-CRAIm8yp.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BlTfOIlE.js} +83 -84
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-DhzRAMcM.js} +12 -12
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-DXyY5we-.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-C6YM6qxm.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-CAdr7wya.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-Z2VMuCbt.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DpkfunVK.js} +53 -54
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-CuJkdrPo.js} +61 -62
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-BKWlSeQ9.js} +8 -8
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-tsg9FQ-_.js} +12 -12
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-CB8dEat8.js} +11 -11
- package/dist/component/{file-upload-rac-DbdkUbWM.js → file-upload-rac-ZdgYt646.js} +67 -68
- package/dist/component/{fixed-payment-rac-f9-01iDN.js → fixed-payment-rac-CuIQEeHh.js} +20 -21
- package/dist/component/{form-DQauhsho.js → form-0jt4L5xo.js} +3045 -2896
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/header-field-rac-CWVGzxKb.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-D6KsV-ko.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CUCyVS8c.js} +29 -30
- package/dist/component/{index-BB7d_9Dv.js → index-TJSnVtCO.js} +72 -72
- package/dist/component/{index-CcUTIUWM.js → index-iOqQidgV.js} +12 -12
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-DQbx8r1c.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-DtZ1NTfD.js} +186 -187
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-ub-_XzHU.js} +1 -1
- package/dist/component/number-input-field-rac-DLItn4DK.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-UuxJzqEx.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-Di6q96Rn.js} +37 -38
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-CG6c4-Ge.js} +52 -53
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-D4JphCuT.js} +75 -76
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-_vDw2usa.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-CgxRlj1f.js} +73 -74
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-bi26aGxN.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-DDJq2ESf.js} +33 -33
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-D1aMVO6l.js} +4 -4
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-HKC85M6t.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-CpRehxFB.js} +42 -43
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-BMuCZ3oj.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-mZ6xoAOd.js} +4 -4
- package/dist/component/rich-text-field-rac-CUK8V8Kf.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-B-7sR2FJ.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-1DDNT5bn.js} +43 -44
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-CB-6dwxz.js} +21 -22
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-7XBci6P2.js} +35 -36
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-B1-Mk8Gg.js} +21 -22
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-CQ9Y7mq-.js} +49 -50
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-Visic-Ml.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-C8fP1g-w.js} +31 -32
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-B6yZxzxm.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-CNjbOxD1.js} +5 -5
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-Bm8PJGep.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-BEPC1Z-4.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-3m6C_Jp5.js} +41 -42
- package/dist/component/url-input-field-rac-CIk_6Lf6.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-DyVoygXH.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-McG3ayOT.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-B9MBWX44.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-r5G_sZsO.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-hcbkvhpw.js} +7 -7
- package/dist/component/use-text-input-class-name-SnurFqAr.js +23 -0
- package/dist/form.d.ts +3 -1
- package/package.json +2 -2
- package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
- package/dist/component/header-field-rac-DamDk5BR.js +0 -25
- package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
- package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
- package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
- package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
- package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { RicosViewer as P } from "@wix/ricos/viewer";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import r, { useState as H, useCallback as Q, useEffect as U, useRef as $ } from "react";
|
|
4
|
+
import { NumberField as j, Input as z } from "react-aria-components";
|
|
5
|
+
import { b5 as _, b2 as S, bf as G, b7 as J, H as K, T as W, u as X, p as Y } from "./form-0jt4L5xo.js";
|
|
6
|
+
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as Z, E as w } from "./field-error-headless-tsg9FQ-_.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-CB8dEat8.js";
|
|
9
|
+
import { g as re, c as te } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
|
+
import { u as ne } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
|
+
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { s as p } from "./field-rac.module-B4l_0KRU.js";
|
|
13
|
+
import { u as se } from "./use-text-input-class-name-SnurFqAr.js";
|
|
14
|
+
const e = ({ children: t }) => {
|
|
15
|
+
var F, L, R;
|
|
16
|
+
const { id: a, value: s, onChange: l, disabled: d, required: b, readOnly: o, onBlur: E, onFocus: f, FieldLayout: m, hasError: u, validation: n } = _(), { labelId: y } = S(), D = ((F = n == null ? void 0 : n.number) == null ? void 0 : F.multipleOf) || 1, A = (L = n == null ? void 0 : n.number) == null ? void 0 : L.maximum, T = (R = n == null ? void 0 : n.number) == null ? void 0 : R.minimum, g = O(s), [x, I] = H(g), V = ne(E), h = c(t, e.Label), q = c(t, e.Input), M = c(t, e.Description), k = c(t, e.Error), B = Q((N) => {
|
|
17
|
+
if (N === void 0 || Number.isNaN(N)) {
|
|
18
|
+
l(""), I(NaN);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const v = re(D), C = Number(N.toFixed(v));
|
|
22
|
+
l(C), I(C);
|
|
23
|
+
}, [
|
|
24
|
+
D,
|
|
25
|
+
l
|
|
26
|
+
]);
|
|
27
|
+
return U(() => {
|
|
28
|
+
I(O(s));
|
|
29
|
+
}, [
|
|
30
|
+
s
|
|
31
|
+
]), /* @__PURE__ */ r.createElement(m, {
|
|
32
|
+
fieldId: a,
|
|
33
|
+
renderLabel: () => h,
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
35
|
+
"aria-labelledby": y,
|
|
36
|
+
value: x,
|
|
37
|
+
onChange: B,
|
|
38
|
+
isDisabled: d,
|
|
39
|
+
isRequired: b,
|
|
40
|
+
isReadOnly: o,
|
|
41
|
+
isInvalid: u,
|
|
42
|
+
onBlur: V,
|
|
43
|
+
onFocus: f,
|
|
44
|
+
minValue: T ?? void 0,
|
|
45
|
+
maxValue: A ?? void 0
|
|
46
|
+
}, q),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, M)
|
|
48
|
+
});
|
|
49
|
+
}, le = ({ className: t }) => {
|
|
50
|
+
var u;
|
|
51
|
+
const { t: a } = G(), { inputId: s, ariaDescribedBy: l } = S(), { id: d, placeholder: b, validation: o, label: E, required: f } = _();
|
|
52
|
+
(u = o == null ? void 0 : o.number) != null && u.multipleOf;
|
|
53
|
+
const m = $(null);
|
|
54
|
+
return J(() => {
|
|
55
|
+
var n;
|
|
56
|
+
(n = m.current) == null || n.focus();
|
|
57
|
+
}, d), /* @__PURE__ */ r.createElement(z, {
|
|
58
|
+
ref: m,
|
|
59
|
+
id: s,
|
|
60
|
+
"aria-describedby": l,
|
|
61
|
+
"aria-label": E,
|
|
62
|
+
"aria-roledescription": a("field.number.aria-role-description"),
|
|
63
|
+
className: t,
|
|
64
|
+
inputMode: "decimal",
|
|
65
|
+
placeholder: b,
|
|
66
|
+
required: f
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
e.Label = ee;
|
|
70
|
+
e.Input = le;
|
|
71
|
+
e.Description = Z;
|
|
72
|
+
e.Error = w;
|
|
73
|
+
const O = (t) => te(t) ?? NaN, oe = ({ content: t, locale: a }) => /* @__PURE__ */ r.createElement(P, {
|
|
74
|
+
content: t,
|
|
75
|
+
locale: a
|
|
76
|
+
}), Le = () => {
|
|
77
|
+
const t = se();
|
|
78
|
+
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
79
|
+
className: i(K, p.label)
|
|
80
|
+
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
81
|
+
className: i(W, p.requiredMark)
|
|
82
|
+
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
83
|
+
className: t
|
|
84
|
+
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
85
|
+
className: i(X, p.error)
|
|
86
|
+
}, /* @__PURE__ */ r.createElement(ae, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
87
|
+
className: i(Y, p.description)
|
|
88
|
+
}, oe));
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
Le as N
|
|
92
|
+
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import e, { useState as N, useRef as S } from "react";
|
|
2
2
|
import { RicosViewer as x } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as
|
|
6
|
-
import { f as u, a as
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { E as
|
|
10
|
-
import { H as
|
|
4
|
+
import { b5 as E, b2 as I, b7 as O, bf as A, H as B, T as V, u as v, p as P } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { TextField as M, Group as k, Input as q, Button as H } from "react-aria-components";
|
|
6
|
+
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as U, E as j } from "./field-error-headless-tsg9FQ-_.js";
|
|
8
|
+
import { L as W } from "./field-label-headless-CB8dEat8.js";
|
|
9
|
+
import { E as Z } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
+
import { H as G } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-B4l_0KRU.js";
|
|
12
|
-
import {
|
|
13
|
-
import { u as J } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
12
|
+
import { u as Q } from "./use-text-input-class-name-SnurFqAr.js";
|
|
14
13
|
const t = ({ children: o, className: r }) => {
|
|
15
|
-
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, FieldLayout: _ } = E(), { labelId: y } = I(), [R,
|
|
14
|
+
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, FieldLayout: _ } = E(), { labelId: y } = I(), [R, T] = N(!1), D = u(o, t.Label), F = u(o, t.Control), L = u(o, t.Description), w = u(o, t.Error);
|
|
16
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
17
16
|
fieldId: l,
|
|
18
|
-
renderLabel: () =>
|
|
19
|
-
renderInput: () => /* @__PURE__ */ e.createElement(
|
|
17
|
+
renderLabel: () => D,
|
|
18
|
+
renderInput: () => /* @__PURE__ */ e.createElement(M, {
|
|
20
19
|
"aria-labelledby": y,
|
|
21
20
|
value: s ?? "",
|
|
22
21
|
onChange: c,
|
|
@@ -27,30 +26,30 @@ const t = ({ children: o, className: r }) => {
|
|
|
27
26
|
onBlur: f,
|
|
28
27
|
onFocus: C,
|
|
29
28
|
className: r
|
|
30
|
-
},
|
|
29
|
+
}, b(F, {
|
|
31
30
|
isVisible: R,
|
|
32
|
-
onToggleVisibility: () =>
|
|
31
|
+
onToggleVisibility: () => T((h) => !h)
|
|
33
32
|
})),
|
|
34
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
33
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, L, w)
|
|
35
34
|
});
|
|
36
|
-
},
|
|
35
|
+
}, $ = ({ children: o, className: r, ...l }) => {
|
|
37
36
|
const { isVisible: s, onToggleVisibility: c } = l, { disabled: n, hasError: m } = E(), a = u(o, t.Input), i = u(o, t.Toggle);
|
|
38
|
-
return /* @__PURE__ */ e.createElement(
|
|
37
|
+
return /* @__PURE__ */ e.createElement(k, {
|
|
39
38
|
className: r,
|
|
40
39
|
isDisabled: n,
|
|
41
40
|
isInvalid: m
|
|
42
|
-
},
|
|
41
|
+
}, b(a, {
|
|
43
42
|
isVisible: s
|
|
44
|
-
}),
|
|
43
|
+
}), b(i, {
|
|
45
44
|
isVisible: s,
|
|
46
45
|
onToggleVisibility: c
|
|
47
46
|
}));
|
|
48
|
-
},
|
|
47
|
+
}, z = ({ className: o, ...r }) => {
|
|
49
48
|
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = S(null);
|
|
50
49
|
return O(() => {
|
|
51
50
|
var i;
|
|
52
51
|
(i = a.current) == null || i.focus();
|
|
53
|
-
}, s), /* @__PURE__ */ e.createElement(
|
|
52
|
+
}, s), /* @__PURE__ */ e.createElement(q, {
|
|
54
53
|
ref: a,
|
|
55
54
|
id: n,
|
|
56
55
|
type: l ? "text" : "password",
|
|
@@ -58,9 +57,9 @@ const t = ({ children: o, className: r }) => {
|
|
|
58
57
|
className: o,
|
|
59
58
|
placeholder: c
|
|
60
59
|
});
|
|
61
|
-
},
|
|
60
|
+
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
62
61
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
63
|
-
return /* @__PURE__ */ e.createElement(
|
|
62
|
+
return /* @__PURE__ */ e.createElement(H, {
|
|
64
63
|
type: "button",
|
|
65
64
|
isDisabled: a,
|
|
66
65
|
onPress: m,
|
|
@@ -71,12 +70,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
71
70
|
isVisible: n
|
|
72
71
|
}));
|
|
73
72
|
};
|
|
74
|
-
t.Label =
|
|
75
|
-
t.Control =
|
|
76
|
-
t.Input =
|
|
77
|
-
t.Toggle =
|
|
78
|
-
t.Description =
|
|
79
|
-
t.Error =
|
|
73
|
+
t.Label = W;
|
|
74
|
+
t.Control = $;
|
|
75
|
+
t.Input = z;
|
|
76
|
+
t.Toggle = J;
|
|
77
|
+
t.Description = U;
|
|
78
|
+
t.Error = j;
|
|
80
79
|
const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
81
80
|
viewBox: "0 0 24 24",
|
|
82
81
|
width: "20",
|
|
@@ -112,30 +111,30 @@ const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
112
111
|
y1: "21",
|
|
113
112
|
x2: "21",
|
|
114
113
|
y2: "3"
|
|
115
|
-
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15",
|
|
114
|
+
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15", g = {
|
|
116
115
|
control: Y,
|
|
117
116
|
toggleButton: ee
|
|
118
117
|
}, te = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(x, {
|
|
119
118
|
content: o,
|
|
120
119
|
locale: r
|
|
121
120
|
}), oe = () => {
|
|
122
|
-
const { t: o } = A(), r =
|
|
121
|
+
const { t: o } = A(), r = Q(g.control);
|
|
123
122
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
124
|
-
className: d(
|
|
123
|
+
className: d(B, p.label)
|
|
125
124
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
126
|
-
className: d(
|
|
125
|
+
className: d(V, p.requiredMark)
|
|
127
126
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
128
127
|
className: r
|
|
129
128
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
130
|
-
className: d(p.innerInput,
|
|
129
|
+
className: d(p.innerInput, G)
|
|
131
130
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
132
|
-
className:
|
|
131
|
+
className: g.toggleButton,
|
|
133
132
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
134
133
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
135
134
|
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
136
|
-
className: d(
|
|
137
|
-
}, /* @__PURE__ */ e.createElement(
|
|
138
|
-
className: d(
|
|
135
|
+
className: d(v, p.error)
|
|
136
|
+
}, /* @__PURE__ */ e.createElement(Z, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
137
|
+
className: d(P, p.description)
|
|
139
138
|
}, te));
|
|
140
139
|
}, be = () => /* @__PURE__ */ e.createElement(oe, null);
|
|
141
140
|
export {
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import r, { useCallback as P, useRef as
|
|
2
|
-
import { RicosViewer as
|
|
1
|
+
import r, { useCallback as P, useRef as Z } from "react";
|
|
2
|
+
import { RicosViewer as j } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
|
-
import { TextField as w, Group as z, Input as
|
|
5
|
-
import {
|
|
6
|
-
import { f as
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { f as N, g as
|
|
10
|
-
import { u as
|
|
11
|
-
import { E as
|
|
12
|
-
import { H as
|
|
4
|
+
import { TextField as w, Group as z, Input as J } from "react-aria-components";
|
|
5
|
+
import { b5 as R, b2 as D, aZ as x, bf as K, b7 as W, H as X, T as Y, u as ee, p as re } from "./form-0jt4L5xo.js";
|
|
6
|
+
import { f as u } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as te, E as ne } from "./field-error-headless-tsg9FQ-_.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-CB8dEat8.js";
|
|
9
|
+
import { f as N, g as se } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
|
+
import { u as oe } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
|
+
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { H as ce } from "./custom-focus-class-_483Pkwp.js";
|
|
13
13
|
import { s as d } from "./field-rac.module-B4l_0KRU.js";
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
function ue(e, t) {
|
|
14
|
+
import { u as ue } from "./use-text-input-class-name-SnurFqAr.js";
|
|
15
|
+
function ie(e, t) {
|
|
17
16
|
return {
|
|
18
17
|
productId: e.id,
|
|
19
18
|
price: t,
|
|
20
19
|
quantity: 1
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function T(e) {
|
|
24
23
|
if (e == null || e === "")
|
|
25
24
|
return;
|
|
26
25
|
const t = Number(String(e).replace(/,/g, "."));
|
|
@@ -28,7 +27,7 @@ function h(e) {
|
|
|
28
27
|
}
|
|
29
28
|
const n = ({ children: e }) => {
|
|
30
29
|
var O, g, A, V;
|
|
31
|
-
const { id: t, value: a, onChange: s, disabled:
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: i, readOnly: m, required: b, hasError: y, onBlur: o, onFocus: E, FieldLayout: M, validation: C } = R(), { labelId: q, prefixId: G } = D(), { regionalFormat: c } = x(), S = (A = (g = (O = C == null ? void 0 : C.predefined) == null ? void 0 : O.paymentOptions) == null ? void 0 : g.products) == null ? void 0 : A[0], _ = (V = a == null ? void 0 : a.at(0)) == null ? void 0 : V.price, [F, I] = oe({
|
|
32
31
|
sourceValue: _,
|
|
33
32
|
format: (l) => N(String(l ?? ""), c),
|
|
34
33
|
regionalFormat: c
|
|
@@ -40,16 +39,16 @@ const n = ({ children: e }) => {
|
|
|
40
39
|
c,
|
|
41
40
|
o,
|
|
42
41
|
I
|
|
43
|
-
]),
|
|
42
|
+
]), B = P((l) => {
|
|
44
43
|
I(l);
|
|
45
|
-
const L =
|
|
46
|
-
if (L !==
|
|
44
|
+
const L = T(N(l, c)), Q = T(_);
|
|
45
|
+
if (L !== Q) {
|
|
47
46
|
if (L === void 0) {
|
|
48
47
|
s(null);
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
50
|
s([
|
|
52
|
-
|
|
51
|
+
ie(S, L)
|
|
53
52
|
]);
|
|
54
53
|
}
|
|
55
54
|
}, [
|
|
@@ -58,84 +57,84 @@ const n = ({ children: e }) => {
|
|
|
58
57
|
c,
|
|
59
58
|
_,
|
|
60
59
|
I
|
|
61
|
-
]),
|
|
60
|
+
]), H = u(e, n.Label), U = u(e, n.Input), k = u(e, n.Description), v = u(e, n.Error);
|
|
62
61
|
return /* @__PURE__ */ r.createElement(M, {
|
|
63
62
|
fieldId: t,
|
|
64
|
-
renderLabel: () =>
|
|
63
|
+
renderLabel: () => H,
|
|
65
64
|
renderInput: () => /* @__PURE__ */ r.createElement(w, {
|
|
66
65
|
"aria-labelledby": `${q} ${G}`,
|
|
67
66
|
value: a ? F : "",
|
|
68
|
-
onChange:
|
|
69
|
-
isDisabled:
|
|
67
|
+
onChange: B,
|
|
68
|
+
isDisabled: i,
|
|
70
69
|
isReadOnly: m,
|
|
71
|
-
isRequired:
|
|
72
|
-
isInvalid:
|
|
70
|
+
isRequired: b,
|
|
71
|
+
isInvalid: y,
|
|
73
72
|
onBlur: $,
|
|
74
73
|
onFocus: E
|
|
75
|
-
},
|
|
76
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
74
|
+
}, U),
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, v, k)
|
|
77
76
|
});
|
|
78
77
|
}, f = ({ children: e, className: t }) => {
|
|
79
|
-
const { disabled: a, hasError: s } = R(),
|
|
78
|
+
const { disabled: a, hasError: s } = R(), i = u(e, f.Currency), m = u(e, f.Value);
|
|
80
79
|
return /* @__PURE__ */ r.createElement(z, {
|
|
81
80
|
className: t,
|
|
82
81
|
isDisabled: a,
|
|
83
82
|
isInvalid: s
|
|
84
|
-
},
|
|
83
|
+
}, i, m);
|
|
85
84
|
}, me = ({ className: e }) => {
|
|
86
|
-
const { currency: t } =
|
|
85
|
+
const { currency: t } = x(), { t: a } = K(), { prefixId: s } = D();
|
|
87
86
|
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
88
87
|
id: s,
|
|
89
88
|
"aria-hidden": !1,
|
|
90
|
-
"aria-label":
|
|
89
|
+
"aria-label": se(a, t),
|
|
91
90
|
className: e
|
|
92
91
|
}, t.sign || t.code) : null;
|
|
93
92
|
}, pe = ({ className: e }) => {
|
|
94
|
-
const { id: t, placeholder: a, label: s } = R(), { inputId:
|
|
95
|
-
return
|
|
93
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: i, labelId: m, prefixId: b, ariaDescribedBy: y } = D(), o = Z(null);
|
|
94
|
+
return W(() => {
|
|
96
95
|
var E;
|
|
97
96
|
(E = o.current) == null || E.focus();
|
|
98
|
-
}, t), /* @__PURE__ */ r.createElement(
|
|
97
|
+
}, t), /* @__PURE__ */ r.createElement(J, {
|
|
99
98
|
ref: o,
|
|
100
|
-
id:
|
|
99
|
+
id: i,
|
|
101
100
|
className: e,
|
|
102
101
|
placeholder: a,
|
|
103
102
|
"aria-label": s,
|
|
104
|
-
"aria-labelledby": `${m} ${
|
|
105
|
-
"aria-describedby":
|
|
103
|
+
"aria-labelledby": `${m} ${b}`,
|
|
104
|
+
"aria-describedby": y,
|
|
106
105
|
autoComplete: "off"
|
|
107
106
|
});
|
|
108
107
|
};
|
|
109
108
|
f.Currency = me;
|
|
110
109
|
f.Value = pe;
|
|
111
|
-
n.Label =
|
|
110
|
+
n.Label = ae;
|
|
112
111
|
n.Input = f;
|
|
113
|
-
n.Description =
|
|
114
|
-
n.Error =
|
|
115
|
-
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14",
|
|
112
|
+
n.Description = te;
|
|
113
|
+
n.Error = ne;
|
|
114
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", h = {
|
|
116
115
|
inputGroup: de,
|
|
117
116
|
currency: fe
|
|
118
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
117
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(j, {
|
|
119
118
|
content: e,
|
|
120
119
|
locale: t
|
|
121
120
|
}), Ie = () => {
|
|
122
|
-
const e =
|
|
121
|
+
const e = ue(h.inputGroup);
|
|
123
122
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
124
|
-
className: p(
|
|
123
|
+
className: p(X, d.label)
|
|
125
124
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
126
|
-
className: p(
|
|
125
|
+
className: p(Y, d.requiredMark)
|
|
127
126
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
128
127
|
className: e
|
|
129
128
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
130
|
-
className:
|
|
129
|
+
className: h.currency
|
|
131
130
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
132
|
-
className: p(d.innerInput,
|
|
131
|
+
className: p(d.innerInput, ce)
|
|
133
132
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
|
134
|
-
className: p(
|
|
135
|
-
}, /* @__PURE__ */ r.createElement(
|
|
136
|
-
className: p(
|
|
133
|
+
className: p(ee, d.error)
|
|
134
|
+
}, /* @__PURE__ */ r.createElement(le, null), /* @__PURE__ */ r.createElement(n.Error.Text, null)), /* @__PURE__ */ r.createElement(n.Description, {
|
|
135
|
+
className: p(re, d.description)
|
|
137
136
|
}, Ee));
|
|
138
|
-
},
|
|
137
|
+
}, Pe = () => /* @__PURE__ */ r.createElement(Ie, null);
|
|
139
138
|
export {
|
|
140
|
-
|
|
139
|
+
Pe as PaymentInputRAC
|
|
141
140
|
};
|