@wix/form-elements 1.84.0 → 1.85.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-BSy3u0GK.js → appointment-rac-CCaJ6P5r.js} +78 -78
- package/dist/component/{bookings-address-rac-CL7Bh1yH.js → bookings-address-rac-DEt9SGPG.js} +1 -1
- package/dist/component/{bookings-email-rac-Bw9tj_tv.js → bookings-email-rac-BydOvOUZ.js} +1 -1
- package/dist/component/{bookings-first-name-rac-BOOu_AXM.js → bookings-first-name-rac-BoQki0Pb.js} +1 -1
- package/dist/component/{bookings-header-rac-3kBei7GF.js → bookings-header-rac-DK-EcXrk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CUKbu22q.js → bookings-last-name-rac-BuGIyd43.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CLrUhdX2.js → bookings-login-bar-rac-Cr500ehb.js} +6 -6
- package/dist/component/{bookings-phone-rac-7DViellg.js → bookings-phone-rac-Bq2zdMxo.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CIUZX--G.js → bookings-rich-text-rac-DRmfusX9.js} +1 -1
- package/dist/component/{checkbox-field-rac-C_jth3RK.js → checkbox-field-rac-b9mcZlMP.js} +5 -5
- package/dist/component/{checkbox-group-field-headless-D-c9Kyj8.js → checkbox-group-field-headless-BSNhdCfs.js} +30 -30
- package/dist/component/{checkbox-group-field-rac-MgGUuYII.js → checkbox-group-field-rac-BObfui8r.js} +6 -6
- package/dist/component/{checkbox-group-rac-rr1mN2EJ.js → checkbox-group-rac-CBNMgBHU.js} +1 -1
- package/dist/component/{checkbox-rac-CRsLQKhN.js → checkbox-rac-DXh-i6Ot.js} +1 -1
- package/dist/component/{contacts-address-rac-BFlNbQKh.js → contacts-address-rac-BDQLFakc.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-D7Ww3iAz.js → contacts-birthdate-rac-BUMVVVfb.js} +1 -1
- package/dist/component/{contacts-company-rac-DLl4nqH-.js → contacts-company-rac-CidGcaA3.js} +1 -1
- package/dist/component/{contacts-email-rac-K8fCs8qS.js → contacts-email-rac-GePAhKDQ.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BOTxHl3m.js → contacts-first-name-rac-kw5sIBEE.js} +1 -1
- package/dist/component/{contacts-last-name-rac-bFnG-7Hm.js → contacts-last-name-rac-DzoZKs1n.js} +1 -1
- package/dist/component/{contacts-phone-rac-B4teqDIV.js → contacts-phone-rac-CxVW4Zp0.js} +1 -1
- package/dist/component/{contacts-position-rac-CnWoXO5h.js → contacts-position-rac-CXFxlSty.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-Bco722BU.js → contacts-subscribe-rac-kpRGeELB.js} +2 -2
- package/dist/component/{contacts-tax-id-rac-QQsKhAx3.js → contacts-tax-id-rac-B5qw-rtP.js} +1 -1
- package/dist/component/{date-availability-DMbyb1GZ.js → date-availability-BCDMem-_.js} +1 -1
- package/dist/component/{date-input-field-rac-CVRjO19U.js → date-input-field-rac-BLDZ4_Mw.js} +43 -43
- package/dist/component/{date-input-rac-zi7AQ8Ai.js → date-input-rac-B1WGYKOp.js} +1 -1
- package/dist/component/{date-picker-field-rac-5H10gH9D.js → date-picker-field-rac-BNd8aZ0c.js} +20 -20
- package/dist/component/{date-picker-rac-CxWNDsyJ.js → date-picker-rac-ItWxSngw.js} +1 -1
- package/dist/component/{date-time-input-field-rac-CDa-nyf8.js → date-time-input-field-rac-Ch8z0NRT.js} +5 -5
- package/dist/component/{date-time-input-rac-DglwFYb0.js → date-time-input-rac-FebIovNN.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BBB652Uy.js → dext-checkbox-group-rac-BXYHMQ3R.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BVtiGV3w.js → dext-checkbox-rac-C78ScIGY.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Di4x6sI_.js → dext-date-picker-rac-BptT4fhe.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-agWHwUo7.js → dext-date-time-input-rac-RWJ51IjA.js} +1 -1
- package/dist/component/{dext-dropdown-rac-U3FZTA2-.js → dext-dropdown-rac-DZDOtSIG.js} +1 -1
- package/dist/component/{dext-email-rac-CZ9AQw_k.js → dext-email-rac-CJceqZsw.js} +1 -1
- package/dist/component/{dext-number-input-rac-DFr_9ZX5.js → dext-number-input-rac-buSXk49E.js} +1 -1
- package/dist/component/{dext-phone-rac-BYsfNwXn.js → dext-phone-rac-CeHUOWck.js} +1 -1
- package/dist/component/{dext-radio-group-rac-B_jm5YAT.js → dext-radio-group-rac-CNyNSfeP.js} +2 -2
- package/dist/component/{dext-rating-input-rac-CNlhMKt-.js → dext-rating-input-rac-mmdh9tYT.js} +1 -1
- package/dist/component/{dext-tags-rac-y9x8Fg54.js → dext-tags-rac-CqJ4iv-V.js} +2 -2
- package/dist/component/{dext-text-area-rac-BgRxIpn9.js → dext-text-area-rac-P1EzLNDE.js} +1 -1
- package/dist/component/{dext-text-input-rac-CdzgUZ38.js → dext-text-input-rac-Dtz4ZLj7.js} +1 -1
- package/dist/component/{dext-url-input-rac-Cg1TYyNV.js → dext-url-input-rac-DUVbW2yl.js} +1 -1
- package/dist/component/{donation-rac-Deiw7Tl9.js → donation-rac-Nn7z8_to.js} +43 -43
- package/dist/component/{dropdown-field-headless-BKj2rdy9.js → dropdown-field-headless-CT4uSCPR.js} +11 -11
- package/dist/component/{dropdown-field-rac-CIdC2_O3.js → dropdown-field-rac-CUiyFJi_.js} +5 -5
- package/dist/component/{dropdown-rac-CYxaJrXP.js → dropdown-rac-Bs_PVy1q.js} +1 -1
- package/dist/component/{ecom-address-rac-Crr3A_iU.js → ecom-address-rac-BTXwDlMM.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DdXAex4c.js → ecom-subscription-checkbox-rac-CGI84A37.js} +3 -3
- package/dist/component/{email-input-field-rac-C516Fm0v.js → email-input-field-rac-DKD7FsQX.js} +54 -54
- package/dist/component/{events-repeater-rac-DL49KaIU.js → events-repeater-rac-B7yIRlyt.js} +30 -30
- package/dist/component/{events-rsvp-rac-B5EvAP8x.js → events-rsvp-rac-C7FOuFmH.js} +3 -3
- package/dist/component/{field-error-headless-D2CJ4Qk7.js → field-error-headless-BHTkMu35.js} +1 -1
- package/dist/component/{field-label-headless-D2-WvVKT.js → field-label-headless-D3DwX65k.js} +7 -7
- package/dist/component/{file-upload-rac-BG3msdbn.js → file-upload-rac-B3n_LYYK.js} +85 -85
- package/dist/component/{fixed-payment-rac-3bI_h_W0.js → fixed-payment-rac-C6jsiS4-.js} +12 -12
- package/dist/component/{form-B3KiRFhB.js → form-BkmOXzqo.js} +2510 -2487
- package/dist/component/{form-element-classes-Ct1UaxuQ.js → form-element-classes-BsXkFtp2.js} +90 -57
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-Bp7hStrt.js → header-field-rac-FG9EP9--.js} +5 -5
- package/dist/component/{header-rac-yVYId2B_.js → header-rac-DZZgqFjW.js} +1 -1
- package/dist/component/{image-choice-rac-D1mqJfcn.js → image-choice-rac-CXgE6z_f.js} +42 -42
- package/dist/component/{index-LrdDmlej.js → index-CSwTHDCX.js} +2 -2
- package/dist/component/{index-B0PANcv8.js → index-DKV2sNhD.js} +4 -4
- package/dist/component/{isObjectLike-DH7T0Txd.js → isObjectLike-DYfHbEQ3.js} +1 -1
- package/dist/component/{multiline-address-field-rac-C-gtuNCU.js → multiline-address-field-rac-DnCOKW8F.js} +128 -128
- package/dist/component/{multiline-address-rac-B3ixmNqi.js → multiline-address-rac-BZRlzLZq.js} +1 -1
- package/dist/component/{number-input-field-rac-BNPMYFay.js → number-input-field-rac-BOJNJ50c.js} +30 -30
- package/dist/component/{number-input-rac-BaEBt2uf.js → number-input-rac-D8ZcIPwq.js} +1 -1
- package/dist/component/{password-rac-B0H_ILkt.js → password-rac-T9PR5j2v.js} +19 -19
- package/dist/component/{payment-input-rac-LIk9MP5a.js → payment-input-rac-C9N3LZOZ.js} +17 -17
- package/dist/component/{phone-input-field-rac-CUUAacDK.js → phone-input-field-rac-BxUiCV5Z.js} +40 -40
- package/dist/component/{phone-rac-BYqYOw60.js → phone-rac-BjKFrr86.js} +1 -1
- package/dist/component/{product-list-rac-CvoI6ajr.js → product-list-rac-BG-VK_Hz.js} +41 -41
- package/dist/component/{quiz-radio-group-rac-D0IJGSh0.js → quiz-radio-group-rac-B1x7Yatu.js} +2 -2
- package/dist/component/{radio-button-module-classes-CWfSY9kQ.js → radio-button-module-classes-BXWANbga.js} +7 -7
- package/dist/component/{radio-group-field-rac-DisEhh0b.js → radio-group-field-rac-DmEOydAr.js} +4 -4
- package/dist/component/{radio-group-rac-DrwjFNWh.js → radio-group-rac-DAcU_lkj.js} +1 -1
- package/dist/component/{rating-input-field-rac-BLMQWT7z.js → rating-input-field-rac-Cazqeqzw.js} +16 -16
- package/dist/component/{rating-input-rac-CGJY2HSO.js → rating-input-rac-KJ8FnJTj.js} +1 -1
- package/dist/component/{rich-content-rac.module-C9cKdumu.js → rich-content-rac.module-PZgMV2M7.js} +1 -1
- package/dist/component/{rich-text-field-rac-DTSRvaTK.js → rich-text-field-rac-DNEeY_m8.js} +3 -3
- package/dist/component/{rich-text-rac-Blk3neHN.js → rich-text-rac-g9upYD25.js} +1 -1
- package/dist/component/{service-dropdown-rac-C9P5IWrV.js → service-dropdown-rac-CmmWetDa.js} +20 -20
- package/dist/component/{services-multi-choice-rac-Cnhwy1a9.js → services-multi-choice-rac-D0PJNlq2.js} +7 -7
- package/dist/component/{signature-rac-Benar-ci.js → signature-rac-Q4G3uEhw.js} +41 -41
- package/dist/component/submit-button-rac-DdLPGJ6v.js +141 -0
- package/dist/component/{tags-field-rac-wA_0ZinI.js → tags-field-rac-PZ8Vfmsn.js} +72 -72
- package/dist/component/{tags-rac-BcVGekA6.js → tags-rac-DLjeR5G1.js} +1 -1
- package/dist/component/{text-area-field-rac-VpuojNac.js → text-area-field-rac-BNVK0R0Z.js} +25 -25
- package/dist/component/{text-area-rac-DDvi8u5M.js → text-area-rac-CNOLe3Vx.js} +1 -1
- package/dist/component/{text-input-field-rac-C6LohBtn.js → text-input-field-rac-DjdW6TCf.js} +3 -3
- package/dist/component/{text-input-headless-5yKhWpLD.js → text-input-headless-DFWQwZAN.js} +10 -10
- package/dist/component/{text-input-rac-C8hsNUp6.js → text-input-rac-GXPtQEjT.js} +1 -1
- package/dist/component/{time-input-rac-fOT-pjju.js → time-input-rac-B_g-erqu.js} +19 -19
- package/dist/component/{url-input-field-rac-DxR6Hymf.js → url-input-field-rac-CXWYeQLf.js} +19 -19
- package/dist/component/{url-input-rac-B928R10o.js → url-input-rac-DX-vjyXj.js} +1 -1
- package/dist/component/use-element-state-class-name-lZnP6sE6.js +22 -0
- package/dist/component/{use-service-options-base-UyJmT2P6.js → use-service-options-base-BJE86Rzo.js} +5 -5
- package/dist/component/{use-text-input-class-name-Qk2v8a6-.js → use-text-input-class-name-B-GYaltW.js} +5 -5
- package/dist/form.d.ts +58 -2
- package/package.json +5 -3
- package/dist/component/submit-button-rac-BDJQsZC3.js +0 -116
- package/dist/component/use-element-state-class-name-CBjBYCW5.js +0 -20
package/dist/component/{number-input-field-rac-BNPMYFay.js → number-input-field-rac-BOJNJ50c.js}
RENAMED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
2
|
-
import
|
|
3
|
-
import r, { useState as
|
|
1
|
+
import { RicosViewer as v } from "@wix/ricos/viewer";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import r, { useState as j, useCallback as Q, useEffect as U, useRef as $ } from "react";
|
|
4
4
|
import { NumberField as z, Input as G } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { aj as _, ag as S, at as H, al as J } from "./form-BkmOXzqo.js";
|
|
6
6
|
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as K, E as W } from "./field-error-headless-
|
|
8
|
-
import { L as X } from "./field-label-headless-
|
|
7
|
+
import { D as K, E as W } from "./field-error-headless-BHTkMu35.js";
|
|
8
|
+
import { L as X } from "./field-label-headless-D3DwX65k.js";
|
|
9
9
|
import { g as Y, c as Z } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
10
|
import { u as w } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ee } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { s as p } from "./field-rac.module-D06m9T9x.js";
|
|
13
|
-
import { y as re,
|
|
14
|
-
import { u as se } from "./use-text-input-class-name-
|
|
13
|
+
import { y as re, P as te, o as ae, i as ne } from "./form-element-classes-BsXkFtp2.js";
|
|
14
|
+
import { u as se } from "./use-text-input-class-name-B-GYaltW.js";
|
|
15
15
|
const e = ({ children: t }) => {
|
|
16
16
|
var F, L, R;
|
|
17
|
-
const { id: n, value: s, onChange: l, disabled: d, required: E, readOnly: o, onBlur:
|
|
17
|
+
const { id: n, value: s, onChange: l, disabled: d, required: E, readOnly: o, onBlur: b, onFocus: f, FieldLayout: m, hasError: u, validation: a } = _(), { labelId: y } = S(), D = ((F = a == null ? void 0 : a.number) == null ? void 0 : F.multipleOf) || 1, g = (L = a == null ? void 0 : a.number) == null ? void 0 : L.maximum, A = (R = a == null ? void 0 : a.number) == null ? void 0 : R.minimum, x = O(s), [T, I] = j(x), V = w(b), h = c(t, e.Label), q = c(t, e.Input), M = c(t, e.Description), k = c(t, e.Error), B = Q((N) => {
|
|
18
18
|
if (N === void 0 || Number.isNaN(N)) {
|
|
19
19
|
l(""), I(NaN);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
l(
|
|
22
|
+
const P = Y(D), C = Number(N.toFixed(P));
|
|
23
|
+
l(C), I(C);
|
|
24
24
|
}, [
|
|
25
25
|
D,
|
|
26
26
|
l
|
|
27
27
|
]);
|
|
28
|
-
return
|
|
29
|
-
I(
|
|
28
|
+
return U(() => {
|
|
29
|
+
I(O(s));
|
|
30
30
|
}, [
|
|
31
31
|
s
|
|
32
32
|
]), /* @__PURE__ */ r.createElement(m, {
|
|
@@ -39,19 +39,19 @@ const e = ({ children: t }) => {
|
|
|
39
39
|
isDisabled: d,
|
|
40
40
|
isRequired: E,
|
|
41
41
|
isReadOnly: o,
|
|
42
|
-
isInvalid:
|
|
42
|
+
isInvalid: u,
|
|
43
43
|
onBlur: V,
|
|
44
|
-
onFocus:
|
|
45
|
-
minValue:
|
|
46
|
-
maxValue:
|
|
47
|
-
},
|
|
48
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
44
|
+
onFocus: f,
|
|
45
|
+
minValue: A ?? void 0,
|
|
46
|
+
maxValue: g ?? void 0
|
|
47
|
+
}, q),
|
|
48
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, M)
|
|
49
49
|
});
|
|
50
50
|
}, le = ({ className: t }) => {
|
|
51
|
-
var
|
|
52
|
-
const { t: n } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: d, placeholder: E, validation: o, label:
|
|
53
|
-
(
|
|
54
|
-
const m =
|
|
51
|
+
var u;
|
|
52
|
+
const { t: n } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: d, placeholder: E, validation: o, label: b, required: f } = _();
|
|
53
|
+
(u = o == null ? void 0 : o.number) != null && u.multipleOf;
|
|
54
|
+
const m = $(null);
|
|
55
55
|
return J(() => {
|
|
56
56
|
var a;
|
|
57
57
|
(a = m.current) == null || a.focus();
|
|
@@ -59,33 +59,33 @@ const e = ({ children: t }) => {
|
|
|
59
59
|
ref: m,
|
|
60
60
|
id: s,
|
|
61
61
|
"aria-describedby": l,
|
|
62
|
-
"aria-label":
|
|
62
|
+
"aria-label": b,
|
|
63
63
|
"aria-roledescription": n("field.number.aria-role-description"),
|
|
64
64
|
className: t,
|
|
65
65
|
inputMode: "decimal",
|
|
66
66
|
placeholder: E,
|
|
67
|
-
required:
|
|
67
|
+
required: f
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
e.Label = X;
|
|
71
71
|
e.Input = le;
|
|
72
72
|
e.Description = K;
|
|
73
73
|
e.Error = W;
|
|
74
|
-
const
|
|
74
|
+
const O = (t) => Z(t) ?? NaN, oe = ({ content: t, locale: n }) => /* @__PURE__ */ r.createElement(v, {
|
|
75
75
|
content: t,
|
|
76
76
|
locale: n
|
|
77
77
|
}), Re = () => {
|
|
78
78
|
const t = se();
|
|
79
79
|
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
80
|
-
className:
|
|
80
|
+
className: i(re, p.label)
|
|
81
81
|
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
82
|
-
className:
|
|
82
|
+
className: i(te, p.requiredMark)
|
|
83
83
|
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
84
84
|
className: t
|
|
85
85
|
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
86
|
-
className:
|
|
86
|
+
className: i(ae, p.error)
|
|
87
87
|
}, /* @__PURE__ */ r.createElement(ee, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
88
|
-
className:
|
|
88
|
+
className: i(ne, p.description)
|
|
89
89
|
}, oe));
|
|
90
90
|
};
|
|
91
91
|
export {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import e, { useState as N, useRef as S } from "react";
|
|
2
|
-
import { RicosViewer as
|
|
2
|
+
import { RicosViewer as x } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as B, Group as
|
|
4
|
+
import { aj as E, ag as I, al as O, at as A } from "./form-BkmOXzqo.js";
|
|
5
|
+
import { TextField as B, Group as P, Input as V, Button as v } from "react-aria-components";
|
|
6
6
|
import { f as u, a as g } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as M, E as k } from "./field-error-headless-
|
|
8
|
-
import { L as q } from "./field-label-headless-
|
|
9
|
-
import { E as
|
|
10
|
-
import { H as
|
|
7
|
+
import { D as M, E as k } from "./field-error-headless-BHTkMu35.js";
|
|
8
|
+
import { L as q } from "./field-label-headless-D3DwX65k.js";
|
|
9
|
+
import { E as j } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
+
import { H as U } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-D06m9T9x.js";
|
|
12
|
-
import { y as H,
|
|
13
|
-
import { u as Q } from "./use-text-input-class-name-
|
|
12
|
+
import { y as H, P as W, o as Z, i as G } from "./form-element-classes-BsXkFtp2.js";
|
|
13
|
+
import { u as Q } from "./use-text-input-class-name-B-GYaltW.js";
|
|
14
14
|
const t = ({ children: o, className: r }) => {
|
|
15
|
-
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur:
|
|
15
|
+
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, FieldLayout: y } = E(), { labelId: _ } = I(), [R, D] = N(!1), F = u(o, t.Label), L = u(o, t.Control), T = u(o, t.Description), w = u(o, t.Error);
|
|
16
16
|
return /* @__PURE__ */ e.createElement(y, {
|
|
17
17
|
fieldId: l,
|
|
18
18
|
renderLabel: () => F,
|
|
@@ -24,7 +24,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
24
24
|
isReadOnly: m,
|
|
25
25
|
isRequired: a,
|
|
26
26
|
isInvalid: i,
|
|
27
|
-
onBlur:
|
|
27
|
+
onBlur: f,
|
|
28
28
|
onFocus: C,
|
|
29
29
|
className: r
|
|
30
30
|
}, g(L, {
|
|
@@ -35,7 +35,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
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
|
-
return /* @__PURE__ */ e.createElement(
|
|
38
|
+
return /* @__PURE__ */ e.createElement(P, {
|
|
39
39
|
className: r,
|
|
40
40
|
isDisabled: n,
|
|
41
41
|
isInvalid: m
|
|
@@ -46,11 +46,11 @@ const t = ({ children: o, className: r }) => {
|
|
|
46
46
|
onToggleVisibility: c
|
|
47
47
|
}));
|
|
48
48
|
}, z = ({ className: o, ...r }) => {
|
|
49
|
-
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } =
|
|
50
|
-
return
|
|
49
|
+
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = S(null);
|
|
50
|
+
return O(() => {
|
|
51
51
|
var i;
|
|
52
52
|
(i = a.current) == null || i.focus();
|
|
53
|
-
}, s), /* @__PURE__ */ e.createElement(
|
|
53
|
+
}, s), /* @__PURE__ */ e.createElement(V, {
|
|
54
54
|
ref: a,
|
|
55
55
|
id: n,
|
|
56
56
|
type: l ? "text" : "password",
|
|
@@ -60,7 +60,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
60
60
|
});
|
|
61
61
|
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
62
62
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
63
|
-
return /* @__PURE__ */ e.createElement(
|
|
63
|
+
return /* @__PURE__ */ e.createElement(v, {
|
|
64
64
|
type: "button",
|
|
65
65
|
isDisabled: a,
|
|
66
66
|
onPress: m,
|
|
@@ -115,7 +115,7 @@ const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
115
115
|
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15", b = {
|
|
116
116
|
control: Y,
|
|
117
117
|
toggleButton: ee
|
|
118
|
-
}, te = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(
|
|
118
|
+
}, te = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(x, {
|
|
119
119
|
content: o,
|
|
120
120
|
locale: r
|
|
121
121
|
}), oe = () => {
|
|
@@ -127,14 +127,14 @@ const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
127
127
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
128
128
|
className: r
|
|
129
129
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
130
|
-
className: d(p.innerInput,
|
|
130
|
+
className: d(p.innerInput, U)
|
|
131
131
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
132
132
|
className: b.toggleButton,
|
|
133
133
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
134
134
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
135
135
|
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
136
136
|
className: d(Z, p.error)
|
|
137
|
-
}, /* @__PURE__ */ e.createElement(
|
|
137
|
+
}, /* @__PURE__ */ e.createElement(j, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
138
138
|
className: d(G, p.description)
|
|
139
139
|
}, te));
|
|
140
140
|
}, be = () => /* @__PURE__ */ e.createElement(oe, null);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import r, { useCallback as
|
|
1
|
+
import r, { useCallback as V, useRef as Q } 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 { aj as R, ag as D, ab as T, at as W, al as X } from "./form-BkmOXzqo.js";
|
|
6
6
|
import { f as i } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as Y, E as Z } from "./field-error-headless-
|
|
8
|
-
import { L as ee } from "./field-label-headless-
|
|
7
|
+
import { D as Y, E as Z } from "./field-error-headless-BHTkMu35.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-D3DwX65k.js";
|
|
9
9
|
import { f as N, g as re } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
10
|
import { u as te } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
11
|
import { E as ne } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { H as ae } from "./custom-focus-class-_483Pkwp.js";
|
|
13
13
|
import { s as d } from "./field-rac.module-D06m9T9x.js";
|
|
14
|
-
import { y as se,
|
|
15
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
14
|
+
import { y as se, P as oe, o as le, i as ce } from "./form-element-classes-BsXkFtp2.js";
|
|
15
|
+
import { u as ie } from "./use-text-input-class-name-B-GYaltW.js";
|
|
16
16
|
function ue(e, t) {
|
|
17
17
|
return {
|
|
18
18
|
productId: e.id,
|
|
@@ -27,12 +27,12 @@ function h(e) {
|
|
|
27
27
|
return Number.isNaN(t) ? void 0 : t;
|
|
28
28
|
}
|
|
29
29
|
const n = ({ children: e }) => {
|
|
30
|
-
var O, g, A,
|
|
31
|
-
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: y, hasError: b, onBlur: o, onFocus: E, FieldLayout: M, validation: C } = R(), { labelId: q, prefixId: G } = D(), { regionalFormat: c } = T(), 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], _ = (
|
|
30
|
+
var O, g, A, P;
|
|
31
|
+
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: y, hasError: b, onBlur: o, onFocus: E, FieldLayout: M, validation: C } = R(), { labelId: q, prefixId: G } = D(), { regionalFormat: c } = T(), 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], _ = (P = a == null ? void 0 : a.at(0)) == null ? void 0 : P.price, [F, I] = te({
|
|
32
32
|
sourceValue: _,
|
|
33
33
|
format: (l) => N(String(l ?? ""), c),
|
|
34
34
|
regionalFormat: c
|
|
35
|
-
}), $ =
|
|
35
|
+
}), $ = V(() => {
|
|
36
36
|
const l = N(F, c);
|
|
37
37
|
I(l || ""), o == null || o();
|
|
38
38
|
}, [
|
|
@@ -40,10 +40,10 @@ const n = ({ children: e }) => {
|
|
|
40
40
|
c,
|
|
41
41
|
o,
|
|
42
42
|
I
|
|
43
|
-
]),
|
|
43
|
+
]), B = V((l) => {
|
|
44
44
|
I(l);
|
|
45
|
-
const L = h(N(l, c)),
|
|
46
|
-
if (L !==
|
|
45
|
+
const L = h(N(l, c)), j = h(_);
|
|
46
|
+
if (L !== j) {
|
|
47
47
|
if (L === void 0) {
|
|
48
48
|
s(null);
|
|
49
49
|
return;
|
|
@@ -58,21 +58,21 @@ const n = ({ children: e }) => {
|
|
|
58
58
|
c,
|
|
59
59
|
_,
|
|
60
60
|
I
|
|
61
|
-
]),
|
|
61
|
+
]), U = i(e, n.Label), k = i(e, n.Input), v = i(e, n.Description), H = i(e, n.Error);
|
|
62
62
|
return /* @__PURE__ */ r.createElement(M, {
|
|
63
63
|
fieldId: t,
|
|
64
|
-
renderLabel: () =>
|
|
64
|
+
renderLabel: () => U,
|
|
65
65
|
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
66
66
|
"aria-labelledby": `${q} ${G}`,
|
|
67
67
|
value: a ? F : "",
|
|
68
|
-
onChange:
|
|
68
|
+
onChange: B,
|
|
69
69
|
isDisabled: u,
|
|
70
70
|
isReadOnly: m,
|
|
71
71
|
isRequired: y,
|
|
72
72
|
isInvalid: b,
|
|
73
73
|
onBlur: $,
|
|
74
74
|
onFocus: E
|
|
75
|
-
},
|
|
75
|
+
}, k),
|
|
76
76
|
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H, v)
|
|
77
77
|
});
|
|
78
78
|
}, f = ({ children: e, className: t }) => {
|
|
@@ -91,7 +91,7 @@ const n = ({ children: e }) => {
|
|
|
91
91
|
className: e
|
|
92
92
|
}, t.sign || t.code) : null;
|
|
93
93
|
}, pe = ({ className: e }) => {
|
|
94
|
-
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: y, ariaDescribedBy: b } = D(), o =
|
|
94
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: y, ariaDescribedBy: b } = D(), o = Q(null);
|
|
95
95
|
return X(() => {
|
|
96
96
|
var E;
|
|
97
97
|
(E = o.current) == null || E.focus();
|
package/dist/component/{phone-input-field-rac-CUUAacDK.js → phone-input-field-rac-BxUiCV5Z.js}
RENAMED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
2
|
import b from "classnames";
|
|
3
|
-
import t, { useMemo as B, useState as V, useRef as
|
|
4
|
-
import { a2 as Ee,
|
|
3
|
+
import t, { useMemo as B, useState as V, useRef as P, useEffect as w, useCallback as Z, createContext as te, useContext as q } from "react";
|
|
4
|
+
import { a2 as Ee, at as v, ab as ne, as as fe, aj as M, ag as oe, al as he } from "./form-BkmOXzqo.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as ge } from "react-aria";
|
|
6
|
-
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as Q, DialogTrigger as Le, Select as Ie, Input as ae, ListBox as
|
|
6
|
+
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as Q, DialogTrigger as Le, Select as Ie, Input as ae, ListBox as Pe, Autocomplete as ve } from "react-aria-components";
|
|
7
7
|
import { f as h, a as ce } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as Fe, E as De } from "./field-error-headless-
|
|
9
|
-
import { L as xe } from "./field-label-headless-
|
|
8
|
+
import { D as Fe, E as De } from "./field-error-headless-BHTkMu35.js";
|
|
9
|
+
import { L as xe } from "./field-label-headless-D3DwX65k.js";
|
|
10
10
|
import { N as Re, S as Be } from "./non-modal-popover-DtIMXHbe.js";
|
|
11
11
|
import { u as Me } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
-
import se, { AsYouType as
|
|
12
|
+
import se, { AsYouType as $e, isValidPhoneNumber as Ae, isSupportedCountry as Te } from "libphonenumber-js";
|
|
13
13
|
import "libphonenumber-js/metadata.min.json";
|
|
14
14
|
import { C as W } from "./calling-country-codes-PyWuOTmF.js";
|
|
15
15
|
import { C as we } from "./chevron-down-icon-CcpVm6B-.js";
|
|
16
16
|
import { E as Ue } from "./error-icon-hZxQ6DEy.js";
|
|
17
17
|
import { H as J } from "./custom-focus-class-_483Pkwp.js";
|
|
18
18
|
import { s as _ } from "./field-rac.module-D06m9T9x.js";
|
|
19
|
-
import { y as ke,
|
|
19
|
+
import { y as ke, P as Ve, x as qe, B as Ge, o as He, i as Ye } from "./form-element-classes-BsXkFtp2.js";
|
|
20
20
|
function X(e) {
|
|
21
21
|
const n = e ? se(e) : void 0, r = n == null ? void 0 : n.country;
|
|
22
22
|
if (r)
|
|
23
23
|
return r;
|
|
24
|
-
const o = new
|
|
24
|
+
const o = new $e();
|
|
25
25
|
return e && o.input(e), o.getCountry();
|
|
26
26
|
}
|
|
27
27
|
function G(e) {
|
|
@@ -35,14 +35,14 @@ function ee(e, n) {
|
|
|
35
35
|
if (e && n)
|
|
36
36
|
try {
|
|
37
37
|
const r = se(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
38
|
-
if (o &&
|
|
38
|
+
if (o && Ae(o))
|
|
39
39
|
return o.replace(/\s+/g, "");
|
|
40
40
|
} catch {
|
|
41
41
|
}
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const { t: e } =
|
|
44
|
+
function je() {
|
|
45
|
+
const { t: e } = v(), { language: n } = ne();
|
|
46
46
|
return B(() => Object.keys(W).reduce((o, a) => {
|
|
47
47
|
const c = W[a], l = G(c), u = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
48
48
|
return l && Te(a) && o.push({
|
|
@@ -56,18 +56,18 @@ function ze() {
|
|
|
56
56
|
n
|
|
57
57
|
]);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function ze(e, n) {
|
|
60
60
|
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ke(e, n) {
|
|
63
63
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
64
64
|
return !!(k(r, n) || k(o, n) || k(a, n));
|
|
65
65
|
}
|
|
66
66
|
function k(e, n) {
|
|
67
67
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const [a, c] = V(e || ""), l =
|
|
69
|
+
function Ze({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
70
|
+
const [a, c] = V(e || ""), l = P(U(e ?? null) ?? ""), [u, i] = V(n);
|
|
71
71
|
fe(() => {
|
|
72
72
|
c(""), l.current = "", i(n), o("");
|
|
73
73
|
});
|
|
@@ -90,7 +90,7 @@ function je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
90
90
|
m,
|
|
91
91
|
n
|
|
92
92
|
]);
|
|
93
|
-
const C =
|
|
93
|
+
const C = Z((d) => {
|
|
94
94
|
if (c(d), !d) {
|
|
95
95
|
l.current = "", o(null);
|
|
96
96
|
return;
|
|
@@ -103,7 +103,7 @@ function je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
103
103
|
}, [
|
|
104
104
|
r,
|
|
105
105
|
o
|
|
106
|
-
]), p =
|
|
106
|
+
]), p = Z((d) => {
|
|
107
107
|
i(d), c((f) => {
|
|
108
108
|
const y = U(ee(f, d));
|
|
109
109
|
return l.current = y ?? "", o(y), f;
|
|
@@ -144,17 +144,17 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
144
144
|
});
|
|
145
145
|
}, s = ({ children: e }) => {
|
|
146
146
|
var I, L;
|
|
147
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = M(), [u, i] = V(null), m = (L = (I = l == null ? void 0 : l.string) == null ? void 0 : I.phoneOptions) == null ? void 0 : L.allowedCountryCodes, C =
|
|
147
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = M(), [u, i] = V(null), m = (L = (I = l == null ? void 0 : l.string) == null ? void 0 : I.phoneOptions) == null ? void 0 : L.allowedCountryCodes, C = je(), p = B(() => ze(C, m), [
|
|
148
148
|
C,
|
|
149
149
|
m
|
|
150
150
|
]), d = B(() => p.map((R) => R.shortCountryCode), [
|
|
151
151
|
p
|
|
152
|
-
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: O, handleCountryCodeChange: S } =
|
|
152
|
+
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: O, handleCountryCodeChange: S } = Ze({
|
|
153
153
|
value: r,
|
|
154
154
|
defaultCountryCode: c,
|
|
155
155
|
allowedCountryCodes: d,
|
|
156
156
|
onChange: o
|
|
157
|
-
}),
|
|
157
|
+
}), A = h(e, s.Label), F = h(e, s.Control), T = h(e, s.Description), D = h(e, s.Error), x = {
|
|
158
158
|
currentValue: f,
|
|
159
159
|
selectedCountryCode: y,
|
|
160
160
|
handlePhoneChange: O,
|
|
@@ -167,7 +167,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
167
167
|
value: x
|
|
168
168
|
}, /* @__PURE__ */ t.createElement(a, {
|
|
169
169
|
fieldId: n,
|
|
170
|
-
renderLabel: () =>
|
|
170
|
+
renderLabel: () => A,
|
|
171
171
|
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
172
172
|
ref: i,
|
|
173
173
|
style: {
|
|
@@ -176,8 +176,8 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
176
176
|
}), F),
|
|
177
177
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, T)
|
|
178
178
|
}));
|
|
179
|
-
},
|
|
180
|
-
const { inputId: r, labelId: o } = oe(), { hasError: a, disabled: c, readOnly: l } = M(), { t: u } =
|
|
179
|
+
}, j = ({ children: e, className: n }) => {
|
|
180
|
+
const { inputId: r, labelId: o } = oe(), { hasError: a, disabled: c, readOnly: l } = M(), { t: u } = v(), { selectedCountryCode: i, countries: m } = N(), C = `${r}-country`, p = i ? m.find((O) => O.shortCountryCode === i) : void 0, d = p && G(p.longCountryCode) || "", f = u("field.phone.country-code.aria-label"), y = p ? `${f}, ${p.countryName}, ${d}` : f;
|
|
181
181
|
return /* @__PURE__ */ t.createElement(Be, {
|
|
182
182
|
isDisabled: c || l,
|
|
183
183
|
id: C,
|
|
@@ -198,8 +198,8 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
198
198
|
className: n
|
|
199
199
|
}, e);
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
j.Flag = Qe;
|
|
202
|
+
j.EmptyState = We;
|
|
203
203
|
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
204
204
|
const { triggerRef: l, optionsRef: u } = c, { popoverContainer: i } = N(), m = h(e, g.Search), C = /* @__PURE__ */ t.createElement(ie, null, e);
|
|
205
205
|
return /* @__PURE__ */ t.createElement(ge, {
|
|
@@ -237,7 +237,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
237
237
|
}
|
|
238
238
|
}, e)))));
|
|
239
239
|
}, ie = ({ children: e, listBoxProps: n }) => {
|
|
240
|
-
const { countries: r } = N(), o = h(e, g.Option), a = h(e, g.Search), c = h(e, g.EmptyState), l = /* @__PURE__ */ t.createElement(
|
|
240
|
+
const { countries: r } = N(), o = h(e, g.Option), a = h(e, g.Search), c = h(e, g.EmptyState), l = /* @__PURE__ */ t.createElement(Pe, {
|
|
241
241
|
...n,
|
|
242
242
|
renderEmptyState: c ? () => c : void 0
|
|
243
243
|
}, r.map((u) => {
|
|
@@ -250,10 +250,10 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
250
250
|
longCountryCode: u.longCountryCode
|
|
251
251
|
});
|
|
252
252
|
}));
|
|
253
|
-
return a ? /* @__PURE__ */ t.createElement(
|
|
253
|
+
return a ? /* @__PURE__ */ t.createElement(ve, {
|
|
254
254
|
filter: (u, i, m) => {
|
|
255
255
|
const C = r.find((p) => p.shortCountryCode === m.key);
|
|
256
|
-
return !!C &&
|
|
256
|
+
return !!C && Ke(C, i);
|
|
257
257
|
}
|
|
258
258
|
}, a, l) : l;
|
|
259
259
|
};
|
|
@@ -273,7 +273,7 @@ const et = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("d
|
|
|
273
273
|
className: n
|
|
274
274
|
}, e);
|
|
275
275
|
g.EmptyState = et;
|
|
276
|
-
const
|
|
276
|
+
const $ = ({ children: e, className: n, ...r }) => {
|
|
277
277
|
const { countryCode: o, dialingCode: a, countryName: c, longCountryCode: l } = r, u = {
|
|
278
278
|
countryCode: o,
|
|
279
279
|
dialingCode: a,
|
|
@@ -304,12 +304,12 @@ const A = ({ children: e, className: n, ...r }) => {
|
|
|
304
304
|
className: e
|
|
305
305
|
}, n);
|
|
306
306
|
};
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
g.Option =
|
|
307
|
+
$.Flag = Ce;
|
|
308
|
+
$.Name = de;
|
|
309
|
+
$.Code = pe;
|
|
310
|
+
g.Option = $;
|
|
311
311
|
const tt = ({ className: e }) => {
|
|
312
|
-
const { t: n } =
|
|
312
|
+
const { t: n } = v(), { inputId: r, ariaDescribedBy: o } = oe(), { id: a, placeholder: c, disabled: l, readOnly: u, required: i, label: m, hasError: C } = M(), { currentValue: p, handlePhoneChange: d } = N(), f = P(null);
|
|
313
313
|
return he(() => {
|
|
314
314
|
var y;
|
|
315
315
|
(y = f.current) == null || y.focus({
|
|
@@ -331,14 +331,14 @@ const tt = ({ className: e }) => {
|
|
|
331
331
|
className: e
|
|
332
332
|
});
|
|
333
333
|
}, nt = ({ children: e, className: n }) => {
|
|
334
|
-
const r =
|
|
334
|
+
const r = P(null), o = P(null), a = P(!1), { disabled: c, readOnly: l, required: u, hasError: i, showFlag: m, onFocus: C, onBlur: p } = M(), d = Me(p), { t: f } = v(), { selectedCountryCode: y, handleCountryCodeChange: O, countries: S } = N(), A = h(e, s.CountryButton), F = h(e, s.CountryOptions.Modal), T = F ?? h(e, s.CountryOptions.Popover), D = h(e, s.PhoneNumber), x = {
|
|
335
335
|
onFocus: () => {
|
|
336
336
|
a.current || (a.current = !0, C == null || C());
|
|
337
337
|
},
|
|
338
338
|
onBlur: (L) => {
|
|
339
|
-
var
|
|
339
|
+
var z, K;
|
|
340
340
|
const R = L.relatedTarget;
|
|
341
|
-
!((
|
|
341
|
+
!((z = r.current) != null && z.contains(R)) && !((K = o.current) != null && K.contains(R)) && (a.current = !1, d());
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
if (S.length === 1)
|
|
@@ -351,7 +351,7 @@ const tt = ({ className: e }) => {
|
|
|
351
351
|
}, m && /* @__PURE__ */ t.createElement(Y, {
|
|
352
352
|
longCountryCode: S[0].longCountryCode
|
|
353
353
|
}), D);
|
|
354
|
-
const I = /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
354
|
+
const I = /* @__PURE__ */ t.createElement(t.Fragment, null, A, ce(T, {
|
|
355
355
|
triggerRef: r,
|
|
356
356
|
optionsRef: o
|
|
357
357
|
}));
|
|
@@ -373,7 +373,7 @@ const tt = ({ className: e }) => {
|
|
|
373
373
|
};
|
|
374
374
|
s.Label = xe;
|
|
375
375
|
s.Control = nt;
|
|
376
|
-
s.CountryButton =
|
|
376
|
+
s.CountryButton = j;
|
|
377
377
|
s.CountryOptions = g;
|
|
378
378
|
s.PhoneNumber = tt;
|
|
379
379
|
s.Description = Fe;
|
|
@@ -421,7 +421,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
421
421
|
className: E.chevron,
|
|
422
422
|
"aria-hidden": "true"
|
|
423
423
|
}, /* @__PURE__ */ t.createElement(we, null)), Vt = () => {
|
|
424
|
-
const { t: e } =
|
|
424
|
+
const { t: e } = v(), { isMobile: n, PortalContainer: r } = ne(), o = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
425
425
|
className: E.countrySearchContainer,
|
|
426
426
|
"aria-label": e("field.phone.country-search-input.aria-label")
|
|
427
427
|
}, /* @__PURE__ */ t.createElement(rt, {
|