@wix/form-elements 1.74.0 → 1.75.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-Bze1s2XD.js → appointment-rac-7xVKSm2N.js} +27 -27
- package/dist/component/{bookings-address-rac-BcrkXf63.js → bookings-address-rac-VXnUSx8U.js} +1 -1
- package/dist/component/{bookings-email-rac-DYq5RxOP.js → bookings-email-rac-B2_ad7Y2.js} +1 -1
- package/dist/component/{bookings-first-name-rac-ZJ_sQ-01.js → bookings-first-name-rac-9BAY5vLx.js} +1 -1
- package/dist/component/{bookings-header-rac-Cv8kl01f.js → bookings-header-rac-B6IgiMOA.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BmnulSZ6.js → bookings-last-name-rac-DoXEDO8K.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-Bdi4xs9y.js → bookings-login-bar-rac-DprQIFyj.js} +2 -2
- package/dist/component/{bookings-phone-rac-C8DjSzUY.js → bookings-phone-rac-VMoXtejZ.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DYu011oy.js → bookings-rich-text-rac-DSzD2jBy.js} +1 -1
- package/dist/component/{checkbox-field-rac-BH3yEE5j.js → checkbox-field-rac-BLihwz3C.js} +327 -320
- package/dist/component/checkbox-group-field-headless-BItyo_iD.js +205 -0
- package/dist/component/checkbox-group-field-rac-Bov3yFC6.js +40 -0
- package/dist/component/{checkbox-group-rac-CgW0DnhX.js → checkbox-group-rac-Fit-qssk.js} +1 -1
- package/dist/component/{checkbox-rac-DOAYMMsi.js → checkbox-rac-CSsY83Nx.js} +1 -1
- package/dist/component/{contacts-address-rac-DXJa4J_k.js → contacts-address-rac-iJuzUQe4.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-CVsuRq3B.js → contacts-birthdate-rac-0g2e8cQP.js} +1 -1
- package/dist/component/{contacts-company-rac-b2bwHSNC.js → contacts-company-rac-BC0tK4WQ.js} +1 -1
- package/dist/component/{contacts-email-rac-DMPcpQ1c.js → contacts-email-rac-dkuclkiH.js} +1 -1
- package/dist/component/{contacts-first-name-rac-CL2BsHuJ.js → contacts-first-name-rac-BSUkCuht.js} +1 -1
- package/dist/component/{contacts-last-name-rac-hdBsWaqb.js → contacts-last-name-rac-08bjVdN2.js} +1 -1
- package/dist/component/{contacts-phone-rac-DQF6aV9B.js → contacts-phone-rac-DVb0Z_0M.js} +1 -1
- package/dist/component/{contacts-position-rac-CVX-WCfx.js → contacts-position-rac-AGUDkv7U.js} +1 -1
- package/dist/component/contacts-subscribe-rac-6jAQHibT.js +13 -0
- package/dist/component/{contacts-tax-id-rac-0KTXvF81.js → contacts-tax-id-rac-C7moEz5b.js} +1 -1
- package/dist/component/{date-availability-DBljhBgO.js → date-availability-DagbE0C8.js} +1 -1
- package/dist/component/{date-input-field-rac-CfflD2Ar.js → date-input-field-rac-BWHKsJGy.js} +30 -30
- package/dist/component/{date-input-rac-fQclCKoa.js → date-input-rac-BlZlmf-s.js} +1 -1
- package/dist/component/{date-picker-field-rac-BSmFOaH-.js → date-picker-field-rac-BSNbYirD.js} +36 -36
- package/dist/component/{date-picker-rac-D7I3ramu.js → date-picker-rac-D3IWMst5.js} +1 -1
- package/dist/component/{date-time-input-field-rac-vjZDQ_Fp.js → date-time-input-field-rac-YKTwuIUs.js} +25 -25
- package/dist/component/{date-time-input-rac-CDbS0VZR.js → date-time-input-rac-CZRsKm1P.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BBiPt6_a.js → dext-checkbox-group-rac-BE7ILz-f.js} +2 -2
- package/dist/component/{dext-checkbox-rac-Cqp--0SO.js → dext-checkbox-rac-B6-94A1N.js} +1 -1
- package/dist/component/{dext-date-picker-rac-5Wft0w9m.js → dext-date-picker-rac-Bx2hUFNm.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-Bbs7bgtn.js → dext-date-time-input-rac-DPKD6quz.js} +1 -1
- package/dist/component/{dext-dropdown-rac-CSvhtqbc.js → dext-dropdown-rac-WrSfNRa5.js} +1 -1
- package/dist/component/{dext-email-rac-BoLeXqyI.js → dext-email-rac-8PSMKNYG.js} +1 -1
- package/dist/component/{dext-number-input-rac-DzaJYTSz.js → dext-number-input-rac-b9YSzEkN.js} +1 -1
- package/dist/component/{dext-phone-rac-BagPg_CT.js → dext-phone-rac-CkapN3c1.js} +1 -1
- package/dist/component/{dext-radio-group-rac-B5HSQt7a.js → dext-radio-group-rac-CfNMkwUa.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DrtaAf-E.js → dext-rating-input-rac-Cun_t7HQ.js} +1 -1
- package/dist/component/{dext-tags-rac-Cg4jJ4jr.js → dext-tags-rac-DLZ91c3w.js} +2 -2
- package/dist/component/{dext-text-area-rac-C_t-W7lk.js → dext-text-area-rac-N9A7QfYw.js} +1 -1
- package/dist/component/{dext-text-input-rac-ChvV21Jf.js → dext-text-input-rac-XbVzAPHH.js} +1 -1
- package/dist/component/{dext-url-input-rac-DclbSYTr.js → dext-url-input-rac-BiaWZ49r.js} +1 -1
- package/dist/component/{donation-rac-FYQIMm5m.js → donation-rac-BEIBjLHK.js} +46 -47
- package/dist/component/{dropdown-field-headless-CTZ-zGqZ.js → dropdown-field-headless-CQfZ3zPD.js} +3 -3
- package/dist/component/{dropdown-field-rac-C1KVtxwv.js → dropdown-field-rac-ubZN_Abg.js} +7 -7
- package/dist/component/{dropdown-rac-CkkDEDje.js → dropdown-rac-CHYFrEjY.js} +1 -1
- package/dist/component/{ecom-address-rac-BOuugSxX.js → ecom-address-rac-C7qJlrsv.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-IZeMlljb.js → ecom-subscription-checkbox-rac-CONIZsTy.js} +6 -6
- package/dist/component/{email-input-field-rac-CNzmm1j7.js → email-input-field-rac-Dg0p6WZe.js} +63 -63
- package/dist/component/events-repeater-rac-BoxNl7gn.js +254 -0
- package/dist/component/{events-rsvp-rac-BmjboAco.js → events-rsvp-rac-BU5d2n4k.js} +3 -3
- package/dist/component/{field-error-headless-DQZ5XAdn.js → field-error-headless-uQOcm2Ak.js} +1 -1
- package/dist/component/{field-label-headless-DoxfHHaj.js → field-label-headless-Bzh7f2Ji.js} +1 -1
- package/dist/component/field-rac.module-DjmaTYkc.js +23 -0
- package/dist/component/{file-upload-rac-YEQ7uXhm.js → file-upload-rac-BTt-rJE5.js} +74 -74
- package/dist/component/{fixed-payment-rac-DDufIQBT.js → fixed-payment-rac-1NOx3D-U.js} +17 -17
- package/dist/component/{form-C6WwBcGP.js → form-DCmjj8mZ.js} +69 -69
- package/dist/component/form-element-classes-Dn33C01k.js +111 -0
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DGfjrjQC.js → header-field-rac-lyvjy6h2.js} +3 -3
- package/dist/component/{header-rac-C_JE2cTg.js → header-rac-B4iPEbNj.js} +1 -1
- package/dist/component/{image-choice-rac-LDLPQwrN.js → image-choice-rac-CmEG-waj.js} +29 -30
- package/dist/component/{index-C2srcuHD.js → index-D-CKLZBh.js} +4 -4
- package/dist/component/{index-CIOoaQ8Z.js → index-UZsDOe8e.js} +2 -2
- package/dist/component/{isObjectLike-E5QfEa1u.js → isObjectLike-BSGOU4jF.js} +1 -1
- package/dist/component/{multiline-address-field-rac-Biyj2tIN.js → multiline-address-field-rac-Dz0NEjSO.js} +125 -125
- package/dist/component/{multiline-address-rac-BCqCvG7a.js → multiline-address-rac-D_MAanxb.js} +1 -1
- package/dist/component/{number-input-field-rac-CwUoIbM8.js → number-input-field-rac-CvjeAm-W.js} +13 -13
- package/dist/component/{number-input-rac-CdYdTDem.js → number-input-rac-oKo2Wx_c.js} +1 -1
- package/dist/component/{password-rac-D62npVHY.js → password-rac-CrnkKtfp.js} +21 -21
- package/dist/component/{payment-input-rac-D4u-3vcW.js → payment-input-rac-BoVdGyvV.js} +18 -18
- package/dist/component/{phone-input-field-rac-uHxR3ozd.js → phone-input-field-rac-DksXoAnr.js} +54 -54
- package/dist/component/{phone-rac-Bf99_BGi.js → phone-rac-BR0iX5TL.js} +1 -1
- package/dist/component/product-list-rac-C4rvv5k-.js +270 -0
- package/dist/component/{quiz-radio-group-rac-CPGS0LEb.js → quiz-radio-group-rac-BxKmUUf8.js} +2 -2
- package/dist/component/{radio-group-field-rac-BWpTNAbO.js → radio-group-field-rac-Dj4rkkKF.js} +3 -3
- package/dist/component/{radio-group-field-rac.module-WxU5zxvM.js → radio-group-field-rac.module-CeBLm9QF.js} +3 -3
- package/dist/component/{radio-group-rac-dA4WZ1Vj.js → radio-group-rac-BpnfptSZ.js} +1 -1
- package/dist/component/{rating-input-field-rac-CJnFsBvH.js → rating-input-field-rac-BP0928qI.js} +30 -31
- package/dist/component/{rating-input-rac-DXVYozFV.js → rating-input-rac-DaEgvjIS.js} +1 -1
- package/dist/component/{rich-content-rac.module-DkKwzJS7.js → rich-content-rac.module-zvvH-tWq.js} +1 -1
- package/dist/component/{rich-text-field-rac-8FWCRrpb.js → rich-text-field-rac-CFCRiMl_.js} +3 -3
- package/dist/component/{rich-text-rac-OeM_mPRy.js → rich-text-rac-BRuLnyN4.js} +1 -1
- package/dist/component/{service-dropdown-rac-mvUMpcS_.js → service-dropdown-rac-C82l5y0C.js} +21 -21
- package/dist/component/services-multi-choice-rac-BAHBSgAT.js +83 -0
- package/dist/component/{signature-rac-D44U9Uyp.js → signature-rac-CIkm3SCW.js} +56 -56
- package/dist/component/{submit-button-rac-BqtcgVAn.js → submit-button-rac-Bz-X9Tbo.js} +2 -2
- package/dist/component/{tags-field-rac-CemsTKWz.js → tags-field-rac-Dn8VyPzT.js} +29 -30
- package/dist/component/{tags-rac-fVjCf6qo.js → tags-rac-BJpVdunR.js} +1 -1
- package/dist/component/{text-area-field-rac-BPciZlZb.js → text-area-field-rac-Pp9HnCS5.js} +18 -18
- package/dist/component/{text-area-rac-CRTORdZM.js → text-area-rac-DbwAFdel.js} +1 -1
- package/dist/component/{text-input-field-rac-CvFoWlRN.js → text-input-field-rac-x4ByKmBv.js} +6 -6
- package/dist/component/{text-input-headless-BQ3TWU9G.js → text-input-headless-fbiKci5q.js} +3 -3
- package/dist/component/{text-input-rac-DSFkEmob.js → text-input-rac-jyCKxyCt.js} +1 -1
- package/dist/component/{time-input-rac-CGgs7ncp.js → time-input-rac-C5Cvmxtt.js} +17 -17
- package/dist/component/{url-input-field-rac-CqvgTc-F.js → url-input-field-rac-CGpCEn2A.js} +20 -20
- package/dist/component/{url-input-rac-C45KOwnr.js → url-input-rac-DhFL8fGq.js} +1 -1
- package/dist/component/use-element-state-class-name-Bnw7sY9P.js +29 -0
- package/dist/component/{use-service-options-base-D4Zl-iGW.js → use-service-options-base-CgT1IKB3.js} +1 -1
- package/package.json +2 -2
- package/dist/component/checkbox-group-field-headless-D_GG5LHM.js +0 -210
- package/dist/component/checkbox-group-field-rac-Cj7Erubs.js +0 -41
- package/dist/component/contacts-subscribe-rac-Dl1ot9qw.js +0 -13
- package/dist/component/events-repeater-rac-CMV0Lmwz.js +0 -247
- package/dist/component/field-rac.module-Cac83bU5.js +0 -21
- package/dist/component/form-element-classes-DDKCTFQj.js +0 -65
- package/dist/component/form-element-keys-D0sEdpFo.js +0 -8
- package/dist/component/product-list-rac-iRf6Ra7i.js +0 -263
- package/dist/component/services-multi-choice-rac-DrgUrn_N.js +0 -76
package/dist/component/{number-input-field-rac-CwUoIbM8.js → number-input-field-rac-CvjeAm-W.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RicosViewer as v } from "@wix/ricos/viewer";
|
|
2
2
|
import m from "classnames";
|
|
3
|
-
import r, { useState as
|
|
4
|
-
import { NumberField as
|
|
5
|
-
import { ai as C, af as S, as as H, ak as J } from "./form-
|
|
3
|
+
import r, { useState as Q, useCallback as U, useEffect as $, useRef as j } from "react";
|
|
4
|
+
import { NumberField as z, Input as G } from "react-aria-components";
|
|
5
|
+
import { ai as C, af as S, as as H, ak as J } from "./form-DCmjj8mZ.js";
|
|
6
6
|
import { f as d } 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-uQOcm2Ak.js";
|
|
8
|
+
import { L as X } from "./field-label-headless-Bzh7f2Ji.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
|
-
import { s as i } from "./field-rac.module-
|
|
13
|
-
import {
|
|
12
|
+
import { s as i } from "./field-rac.module-DjmaTYkc.js";
|
|
13
|
+
import { y as re, Q as te, x as ne, p as ae, i as se } from "./form-element-classes-Dn33C01k.js";
|
|
14
14
|
const e = ({ children: n }) => {
|
|
15
15
|
var D, L, R;
|
|
16
|
-
const { id: a, value: s, onChange: l, disabled: p, required: E, readOnly: o, onBlur: b, onFocus: f, FieldLayout: u, hasError: c, validation: t } = C(), { labelId: y } = S(), F = ((D = t == null ? void 0 : t.number) == null ? void 0 : D.multipleOf) || 1, A = (L = t == null ? void 0 : t.number) == null ? void 0 : L.maximum,
|
|
16
|
+
const { id: a, value: s, onChange: l, disabled: p, required: E, readOnly: o, onBlur: b, onFocus: f, FieldLayout: u, hasError: c, validation: t } = C(), { labelId: y } = S(), F = ((D = t == null ? void 0 : t.number) == null ? void 0 : D.multipleOf) || 1, A = (L = t == null ? void 0 : t.number) == null ? void 0 : L.maximum, x = (R = t == null ? void 0 : t.number) == null ? void 0 : R.minimum, M = _(s), [T, I] = Q(M), V = w(b), g = d(n, e.Label), h = d(n, e.Input), k = d(n, e.Description), q = d(n, e.Error), B = U((N) => {
|
|
17
17
|
if (N === void 0 || Number.isNaN(N)) {
|
|
18
18
|
l(""), I(NaN);
|
|
19
19
|
return;
|
|
@@ -24,14 +24,14 @@ const e = ({ children: n }) => {
|
|
|
24
24
|
F,
|
|
25
25
|
l
|
|
26
26
|
]);
|
|
27
|
-
return
|
|
27
|
+
return $(() => {
|
|
28
28
|
I(_(s));
|
|
29
29
|
}, [
|
|
30
30
|
s
|
|
31
31
|
]), /* @__PURE__ */ r.createElement(u, {
|
|
32
32
|
fieldId: a,
|
|
33
33
|
renderLabel: () => g,
|
|
34
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
35
35
|
"aria-labelledby": y,
|
|
36
36
|
value: T,
|
|
37
37
|
onChange: B,
|
|
@@ -41,16 +41,16 @@ const e = ({ children: n }) => {
|
|
|
41
41
|
isInvalid: c,
|
|
42
42
|
onBlur: V,
|
|
43
43
|
onFocus: f,
|
|
44
|
-
minValue:
|
|
44
|
+
minValue: x ?? void 0,
|
|
45
45
|
maxValue: A ?? void 0
|
|
46
46
|
}, h),
|
|
47
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, q, k)
|
|
48
48
|
});
|
|
49
49
|
}, le = ({ className: n }) => {
|
|
50
50
|
var c;
|
|
51
51
|
const { t: a } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: p, placeholder: E, validation: o, label: b, required: f } = C();
|
|
52
52
|
(c = o == null ? void 0 : o.number) != null && c.multipleOf;
|
|
53
|
-
const u =
|
|
53
|
+
const u = j(null);
|
|
54
54
|
return J(() => {
|
|
55
55
|
var t;
|
|
56
56
|
(t = u.current) == null || t.focus();
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e, { useState as h, useRef as N } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { ai as
|
|
4
|
+
import { ai as E, af as I, ak as x, as as A } from "./form-DCmjj8mZ.js";
|
|
5
5
|
import { TextField as B, Group as P, Input as V, Button as v } from "react-aria-components";
|
|
6
|
-
import { f as
|
|
7
|
-
import { D as M, E as k } from "./field-error-headless-
|
|
8
|
-
import { L as q } from "./field-label-headless-
|
|
6
|
+
import { f as p, a as g } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as M, E as k } from "./field-error-headless-uQOcm2Ak.js";
|
|
8
|
+
import { L as q } from "./field-label-headless-Bzh7f2Ji.js";
|
|
9
9
|
import { E as U } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { H as j } from "./custom-focus-class-_483Pkwp.js";
|
|
11
|
-
import { s as u } from "./field-rac.module-
|
|
12
|
-
import {
|
|
11
|
+
import { s as u } from "./field-rac.module-DjmaTYkc.js";
|
|
12
|
+
import { y as H, Q, x as W, p as Z, i as G } from "./form-element-classes-Dn33C01k.js";
|
|
13
13
|
const t = ({ children: r, className: o }) => {
|
|
14
|
-
const { id: i, value: s, onChange: c, disabled: l, readOnly: m, required: n, hasError: a, onBlur: f, onFocus: _, FieldLayout: y } =
|
|
14
|
+
const { id: i, value: s, onChange: c, disabled: l, readOnly: m, required: n, hasError: a, onBlur: f, onFocus: _, FieldLayout: y } = E(), { labelId: C } = I(), [F, L] = h(!1), R = p(r, t.Label), D = p(r, t.Control), T = p(r, t.Description), S = p(r, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(y, {
|
|
16
16
|
fieldId: i,
|
|
17
|
-
renderLabel: () =>
|
|
17
|
+
renderLabel: () => R,
|
|
18
18
|
renderInput: () => /* @__PURE__ */ e.createElement(B, {
|
|
19
|
-
"aria-labelledby":
|
|
19
|
+
"aria-labelledby": C,
|
|
20
20
|
value: s ?? "",
|
|
21
21
|
onChange: c,
|
|
22
22
|
isDisabled: l,
|
|
@@ -27,13 +27,13 @@ const t = ({ children: r, className: o }) => {
|
|
|
27
27
|
onFocus: _,
|
|
28
28
|
className: o
|
|
29
29
|
}, g(D, {
|
|
30
|
-
isVisible:
|
|
31
|
-
onToggleVisibility: () =>
|
|
30
|
+
isVisible: F,
|
|
31
|
+
onToggleVisibility: () => L((w) => !w)
|
|
32
32
|
})),
|
|
33
33
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, T, S)
|
|
34
34
|
});
|
|
35
|
-
},
|
|
36
|
-
const { isVisible: s, onToggleVisibility: c } = i, { disabled: l, hasError: m } =
|
|
35
|
+
}, $ = ({ children: r, className: o, ...i }) => {
|
|
36
|
+
const { isVisible: s, onToggleVisibility: c } = i, { disabled: l, hasError: m } = E(), n = p(r, t.Input), a = p(r, t.Toggle);
|
|
37
37
|
return /* @__PURE__ */ e.createElement(P, {
|
|
38
38
|
className: o,
|
|
39
39
|
isDisabled: l,
|
|
@@ -44,8 +44,8 @@ const t = ({ children: r, className: o }) => {
|
|
|
44
44
|
isVisible: s,
|
|
45
45
|
onToggleVisibility: c
|
|
46
46
|
}));
|
|
47
|
-
},
|
|
48
|
-
const { isVisible: i } = o, { id: s, placeholder: c } =
|
|
47
|
+
}, z = ({ className: r, ...o }) => {
|
|
48
|
+
const { isVisible: i } = o, { id: s, placeholder: c } = E(), { inputId: l, ariaDescribedBy: m } = I(), n = N(null);
|
|
49
49
|
return x(() => {
|
|
50
50
|
var a;
|
|
51
51
|
(a = n.current) == null || a.focus();
|
|
@@ -58,7 +58,7 @@ const t = ({ children: r, className: o }) => {
|
|
|
58
58
|
placeholder: c
|
|
59
59
|
});
|
|
60
60
|
}, J = ({ className: r, showPasswordTooltipText: o, hidePasswordTooltipText: i, children: s, ...c }) => {
|
|
61
|
-
const { isVisible: l, onToggleVisibility: m } = c, { disabled: n } =
|
|
61
|
+
const { isVisible: l, onToggleVisibility: m } = c, { disabled: n } = E(), a = l ? i : o;
|
|
62
62
|
return /* @__PURE__ */ e.createElement(v, {
|
|
63
63
|
type: "button",
|
|
64
64
|
isDisabled: n,
|
|
@@ -71,8 +71,8 @@ const t = ({ children: r, className: o }) => {
|
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
73
|
t.Label = q;
|
|
74
|
-
t.Control =
|
|
75
|
-
t.Input =
|
|
74
|
+
t.Control = $;
|
|
75
|
+
t.Input = z;
|
|
76
76
|
t.Toggle = J;
|
|
77
77
|
t.Description = M;
|
|
78
78
|
t.Error = k;
|
|
@@ -122,9 +122,9 @@ const K = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
122
122
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
123
123
|
className: d(H, u.label)
|
|
124
124
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
125
|
-
className: d(
|
|
125
|
+
className: d(Q, u.requiredMark)
|
|
126
126
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
127
|
-
className: d(
|
|
127
|
+
className: d(W, u.input, b.control)
|
|
128
128
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
129
129
|
className: d(u.innerInput, j)
|
|
130
130
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
@@ -132,7 +132,7 @@ const K = (r) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
132
132
|
showPasswordTooltipText: r("forms.widget.modals.show-password-tooltip"),
|
|
133
133
|
hidePasswordTooltipText: r("forms.widget.modals.hide-password-tooltip")
|
|
134
134
|
}, ({ isVisible: o }) => o ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
135
|
-
className: d(
|
|
135
|
+
className: d(Z, u.error)
|
|
136
136
|
}, /* @__PURE__ */ e.createElement(U, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
137
137
|
className: d(G, u.description)
|
|
138
138
|
}, te));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import r, { useCallback as V, useRef as
|
|
2
|
-
import { RicosViewer as
|
|
1
|
+
import r, { useCallback as V, useRef as j } from "react";
|
|
2
|
+
import { RicosViewer as w } from "@wix/ricos/viewer";
|
|
3
3
|
import i from "classnames";
|
|
4
|
-
import { TextField as
|
|
5
|
-
import { ai as D, af as S, ab as
|
|
4
|
+
import { TextField as z, Group as J, Input as K } from "react-aria-components";
|
|
5
|
+
import { ai as D, af as S, ab as T, as as W, ak as X } from "./form-DCmjj8mZ.js";
|
|
6
6
|
import { f as m } 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-uQOcm2Ak.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-Bzh7f2Ji.js";
|
|
9
9
|
import { f as R, 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
|
-
import { s as u } from "./field-rac.module-
|
|
14
|
-
import {
|
|
13
|
+
import { s as u } from "./field-rac.module-DjmaTYkc.js";
|
|
14
|
+
import { y as se, Q as oe, x as le, p as ce, i as ie } from "./form-element-classes-Dn33C01k.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -27,7 +27,7 @@ function h(e) {
|
|
|
27
27
|
}
|
|
28
28
|
const n = ({ children: e }) => {
|
|
29
29
|
var O, A, g, P;
|
|
30
|
-
const { id: t, value: a, onChange: s, disabled: p, readOnly: d, required: y, hasError: b, onBlur: o, onFocus: E, FieldLayout: M, validation: _ } = D(), { labelId: q, prefixId: G } = S(), { regionalFormat: c } =
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: p, readOnly: d, required: y, hasError: b, onBlur: o, onFocus: E, FieldLayout: M, validation: _ } = D(), { labelId: q, prefixId: G } = S(), { regionalFormat: c } = T(), N = (g = (A = (O = _ == null ? void 0 : _.predefined) == null ? void 0 : O.paymentOptions) == null ? void 0 : A.products) == null ? void 0 : g[0], C = (P = a == null ? void 0 : a.at(0)) == null ? void 0 : P.price, [F, I] = te({
|
|
31
31
|
sourceValue: C,
|
|
32
32
|
format: (l) => R(String(l ?? ""), c),
|
|
33
33
|
regionalFormat: c
|
|
@@ -41,8 +41,8 @@ const n = ({ children: e }) => {
|
|
|
41
41
|
I
|
|
42
42
|
]), U = V((l) => {
|
|
43
43
|
I(l);
|
|
44
|
-
const L = h(R(l, c)),
|
|
45
|
-
if (L !==
|
|
44
|
+
const L = h(R(l, c)), Q = h(C);
|
|
45
|
+
if (L !== Q) {
|
|
46
46
|
if (L === void 0) {
|
|
47
47
|
s(null);
|
|
48
48
|
return;
|
|
@@ -61,7 +61,7 @@ const n = ({ children: e }) => {
|
|
|
61
61
|
return /* @__PURE__ */ r.createElement(M, {
|
|
62
62
|
fieldId: t,
|
|
63
63
|
renderLabel: () => k,
|
|
64
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
65
65
|
"aria-labelledby": `${q} ${G}`,
|
|
66
66
|
value: a ? F : "",
|
|
67
67
|
onChange: U,
|
|
@@ -82,7 +82,7 @@ const n = ({ children: e }) => {
|
|
|
82
82
|
isInvalid: s
|
|
83
83
|
}, p, d);
|
|
84
84
|
}, me = ({ className: e }) => {
|
|
85
|
-
const { currency: t } =
|
|
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,7 +90,7 @@ 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 } = D(), { inputId: p, labelId: d, prefixId: y, ariaDescribedBy: b } = S(), o =
|
|
93
|
+
const { id: t, placeholder: a, label: s } = D(), { inputId: p, labelId: d, prefixId: y, ariaDescribedBy: b } = S(), o = j(null);
|
|
94
94
|
return X(() => {
|
|
95
95
|
var E;
|
|
96
96
|
(E = o.current) == null || E.focus();
|
|
@@ -111,10 +111,10 @@ n.Label = ee;
|
|
|
111
111
|
n.Input = f;
|
|
112
112
|
n.Description = Y;
|
|
113
113
|
n.Error = Z;
|
|
114
|
-
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14",
|
|
114
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
115
115
|
inputGroup: de,
|
|
116
116
|
currency: fe
|
|
117
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
117
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(w, {
|
|
118
118
|
content: e,
|
|
119
119
|
locale: t
|
|
120
120
|
}), Ie = () => /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
@@ -122,9 +122,9 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", T = {
|
|
|
122
122
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
123
123
|
className: i(oe, u.requiredMark)
|
|
124
124
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
125
|
-
className: i(le, u.input,
|
|
125
|
+
className: i(le, u.input, x.inputGroup)
|
|
126
126
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
127
|
-
className:
|
|
127
|
+
className: x.currency
|
|
128
128
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
129
129
|
className: i(u.innerInput, ae)
|
|
130
130
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
package/dist/component/{phone-input-field-rac-uHxR3ozd.js → phone-input-field-rac-DksXoAnr.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
2
|
import b from "classnames";
|
|
3
|
-
import t, { useMemo as B, useState as
|
|
4
|
-
import { a2 as Ee, as as P, ab as ne, ar as fe, ai as M, af as oe, ak as he } from "./form-
|
|
3
|
+
import t, { useMemo as B, useState as V, useRef as v, useEffect as w, useCallback as Z, createContext as te, useContext as q } from "react";
|
|
4
|
+
import { a2 as Ee, as as P, ab as ne, ar as fe, ai as M, af as oe, ak as he } from "./form-DCmjj8mZ.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
|
|
6
|
+
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as j, DialogTrigger as Le, Select as Ie, Input as ae, ListBox as ve, Autocomplete as Pe } 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
|
|
10
|
-
import { N as
|
|
8
|
+
import { D as Fe, E as De } from "./field-error-headless-uQOcm2Ak.js";
|
|
9
|
+
import { L as xe } from "./field-label-headless-Bzh7f2Ji.js";
|
|
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
12
|
import se, { AsYouType as $e, isValidPhoneNumber as Ae, isSupportedCountry as Te } from "libphonenumber-js";
|
|
13
13
|
import "libphonenumber-js/metadata.min.json";
|
|
@@ -15,8 +15,8 @@ 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
|
-
import { s as _ } from "./field-rac.module-
|
|
19
|
-
import {
|
|
18
|
+
import { s as _ } from "./field-rac.module-DjmaTYkc.js";
|
|
19
|
+
import { y as ke, Q as Ve, x as qe, B as Ge, p as He, i as Ye } from "./form-element-classes-Dn33C01k.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)
|
|
@@ -24,7 +24,7 @@ function X(e) {
|
|
|
24
24
|
const o = new $e();
|
|
25
25
|
return e && o.input(e), o.getCountry();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function G(e) {
|
|
28
28
|
var n;
|
|
29
29
|
return e && ((n = Ee.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
30
30
|
}
|
|
@@ -41,10 +41,10 @@ function ee(e, n) {
|
|
|
41
41
|
}
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ze() {
|
|
45
45
|
const { t: e } = P(), { language: n } = ne();
|
|
46
46
|
return B(() => Object.keys(W).reduce((o, a) => {
|
|
47
|
-
const c = W[a], l =
|
|
47
|
+
const c = W[a], l = G(c), u = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
48
48
|
return l && Te(a) && o.push({
|
|
49
49
|
countryName: u,
|
|
50
50
|
longCountryCode: c,
|
|
@@ -56,10 +56,10 @@ function Ye() {
|
|
|
56
56
|
n
|
|
57
57
|
]);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ke(e, n) {
|
|
60
60
|
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Qe(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
|
}
|
|
@@ -67,7 +67,7 @@ function k(e, n) {
|
|
|
67
67
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
68
68
|
}
|
|
69
69
|
function Ze({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
70
|
-
const [a, c] =
|
|
70
|
+
const [a, c] = V(e || ""), l = v(U(e ?? null) ?? ""), [u, i] = V(n);
|
|
71
71
|
fe(() => {
|
|
72
72
|
c(""), l.current = "", i(n), o("");
|
|
73
73
|
});
|
|
@@ -119,16 +119,16 @@ function Ze({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
const le = /* @__PURE__ */ te(null), N = () => {
|
|
122
|
-
const e =
|
|
122
|
+
const e = q(le);
|
|
123
123
|
if (!e)
|
|
124
124
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
125
125
|
return e;
|
|
126
|
-
}, ue = /* @__PURE__ */ te(null),
|
|
127
|
-
const e =
|
|
126
|
+
}, ue = /* @__PURE__ */ te(null), H = () => {
|
|
127
|
+
const e = q(ue);
|
|
128
128
|
if (!e)
|
|
129
129
|
throw new Error("Option sub-components must be used within Option component");
|
|
130
130
|
return e;
|
|
131
|
-
},
|
|
131
|
+
}, Y = ({ longCountryCode: e, className: n }) => {
|
|
132
132
|
function r(c, l) {
|
|
133
133
|
const u = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", m = `${c}${l === "2x" ? "_2x" : ""}.png`;
|
|
134
134
|
return `${u}${m}`;
|
|
@@ -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] =
|
|
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 = ze(), p = B(() => Ke(C, m), [
|
|
148
148
|
C,
|
|
149
149
|
m
|
|
150
|
-
]), d = B(() => p.map((
|
|
150
|
+
]), d = B(() => p.map((R) => R.shortCountryCode), [
|
|
151
151
|
p
|
|
152
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
|
-
}), A = h(e, s.Label), F = h(e, s.Control), T = h(e, s.Description), D = h(e, s.Error),
|
|
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,
|
|
@@ -164,7 +164,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
164
164
|
popoverContainer: u
|
|
165
165
|
};
|
|
166
166
|
return /* @__PURE__ */ t.createElement(le.Provider, {
|
|
167
|
-
value:
|
|
167
|
+
value: x
|
|
168
168
|
}, /* @__PURE__ */ t.createElement(a, {
|
|
169
169
|
fieldId: n,
|
|
170
170
|
renderLabel: () => A,
|
|
@@ -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 } = P(), { selectedCountryCode: i, countries: m } = N(), C = `${r}-country`, p = i ? m.find((O) => O.shortCountryCode === i) : void 0, d = p &&
|
|
179
|
+
}, z = ({ children: e, className: n }) => {
|
|
180
|
+
const { inputId: r, labelId: o } = oe(), { hasError: a, disabled: c, readOnly: l } = M(), { t: u } = P(), { 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,
|
|
@@ -186,9 +186,9 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
186
186
|
className: n,
|
|
187
187
|
"data-invalid": a || void 0
|
|
188
188
|
}, e);
|
|
189
|
-
},
|
|
189
|
+
}, je = ({ className: e }) => {
|
|
190
190
|
const { selectedCountryCode: n, countries: r } = N(), o = r.find((a) => a.shortCountryCode === n);
|
|
191
|
-
return o ? /* @__PURE__ */ t.createElement(
|
|
191
|
+
return o ? /* @__PURE__ */ t.createElement(Y, {
|
|
192
192
|
className: e,
|
|
193
193
|
longCountryCode: o.longCountryCode
|
|
194
194
|
}) : null;
|
|
@@ -198,13 +198,13 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
198
198
|
className: n
|
|
199
199
|
}, e);
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
z.Flag = je;
|
|
202
|
+
z.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, {
|
|
206
206
|
getContainer: () => i
|
|
207
|
-
}, /* @__PURE__ */ t.createElement(
|
|
207
|
+
}, /* @__PURE__ */ t.createElement(Re, {
|
|
208
208
|
ref: u,
|
|
209
209
|
triggerRef: l,
|
|
210
210
|
className: n,
|
|
@@ -215,7 +215,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
215
215
|
"aria-label": r
|
|
216
216
|
}, C) : C));
|
|
217
217
|
}, Je = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...c }) => {
|
|
218
|
-
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m =
|
|
218
|
+
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m = q(be);
|
|
219
219
|
return /* @__PURE__ */ t.createElement(_e, {
|
|
220
220
|
className: r,
|
|
221
221
|
isDismissable: !0
|
|
@@ -241,7 +241,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
241
241
|
...n,
|
|
242
242
|
renderEmptyState: c ? () => c : void 0
|
|
243
243
|
}, r.map((u) => {
|
|
244
|
-
const i =
|
|
244
|
+
const i = G(u.longCountryCode) || "";
|
|
245
245
|
return ce(o, {
|
|
246
246
|
key: u.shortCountryCode,
|
|
247
247
|
countryCode: u.shortCountryCode,
|
|
@@ -253,7 +253,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
253
253
|
return a ? /* @__PURE__ */ t.createElement(Pe, {
|
|
254
254
|
filter: (u, i, m) => {
|
|
255
255
|
const C = r.find((p) => p.shortCountryCode === m.key);
|
|
256
|
-
return !!C &&
|
|
256
|
+
return !!C && Qe(C, i);
|
|
257
257
|
}
|
|
258
258
|
}, a, l) : l;
|
|
259
259
|
};
|
|
@@ -288,18 +288,18 @@ const $ = ({ children: e, className: n, ...r }) => {
|
|
|
288
288
|
value: u
|
|
289
289
|
}, i));
|
|
290
290
|
}, Ce = ({ className: e }) => {
|
|
291
|
-
const { longCountryCode: n } =
|
|
292
|
-
return /* @__PURE__ */ t.createElement(
|
|
291
|
+
const { longCountryCode: n } = H();
|
|
292
|
+
return /* @__PURE__ */ t.createElement(Y, {
|
|
293
293
|
className: e,
|
|
294
294
|
longCountryCode: n
|
|
295
295
|
});
|
|
296
296
|
}, de = ({ className: e }) => {
|
|
297
|
-
const { countryName: n } =
|
|
297
|
+
const { countryName: n } = H();
|
|
298
298
|
return /* @__PURE__ */ t.createElement("span", {
|
|
299
299
|
className: e
|
|
300
300
|
}, n);
|
|
301
301
|
}, pe = ({ className: e }) => {
|
|
302
|
-
const { dialingCode: n } =
|
|
302
|
+
const { dialingCode: n } = H();
|
|
303
303
|
return /* @__PURE__ */ t.createElement("span", {
|
|
304
304
|
className: e
|
|
305
305
|
}, n);
|
|
@@ -331,36 +331,36 @@ const tt = ({ className: e }) => {
|
|
|
331
331
|
className: e
|
|
332
332
|
});
|
|
333
333
|
}, nt = ({ children: e, className: n }) => {
|
|
334
|
-
const r = v(null), o = v(null), a = v(!1), { disabled: c, readOnly: l, required: u, hasError: i, showFlag: m, onFocus: C, onBlur: p } = M(), d = Me(p), { t: f } = P(), { 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),
|
|
334
|
+
const r = v(null), o = v(null), a = v(!1), { disabled: c, readOnly: l, required: u, hasError: i, showFlag: m, onFocus: C, onBlur: p } = M(), d = Me(p), { t: f } = P(), { 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
|
|
340
|
-
const
|
|
341
|
-
!((
|
|
339
|
+
var K, Q;
|
|
340
|
+
const R = L.relatedTarget;
|
|
341
|
+
!((K = r.current) != null && K.contains(R)) && !((Q = o.current) != null && Q.contains(R)) && (a.current = !1, d());
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
if (S.length === 1)
|
|
345
|
-
return /* @__PURE__ */ t.createElement(
|
|
345
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
346
346
|
ref: r,
|
|
347
347
|
className: n,
|
|
348
348
|
isDisabled: c,
|
|
349
349
|
isInvalid: i,
|
|
350
|
-
...
|
|
351
|
-
}, m && /* @__PURE__ */ t.createElement(
|
|
350
|
+
...x
|
|
351
|
+
}, m && /* @__PURE__ */ t.createElement(Y, {
|
|
352
352
|
longCountryCode: S[0].longCountryCode
|
|
353
353
|
}), D);
|
|
354
354
|
const I = /* @__PURE__ */ t.createElement(t.Fragment, null, A, ce(T, {
|
|
355
355
|
triggerRef: r,
|
|
356
356
|
optionsRef: o
|
|
357
357
|
}));
|
|
358
|
-
return /* @__PURE__ */ t.createElement(
|
|
358
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
359
359
|
ref: r,
|
|
360
360
|
className: n,
|
|
361
361
|
isDisabled: c,
|
|
362
362
|
isInvalid: i,
|
|
363
|
-
...
|
|
363
|
+
...x
|
|
364
364
|
}, F ? /* @__PURE__ */ t.createElement(Le, null, I) : /* @__PURE__ */ t.createElement(Ie, {
|
|
365
365
|
"aria-label": f("field.phone.country-code.aria-label"),
|
|
366
366
|
value: y ?? null,
|
|
@@ -371,9 +371,9 @@ const tt = ({ className: e }) => {
|
|
|
371
371
|
placeholder: ""
|
|
372
372
|
}, I), D);
|
|
373
373
|
};
|
|
374
|
-
s.Label =
|
|
374
|
+
s.Label = xe;
|
|
375
375
|
s.Control = nt;
|
|
376
|
-
s.CountryButton =
|
|
376
|
+
s.CountryButton = z;
|
|
377
377
|
s.CountryOptions = g;
|
|
378
378
|
s.PhoneNumber = tt;
|
|
379
379
|
s.Description = Fe;
|
|
@@ -420,7 +420,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
420
420
|
}), _t = () => /* @__PURE__ */ t.createElement("span", {
|
|
421
421
|
className: E.chevron,
|
|
422
422
|
"aria-hidden": "true"
|
|
423
|
-
}, /* @__PURE__ */ t.createElement(we, null)),
|
|
423
|
+
}, /* @__PURE__ */ t.createElement(we, null)), Vt = () => {
|
|
424
424
|
const { t: e } = P(), { 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")
|
|
@@ -441,9 +441,9 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
441
441
|
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
442
442
|
className: b(ke, _.label)
|
|
443
443
|
}, /* @__PURE__ */ t.createElement(s.Label.Required, {
|
|
444
|
-
className: b(
|
|
444
|
+
className: b(Ve, _.requiredMark)
|
|
445
445
|
})), /* @__PURE__ */ t.createElement(s.Control, {
|
|
446
|
-
className: b(
|
|
446
|
+
className: b(qe, _.input, E.control)
|
|
447
447
|
}, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
448
448
|
className: E.countryButton
|
|
449
449
|
}, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
@@ -458,16 +458,16 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
458
458
|
portalContainer: r,
|
|
459
459
|
"aria-label": e("field.phone.country-code.aria-label")
|
|
460
460
|
}, o, a, c) : /* @__PURE__ */ t.createElement(s.CountryOptions.Popover, {
|
|
461
|
-
className: b(
|
|
461
|
+
className: b(Ge, _.selectPopover, E.countryOptions),
|
|
462
462
|
placement: "bottom start",
|
|
463
463
|
offset: 0,
|
|
464
464
|
"aria-label": e("field.phone.country-code.aria-label")
|
|
465
465
|
}, o, a, c)), /* @__PURE__ */ t.createElement(s.Error, {
|
|
466
|
-
className: b(
|
|
466
|
+
className: b(He, _.error)
|
|
467
467
|
}, /* @__PURE__ */ t.createElement(Ue, null), /* @__PURE__ */ t.createElement(s.Error.Text, null)), /* @__PURE__ */ t.createElement(s.Description, {
|
|
468
|
-
className: b(
|
|
468
|
+
className: b(Ye, _.description)
|
|
469
469
|
}, bt));
|
|
470
470
|
};
|
|
471
471
|
export {
|
|
472
|
-
|
|
472
|
+
Vt as P
|
|
473
473
|
};
|