@wix/form-elements 1.242.0 → 1.243.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-Bab9tSUj.js → appointment-rac-D-dMrhRb.js} +43 -43
- package/dist/component/{bookings-address-rac-DcpXlUvQ.js → bookings-address-rac-B6aQ4P5I.js} +1 -1
- package/dist/component/{bookings-email-rac-Bp0i-XuQ.js → bookings-email-rac-Bh849hrc.js} +1 -1
- package/dist/component/{bookings-first-name-rac-BWSlc38n.js → bookings-first-name-rac-C69Ind1o.js} +1 -1
- package/dist/component/{bookings-header-rac-C2jB1zfG.js → bookings-header-rac-DGUzMGRj.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BkwCVLE2.js → bookings-last-name-rac-Ch9Bm-sr.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DpGFo3D_.js → bookings-login-bar-rac-CUhHuZm-.js} +1 -1
- package/dist/component/{bookings-phone-rac-BtgTVsj2.js → bookings-phone-rac-BI4PoSu3.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DsOs6O8q.js → bookings-rich-text-rac-B4D2ZCJs.js} +1 -1
- package/dist/component/{checkbox-field-rac-DysYJ41o.js → checkbox-field-rac-zE0dzJYu.js} +81 -81
- package/dist/component/{checkbox-group-field-headless-Df-A3KXl.js → checkbox-group-field-headless-C2x-la-e.js} +44 -44
- package/dist/component/{checkbox-group-field-rac-DFnJDZWN.js → checkbox-group-field-rac-iJkQGTiJ.js} +4 -4
- package/dist/component/{checkbox-group-rac-B7TaGbZy.js → checkbox-group-rac-DoK5e4c8.js} +1 -1
- package/dist/component/{checkbox-rac-Di0BHQqP.js → checkbox-rac-8i-6GMze.js} +1 -1
- package/dist/component/{contacts-address-rac-DhSjIORz.js → contacts-address-rac-CHcRQBjy.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-B3nWdWka.js → contacts-birthdate-rac-CkSsvQ6R.js} +1 -1
- package/dist/component/{contacts-company-rac-DFYyTkvq.js → contacts-company-rac-CIsmil8s.js} +1 -1
- package/dist/component/{contacts-email-rac-DGzgN38U.js → contacts-email-rac-AEvRJfWd.js} +1 -1
- package/dist/component/{contacts-first-name-rac-CZ3e4Pxp.js → contacts-first-name-rac-CLSJ2cna.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Dvu7FY_c.js → contacts-last-name-rac-o59dmvVn.js} +1 -1
- package/dist/component/{contacts-phone-rac-DeLq3Efe.js → contacts-phone-rac-jh-YSD-N.js} +1 -1
- package/dist/component/{contacts-position-rac-YhEGkgEL.js → contacts-position-rac-Ak4X2gV_.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DzVP-ujl.js → contacts-subscribe-rac-By9Bk1YL.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-CU4sTn5G.js → contacts-tax-id-rac-B1enZgKk.js} +1 -1
- package/dist/component/{date-availability-1nR4MMNM.js → date-availability--3J2b6Ur.js} +1 -1
- package/dist/component/{date-input-field-rac-CM_aSFwq.js → date-input-field-rac-BFt0DKA9.js} +66 -66
- package/dist/component/{date-input-rac-BKDGvMhS.js → date-input-rac-D8BA8S1A.js} +1 -1
- package/dist/component/{date-picker-field-rac-Cy3E6oIi.js → date-picker-field-rac-cwYdVf60.js} +40 -40
- package/dist/component/{date-picker-rac-P7Rt52yN.js → date-picker-rac-B7uR5ZnA.js} +1 -1
- package/dist/component/{date-time-input-field-rac-Dy0yHP_r.js → date-time-input-field-rac-PaKyrMb9.js} +98 -98
- package/dist/component/{date-time-input-rac-Bte2ExkW.js → date-time-input-rac-Ck8Edatx.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-aDNIkDPY.js → dext-checkbox-group-rac-Cru3Lq4c.js} +2 -2
- package/dist/component/{dext-checkbox-rac-7cCDU8rx.js → dext-checkbox-rac-wtMsRxly.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CiKlP583.js → dext-date-picker-rac-B34DtxLN.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-Cg0rG4Qg.js → dext-date-time-input-rac-BsdfLty5.js} +1 -1
- package/dist/component/{dext-dropdown-rac-BqQfNIBY.js → dext-dropdown-rac-DeZYnwo7.js} +1 -1
- package/dist/component/{dext-email-rac-BfeJHd-1.js → dext-email-rac-B4GTK5H8.js} +1 -1
- package/dist/component/{dext-number-input-rac-Co2-0GIg.js → dext-number-input-rac-BIyJJ9h0.js} +1 -1
- package/dist/component/{dext-phone-rac-nruJqfOS.js → dext-phone-rac-lf64Ywlp.js} +1 -1
- package/dist/component/{dext-radio-group-rac-D4dpTCbP.js → dext-radio-group-rac-CGt1_jue.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DZdFsFwX.js → dext-rating-input-rac-CbaW1lxS.js} +1 -1
- package/dist/component/{dext-tags-rac-Bo06MMsK.js → dext-tags-rac-DnHDnzD_.js} +2 -2
- package/dist/component/{dext-text-area-rac-DFilJP7d.js → dext-text-area-rac-C8DVKWKo.js} +1 -1
- package/dist/component/{dext-text-input-rac-Btnz_-2P.js → dext-text-input-rac-DVl-1SDY.js} +1 -1
- package/dist/component/{dext-url-input-rac-YpJVis2h.js → dext-url-input-rac-CkpAMLF9.js} +1 -1
- package/dist/component/{dismiss-icon-DNnhVj3P.js → dismiss-icon-CwZIlL7w.js} +6 -6
- package/dist/component/{donation-rac-CgrtVdQ9.js → donation-rac-DCNG5ByO.js} +44 -44
- package/dist/component/{dropdown-field-rac-CWdttDy1.js → dropdown-field-rac-CVbM-0KX.js} +3 -3
- package/dist/component/{dropdown-rac-Bn29r6Vt.js → dropdown-rac-CE9IjTvE.js} +1 -1
- package/dist/component/{ecom-address-rac-DPSadNy1.js → ecom-address-rac-BD_okFDt.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-C5RN2TfZ.js → ecom-subscription-checkbox-rac-C7zdxqra.js} +2 -2
- package/dist/component/{email-input-field-rac-Bl_i7BQ3.js → email-input-field-rac-CY4wE0eP.js} +35 -35
- package/dist/component/{events-repeater-rac-8MaxRBKl.js → events-repeater-rac-Bh-TBEQG.js} +26 -26
- package/dist/component/{events-rsvp-rac-DgduOqZJ.js → events-rsvp-rac-BPhzKqUb.js} +3 -3
- package/dist/component/{field-error-headless-CBz8B75M.js → field-error-headless-D3lVhOaC.js} +1 -1
- package/dist/component/{field-label-headless-5GuAGL0Y.js → field-label-headless-CrZoTwxs.js} +5 -5
- package/dist/component/{file-upload-rac-BQbXxpk9.js → file-upload-rac-DYP83swC.js} +187 -186
- package/dist/component/{fixed-payment-rac-zRYih9qW.js → fixed-payment-rac-DY7hXK7g.js} +11 -11
- package/dist/component/{form-Bc8sA308.js → form-DpFQ9uO1.js} +3059 -2934
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C6f6tpfn.js → header-field-rac-9wOBV_rW.js} +2 -2
- package/dist/component/{header-rac-Dv-9gQlw.js → header-rac-gzKNBkq_.js} +1 -1
- package/dist/component/{image-choice-rac-DgmQKZLT.js → image-choice-rac-B6dvv6Jc.js} +25 -25
- package/dist/component/{index-Btc2rtde.js → index-CbCZUvYt.js} +2 -2
- package/dist/component/{index-BH3c1lm6.js → index-DCl2274b.js} +4 -4
- package/dist/component/{isObjectLike-DUAmJpnS.js → isObjectLike-DDBjMXgH.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CD692gBt.js → multiline-address-field-rac-CPkSpMMb.js} +210 -210
- package/dist/component/{multiline-address-rac-DRInxa21.js → multiline-address-rac-DCnk-LvE.js} +1 -1
- package/dist/component/{number-input-field-rac-D7Uf9yNQ.js → number-input-field-rac-Dt0hM2jA.js} +19 -19
- package/dist/component/{number-input-rac-C600LCBk.js → number-input-rac-pjmjC2-7.js} +1 -1
- package/dist/component/{password-rac-BLi1E4nU.js → password-rac-D9Gmp1yw.js} +32 -32
- package/dist/component/{payment-input-rac-DhtjMf3j.js → payment-input-rac-CI78trIl.js} +33 -33
- package/dist/component/{phone-input-field-rac-DcmI5WGt.js → phone-input-field-rac-BCPj6vEP.js} +39 -39
- package/dist/component/{phone-rac-KcmTZZ9n.js → phone-rac-FAGNDAR-.js} +1 -1
- package/dist/component/{product-list-rac-DqcTH4Uz.js → product-list-rac-D7n9P2wQ.js} +14 -14
- package/dist/component/{quiz-radio-group-rac-BhE36x3f.js → quiz-radio-group-rac-BO55azn2.js} +1 -1
- package/dist/component/{radio-button-module-classes-Bb8FJ98H.js → radio-button-module-classes-BIraDyOu.js} +35 -35
- package/dist/component/{radio-group-field-rac-ZRFBSw-k.js → radio-group-field-rac-BvUZ-DmS.js} +4 -4
- package/dist/component/{radio-group-rac-DJzh_9Rz.js → radio-group-rac-qc0JijX9.js} +1 -1
- package/dist/component/{rating-input-field-rac-O761Lr7O.js → rating-input-field-rac-D3u_T_la.js} +18 -18
- package/dist/component/{rating-input-rac-N5UUwsk9.js → rating-input-rac-CqlPfSQQ.js} +1 -1
- package/dist/component/{rich-content-rac.module-CyyY4g0Y.js → rich-content-rac.module-B4TapWZL.js} +7 -7
- package/dist/component/{rich-text-field-rac-G1dCddAG.js → rich-text-field-rac-LgoEQuKS.js} +4 -4
- package/dist/component/{rich-text-rac-DRls3PAt.js → rich-text-rac-1IcHKfEb.js} +1 -1
- package/dist/component/{service-dropdown-rac-CQtdLY6W.js → service-dropdown-rac-CMkRaLmg.js} +22 -22
- package/dist/component/{services-multi-choice-rac-GXHhjMdj.js → services-multi-choice-rac-DzwHkD-j.js} +7 -7
- package/dist/component/{signature-rac-Bthr2qFV.js → signature-rac-D3X5-ScB.js} +71 -71
- package/dist/component/{submit-button-rac-CZpKTkAI.js → submit-button-rac-BWL76gny.js} +15 -15
- package/dist/component/{tags-field-rac-C7tkzxNX.js → tags-field-rac-BwGeFDfH.js} +24 -24
- package/dist/component/{tags-rac-CWgu9IXx.js → tags-rac-DU7-Kl1T.js} +1 -1
- package/dist/component/{text-area-field-rac-BFRW0mfT.js → text-area-field-rac-BO_9zG3x.js} +19 -19
- package/dist/component/{text-area-rac-DaJColM3.js → text-area-rac-CG7vi5-F.js} +1 -1
- package/dist/component/{text-input-field-rac-D4QPznxH.js → text-input-field-rac-FWkVzsiY.js} +3 -3
- package/dist/component/{text-input-headless-B3LeZbMa.js → text-input-headless-COFlfx6N.js} +9 -9
- package/dist/component/{text-input-rac-D6t913v4.js → text-input-rac-D_7yUDzw.js} +1 -1
- package/dist/component/{time-input-rac-BRXeAxLy.js → time-input-rac-0Ggsm6qE.js} +24 -24
- package/dist/component/{url-input-field-rac-C7AeMSCu.js → url-input-field-rac-CH7kG_Qf.js} +25 -25
- package/dist/component/{url-input-rac-Crya6SOE.js → url-input-rac-CjBn6ZWh.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-CF6Nkoi8.js → use-dropdown-option-class-name-Cy_iJyiA.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-CPKkbYSD.js → use-dropdown-trigger-class-name-Ddu4_w_z.js} +26 -26
- package/dist/component/{use-element-state-class-name-c_YzmI-w.js → use-element-state-class-name-DNjpnp27.js} +2 -2
- package/dist/component/{use-hoverable-input-class-name-DPft9EoC.js → use-hoverable-input-class-name-Wy3Ujp2_.js} +2 -2
- package/dist/component/{use-is-forced-open-dropdown-DTCIHm6F.js → use-is-forced-open-dropdown-Vu0JjNY7.js} +4 -4
- package/dist/component/{use-native-mobile-input-CuS4DTkh.js → use-native-mobile-input-l8hf9N2p.js} +3 -3
- package/dist/component/{use-service-options-base-D_sHL_KM.js → use-service-options-base-Di4c__b_.js} +3 -3
- package/dist/component/use-text-input-class-name-BBZXre-_.js +6 -0
- package/package.json +2 -2
- package/dist/component/use-text-input-class-name-BCtZ8l6Q.js +0 -6
package/dist/component/{number-input-field-rac-D7Uf9yNQ.js → number-input-field-rac-Dt0hM2jA.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
1
|
+
import { RicosViewer as K } from "@wix/ricos/viewer";
|
|
2
2
|
import d from "classnames";
|
|
3
|
-
import t, { useState as
|
|
4
|
-
import { NumberField as
|
|
5
|
-
import {
|
|
3
|
+
import t, { useState as U, useCallback as Z, useEffect as $, useRef as j } from "react";
|
|
4
|
+
import { NumberField as v, Input as z } from "react-aria-components";
|
|
5
|
+
import { bO as _, bL as S, bZ as G, bQ as H, bX as J, X as W, am as Y, M as w, I as ee } from "./form-DpFQ9uO1.js";
|
|
6
6
|
import { c as y, g as x } from "./numeric-input-utils-CuBMi4-a.js";
|
|
7
7
|
import { f as p } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as re, E as te } from "./field-error-headless-
|
|
9
|
-
import { L as ne } from "./field-label-headless-
|
|
8
|
+
import { D as re, E as te } from "./field-error-headless-D3lVhOaC.js";
|
|
9
|
+
import { L as ne } from "./field-label-headless-CrZoTwxs.js";
|
|
10
10
|
import { u as se } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { s as b } from "./field-rac.module-D0QzJXUv.js";
|
|
13
|
-
import { u as me } from "./use-text-input-class-name-
|
|
13
|
+
import { u as me } from "./use-text-input-class-name-BBZXre-_.js";
|
|
14
14
|
const le = (r, { validation: s }) => {
|
|
15
15
|
const a = y(r.value.trim());
|
|
16
16
|
if (a === void 0)
|
|
@@ -19,28 +19,28 @@ const le = (r, { validation: s }) => {
|
|
|
19
19
|
return Math.min(Math.max(l, u ?? -1 / 0), o ?? 1 / 0);
|
|
20
20
|
}, e = ({ children: r }) => {
|
|
21
21
|
var D, L, R;
|
|
22
|
-
const { id: s, value: a, onChange: m, disabled: u, required: o, readOnly: l, onBlur: f, onFocus: E, FieldLayout: i, hasError: c, validation: n } = _(), { labelId: h } = S(), F = ((D = n == null ? void 0 : n.number) == null ? void 0 : D.multipleOf) || 1, M = (L = n == null ? void 0 : n.number) == null ? void 0 : L.maximum, A = (R = n == null ? void 0 : n.number) == null ? void 0 : R.minimum, V = C(a), [g, I] =
|
|
22
|
+
const { id: s, value: a, onChange: m, disabled: u, required: o, readOnly: l, onBlur: f, onFocus: E, FieldLayout: i, hasError: c, validation: n } = _(), { labelId: h } = S(), F = ((D = n == null ? void 0 : n.number) == null ? void 0 : D.multipleOf) || 1, M = (L = n == null ? void 0 : n.number) == null ? void 0 : L.maximum, A = (R = n == null ? void 0 : n.number) == null ? void 0 : R.minimum, V = C(a), [g, I] = U(V), T = se(f), q = p(r, e.Label), k = p(r, e.Input), B = p(r, e.Description), P = p(r, e.Error), Q = Z((N) => {
|
|
23
23
|
if (N === void 0 || Number.isNaN(N)) {
|
|
24
24
|
m(""), I(NaN);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const X = x(F), O = Number(N.toFixed(X));
|
|
28
28
|
m(O), I(O);
|
|
29
29
|
}, [
|
|
30
30
|
F,
|
|
31
31
|
m
|
|
32
32
|
]);
|
|
33
|
-
return
|
|
33
|
+
return $(() => {
|
|
34
34
|
I(C(a));
|
|
35
35
|
}, [
|
|
36
36
|
a
|
|
37
37
|
]), /* @__PURE__ */ t.createElement(i, {
|
|
38
38
|
fieldId: s,
|
|
39
39
|
renderLabel: () => q,
|
|
40
|
-
renderInput: () => /* @__PURE__ */ t.createElement(
|
|
40
|
+
renderInput: () => /* @__PURE__ */ t.createElement(v, {
|
|
41
41
|
"aria-labelledby": h,
|
|
42
42
|
value: g,
|
|
43
|
-
onChange:
|
|
43
|
+
onChange: Q,
|
|
44
44
|
isDisabled: u,
|
|
45
45
|
isRequired: o,
|
|
46
46
|
isReadOnly: l,
|
|
@@ -54,15 +54,15 @@ const le = (r, { validation: s }) => {
|
|
|
54
54
|
});
|
|
55
55
|
}, ue = ({ className: r }) => {
|
|
56
56
|
var c;
|
|
57
|
-
const { t: s } =
|
|
57
|
+
const { t: s } = G(), { inputId: a, ariaDescribedBy: m } = S(), { id: u, placeholder: o, validation: l, label: f, required: E } = _();
|
|
58
58
|
(c = l == null ? void 0 : l.number) != null && c.multipleOf;
|
|
59
|
-
const i =
|
|
60
|
-
return
|
|
59
|
+
const i = j(null);
|
|
60
|
+
return H(() => {
|
|
61
61
|
var n;
|
|
62
62
|
(n = i.current) == null || n.focus({
|
|
63
63
|
preventScroll: !0
|
|
64
64
|
});
|
|
65
|
-
}, u),
|
|
65
|
+
}, u), J(i, le), /* @__PURE__ */ t.createElement(z, {
|
|
66
66
|
ref: i,
|
|
67
67
|
id: a,
|
|
68
68
|
"aria-describedby": m,
|
|
@@ -78,15 +78,15 @@ e.Label = ne;
|
|
|
78
78
|
e.Input = ue;
|
|
79
79
|
e.Description = re;
|
|
80
80
|
e.Error = te;
|
|
81
|
-
const C = (r) => y(r) ?? NaN, oe = ({ content: r, locale: s }) => /* @__PURE__ */ t.createElement(
|
|
81
|
+
const C = (r) => y(r) ?? NaN, oe = ({ content: r, locale: s }) => /* @__PURE__ */ t.createElement(K, {
|
|
82
82
|
content: r,
|
|
83
83
|
locale: s
|
|
84
84
|
}), Oe = () => {
|
|
85
85
|
const r = me();
|
|
86
86
|
return /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
|
|
87
|
-
className: d(
|
|
87
|
+
className: d(W, b.label)
|
|
88
88
|
}, /* @__PURE__ */ t.createElement(e.Label.Required, {
|
|
89
|
-
className: d(
|
|
89
|
+
className: d(Y, b.requiredMark)
|
|
90
90
|
})), /* @__PURE__ */ t.createElement(e.Input, {
|
|
91
91
|
className: r
|
|
92
92
|
}), /* @__PURE__ */ t.createElement(e.Error, {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import e, { useState as
|
|
2
|
-
import { RicosViewer as
|
|
1
|
+
import e, { useState as N, useRef as O } from "react";
|
|
2
|
+
import { RicosViewer as x } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as q, Group as U, Input as
|
|
4
|
+
import { bO as E, bL as I, bQ as A, bX as B, bZ as V, X as v, am as P, M, I as k } from "./form-DpFQ9uO1.js";
|
|
5
|
+
import { TextField as q, Group as U, Input as Z, Button as j } from "react-aria-components";
|
|
6
6
|
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as H, E as
|
|
8
|
-
import { L as
|
|
9
|
-
import { E as
|
|
10
|
-
import { H as
|
|
7
|
+
import { D as H, E as Q } from "./field-error-headless-D3lVhOaC.js";
|
|
8
|
+
import { L as W } from "./field-label-headless-CrZoTwxs.js";
|
|
9
|
+
import { E as X } 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-D0QzJXUv.js";
|
|
12
|
-
import { u as
|
|
12
|
+
import { u as K } from "./use-text-input-class-name-BBZXre-_.js";
|
|
13
13
|
const t = ({ children: o, className: r }) => {
|
|
14
|
-
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: y, FieldLayout: _ } = E(), { labelId:
|
|
14
|
+
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: y, FieldLayout: _ } = E(), { labelId: L } = I(), [R, D] = N(!1), F = u(o, t.Label), T = u(o, t.Control), h = u(o, t.Description), w = u(o, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
16
16
|
fieldId: l,
|
|
17
|
-
renderLabel: () =>
|
|
17
|
+
renderLabel: () => F,
|
|
18
18
|
renderInput: () => /* @__PURE__ */ e.createElement(q, {
|
|
19
19
|
autoComplete: y,
|
|
20
|
-
"aria-labelledby":
|
|
20
|
+
"aria-labelledby": L,
|
|
21
21
|
value: s ?? "",
|
|
22
22
|
onChange: c,
|
|
23
23
|
isDisabled: n,
|
|
@@ -28,12 +28,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
28
28
|
onFocus: C,
|
|
29
29
|
className: r
|
|
30
30
|
}, b(T, {
|
|
31
|
-
isVisible:
|
|
32
|
-
onToggleVisibility: () =>
|
|
31
|
+
isVisible: R,
|
|
32
|
+
onToggleVisibility: () => D((S) => !S)
|
|
33
33
|
})),
|
|
34
34
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, h, w)
|
|
35
35
|
});
|
|
36
|
-
},
|
|
36
|
+
}, $ = ({ children: o, className: r, ...l }) => {
|
|
37
37
|
const { isVisible: s, onToggleVisibility: c } = l, { disabled: n, hasError: m } = E(), a = u(o, t.Input), i = u(o, t.Toggle);
|
|
38
38
|
return /* @__PURE__ */ e.createElement(U, {
|
|
39
39
|
className: r,
|
|
@@ -45,14 +45,14 @@ const t = ({ children: o, className: r }) => {
|
|
|
45
45
|
isVisible: s,
|
|
46
46
|
onToggleVisibility: c
|
|
47
47
|
}));
|
|
48
|
-
},
|
|
49
|
-
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a =
|
|
48
|
+
}, z = ({ className: o, ...r }) => {
|
|
49
|
+
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = O(null);
|
|
50
50
|
return A(() => {
|
|
51
51
|
var i;
|
|
52
52
|
(i = a.current) == null || i.focus({
|
|
53
53
|
preventScroll: !0
|
|
54
54
|
});
|
|
55
|
-
}, s), B(a), /* @__PURE__ */ e.createElement(
|
|
55
|
+
}, s), B(a), /* @__PURE__ */ e.createElement(Z, {
|
|
56
56
|
ref: a,
|
|
57
57
|
id: n,
|
|
58
58
|
type: l ? "text" : "password",
|
|
@@ -60,7 +60,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
60
60
|
className: o,
|
|
61
61
|
placeholder: c
|
|
62
62
|
});
|
|
63
|
-
},
|
|
63
|
+
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
64
64
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
65
65
|
return /* @__PURE__ */ e.createElement(j, {
|
|
66
66
|
type: "button",
|
|
@@ -73,13 +73,13 @@ const t = ({ children: o, className: r }) => {
|
|
|
73
73
|
isVisible: n
|
|
74
74
|
}));
|
|
75
75
|
};
|
|
76
|
-
t.Label =
|
|
77
|
-
t.Control =
|
|
78
|
-
t.Input =
|
|
79
|
-
t.Toggle =
|
|
76
|
+
t.Label = W;
|
|
77
|
+
t.Control = $;
|
|
78
|
+
t.Input = z;
|
|
79
|
+
t.Toggle = J;
|
|
80
80
|
t.Description = H;
|
|
81
|
-
t.Error =
|
|
82
|
-
const
|
|
81
|
+
t.Error = Q;
|
|
82
|
+
const Y = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
83
83
|
viewBox: "0 0 24 24",
|
|
84
84
|
width: "20",
|
|
85
85
|
height: "20",
|
|
@@ -117,26 +117,26 @@ const J = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
117
117
|
})), te = "_control_1malj_1", oe = "_toggleButton_1malj_15", g = {
|
|
118
118
|
control: te,
|
|
119
119
|
toggleButton: oe
|
|
120
|
-
}, re = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(
|
|
120
|
+
}, re = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(x, {
|
|
121
121
|
content: o,
|
|
122
122
|
locale: r
|
|
123
123
|
}), se = () => {
|
|
124
|
-
const { t: o } =
|
|
124
|
+
const { t: o } = V(), r = K(g.control);
|
|
125
125
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
126
|
-
className: d(
|
|
126
|
+
className: d(v, p.label)
|
|
127
127
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
128
|
-
className: d(
|
|
128
|
+
className: d(P, p.requiredMark)
|
|
129
129
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
130
130
|
className: r
|
|
131
131
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
132
|
-
className: d(p.innerInput,
|
|
132
|
+
className: d(p.innerInput, G)
|
|
133
133
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
134
134
|
className: g.toggleButton,
|
|
135
135
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
136
136
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
137
|
-
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(ee, null) : /* @__PURE__ */ e.createElement(
|
|
137
|
+
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(ee, null) : /* @__PURE__ */ e.createElement(Y, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
138
138
|
className: d(M, p.error)
|
|
139
|
-
}, /* @__PURE__ */ e.createElement(
|
|
139
|
+
}, /* @__PURE__ */ e.createElement(X, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
140
140
|
className: d(k, p.description)
|
|
141
141
|
}, re));
|
|
142
142
|
}, Ie = () => /* @__PURE__ */ e.createElement(se, null);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import r, { useCallback as
|
|
2
|
-
import { RicosViewer as
|
|
1
|
+
import r, { useCallback as P, useRef as X } from "react";
|
|
2
|
+
import { RicosViewer as Z } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
|
-
import { TextField as
|
|
5
|
-
import {
|
|
4
|
+
import { TextField as j, Group as w, Input as z } from "react-aria-components";
|
|
5
|
+
import { bO as R, bL as D, bG as M, bZ as J, bQ as K, X as W, am as Y, M as ee, I as re } from "./form-DpFQ9uO1.js";
|
|
6
6
|
import { f as i } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as te, E as ne } from "./field-error-headless-
|
|
8
|
-
import { L as ae } from "./field-label-headless-
|
|
9
|
-
import { f as
|
|
7
|
+
import { D as te, E as ne } from "./field-error-headless-D3lVhOaC.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-CrZoTwxs.js";
|
|
9
|
+
import { f as N, g as se } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
10
|
import { u as oe } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
11
|
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { H as ce } from "./custom-focus-class-_483Pkwp.js";
|
|
13
13
|
import { s as d } from "./field-rac.module-D0QzJXUv.js";
|
|
14
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-BBZXre-_.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -26,44 +26,44 @@ function h(e) {
|
|
|
26
26
|
return Number.isNaN(t) ? void 0 : t;
|
|
27
27
|
}
|
|
28
28
|
const n = ({ children: e }) => {
|
|
29
|
-
var O, g, A,
|
|
30
|
-
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: b, hasError: y, onBlur: o, onFocus: E, FieldLayout: T, validation: C } = R(), { labelId:
|
|
31
|
-
sourceValue:
|
|
32
|
-
format: (l) =>
|
|
29
|
+
var O, g, A, V;
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: b, hasError: y, onBlur: o, onFocus: E, FieldLayout: T, validation: C } = R(), { labelId: G, prefixId: q } = D(), { regionalFormat: c } = M(), 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({
|
|
31
|
+
sourceValue: _,
|
|
32
|
+
format: (l) => N(String(l ?? ""), c),
|
|
33
33
|
regionalFormat: c
|
|
34
|
-
}), $ =
|
|
35
|
-
const l =
|
|
34
|
+
}), $ = P(() => {
|
|
35
|
+
const l = N(F, c);
|
|
36
36
|
I(l || ""), o == null || o();
|
|
37
37
|
}, [
|
|
38
|
-
|
|
38
|
+
F,
|
|
39
39
|
c,
|
|
40
40
|
o,
|
|
41
41
|
I
|
|
42
|
-
]), v =
|
|
42
|
+
]), v = P((l) => {
|
|
43
43
|
I(l);
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
44
|
+
const L = h(N(l, c)), Q = h(_);
|
|
45
|
+
if (L !== Q) {
|
|
46
|
+
if (L === void 0) {
|
|
47
47
|
s(null);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
s([
|
|
51
|
-
ue(S,
|
|
51
|
+
ue(S, L)
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
54
|
}, [
|
|
55
55
|
s,
|
|
56
56
|
S,
|
|
57
57
|
c,
|
|
58
|
-
|
|
58
|
+
_,
|
|
59
59
|
I
|
|
60
60
|
]), B = i(e, n.Label), U = i(e, n.Input), k = i(e, n.Description), H = i(e, n.Error);
|
|
61
61
|
return /* @__PURE__ */ r.createElement(T, {
|
|
62
62
|
fieldId: t,
|
|
63
63
|
renderLabel: () => B,
|
|
64
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
65
|
-
"aria-labelledby": `${
|
|
66
|
-
value: a ?
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
65
|
+
"aria-labelledby": `${G} ${q}`,
|
|
66
|
+
value: a ? F : "",
|
|
67
67
|
onChange: v,
|
|
68
68
|
isDisabled: u,
|
|
69
69
|
isReadOnly: m,
|
|
@@ -76,13 +76,13 @@ const n = ({ children: e }) => {
|
|
|
76
76
|
});
|
|
77
77
|
}, f = ({ children: e, className: t }) => {
|
|
78
78
|
const { disabled: a, hasError: s } = R(), u = i(e, f.Currency), m = i(e, f.Value);
|
|
79
|
-
return /* @__PURE__ */ r.createElement(
|
|
79
|
+
return /* @__PURE__ */ r.createElement(w, {
|
|
80
80
|
className: t,
|
|
81
81
|
isDisabled: a,
|
|
82
82
|
isInvalid: s
|
|
83
83
|
}, u, m);
|
|
84
84
|
}, me = ({ className: e }) => {
|
|
85
|
-
const { currency: t } = M(), { t: a } =
|
|
85
|
+
const { currency: t } = M(), { t: a } = J(), { prefixId: s } = D();
|
|
86
86
|
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
87
87
|
id: s,
|
|
88
88
|
"aria-hidden": !1,
|
|
@@ -90,13 +90,13 @@ const n = ({ children: e }) => {
|
|
|
90
90
|
className: e
|
|
91
91
|
}, t.sign || t.code) : null;
|
|
92
92
|
}, pe = ({ className: e }) => {
|
|
93
|
-
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: b, ariaDescribedBy: y } = D(), o =
|
|
94
|
-
return
|
|
93
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: b, ariaDescribedBy: y } = D(), o = X(null);
|
|
94
|
+
return K(() => {
|
|
95
95
|
var E;
|
|
96
96
|
(E = o.current) == null || E.focus({
|
|
97
97
|
preventScroll: !0
|
|
98
98
|
});
|
|
99
|
-
}, t), /* @__PURE__ */ r.createElement(
|
|
99
|
+
}, t), /* @__PURE__ */ r.createElement(z, {
|
|
100
100
|
ref: o,
|
|
101
101
|
id: u,
|
|
102
102
|
className: e,
|
|
@@ -117,7 +117,7 @@ n.Error = ne;
|
|
|
117
117
|
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
118
118
|
inputGroup: de,
|
|
119
119
|
currency: fe
|
|
120
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
120
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(Z, {
|
|
121
121
|
content: e,
|
|
122
122
|
locale: t
|
|
123
123
|
}), Ie = () => {
|
|
@@ -125,7 +125,7 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
|
125
125
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
126
126
|
className: p(W, d.label)
|
|
127
127
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
128
|
-
className: p(
|
|
128
|
+
className: p(Y, d.requiredMark)
|
|
129
129
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
130
130
|
className: e
|
|
131
131
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
@@ -137,7 +137,7 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
|
137
137
|
}, /* @__PURE__ */ r.createElement(le, null), /* @__PURE__ */ r.createElement(n.Error.Text, null)), /* @__PURE__ */ r.createElement(n.Description, {
|
|
138
138
|
className: p(re, d.description)
|
|
139
139
|
}, Ee));
|
|
140
|
-
},
|
|
140
|
+
}, Pe = () => /* @__PURE__ */ r.createElement(Ie, null);
|
|
141
141
|
export {
|
|
142
|
-
|
|
142
|
+
Pe as PaymentInputRAC
|
|
143
143
|
};
|
package/dist/component/{phone-input-field-rac-DcmI5WGt.js → phone-input-field-rac-BCPj6vEP.js}
RENAMED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { RicosViewer as ge } from "@wix/ricos/viewer";
|
|
2
2
|
import g from "classnames";
|
|
3
3
|
import n, { useMemo as M, useState as w, useRef as S, useEffect as k, useCallback as U, createContext as ae, useContext as j, useId as se } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { bw as be, bZ as L, bG as ce, bY as Ne, bO as F, bL as W, bQ as Oe, bX as _e, X as ve, am as Se, a3 as ne, M as Le, I as Ie, a5 as Pe, a4 as Fe, a2 as De } from "./form-DpFQ9uO1.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as Be } from "react-aria";
|
|
6
6
|
import { VisuallyHidden as le, Dialog as ue, OverlayTriggerStateContext as Re, ModalOverlay as xe, Modal as Me, SearchField as we, Group as H, ListBoxItem as Te, DialogTrigger as $e, Select as Ae, Input as ie, Autocomplete as Ve } from "react-aria-components";
|
|
7
7
|
import de, { AsYouType as ke, isValidPhoneNumber as He, isSupportedCountry as qe } from "libphonenumber-js";
|
|
8
8
|
import "libphonenumber-js/metadata.min.json";
|
|
9
9
|
import { f as E, a as P } from "./find-child-C60k4CxG.js";
|
|
10
|
-
import { D as Ue, E as
|
|
11
|
-
import { L as Ye } from "./field-label-headless-
|
|
12
|
-
import { N as
|
|
13
|
-
import { N as
|
|
14
|
-
import { N as
|
|
10
|
+
import { D as Ue, E as Ge } from "./field-error-headless-D3lVhOaC.js";
|
|
11
|
+
import { L as Ye } from "./field-label-headless-CrZoTwxs.js";
|
|
12
|
+
import { N as Ke, u as Ze } from "./use-native-mobile-input-l8hf9N2p.js";
|
|
13
|
+
import { N as ze } from "./native-select-BbxBpe3S.js";
|
|
14
|
+
import { N as Qe, S as Xe } from "./non-modal-popover-D-u13tmp.js";
|
|
15
15
|
import { u as je } from "./use-invoke-callback-UH73A_J3.js";
|
|
16
|
-
import { d as
|
|
17
|
-
import { V as Je, a as et } from "./use-dropdown-option-class-name-
|
|
16
|
+
import { d as We } from "./use-is-forced-open-dropdown-Vu0JjNY7.js";
|
|
17
|
+
import { V as Je, a as et } from "./use-dropdown-option-class-name-Cy_iJyiA.js";
|
|
18
18
|
import { C as oe } from "./calling-country-codes-PyWuOTmF.js";
|
|
19
19
|
import { C as tt } from "./chevron-down-icon-CcpVm6B-.js";
|
|
20
20
|
import { E as nt } from "./error-icon-hZxQ6DEy.js";
|
|
21
|
-
import { H as
|
|
21
|
+
import { H as Z } from "./custom-focus-class-_483Pkwp.js";
|
|
22
22
|
import { s as O } from "./field-rac.module-D0QzJXUv.js";
|
|
23
|
-
import { u as re } from "./use-hoverable-input-class-name-
|
|
24
|
-
function
|
|
23
|
+
import { u as re } from "./use-hoverable-input-class-name-Wy3Ujp2_.js";
|
|
24
|
+
function Q(e) {
|
|
25
25
|
const t = e ? de(e) : void 0, r = t == null ? void 0 : t.country;
|
|
26
26
|
if (r)
|
|
27
27
|
return r;
|
|
28
28
|
const o = new ke();
|
|
29
29
|
return e && o.input(e), o.getCountry();
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function G(e) {
|
|
32
32
|
var t;
|
|
33
33
|
return e && ((t = be.getCountryByKey(e)) == null ? void 0 : t.dialCode);
|
|
34
34
|
}
|
|
35
35
|
function q(e) {
|
|
36
36
|
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function X(e, t) {
|
|
39
39
|
if (e && t)
|
|
40
40
|
try {
|
|
41
41
|
const r = de(e, t), o = r == null ? void 0 : r.formatInternational();
|
|
@@ -50,13 +50,13 @@ const ot = (e, t) => {
|
|
|
50
50
|
const r = e.value;
|
|
51
51
|
if (!r)
|
|
52
52
|
return;
|
|
53
|
-
const { defaultCountry: o, validation: a } = t, s = (i = (u = a == null ? void 0 : a.string) == null ? void 0 : u.phoneOptions) == null ? void 0 : i.allowedCountryCodes, c =
|
|
54
|
-
return q(
|
|
53
|
+
const { defaultCountry: o, validation: a } = t, s = (i = (u = a == null ? void 0 : a.string) == null ? void 0 : u.phoneOptions) == null ? void 0 : i.allowedCountryCodes, c = Q(r) || o || ((s == null ? void 0 : s.length) === 1 ? s[0] : void 0);
|
|
54
|
+
return q(X(r, c)) ?? void 0;
|
|
55
55
|
};
|
|
56
56
|
function rt() {
|
|
57
57
|
const { t: e } = L(), { language: t } = ce();
|
|
58
58
|
return M(() => Object.keys(oe).reduce((o, a) => {
|
|
59
|
-
const s = oe[a], c =
|
|
59
|
+
const s = oe[a], c = G(s), u = e(`locale-dataset.countries.${s.toUpperCase()}`);
|
|
60
60
|
return c && qe(a) && o.push({
|
|
61
61
|
countryName: u,
|
|
62
62
|
longCountryCode: s,
|
|
@@ -73,9 +73,9 @@ function at(e, t) {
|
|
|
73
73
|
}
|
|
74
74
|
function st(e, t) {
|
|
75
75
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
76
|
-
return !!(
|
|
76
|
+
return !!(z(r, t) || z(o, t) || z(a, t));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function z(e, t) {
|
|
79
79
|
return e.toLowerCase().includes(t.toLowerCase());
|
|
80
80
|
}
|
|
81
81
|
function ct({ currentValue: e, selectedCountryCode: t, handlePhoneChange: r, handleCountryCodeChange: o }) {
|
|
@@ -117,7 +117,7 @@ function lt({ value: e, defaultCountryCode: t, allowedCountryCodes: r, onChange:
|
|
|
117
117
|
Ne(() => {
|
|
118
118
|
s(""), c.current = "", i(t), o("");
|
|
119
119
|
});
|
|
120
|
-
const d = M(() =>
|
|
120
|
+
const d = M(() => Q(a), [
|
|
121
121
|
a
|
|
122
122
|
]);
|
|
123
123
|
k(() => {
|
|
@@ -141,9 +141,9 @@ function lt({ value: e, defaultCountryCode: t, allowedCountryCodes: r, onChange:
|
|
|
141
141
|
c.current = "", o(null);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
const f =
|
|
144
|
+
const f = Q(m);
|
|
145
145
|
i((p) => {
|
|
146
|
-
const _ = f || p || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), I = q(
|
|
146
|
+
const _ = f || p || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), I = q(X(m, _));
|
|
147
147
|
return c.current = I ?? "", o(I), f || p;
|
|
148
148
|
});
|
|
149
149
|
}, [
|
|
@@ -151,7 +151,7 @@ function lt({ value: e, defaultCountryCode: t, allowedCountryCodes: r, onChange:
|
|
|
151
151
|
o
|
|
152
152
|
]), y = U((m) => {
|
|
153
153
|
i(m), s((f) => {
|
|
154
|
-
const p = q(
|
|
154
|
+
const p = q(X(f, m));
|
|
155
155
|
return c.current = p ?? "", o(p), f;
|
|
156
156
|
});
|
|
157
157
|
}, [
|
|
@@ -200,10 +200,10 @@ const me = /* @__PURE__ */ ae(null), N = () => {
|
|
|
200
200
|
defaultCountryCode: s,
|
|
201
201
|
allowedCountryCodes: m,
|
|
202
202
|
onChange: o
|
|
203
|
-
}), { currentValue: p, selectedCountryCode: _ } = f, { detectedCountryCode: I, handlePhoneChange:
|
|
203
|
+
}), { currentValue: p, selectedCountryCode: _ } = f, { detectedCountryCode: I, handlePhoneChange: K, handleCountryCodeChange: T } = ct(f), $ = E(e, l.Label), D = E(e, l.Control), A = E(e, l.Description), B = E(e, l.Error), R = {
|
|
204
204
|
currentValue: p,
|
|
205
205
|
selectedCountryCode: _,
|
|
206
|
-
handlePhoneChange:
|
|
206
|
+
handlePhoneChange: K,
|
|
207
207
|
handleCountryCodeChange: T,
|
|
208
208
|
countryCodes: m,
|
|
209
209
|
countries: y,
|
|
@@ -234,8 +234,8 @@ const me = /* @__PURE__ */ ae(null), N = () => {
|
|
|
234
234
|
countryName: o.countryName
|
|
235
235
|
}));
|
|
236
236
|
}, te = ({ children: e, className: t }) => {
|
|
237
|
-
const { labelId: r } =
|
|
238
|
-
return /* @__PURE__ */ n.createElement(
|
|
237
|
+
const { labelId: r } = W(), { hasError: o, disabled: a, readOnly: s } = F(), { t: c } = L(), { selectedCountryCode: u, countries: i } = N(), d = se(), C = u ? i.find((p) => p.shortCountryCode === u) : void 0, y = C && G(C.longCountryCode) || "", m = c("field.phone.country-code.aria-label"), f = C ? `${m}, ${C.countryName}, ${y}` : m;
|
|
238
|
+
return /* @__PURE__ */ n.createElement(Xe, {
|
|
239
239
|
isDisabled: a || s,
|
|
240
240
|
id: d,
|
|
241
241
|
"aria-label": f,
|
|
@@ -266,7 +266,7 @@ const b = ({ children: e, className: t, "aria-label": r, placement: o, offset: a
|
|
|
266
266
|
}, e);
|
|
267
267
|
return /* @__PURE__ */ n.createElement(Be, {
|
|
268
268
|
getContainer: () => C
|
|
269
|
-
}, /* @__PURE__ */ n.createElement(
|
|
269
|
+
}, /* @__PURE__ */ n.createElement(Qe, {
|
|
270
270
|
ref: u,
|
|
271
271
|
triggerRef: c,
|
|
272
272
|
className: t,
|
|
@@ -305,7 +305,7 @@ const b = ({ children: e, className: t, "aria-label": r, placement: o, offset: a
|
|
|
305
305
|
...t,
|
|
306
306
|
renderEmptyState: c ? () => c : void 0
|
|
307
307
|
}, o.map((i) => {
|
|
308
|
-
const d =
|
|
308
|
+
const d = G(i.longCountryCode) || "";
|
|
309
309
|
return P(a, {
|
|
310
310
|
key: i.shortCountryCode,
|
|
311
311
|
countryCode: i.shortCountryCode,
|
|
@@ -379,7 +379,7 @@ Y.Name = he;
|
|
|
379
379
|
Y.Code = Ee;
|
|
380
380
|
b.Option = Y;
|
|
381
381
|
const yt = ({ className: e }) => {
|
|
382
|
-
const { t } = L(), { inputId: r, ariaDescribedBy: o } =
|
|
382
|
+
const { t } = L(), { inputId: r, ariaDescribedBy: o } = W(), { id: a, placeholder: s, disabled: c, readOnly: u, required: i, label: d, hasError: C } = F(), { currentValue: y, handlePhoneChange: m } = N(), f = S(null);
|
|
383
383
|
return Oe(() => {
|
|
384
384
|
var p;
|
|
385
385
|
(p = f.current) == null || p.focus({
|
|
@@ -422,7 +422,7 @@ const yt = ({ className: e }) => {
|
|
|
422
422
|
const r = t;
|
|
423
423
|
return /* @__PURE__ */ n.createElement($e, null, E(e, l.CountryButton), P(E(e, l.CountryOptions.Modal), r));
|
|
424
424
|
}, Et = ({ children: e, className: t }) => {
|
|
425
|
-
const r = S(null), o = S(null), a = S(!1), { id: s, disabled: c, hasError: u, showFlag: i, onFocus: d, onBlur: C } = F(), y = je(C), { countries: m } = N(), f = E(e, l.CountryDrawer), p = E(e, l.CountryPopover), _ = E(e, l.PhoneNumber), I = E(e, l.NativeCountrySelect),
|
|
425
|
+
const r = S(null), o = S(null), a = S(!1), { id: s, disabled: c, hasError: u, showFlag: i, onFocus: d, onBlur: C } = F(), y = je(C), { countries: m } = N(), f = E(e, l.CountryDrawer), p = E(e, l.CountryPopover), _ = E(e, l.PhoneNumber), I = E(e, l.NativeCountrySelect), K = Ze(), T = m.length > 1, $ = We(s) && !!p && T, D = typeof t == "function" ? ({ isHovered: R, isFocusWithin: v }) => t({
|
|
426
426
|
hasCountryOptions: T,
|
|
427
427
|
isHovered: R,
|
|
428
428
|
isFocusWithin: v
|
|
@@ -448,7 +448,7 @@ const yt = ({ className: e }) => {
|
|
|
448
448
|
...B
|
|
449
449
|
}, i && /* @__PURE__ */ n.createElement(ee, {
|
|
450
450
|
longCountryCode: m[0].longCountryCode
|
|
451
|
-
}), _) :
|
|
451
|
+
}), _) : K ? /* @__PURE__ */ n.createElement(H, {
|
|
452
452
|
ref: r,
|
|
453
453
|
className: D,
|
|
454
454
|
isDisabled: c,
|
|
@@ -462,16 +462,16 @@ const yt = ({ className: e }) => {
|
|
|
462
462
|
...B
|
|
463
463
|
}, !$ && P(f, A), P(p, A), _);
|
|
464
464
|
}, gt = ({ className: e, children: t }) => {
|
|
465
|
-
const { disabled: r, readOnly: o, required: a, hasError: s } = F(), { labelId: c } =
|
|
465
|
+
const { disabled: r, readOnly: o, required: a, hasError: s } = F(), { labelId: c } = W(), { t: u } = L(), { countries: i, selectedCountryCode: d, handleCountryCodeChange: C } = N(), y = se(), m = u("field.phone.country-code.aria-label"), f = M(() => i.map((p) => ({
|
|
466
466
|
value: p.shortCountryCode,
|
|
467
|
-
label: `${p.countryName} ${
|
|
467
|
+
label: `${p.countryName} ${G(p.longCountryCode) || ""}`.trim()
|
|
468
468
|
})), [
|
|
469
469
|
i
|
|
470
470
|
]);
|
|
471
|
-
return /* @__PURE__ */ n.createElement(
|
|
471
|
+
return /* @__PURE__ */ n.createElement(Ke, null, /* @__PURE__ */ n.createElement(le, {
|
|
472
472
|
id: y,
|
|
473
473
|
"aria-hidden": "true"
|
|
474
|
-
}, m), /* @__PURE__ */ n.createElement(
|
|
474
|
+
}, m), /* @__PURE__ */ n.createElement(ze, {
|
|
475
475
|
className: e,
|
|
476
476
|
"aria-labelledby": c ? `${c} ${y}` : y,
|
|
477
477
|
value: d,
|
|
@@ -493,7 +493,7 @@ l.CountryPopover = ft;
|
|
|
493
493
|
l.CountryOptions = b;
|
|
494
494
|
l.PhoneNumber = yt;
|
|
495
495
|
l.Description = Ue;
|
|
496
|
-
l.Error =
|
|
496
|
+
l.Error = Ge;
|
|
497
497
|
const bt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
498
498
|
width: 24,
|
|
499
499
|
height: 24,
|
|
@@ -540,7 +540,7 @@ const bt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
|
540
540
|
className: h.chevron,
|
|
541
541
|
"aria-hidden": "true"
|
|
542
542
|
}, /* @__PURE__ */ n.createElement(tt, null)), mn = () => {
|
|
543
|
-
const e = et(Fe, O.selectOptionWithoutFocusRing, h.option,
|
|
543
|
+
const e = et(Fe, O.selectOptionWithoutFocusRing, h.option, Z), t = re(De, [
|
|
544
544
|
h.control
|
|
545
545
|
]), r = re(Pe, [
|
|
546
546
|
h.countrySearch
|
|
@@ -550,7 +550,7 @@ const bt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
|
550
550
|
}, /* @__PURE__ */ n.createElement(Nt, {
|
|
551
551
|
className: h.searchIcon
|
|
552
552
|
}), /* @__PURE__ */ n.createElement(l.CountryOptions.Search.Input, {
|
|
553
|
-
className: g(O.innerInput,
|
|
553
|
+
className: g(O.innerInput, Z),
|
|
554
554
|
placeholder: o("field.phone.country-search-input.placeholder")
|
|
555
555
|
})), c = /* @__PURE__ */ n.createElement(l.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), u = /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(l.CountryButton.Flag, {
|
|
556
556
|
className: h.flag
|
|
@@ -586,7 +586,7 @@ const bt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
|
586
586
|
offset: 0,
|
|
587
587
|
"aria-label": o("field.phone.country-code.aria-label")
|
|
588
588
|
}, s, c, i)), /* @__PURE__ */ n.createElement(l.NativeCountrySelect, {
|
|
589
|
-
className: g(h.nativeCountrySelect,
|
|
589
|
+
className: g(h.nativeCountrySelect, Z)
|
|
590
590
|
}, /* @__PURE__ */ n.createElement("span", {
|
|
591
591
|
className: h.nativeCountryDisplay,
|
|
592
592
|
"aria-hidden": "true"
|