@wix/form-elements 1.63.0 → 1.64.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-B1VVk_Ui.js → appointment-rac-DojiZqx9.js} +35 -35
- package/dist/component/{bookings-address-rac-IQeHFdHT.js → bookings-address-rac-Bm_lQchD.js} +1 -1
- package/dist/component/{bookings-email-rac-z26A790r.js → bookings-email-rac-vwuy0kW8.js} +1 -1
- package/dist/component/{bookings-first-name-rac-Djf0GPP4.js → bookings-first-name-rac-BbWuLoeg.js} +1 -1
- package/dist/component/{bookings-header-rac-CXOzAOpz.js → bookings-header-rac-DVknNH29.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CbB8alM9.js → bookings-last-name-rac-BnT3Cq0b.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CXrLx7Pn.js → bookings-login-bar-rac-DKi-VAXc.js} +5 -5
- package/dist/component/{bookings-phone-rac-DGYx7h5g.js → bookings-phone-rac-Bfy8rheB.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-viJG57XF.js → bookings-rich-text-rac-DGiBDcXw.js} +1 -1
- package/dist/component/{checkbox-field-rac-e-RAmupX.js → checkbox-field-rac-CYADRY54.js} +5 -5
- package/dist/component/checkbox-group-field-headless-BDAFpX5F.js +210 -0
- package/dist/component/checkbox-group-field-rac-2YUsOmDI.js +40 -0
- package/dist/component/{checkbox-group-rac-CDfDTWqz.js → checkbox-group-rac-CQf1C9H5.js} +1 -1
- package/dist/component/{checkbox-rac-BRBKYD_5.js → checkbox-rac-Bjv8jZjs.js} +1 -1
- package/dist/component/{contacts-address-rac-BtWWQi77.js → contacts-address-rac-BBTiEec9.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DaEUXJTf.js → contacts-birthdate-rac-XReeFHVW.js} +1 -1
- package/dist/component/{contacts-company-rac-IgRyjtcM.js → contacts-company-rac-B-fUQszu.js} +1 -1
- package/dist/component/{contacts-email-rac-BS1MDrMk.js → contacts-email-rac-DBtcCcsV.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BAvXypDF.js → contacts-first-name-rac-mkwU3706.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C289RYPl.js → contacts-last-name-rac-DY5N-AZx.js} +1 -1
- package/dist/component/{contacts-phone-rac-DIpyskam.js → contacts-phone-rac-Ce1rMz_z.js} +1 -1
- package/dist/component/{contacts-position-rac-nPeh3lKU.js → contacts-position-rac-B65H8PDu.js} +1 -1
- package/dist/component/contacts-subscribe-rac-BxO8rIyL.js +13 -0
- package/dist/component/{contacts-tax-id-rac-C4WB-SR0.js → contacts-tax-id-rac-Jtt0ySK2.js} +1 -1
- package/dist/component/{date-availability-HHjPx4Uv.js → date-availability-B8UwvTJa.js} +1 -1
- package/dist/component/{date-input-field-rac-GFgFcpX2.js → date-input-field-rac-RL2a0xoD.js} +33 -33
- package/dist/component/{date-input-rac-B9BUEIA-.js → date-input-rac-ak3G7V07.js} +1 -1
- package/dist/component/{date-picker-field-rac-BfjYIIuY.js → date-picker-field-rac-SL_Roltf.js} +31 -31
- package/dist/component/{date-picker-rac-Bd2UN0ZF.js → date-picker-rac-ByrM0YIX.js} +1 -1
- package/dist/component/{date-time-input-field-rac-CAXnxLQP.js → date-time-input-field-rac-DOE7xcKi.js} +36 -36
- package/dist/component/{date-time-input-rac-BuJ3Awlh.js → date-time-input-rac-BA-GyrAc.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-DKp4cBVa.js → dext-checkbox-group-rac-EwUnBO80.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BMu_k06A.js → dext-checkbox-rac-CIRKi4B5.js} +1 -1
- package/dist/component/{dext-date-picker-rac-L3sdldhT.js → dext-date-picker-rac-BYO_Q1zM.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-UmabFzDN.js → dext-date-time-input-rac-BOahPeaH.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DbjgYaG-.js → dext-dropdown-rac-sTD_r-0H.js} +1 -1
- package/dist/component/{dext-email-rac-rNudrOOK.js → dext-email-rac-e-2_h3he.js} +1 -1
- package/dist/component/{dext-number-input-rac-hw1FTrJL.js → dext-number-input-rac-D6LACzWl.js} +1 -1
- package/dist/component/{dext-phone-rac-DrZ_Vwv2.js → dext-phone-rac-kUycy5Od.js} +1 -1
- package/dist/component/{dext-radio-group-rac-DAt2ax-I.js → dext-radio-group-rac-DPD2UkrV.js} +2 -2
- package/dist/component/{dext-rating-input-rac-BW2Ike11.js → dext-rating-input-rac-DUsnrl9W.js} +1 -1
- package/dist/component/{dext-tags-rac-DDzwlKrR.js → dext-tags-rac-D6z69HuO.js} +2 -2
- package/dist/component/{dext-text-area-rac-D0xf4z3z.js → dext-text-area-rac-C-DVtFJ1.js} +1 -1
- package/dist/component/{dext-text-input-rac-Da04OLmq.js → dext-text-input-rac-CIa2MdC6.js} +1 -1
- package/dist/component/{dext-url-input-rac-B-g4xTqh.js → dext-url-input-rac-8rVVW5us.js} +1 -1
- package/dist/component/{donation-rac-gKeq72jg.js → donation-rac-BjmSBabc.js} +60 -60
- package/dist/component/{dropdown-field-headless-Js5TxdU4.js → dropdown-field-headless-DReo519l.js} +16 -16
- package/dist/component/{dropdown-field-rac-BDxcvX00.js → dropdown-field-rac-DzrjA2O6.js} +7 -7
- package/dist/component/{dropdown-rac-B5UHNzV-.js → dropdown-rac-CS7oLTp_.js} +1 -1
- package/dist/component/{ecom-address-rac-0zm4bX37.js → ecom-address-rac-EIb88J_6.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DCXoI33l.js → ecom-subscription-checkbox-rac-CE0Ks6qS.js} +5 -5
- package/dist/component/{email-input-field-rac-svf6hUHF.js → email-input-field-rac-BScZxYHw.js} +47 -47
- package/dist/component/{events-repeater-rac-DMIqzuVK.js → events-repeater-rac-Y0rH2Jli.js} +45 -45
- package/dist/component/{events-rsvp-rac-B_YD4ckO.js → events-rsvp-rac-BiAYVv_b.js} +12 -12
- package/dist/component/{field-error-headless-DTKnr5Zx.js → field-error-headless-DrnFrGun.js} +3 -3
- package/dist/component/{field-label-headless-DV4aNd5Y.js → field-label-headless-BIYf1BIh.js} +4 -4
- package/dist/component/field-rac.module-CWkwwhq4.js +21 -0
- package/dist/component/{file-upload-rac-lGKJjG3m.js → file-upload-rac-br--tZLp.js} +73 -73
- package/dist/component/{fixed-payment-rac-BVS6glii.js → fixed-payment-rac-XEtrsaMy.js} +11 -11
- package/dist/component/{form-DzjdnO7t.js → form-9yjqDnxY.js} +1563 -1556
- package/dist/component/form-element-classes-KRzHUNLu.js +57 -0
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-tzBH-8Yh.js → header-field-rac-CLELgzqY.js} +7 -7
- package/dist/component/{header-rac-6thQAvVF.js → header-rac-D8KGkVVp.js} +1 -1
- package/dist/component/{image-choice-rac-Dx1b-saW.js → image-choice-rac-Cl09CLP4.js} +14 -14
- package/dist/component/{index-DIP7KB8P.js → index-C4y71e1i.js} +2 -2
- package/dist/component/{index-Lnx0829a.js → index-PHkE0Ru4.js} +4 -4
- package/dist/component/{isObjectLike-B_1KizZV.js → isObjectLike-srCDplej.js} +1 -1
- package/dist/component/{multiline-address-field-rac-BY2SUp2d.js → multiline-address-field-rac-CsBLI9y-.js} +80 -80
- package/dist/component/{multiline-address-rac-BL8Yp4F0.js → multiline-address-rac-DFDPFfXh.js} +1 -1
- package/dist/component/{number-input-field-rac-x0yFmXbe.js → number-input-field-rac-DZRR7gdt.js} +16 -16
- package/dist/component/{number-input-rac-pJXc2YsD.js → number-input-rac-BCS5lkff.js} +1 -1
- package/dist/component/{password-rac-B4XCP64b.js → password-rac-ClDGgR3E.js} +16 -16
- package/dist/component/{payment-input-rac-CZdOAjK4.js → payment-input-rac-COydWmUE.js} +28 -28
- package/dist/component/{phone-input-field-rac-DO_V5Z_T.js → phone-input-field-rac-DYCibqe1.js} +42 -42
- package/dist/component/{phone-rac-D16nLDjP.js → phone-rac-BS-dmWkJ.js} +1 -1
- package/dist/component/{product-list-rac-DER8gVqy.js → product-list-rac-hxOhaA-r.js} +75 -75
- package/dist/component/quiz-radio-group-rac-BT-YZO2Q.js +13 -0
- package/dist/component/{radio-group-field-rac-Dt2pU0VV.js → radio-group-field-rac-DKqWnMBJ.js} +3 -3
- package/dist/component/{radio-group-field-rac.module--sO0VqCA.js → radio-group-field-rac.module-BwUynK_5.js} +7 -7
- package/dist/component/{radio-group-rac-CqCmtkNQ.js → radio-group-rac-DHURQZKK.js} +1 -1
- package/dist/component/{rating-input-field-rac-xDrHHcL2.js → rating-input-field-rac-CZRdSVrf.js} +30 -30
- package/dist/component/{rating-input-rac-Bo5E9N87.js → rating-input-rac-BaH52DYm.js} +1 -1
- package/dist/component/{rich-content-rac.module-CJXbNca9.js → rich-content-rac.module-ILBfxEmN.js} +1 -1
- package/dist/component/{rich-text-field-rac-CkV0Z9F-.js → rich-text-field-rac-B58q8Is7.js} +5 -5
- package/dist/component/{rich-text-rac-59DbKpXz.js → rich-text-rac-DGbZh1eX.js} +1 -1
- package/dist/component/{service-dropdown-rac-BLnflnUr.js → service-dropdown-rac-DUiNIbdv.js} +45 -45
- package/dist/component/services-multi-choice-rac-B7y9s2l8.js +76 -0
- package/dist/component/{signature-rac-Bb5IaS28.js → signature-rac-CydpvQJZ.js} +25 -25
- package/dist/component/{submit-button-rac-Bjyi8sUA.js → submit-button-rac-OO53h4H8.js} +6 -6
- package/dist/component/{tags-field-rac-C_VO3_69.js → tags-field-rac-eX3d3JEH.js} +44 -44
- package/dist/component/{tags-rac-CKiutCWe.js → tags-rac-CdIB_48Z.js} +1 -1
- package/dist/component/{text-area-field-rac-Cg-vIhFe.js → text-area-field-rac-Bir5Q7gz.js} +17 -17
- package/dist/component/{text-area-rac-tMFx38UD.js → text-area-rac-Ct1UNU04.js} +1 -1
- package/dist/component/{text-input-field-rac-CgN_2hOD.js → text-input-field-rac-onGUXC9J.js} +6 -6
- package/dist/component/{text-input-headless-CkhvKrFp.js → text-input-headless-Bs9m7QFg.js} +11 -11
- package/dist/component/{text-input-rac-BsyBgd3b.js → text-input-rac-DK4nEw4D.js} +1 -1
- package/dist/component/{time-input-rac-BxRVJtHE.js → time-input-rac-BCG9ktFa.js} +35 -35
- package/dist/component/{url-input-field-rac-B_1yVniS.js → url-input-field-rac-mUkrVTcL.js} +24 -24
- package/dist/component/{url-input-rac-D8VrKYVe.js → url-input-rac-Cl7LFYlr.js} +1 -1
- package/dist/component/{use-service-options-base-Ci9gIluo.js → use-service-options-base-BYVuKRj2.js} +6 -6
- package/dist/form.d.ts +3 -1
- package/package.json +2 -2
- package/dist/component/checkbox-group-field-headless-Cvia4lL6.js +0 -204
- package/dist/component/checkbox-group-field-rac-BXxk90dk.js +0 -33
- package/dist/component/contacts-subscribe-rac-Ci5OLk68.js +0 -13
- package/dist/component/field-rac.module-DtugsLiL.js +0 -21
- package/dist/component/form-element-classes-Bi-nNM8q.js +0 -55
- package/dist/component/quiz-radio-group-rac-BgTmHHi4.js +0 -13
- package/dist/component/services-multi-choice-rac-C-bFjwx8.js +0 -76
|
@@ -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 Q } from "@wix/ricos/viewer";
|
|
3
3
|
import i from "classnames";
|
|
4
|
-
import { TextField as
|
|
5
|
-
import {
|
|
4
|
+
import { TextField as w, Group as z, Input as K } from "react-aria-components";
|
|
5
|
+
import { ai as D, af as S, ab as x, as as W, ak as X } from "./form-9yjqDnxY.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-DrnFrGun.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-BIYf1BIh.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-CWkwwhq4.js";
|
|
14
|
+
import { t as se, J as oe, s as le, n as ce, j as ie } from "./form-element-classes-KRzHUNLu.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:
|
|
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 } = x(), 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
|
|
@@ -57,11 +57,11 @@ const n = ({ children: e }) => {
|
|
|
57
57
|
c,
|
|
58
58
|
C,
|
|
59
59
|
I
|
|
60
|
-
]),
|
|
60
|
+
]), k = m(e, n.Label), B = m(e, n.Input), v = m(e, n.Description), H = m(e, n.Error);
|
|
61
61
|
return /* @__PURE__ */ r.createElement(M, {
|
|
62
62
|
fieldId: t,
|
|
63
|
-
renderLabel: () =>
|
|
64
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
63
|
+
renderLabel: () => k,
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(w, {
|
|
65
65
|
"aria-labelledby": `${q} ${G}`,
|
|
66
66
|
value: a ? F : "",
|
|
67
67
|
onChange: U,
|
|
@@ -70,13 +70,13 @@ const n = ({ children: e }) => {
|
|
|
70
70
|
isRequired: y,
|
|
71
71
|
isInvalid: b,
|
|
72
72
|
onBlur: $,
|
|
73
|
-
onFocus:
|
|
74
|
-
},
|
|
75
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
73
|
+
onFocus: E
|
|
74
|
+
}, B),
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H, v)
|
|
76
76
|
});
|
|
77
|
-
},
|
|
78
|
-
const { disabled: a, hasError: s } = D(), p = m(e,
|
|
79
|
-
return /* @__PURE__ */ r.createElement(
|
|
77
|
+
}, f = ({ children: e, className: t }) => {
|
|
78
|
+
const { disabled: a, hasError: s } = D(), p = m(e, f.Currency), d = m(e, f.Value);
|
|
79
|
+
return /* @__PURE__ */ r.createElement(z, {
|
|
80
80
|
className: t,
|
|
81
81
|
isDisabled: a,
|
|
82
82
|
isInvalid: s
|
|
@@ -90,10 +90,10 @@ 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
|
-
var
|
|
96
|
-
(
|
|
95
|
+
var E;
|
|
96
|
+
(E = o.current) == null || E.focus();
|
|
97
97
|
}, t), /* @__PURE__ */ r.createElement(K, {
|
|
98
98
|
ref: o,
|
|
99
99
|
id: p,
|
|
@@ -105,16 +105,16 @@ const n = ({ children: e }) => {
|
|
|
105
105
|
autoComplete: "off"
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
f.Currency = me;
|
|
109
|
+
f.Value = pe;
|
|
110
110
|
n.Label = ee;
|
|
111
|
-
n.Input =
|
|
111
|
+
n.Input = f;
|
|
112
112
|
n.Description = Y;
|
|
113
113
|
n.Error = Z;
|
|
114
|
-
const de = "_inputGroup_vuy4u_1",
|
|
114
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", T = {
|
|
115
115
|
inputGroup: de,
|
|
116
|
-
currency:
|
|
117
|
-
},
|
|
116
|
+
currency: fe
|
|
117
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(Q, {
|
|
118
118
|
content: e,
|
|
119
119
|
locale: t
|
|
120
120
|
}), Ie = () => /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
@@ -131,7 +131,7 @@ const de = "_inputGroup_vuy4u_1", Ee = "_currency_vuy4u_14", T = {
|
|
|
131
131
|
className: i(ce, u.error)
|
|
132
132
|
}, /* @__PURE__ */ r.createElement(ne, null), /* @__PURE__ */ r.createElement(n.Error.Text, null)), /* @__PURE__ */ r.createElement(n.Description, {
|
|
133
133
|
className: i(ie, u.description)
|
|
134
|
-
},
|
|
134
|
+
}, Ee)), Ve = () => /* @__PURE__ */ r.createElement(Ie, null);
|
|
135
135
|
export {
|
|
136
136
|
Ve as PaymentInputRAC
|
|
137
137
|
};
|
package/dist/component/{phone-input-field-rac-DO_V5Z_T.js → phone-input-field-rac-DYCibqe1.js}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
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,
|
|
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-9yjqDnxY.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 Re } from "./field-label-headless-
|
|
8
|
+
import { D as Fe, E as De } from "./field-error-headless-DrnFrGun.js";
|
|
9
|
+
import { L as Re } from "./field-label-headless-BIYf1BIh.js";
|
|
10
10
|
import { N as xe, 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";
|
|
14
|
-
import { C as
|
|
14
|
+
import { C as Q } 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
|
-
import { H as
|
|
18
|
-
import { s as _ } from "./field-rac.module-
|
|
19
|
-
import {
|
|
17
|
+
import { H as W } from "./custom-focus-class-_483Pkwp.js";
|
|
18
|
+
import { s as _ } from "./field-rac.module-CWkwwhq4.js";
|
|
19
|
+
import { t as ke, J as Ve, s as qe, w as Ge, n as He, j as Ye } from "./form-element-classes-KRzHUNLu.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
|
}
|
|
@@ -43,8 +43,8 @@ function ee(e, n) {
|
|
|
43
43
|
}
|
|
44
44
|
function je() {
|
|
45
45
|
const { t: e } = P(), { language: n } = ne();
|
|
46
|
-
return B(() => Object.keys(
|
|
47
|
-
const c =
|
|
46
|
+
return B(() => Object.keys(Q).reduce((o, a) => {
|
|
47
|
+
const c = Q[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,
|
|
@@ -61,13 +61,13 @@ function ze(e, n) {
|
|
|
61
61
|
}
|
|
62
62
|
function Ke(e, n) {
|
|
63
63
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
64
|
-
return !!(
|
|
64
|
+
return !!(k(r, n) || k(o, n) || k(a, n));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
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,12 +119,12 @@ 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;
|
|
@@ -144,7 +144,7 @@ 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 = je(), p = B(() => ze(C, m), [
|
|
148
148
|
C,
|
|
149
149
|
m
|
|
150
150
|
]), d = B(() => p.map((x) => x.shortCountryCode), [
|
|
@@ -177,7 +177,7 @@ const le = /* @__PURE__ */ te(null), N = () => {
|
|
|
177
177
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, T)
|
|
178
178
|
}));
|
|
179
179
|
}, j = ({ 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 &&
|
|
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,20 +186,20 @@ 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
191
|
return o ? /* @__PURE__ */ t.createElement(Y, {
|
|
192
192
|
className: e,
|
|
193
193
|
longCountryCode: o.longCountryCode
|
|
194
194
|
}) : null;
|
|
195
|
-
},
|
|
195
|
+
}, Qe = ({ children: e, className: n }) => {
|
|
196
196
|
const { selectedCountryCode: r, countries: o } = N();
|
|
197
197
|
return o.some((c) => c.shortCountryCode === r) ? null : /* @__PURE__ */ t.createElement("span", {
|
|
198
198
|
className: n
|
|
199
199
|
}, e);
|
|
200
200
|
};
|
|
201
|
-
j.Flag =
|
|
202
|
-
j.EmptyState =
|
|
201
|
+
j.Flag = Je;
|
|
202
|
+
j.EmptyState = Qe;
|
|
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, {
|
|
@@ -214,8 +214,8 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
214
214
|
}, m ? /* @__PURE__ */ t.createElement(re, {
|
|
215
215
|
"aria-label": r
|
|
216
216
|
}, C) : C));
|
|
217
|
-
},
|
|
218
|
-
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m =
|
|
217
|
+
}, We = ({ 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 = 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,
|
|
@@ -258,7 +258,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
258
258
|
}, a, l) : l;
|
|
259
259
|
};
|
|
260
260
|
g.Popover = g;
|
|
261
|
-
g.Modal =
|
|
261
|
+
g.Modal = We;
|
|
262
262
|
const me = ({ className: e, children: n, "aria-label": r }) => /* @__PURE__ */ t.createElement(Oe, {
|
|
263
263
|
className: e,
|
|
264
264
|
"aria-label": r,
|
|
@@ -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 } =
|
|
291
|
+
const { longCountryCode: n } = H();
|
|
292
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);
|
|
@@ -342,7 +342,7 @@ const tt = ({ className: e }) => {
|
|
|
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,
|
|
@@ -355,7 +355,7 @@ const tt = ({ className: e }) => {
|
|
|
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,
|
|
@@ -420,17 +420,17 @@ 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")
|
|
427
427
|
}, /* @__PURE__ */ t.createElement(rt, {
|
|
428
428
|
className: E.searchIcon
|
|
429
429
|
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Search.Input, {
|
|
430
|
-
className: b(E.countrySearch,
|
|
430
|
+
className: b(E.countrySearch, W),
|
|
431
431
|
placeholder: e("field.phone.country-search-input.placeholder")
|
|
432
432
|
})), a = /* @__PURE__ */ t.createElement(s.CountryOptions.EmptyState, null, e("field.phone.country-selector-dropdown.no-result")), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Option, {
|
|
433
|
-
className: b(_.selectOption, _.selectOptionWithoutFocusRing, E.option,
|
|
433
|
+
className: b(_.selectOption, _.selectOptionWithoutFocusRing, E.option, W)
|
|
434
434
|
}, /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Flag, {
|
|
435
435
|
className: E.flag
|
|
436
436
|
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Name, {
|
|
@@ -439,11 +439,11 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
439
439
|
className: E.code
|
|
440
440
|
}));
|
|
441
441
|
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
442
|
-
className: b(
|
|
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
468
|
className: b(Ye, _.description)
|
|
469
469
|
}, bt));
|
|
470
470
|
};
|
|
471
471
|
export {
|
|
472
|
-
|
|
472
|
+
Vt as P
|
|
473
473
|
};
|