@wix/form-elements 1.146.0 → 1.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/{appointment-rac-scUix9QX.js → appointment-rac-BNqXl3dq.js} +168 -164
- package/dist/component/{bookings-address-rac-CKemkJOO.js → bookings-address-rac-DzLf588z.js} +1 -1
- package/dist/component/{bookings-email-rac-CDqdhPAB.js → bookings-email-rac-BCNWH7ss.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DEy_7Hjb.js → bookings-first-name-rac-D36aHUOJ.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl4xy9lB.js → bookings-header-rac-CNr2y2ES.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsL9xQ1W.js → bookings-last-name-rac-yHE6ZIxr.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DkHYQ4No.js → bookings-login-bar-rac-C3weOc1i.js} +6 -6
- package/dist/component/{bookings-phone-rac-BoBiFwbV.js → bookings-phone-rac-CIo_ApRf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DZZnPKWA.js → bookings-rich-text-rac-rgKnvt57.js} +1 -1
- package/dist/component/{checkbox-field-rac-UgLmJxB-.js → checkbox-field-rac-CMaVxLNe.js} +9 -7
- package/dist/component/{checkbox-group-field-headless-C809nB0Q.js → checkbox-group-field-headless-XPtqS8Km.js} +68 -68
- package/dist/component/{checkbox-group-field-rac-u4i4wG21.js → checkbox-group-field-rac-C_58XfQt.js} +9 -9
- package/dist/component/{checkbox-group-rac-DBAQhSo3.js → checkbox-group-rac-FQrWViSh.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-6173wvuW.js → checkbox-indicator-module-classes-akWZsZNn.js} +1 -1
- package/dist/component/{checkbox-rac-FDQVsI5-.js → checkbox-rac-C5Lj2b1N.js} +1 -1
- package/dist/component/{contacts-address-rac-DnArylPa.js → contacts-address-rac-OhpLzD0X.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-C19jhGEO.js → contacts-birthdate-rac-Dnqq84ct.js} +1 -1
- package/dist/component/{contacts-company-rac-Dxs0hs_i.js → contacts-company-rac-DMnTF55t.js} +1 -1
- package/dist/component/{contacts-email-rac-D-H43L8r.js → contacts-email-rac-DmZhScW2.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DwV5NESk.js → contacts-first-name-rac-B6A4fuzK.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C5v2xurf.js → contacts-last-name-rac-DVz97lew.js} +1 -1
- package/dist/component/{contacts-phone-rac-D9a5x-xl.js → contacts-phone-rac-DV8aO0uS.js} +1 -1
- package/dist/component/{contacts-position-rac-DfsgOv-k.js → contacts-position-rac-BP_yBIE4.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-B-Hho0Kb.js → contacts-subscribe-rac-wmTprtLf.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-q6TQkB4b.js → contacts-tax-id-rac-CUEPBQye.js} +1 -1
- package/dist/component/{date-availability-CMDvf5VU.js → date-availability-BK_0gLRv.js} +1 -1
- package/dist/component/{date-input-field-rac-C1WLUct3.js → date-input-field-rac-BfWPvRnd.js} +84 -78
- package/dist/component/{date-input-rac-cNQ-nr4D.js → date-input-rac-B7vAMRBX.js} +1 -1
- package/dist/component/{date-picker-field-rac-mx11z-MO.js → date-picker-field-rac-CpDY4EkU.js} +111 -105
- package/dist/component/{date-picker-rac-DeTz17zC.js → date-picker-rac-BCswaZB1.js} +1 -1
- package/dist/component/{date-time-input-field-rac-feQ2E1eU.js → date-time-input-field-rac-D9w4eEa0.js} +135 -129
- package/dist/component/{date-time-input-rac-G0s0xP4v.js → date-time-input-rac-_im8-JRC.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BcTN1nJb.js → dext-checkbox-group-rac-Di7B1Wzv.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DX0TOrCO.js → dext-checkbox-rac-BPendOsP.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CpDp11oa.js → dext-date-picker-rac-_-Ig9Qn6.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BRvO8izU.js → dext-date-time-input-rac-dKFW87yu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DGZ4Yi_X.js → dext-dropdown-rac-Cpdpps7P.js} +1 -1
- package/dist/component/{dext-email-rac-B9YCFHB4.js → dext-email-rac-D4UmYH5m.js} +1 -1
- package/dist/component/{dext-number-input-rac-D890dBZf.js → dext-number-input-rac-DUetGnYJ.js} +1 -1
- package/dist/component/{dext-phone-rac-BAQftbXo.js → dext-phone-rac-Bsz_DAT9.js} +1 -1
- package/dist/component/dext-radio-group-rac-B_soj2FD.js +18 -0
- package/dist/component/{dext-rating-input-rac-BqQKVaHo.js → dext-rating-input-rac-cm40qt4O.js} +1 -1
- package/dist/component/{dext-tags-rac-zxxKcNUe.js → dext-tags-rac-D1ULx6t1.js} +2 -2
- package/dist/component/{dext-text-area-rac-Ctp9SwPg.js → dext-text-area-rac-IkL67rHB.js} +1 -1
- package/dist/component/{dext-text-input-rac-c_QMlyjr.js → dext-text-input-rac-DsYSTEL2.js} +1 -1
- package/dist/component/{dext-url-input-rac-96pv15aC.js → dext-url-input-rac-BKvEkpYu.js} +1 -1
- package/dist/component/{donation-rac-GEWKSLJY.js → donation-rac-CaCXMa-H.js} +87 -85
- package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-DcrQK8mL.js} +36 -34
- package/dist/component/{dropdown-field-rac-CCXfBmSc.js → dropdown-field-rac-CuGoz_6I.js} +9 -10
- package/dist/component/{dropdown-rac-CR7hswXE.js → dropdown-rac-rIe6ZqaZ.js} +1 -1
- package/dist/component/{ecom-address-rac-khMuxEFD.js → ecom-address-rac-DT0rzvvp.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CAi_AHpb.js → ecom-subscription-checkbox-rac-ZfbiME6e.js} +5 -5
- package/dist/component/{email-input-field-rac-B83mY2lg.js → email-input-field-rac-8Qn3yskh.js} +62 -62
- package/dist/component/{events-repeater-rac-ClEwXgmb.js → events-repeater-rac-DyHrMd3y.js} +25 -21
- package/dist/component/{events-rsvp-rac-BJ5q2SVR.js → events-rsvp-rac-CoL-euuc.js} +9 -9
- package/dist/component/{field-error-headless-CsYQCsiT.js → field-error-headless-RylIeqXr.js} +6 -6
- package/dist/component/{field-label-headless-Yg_1PMSg.js → field-label-headless-d3hZxIEc.js} +15 -15
- package/dist/component/field-rac.module-DP0lkkEv.js +25 -0
- package/dist/component/{file-upload-rac-DJsuI_lR.js → file-upload-rac-rXbabrgc.js} +172 -168
- package/dist/component/{fixed-payment-rac-BMFe9wxU.js → fixed-payment-rac-CaR7pXXA.js} +13 -13
- package/dist/component/{form-Bed4Kfz8.js → form-DhIEC3nB.js} +2309 -2308
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-DPQTrOSZ.js → header-field-rac-nELbyGjP.js} +4 -4
- package/dist/component/{header-rac-CzXsuLmE.js → header-rac-q80EQNmM.js} +1 -1
- package/dist/component/{image-choice-rac-R_4pbOSr.js → image-choice-rac-CLMiTQK0.js} +42 -42
- package/dist/component/{index-DZxHlvzt.js → index-C-jVrv9Y.js} +91 -91
- package/dist/component/{index-qSZCe_WC.js → index-DnLJzPM-.js} +2 -2
- package/dist/component/{isObjectLike-B-a5uaU-.js → isObjectLike-Bf577MHV.js} +15 -15
- package/dist/component/{multiline-address-field-rac-rv4IZZy_.js → multiline-address-field-rac-BVAv1w9F.js} +155 -137
- package/dist/component/{multiline-address-rac-DZ7cYtgn.js → multiline-address-rac-qMuUHA9U.js} +1 -1
- package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-B_vnBWFG.js} +24 -22
- package/dist/component/{number-input-rac-BeGn6qJR.js → number-input-rac-BPCIW8Fz.js} +1 -1
- package/dist/component/{password-rac-DfvhdsKG.js → password-rac-D72HG72u.js} +28 -26
- package/dist/component/{payment-input-rac-BmMfi5rf.js → payment-input-rac-DthVgsAi.js} +32 -30
- package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-XIPkH8Fb.js} +46 -46
- package/dist/component/{phone-rac-quZjJ08H.js → phone-rac-U94fCfer.js} +1 -1
- package/dist/component/{product-list-rac-Ci0KB7sN.js → product-list-rac-BRMGPyhr.js} +78 -78
- package/dist/component/{quiz-radio-group-rac--UUtGx2t.js → quiz-radio-group-rac-DafNzzgX.js} +1 -1
- package/dist/component/radio-button-module-classes-DtFlHID_.js +134 -0
- package/dist/component/{radio-group-field-rac-w8fHpFKJ.js → radio-group-field-rac-BXrYWjew.js} +13 -13
- package/dist/component/{radio-group-rac-jO8aghii.js → radio-group-rac-BNyFfQYV.js} +1 -1
- package/dist/component/{rating-input-field-rac-BRc2PtqE.js → rating-input-field-rac-KbkiVCZ7.js} +27 -27
- package/dist/component/{rating-input-rac-D9zs06xR.js → rating-input-rac-zT4vPkwP.js} +1 -1
- package/dist/component/{rich-content-rac.module-Cv3ZmD00.js → rich-content-rac.module-C0OQetct.js} +8 -8
- package/dist/component/{rich-text-field-rac-BmWuIfA8.js → rich-text-field-rac-T4NoShC0.js} +4 -4
- package/dist/component/{rich-text-rac-BnqnrvB1.js → rich-text-rac-m6VRCRZu.js} +1 -1
- package/dist/component/{service-dropdown-rac-Cl81KfJU.js → service-dropdown-rac-BFwKhL1l.js} +44 -45
- package/dist/component/{services-multi-choice-rac-sQ1NF9hY.js → services-multi-choice-rac-DjzcuRWv.js} +13 -13
- package/dist/component/{signature-rac-Huairu7V.js → signature-rac-B1LPKnIw.js} +281 -279
- package/dist/component/{submit-button-rac-Dpg7N0TG.js → submit-button-rac-Cz3PVtW4.js} +25 -25
- package/dist/component/{tags-field-rac-BQ8TEqXH.js → tags-field-rac-DzSoL__s.js} +82 -82
- package/dist/component/{tags-rac-CFOmyCCc.js → tags-rac-DMYJDrm-.js} +1 -1
- package/dist/component/{text-area-field-rac-DNiMa7d3.js → text-area-field-rac-SuMzBm-Q.js} +30 -28
- package/dist/component/{text-area-rac-kLFe-KbZ.js → text-area-rac-C-zmnJgt.js} +1 -1
- package/dist/component/{text-input-field-rac-CqENSUUX.js → text-input-field-rac-BmQlXTK9.js} +6 -6
- package/dist/component/text-input-headless-BsrjGTK4.js +47 -0
- package/dist/component/{text-input-rac-uYQEfOtE.js → text-input-rac-DhQFKG4h.js} +1 -1
- package/dist/component/time-input-rac-CRZZdbTI.js +161 -0
- package/dist/component/{url-input-field-rac-BioH7kuz.js → url-input-field-rac-D617Pvsf.js} +30 -28
- package/dist/component/{url-input-rac-D2VSSyqW.js → url-input-rac-CLvxaWZz.js} +1 -1
- package/dist/component/use-dropdown-trigger-class-name-C4uqTKFP.js +117 -0
- package/dist/component/{use-element-state-class-name-oiKCauK-.js → use-element-state-class-name-DJx-T0zf.js} +3 -3
- package/dist/component/use-hoverable-input-class-name-pwVZXwrY.js +25 -0
- package/dist/component/use-is-forced-open-dropdown-DBpm1D-o.js +48 -0
- package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-xHeVTve3.js} +6 -6
- package/dist/component/use-text-input-class-name-CrEjJ2Z8.js +6 -0
- package/dist/form.d.ts +5 -0
- package/package.json +2 -2
- package/dist/component/dext-radio-group-rac-CtEjnu_X.js +0 -18
- package/dist/component/field-rac.module-DfEb7pBp.js +0 -25
- package/dist/component/radio-button-module-classes-CqdBGknT.js +0 -132
- package/dist/component/text-input-headless-BdPkEeK2.js +0 -45
- package/dist/component/time-input-rac-BYoojlJ9.js +0 -159
- package/dist/component/use-dropdown-option-class-name-BEmvU-Gg.js +0 -115
- package/dist/component/use-dropdown-trigger-class-name-qj9skLWZ.js +0 -40
- package/dist/component/use-hoverable-input-class-name-BW3nCyhG.js +0 -25
- package/dist/component/use-text-input-class-name-BhQFcXYH.js +0 -6
package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-B_vnBWFG.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RicosViewer as P } from "@wix/ricos/viewer";
|
|
2
2
|
import i from "classnames";
|
|
3
|
-
import r, { useState as
|
|
3
|
+
import r, { useState as H, useCallback as Q, useEffect as U, useRef as $ } from "react";
|
|
4
4
|
import { NumberField as j, Input as z } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { bo as S, bl as _, by as G, bq as J, S as K, a0 as W, H as X, v as Y } from "./form-DhIEC3nB.js";
|
|
6
6
|
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as Z, E as w } from "./field-error-headless-
|
|
8
|
-
import { L as ee } from "./field-label-headless-
|
|
7
|
+
import { D as Z, E as w } from "./field-error-headless-RylIeqXr.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-d3hZxIEc.js";
|
|
9
9
|
import { g as re, c as te } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
10
|
import { u as ne } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
-
import { s as p } from "./field-rac.module-
|
|
13
|
-
import { u as se } from "./use-text-input-class-name-
|
|
12
|
+
import { s as p } from "./field-rac.module-DP0lkkEv.js";
|
|
13
|
+
import { u as se } from "./use-text-input-class-name-CrEjJ2Z8.js";
|
|
14
14
|
const e = ({ children: t }) => {
|
|
15
|
-
var F,
|
|
16
|
-
const { id: a, value: s, onChange: l, disabled: d, required: b, readOnly: o, onBlur: E, onFocus: f, FieldLayout: m, hasError: u, validation: n } =
|
|
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 } = S(), { labelId: y } = _(), 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, g = (R = n == null ? void 0 : n.number) == null ? void 0 : R.minimum, q = O(s), [x, I] = H(q), T = ne(E), V = c(t, e.Label), h = c(t, e.Input), M = c(t, e.Description), k = c(t, e.Error), B = Q((N) => {
|
|
17
17
|
if (N === void 0 || Number.isNaN(N)) {
|
|
18
18
|
l(""), I(NaN);
|
|
19
19
|
return;
|
|
@@ -24,36 +24,38 @@ const e = ({ children: t }) => {
|
|
|
24
24
|
D,
|
|
25
25
|
l
|
|
26
26
|
]);
|
|
27
|
-
return
|
|
27
|
+
return U(() => {
|
|
28
28
|
I(O(s));
|
|
29
29
|
}, [
|
|
30
30
|
s
|
|
31
31
|
]), /* @__PURE__ */ r.createElement(m, {
|
|
32
32
|
fieldId: a,
|
|
33
|
-
renderLabel: () =>
|
|
33
|
+
renderLabel: () => V,
|
|
34
34
|
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
35
|
-
"aria-labelledby":
|
|
36
|
-
value:
|
|
35
|
+
"aria-labelledby": y,
|
|
36
|
+
value: x,
|
|
37
37
|
onChange: B,
|
|
38
38
|
isDisabled: d,
|
|
39
39
|
isRequired: b,
|
|
40
40
|
isReadOnly: o,
|
|
41
41
|
isInvalid: u,
|
|
42
|
-
onBlur:
|
|
42
|
+
onBlur: T,
|
|
43
43
|
onFocus: f,
|
|
44
|
-
minValue:
|
|
45
|
-
maxValue:
|
|
46
|
-
},
|
|
47
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
44
|
+
minValue: g ?? void 0,
|
|
45
|
+
maxValue: A ?? void 0
|
|
46
|
+
}, h),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, M)
|
|
48
48
|
});
|
|
49
49
|
}, le = ({ className: t }) => {
|
|
50
50
|
var u;
|
|
51
|
-
const { t: a } =
|
|
51
|
+
const { t: a } = G(), { inputId: s, ariaDescribedBy: l } = _(), { id: d, placeholder: b, validation: o, label: E, required: f } = S();
|
|
52
52
|
(u = o == null ? void 0 : o.number) != null && u.multipleOf;
|
|
53
|
-
const m =
|
|
53
|
+
const m = $(null);
|
|
54
54
|
return J(() => {
|
|
55
55
|
var n;
|
|
56
|
-
(n = m.current) == null || n.focus(
|
|
56
|
+
(n = m.current) == null || n.focus({
|
|
57
|
+
preventScroll: !0
|
|
58
|
+
});
|
|
57
59
|
}, d), /* @__PURE__ */ r.createElement(z, {
|
|
58
60
|
ref: m,
|
|
59
61
|
id: s,
|
|
@@ -73,7 +75,7 @@ e.Error = w;
|
|
|
73
75
|
const O = (t) => te(t) ?? NaN, oe = ({ content: t, locale: a }) => /* @__PURE__ */ r.createElement(P, {
|
|
74
76
|
content: t,
|
|
75
77
|
locale: a
|
|
76
|
-
}),
|
|
78
|
+
}), Le = () => {
|
|
77
79
|
const t = se();
|
|
78
80
|
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
79
81
|
className: i(K, p.label)
|
|
@@ -88,5 +90,5 @@ const O = (t) => te(t) ?? NaN, oe = ({ content: t, locale: a }) => /* @__PURE__
|
|
|
88
90
|
}, oe));
|
|
89
91
|
};
|
|
90
92
|
export {
|
|
91
|
-
|
|
93
|
+
Le as N
|
|
92
94
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import e, { useState as
|
|
1
|
+
import e, { useState as N, useRef as x } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as k, Group as q, Input as
|
|
4
|
+
import { bo as E, bl as I, bq as v, by as A, S as B, a0 as V, H as P, v as M } from "./form-DhIEC3nB.js";
|
|
5
|
+
import { TextField as k, Group as q, Input as H, Button as U } from "react-aria-components";
|
|
6
6
|
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { E as
|
|
10
|
-
import { H as
|
|
11
|
-
import { s as p } from "./field-rac.module-
|
|
12
|
-
import { u as
|
|
7
|
+
import { D as j, E as W } from "./field-error-headless-RylIeqXr.js";
|
|
8
|
+
import { L as Z } from "./field-label-headless-d3hZxIEc.js";
|
|
9
|
+
import { E as G } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
+
import { H as Q } from "./custom-focus-class-_483Pkwp.js";
|
|
11
|
+
import { s as p } from "./field-rac.module-DP0lkkEv.js";
|
|
12
|
+
import { u as $ } from "./use-text-input-class-name-CrEjJ2Z8.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:
|
|
15
|
-
return /* @__PURE__ */ e.createElement(
|
|
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: R } = I(), [D, F] = N(!1), L = u(o, t.Label), T = u(o, t.Control), S = u(o, t.Description), w = u(o, t.Error);
|
|
15
|
+
return /* @__PURE__ */ e.createElement(_, {
|
|
16
16
|
fieldId: l,
|
|
17
17
|
renderLabel: () => L,
|
|
18
18
|
renderInput: () => /* @__PURE__ */ e.createElement(k, {
|
|
19
|
-
autoComplete:
|
|
19
|
+
autoComplete: y,
|
|
20
20
|
"aria-labelledby": R,
|
|
21
21
|
value: s ?? "",
|
|
22
22
|
onChange: c,
|
|
@@ -29,9 +29,9 @@ const t = ({ children: o, className: r }) => {
|
|
|
29
29
|
className: r
|
|
30
30
|
}, b(T, {
|
|
31
31
|
isVisible: D,
|
|
32
|
-
onToggleVisibility: () => F((
|
|
32
|
+
onToggleVisibility: () => F((h) => !h)
|
|
33
33
|
})),
|
|
34
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
34
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, S, w)
|
|
35
35
|
});
|
|
36
36
|
}, z = ({ 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);
|
|
@@ -47,10 +47,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
47
47
|
}));
|
|
48
48
|
}, J = ({ className: o, ...r }) => {
|
|
49
49
|
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = x(null);
|
|
50
|
-
return
|
|
50
|
+
return v(() => {
|
|
51
51
|
var i;
|
|
52
|
-
(i = a.current) == null || i.focus(
|
|
53
|
-
|
|
52
|
+
(i = a.current) == null || i.focus({
|
|
53
|
+
preventScroll: !0
|
|
54
|
+
});
|
|
55
|
+
}, s), /* @__PURE__ */ e.createElement(H, {
|
|
54
56
|
ref: a,
|
|
55
57
|
id: n,
|
|
56
58
|
type: l ? "text" : "password",
|
|
@@ -60,7 +62,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
60
62
|
});
|
|
61
63
|
}, K = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
62
64
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
63
|
-
return /* @__PURE__ */ e.createElement(
|
|
65
|
+
return /* @__PURE__ */ e.createElement(U, {
|
|
64
66
|
type: "button",
|
|
65
67
|
isDisabled: a,
|
|
66
68
|
onPress: m,
|
|
@@ -71,12 +73,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
71
73
|
isVisible: n
|
|
72
74
|
}));
|
|
73
75
|
};
|
|
74
|
-
t.Label =
|
|
76
|
+
t.Label = Z;
|
|
75
77
|
t.Control = z;
|
|
76
78
|
t.Input = J;
|
|
77
79
|
t.Toggle = K;
|
|
78
|
-
t.Description =
|
|
79
|
-
t.Error =
|
|
80
|
+
t.Description = j;
|
|
81
|
+
t.Error = W;
|
|
80
82
|
const X = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
81
83
|
viewBox: "0 0 24 24",
|
|
82
84
|
width: "20",
|
|
@@ -119,22 +121,22 @@ const X = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
119
121
|
content: o,
|
|
120
122
|
locale: r
|
|
121
123
|
}), re = () => {
|
|
122
|
-
const { t: o } =
|
|
124
|
+
const { t: o } = A(), r = $(g.control);
|
|
123
125
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
124
|
-
className: d(
|
|
126
|
+
className: d(B, p.label)
|
|
125
127
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
126
|
-
className: d(
|
|
128
|
+
className: d(V, p.requiredMark)
|
|
127
129
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
128
130
|
className: r
|
|
129
131
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
130
|
-
className: d(p.innerInput,
|
|
132
|
+
className: d(p.innerInput, Q)
|
|
131
133
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
132
134
|
className: g.toggleButton,
|
|
133
135
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
134
136
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
135
137
|
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(Y, null) : /* @__PURE__ */ e.createElement(X, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
136
138
|
className: d(P, p.error)
|
|
137
|
-
}, /* @__PURE__ */ e.createElement(
|
|
139
|
+
}, /* @__PURE__ */ e.createElement(G, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
138
140
|
className: d(M, p.description)
|
|
139
141
|
}, oe));
|
|
140
142
|
}, ge = () => /* @__PURE__ */ e.createElement(re, null);
|
|
@@ -2,16 +2,16 @@ import r, { useCallback as P, useRef as j } from "react";
|
|
|
2
2
|
import { RicosViewer as w } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
4
|
import { TextField as z, Group as J, Input as K } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { bo as R, bl as S, bg as T, by as W, bq as X, S as Y, a0 as Z, H as ee, v as re } from "./form-DhIEC3nB.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-RylIeqXr.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-d3hZxIEc.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
|
-
import { s as d } from "./field-rac.module-
|
|
14
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
13
|
+
import { s as d } from "./field-rac.module-DP0lkkEv.js";
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-CrEjJ2Z8.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -19,7 +19,7 @@ function ue(e, t) {
|
|
|
19
19
|
quantity: 1
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function h(e) {
|
|
23
23
|
if (e == null || e === "")
|
|
24
24
|
return;
|
|
25
25
|
const t = Number(String(e).replace(/,/g, "."));
|
|
@@ -27,62 +27,62 @@ function x(e) {
|
|
|
27
27
|
}
|
|
28
28
|
const n = ({ children: e }) => {
|
|
29
29
|
var O, g, A, V;
|
|
30
|
-
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: I, hasError: y, onBlur: o, onFocus: E, FieldLayout: M, validation: C } =
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: I, hasError: y, onBlur: o, onFocus: E, FieldLayout: M, validation: C } = R(), { labelId: q, prefixId: G } = S(), { regionalFormat: c } = T(), D = (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, b] = oe({
|
|
31
31
|
sourceValue: _,
|
|
32
|
-
format: (l) =>
|
|
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
|
b(l || ""), o == null || o();
|
|
37
37
|
}, [
|
|
38
38
|
F,
|
|
39
39
|
c,
|
|
40
40
|
o,
|
|
41
41
|
b
|
|
42
|
-
]),
|
|
42
|
+
]), v = P((l) => {
|
|
43
43
|
b(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(
|
|
51
|
+
ue(D, L)
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
54
|
}, [
|
|
55
55
|
s,
|
|
56
|
-
|
|
56
|
+
D,
|
|
57
57
|
c,
|
|
58
58
|
_,
|
|
59
59
|
b
|
|
60
|
-
]), B = i(e, n.Label),
|
|
60
|
+
]), B = i(e, n.Label), H = i(e, n.Input), U = i(e, n.Description), k = i(e, n.Error);
|
|
61
61
|
return /* @__PURE__ */ r.createElement(M, {
|
|
62
62
|
fieldId: t,
|
|
63
63
|
renderLabel: () => B,
|
|
64
64
|
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
65
|
-
"aria-labelledby": `${
|
|
65
|
+
"aria-labelledby": `${q} ${G}`,
|
|
66
66
|
value: a ? F : "",
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: v,
|
|
68
68
|
isDisabled: u,
|
|
69
69
|
isReadOnly: m,
|
|
70
70
|
isRequired: I,
|
|
71
71
|
isInvalid: y,
|
|
72
|
-
onBlur:
|
|
72
|
+
onBlur: $,
|
|
73
73
|
onFocus: E
|
|
74
|
-
},
|
|
75
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
74
|
+
}, H),
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, U)
|
|
76
76
|
});
|
|
77
77
|
}, f = ({ children: e, className: t }) => {
|
|
78
|
-
const { disabled: a, hasError: s } =
|
|
78
|
+
const { disabled: a, hasError: s } = R(), u = i(e, f.Currency), m = i(e, f.Value);
|
|
79
79
|
return /* @__PURE__ */ r.createElement(J, {
|
|
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 } = T(), { t: a } = W(), { prefixId: s } =
|
|
85
|
+
const { currency: t } = T(), { t: a } = W(), { prefixId: s } = S();
|
|
86
86
|
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
87
87
|
id: s,
|
|
88
88
|
"aria-hidden": !1,
|
|
@@ -90,10 +90,12 @@ 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 } =
|
|
93
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: I, ariaDescribedBy: y } = S(), o = j(null);
|
|
94
94
|
return X(() => {
|
|
95
95
|
var E;
|
|
96
|
-
(E = o.current) == null || E.focus(
|
|
96
|
+
(E = o.current) == null || E.focus({
|
|
97
|
+
preventScroll: !0
|
|
98
|
+
});
|
|
97
99
|
}, t), /* @__PURE__ */ r.createElement(K, {
|
|
98
100
|
ref: o,
|
|
99
101
|
id: u,
|
|
@@ -112,14 +114,14 @@ n.Label = ae;
|
|
|
112
114
|
n.Input = f;
|
|
113
115
|
n.Description = te;
|
|
114
116
|
n.Error = ne;
|
|
115
|
-
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14",
|
|
117
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
116
118
|
inputGroup: de,
|
|
117
119
|
currency: fe
|
|
118
120
|
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(w, {
|
|
119
121
|
content: e,
|
|
120
122
|
locale: t
|
|
121
123
|
}), be = () => {
|
|
122
|
-
const e = ie(
|
|
124
|
+
const e = ie(x.inputGroup);
|
|
123
125
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
124
126
|
className: p(Y, d.label)
|
|
125
127
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
@@ -127,7 +129,7 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", h = {
|
|
|
127
129
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
128
130
|
className: e
|
|
129
131
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
130
|
-
className:
|
|
132
|
+
className: x.currency
|
|
131
133
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
132
134
|
className: p(d.innerInput, ce)
|
|
133
135
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-XIPkH8Fb.js}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { RicosViewer as Ce } from "@wix/ricos/viewer";
|
|
2
2
|
import h from "classnames";
|
|
3
|
-
import t, { useMemo as
|
|
4
|
-
import {
|
|
3
|
+
import t, { useMemo as j, useState as $, useRef as F, useEffect as k, useCallback as W, createContext as ee, useContext as H, useId as de } from "react";
|
|
4
|
+
import { b7 as ye, by as D, bg as te, bx as Ee, bo as w, bl as ne, bq as fe, S as ge, a0 as he, R as be, y as Oe, H as _e, v as Ne } from "./form-DhIEC3nB.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as Se } from "react-aria";
|
|
6
|
-
import { Dialog as oe, OverlayTriggerStateContext as Le, ModalOverlay as Ie, Modal as ve, SearchField as Pe, Group as q, ListBoxItem as Fe, DialogTrigger as
|
|
6
|
+
import { Dialog as oe, OverlayTriggerStateContext as Le, ModalOverlay as Ie, Modal as ve, SearchField as Pe, Group as q, ListBoxItem as Fe, DialogTrigger as De, Select as we, Input as re, Autocomplete as Be } from "react-aria-components";
|
|
7
7
|
import { f as g, a as I } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as Re, E as xe } from "./field-error-headless-
|
|
9
|
-
import { L as Me } from "./field-label-headless-
|
|
10
|
-
import { N as Te, S as
|
|
11
|
-
import { u as
|
|
12
|
-
import { a as Ae
|
|
13
|
-
import { V as
|
|
14
|
-
import ae, { AsYouType as qe, isValidPhoneNumber as
|
|
8
|
+
import { D as Re, E as xe } from "./field-error-headless-RylIeqXr.js";
|
|
9
|
+
import { L as Me } from "./field-label-headless-d3hZxIEc.js";
|
|
10
|
+
import { N as Te, S as je } from "./non-modal-popover-D-u13tmp.js";
|
|
11
|
+
import { u as $e } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
+
import { a as Ae } from "./use-is-forced-open-dropdown-DBpm1D-o.js";
|
|
13
|
+
import { V as ke, u as Ue, a as Ve } from "./use-dropdown-trigger-class-name-C4uqTKFP.js";
|
|
14
|
+
import ae, { AsYouType as qe, isValidPhoneNumber as He, isSupportedCountry as Ge } from "libphonenumber-js";
|
|
15
15
|
import "libphonenumber-js/metadata.min.json";
|
|
16
|
-
import { C as
|
|
16
|
+
import { C as Z } from "./calling-country-codes-PyWuOTmF.js";
|
|
17
17
|
import { C as Ye } from "./chevron-down-icon-CcpVm6B-.js";
|
|
18
18
|
import { E as ze } from "./error-icon-hZxQ6DEy.js";
|
|
19
|
-
import { H as
|
|
20
|
-
import { s as O } from "./field-rac.module-
|
|
21
|
-
import { u as Ke } from "./use-text-input-class-name-
|
|
19
|
+
import { H as Q } from "./custom-focus-class-_483Pkwp.js";
|
|
20
|
+
import { s as O } from "./field-rac.module-DP0lkkEv.js";
|
|
21
|
+
import { u as Ke } from "./use-text-input-class-name-CrEjJ2Z8.js";
|
|
22
22
|
function J(e) {
|
|
23
23
|
const n = e ? ae(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
24
|
if (r)
|
|
@@ -26,7 +26,7 @@ function J(e) {
|
|
|
26
26
|
const o = new qe();
|
|
27
27
|
return e && o.input(e), o.getCountry();
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function G(e) {
|
|
30
30
|
var n;
|
|
31
31
|
return e && ((n = ye.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
32
32
|
}
|
|
@@ -37,17 +37,17 @@ function X(e, n) {
|
|
|
37
37
|
if (e && n)
|
|
38
38
|
try {
|
|
39
39
|
const r = ae(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
40
|
-
if (o &&
|
|
40
|
+
if (o && He(o))
|
|
41
41
|
return o.replace(/\s+/g, "");
|
|
42
42
|
} catch {
|
|
43
43
|
}
|
|
44
44
|
return e;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const { t: e } =
|
|
48
|
-
return
|
|
49
|
-
const c =
|
|
50
|
-
return l &&
|
|
46
|
+
function We() {
|
|
47
|
+
const { t: e } = D(), { language: n } = te();
|
|
48
|
+
return j(() => Object.keys(Z).reduce((o, a) => {
|
|
49
|
+
const c = Z[a], l = G(c), i = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
50
|
+
return l && Ge(a) && o.push({
|
|
51
51
|
countryName: i,
|
|
52
52
|
longCountryCode: c,
|
|
53
53
|
shortCountryCode: a,
|
|
@@ -58,10 +58,10 @@ function Qe() {
|
|
|
58
58
|
n
|
|
59
59
|
]);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ze(e, n) {
|
|
62
62
|
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Qe(e, n) {
|
|
65
65
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
66
66
|
return !!(V(r, n) || V(o, n) || V(a, n));
|
|
67
67
|
}
|
|
@@ -69,11 +69,11 @@ function V(e, n) {
|
|
|
69
69
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
70
70
|
}
|
|
71
71
|
function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
72
|
-
const [a, c] =
|
|
72
|
+
const [a, c] = $(e || ""), l = F(U(e ?? null) ?? ""), [i, u] = $(n);
|
|
73
73
|
Ee(() => {
|
|
74
74
|
c(""), l.current = "", u(n), o("");
|
|
75
75
|
});
|
|
76
|
-
const m =
|
|
76
|
+
const m = j(() => J(a), [
|
|
77
77
|
a
|
|
78
78
|
]);
|
|
79
79
|
k(() => {
|
|
@@ -92,7 +92,7 @@ function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
92
92
|
m,
|
|
93
93
|
n
|
|
94
94
|
]);
|
|
95
|
-
const C =
|
|
95
|
+
const C = W((p) => {
|
|
96
96
|
if (c(p), !p) {
|
|
97
97
|
l.current = "", o(null);
|
|
98
98
|
return;
|
|
@@ -105,7 +105,7 @@ function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
105
105
|
}, [
|
|
106
106
|
r,
|
|
107
107
|
o
|
|
108
|
-
]), d =
|
|
108
|
+
]), d = W((p) => {
|
|
109
109
|
u(p), c((f) => {
|
|
110
110
|
const y = U(X(f, p));
|
|
111
111
|
return l.current = y ?? "", o(y), f;
|
|
@@ -121,12 +121,12 @@ function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
const se = /* @__PURE__ */ ee(null), _ = () => {
|
|
124
|
-
const e =
|
|
124
|
+
const e = H(se);
|
|
125
125
|
if (!e)
|
|
126
126
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
127
127
|
return e;
|
|
128
128
|
}, ce = /* @__PURE__ */ ee(null), Y = () => {
|
|
129
|
-
const e =
|
|
129
|
+
const e = H(ce);
|
|
130
130
|
if (!e)
|
|
131
131
|
throw new Error("Option sub-components must be used within Option component");
|
|
132
132
|
return e;
|
|
@@ -146,10 +146,10 @@ const se = /* @__PURE__ */ ee(null), _ = () => {
|
|
|
146
146
|
});
|
|
147
147
|
}, s = ({ children: e }) => {
|
|
148
148
|
var S, P;
|
|
149
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } =
|
|
149
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = w(), [i, u] = $(null), m = (P = (S = l == null ? void 0 : l.string) == null ? void 0 : S.phoneOptions) == null ? void 0 : P.allowedCountryCodes, C = We(), d = j(() => Ze(C, m), [
|
|
150
150
|
C,
|
|
151
151
|
m
|
|
152
|
-
]), p =
|
|
152
|
+
]), p = j(() => d.map((T) => T.shortCountryCode), [
|
|
153
153
|
d
|
|
154
154
|
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: L, handleCountryCodeChange: N } = Je({
|
|
155
155
|
value: r,
|
|
@@ -179,8 +179,8 @@ const se = /* @__PURE__ */ ee(null), _ = () => {
|
|
|
179
179
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, M, x)
|
|
180
180
|
}));
|
|
181
181
|
}, K = ({ children: e, className: n }) => {
|
|
182
|
-
const { labelId: r } = ne(), { hasError: o, disabled: a, readOnly: c } =
|
|
183
|
-
return /* @__PURE__ */ t.createElement(
|
|
182
|
+
const { labelId: r } = ne(), { hasError: o, disabled: a, readOnly: c } = w(), { t: l } = D(), { selectedCountryCode: i, countries: u } = _(), m = de(), C = i ? u.find((y) => y.shortCountryCode === i) : void 0, d = C && G(C.longCountryCode) || "", p = l("field.phone.country-code.aria-label"), f = C ? `${p}, ${C.countryName}, ${d}` : p;
|
|
183
|
+
return /* @__PURE__ */ t.createElement(je, {
|
|
184
184
|
isDisabled: a || c,
|
|
185
185
|
id: m,
|
|
186
186
|
"aria-label": f,
|
|
@@ -222,7 +222,7 @@ const b = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
222
222
|
"aria-label": r
|
|
223
223
|
}, p) : p));
|
|
224
224
|
}, tt = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...c }) => {
|
|
225
|
-
const { optionsRef: l } = c, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), m =
|
|
225
|
+
const { optionsRef: l } = c, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), m = H(Le);
|
|
226
226
|
return /* @__PURE__ */ t.createElement(Ie, {
|
|
227
227
|
className: r,
|
|
228
228
|
isDismissable: !0
|
|
@@ -245,12 +245,12 @@ const b = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
245
245
|
}
|
|
246
246
|
}, e)))));
|
|
247
247
|
}, le = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
248
|
-
const { countries: o } = _(), a = g(e, b.Option), c = g(e, b.Search), l = g(e, b.EmptyState), i = /* @__PURE__ */ t.createElement(
|
|
248
|
+
const { countries: o } = _(), a = g(e, b.Option), c = g(e, b.Search), l = g(e, b.EmptyState), i = /* @__PURE__ */ t.createElement(ke, {
|
|
249
249
|
isForcedOpen: r === !0,
|
|
250
250
|
...n,
|
|
251
251
|
renderEmptyState: l ? () => l : void 0
|
|
252
252
|
}, o.map((u) => {
|
|
253
|
-
const m =
|
|
253
|
+
const m = G(u.longCountryCode) || "";
|
|
254
254
|
return I(a, {
|
|
255
255
|
key: u.shortCountryCode,
|
|
256
256
|
countryCode: u.shortCountryCode,
|
|
@@ -262,7 +262,7 @@ const b = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
262
262
|
return c ? /* @__PURE__ */ t.createElement(Be, {
|
|
263
263
|
filter: (u, m, C) => {
|
|
264
264
|
const d = o.find((p) => p.shortCountryCode === C.key);
|
|
265
|
-
return !!d &&
|
|
265
|
+
return !!d && Qe(d, m);
|
|
266
266
|
}
|
|
267
267
|
}, r ? I(c, {
|
|
268
268
|
autoFocus: !1
|
|
@@ -324,7 +324,7 @@ A.Name = me;
|
|
|
324
324
|
A.Code = pe;
|
|
325
325
|
b.Option = A;
|
|
326
326
|
const rt = ({ className: e }) => {
|
|
327
|
-
const { t: n } =
|
|
327
|
+
const { t: n } = D(), { inputId: r, ariaDescribedBy: o } = ne(), { id: a, placeholder: c, disabled: l, readOnly: i, required: u, label: m, hasError: C } = w(), { currentValue: d, handlePhoneChange: p } = _(), f = F(null);
|
|
328
328
|
return fe(() => {
|
|
329
329
|
var y;
|
|
330
330
|
(y = f.current) == null || y.focus({
|
|
@@ -347,8 +347,8 @@ const rt = ({ className: e }) => {
|
|
|
347
347
|
className: e
|
|
348
348
|
});
|
|
349
349
|
}, at = ({ children: e, ...n }) => {
|
|
350
|
-
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } =
|
|
351
|
-
return /* @__PURE__ */ t.createElement(
|
|
350
|
+
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = w(), [u, m] = $(!1), { t: C } = D(), { selectedCountryCode: d, handleCountryCodeChange: p } = _(), f = o || u && !a && !c;
|
|
351
|
+
return /* @__PURE__ */ t.createElement(we, {
|
|
352
352
|
"aria-label": C("field.phone.country-code.aria-label"),
|
|
353
353
|
value: d ?? null,
|
|
354
354
|
onChange: (y) => p(y),
|
|
@@ -365,9 +365,9 @@ const rt = ({ className: e }) => {
|
|
|
365
365
|
}));
|
|
366
366
|
}, st = ({ children: e, ...n }) => {
|
|
367
367
|
const r = n;
|
|
368
|
-
return /* @__PURE__ */ t.createElement(
|
|
368
|
+
return /* @__PURE__ */ t.createElement(De, null, g(e, s.CountryButton), I(g(e, s.CountryOptions.Modal), r));
|
|
369
369
|
}, ct = ({ children: e, className: n }) => {
|
|
370
|
-
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: m, onBlur: C } =
|
|
370
|
+
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: m, onBlur: C } = w(), d = $e(C), { countries: p } = _(), f = g(e, s.CountryDrawer), y = g(e, s.CountryPopover), L = g(e, s.PhoneNumber), N = p.length > 1, B = Ae(c) && !!y && N, R = typeof n == "function" ? ({ isHovered: v, isFocusWithin: S }) => n({
|
|
371
371
|
hasCountryOptions: N,
|
|
372
372
|
isHovered: v,
|
|
373
373
|
isFocusWithin: S
|
|
@@ -453,14 +453,14 @@ const lt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
453
453
|
}), vt = () => /* @__PURE__ */ t.createElement("span", {
|
|
454
454
|
className: E.chevron,
|
|
455
455
|
"aria-hidden": "true"
|
|
456
|
-
}, /* @__PURE__ */ t.createElement(Ye, null)),
|
|
457
|
-
const e =
|
|
456
|
+
}, /* @__PURE__ */ t.createElement(Ye, null)), Wt = () => {
|
|
457
|
+
const e = Ue(O.selectOptionWithoutFocusRing, E.option, Q), n = Ve(E.control), r = Ke(E.countrySearch), { t: o } = D(), { PortalContainer: a } = te(), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
458
458
|
className: r,
|
|
459
459
|
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
460
460
|
}, /* @__PURE__ */ t.createElement(ut, {
|
|
461
461
|
className: E.searchIcon
|
|
462
462
|
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Search.Input, {
|
|
463
|
-
className: h(O.innerInput,
|
|
463
|
+
className: h(O.innerInput, Q),
|
|
464
464
|
placeholder: o("field.phone.country-search-input.placeholder")
|
|
465
465
|
})), l = /* @__PURE__ */ t.createElement(s.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), i = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
466
466
|
className: E.flag
|
|
@@ -504,5 +504,5 @@ const lt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
504
504
|
}, It));
|
|
505
505
|
};
|
|
506
506
|
export {
|
|
507
|
-
|
|
507
|
+
Wt as P
|
|
508
508
|
};
|