@wix/form-elements 1.223.0 → 1.225.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-UcRjJTHp.js → appointment-rac-DfglpMHC.js} +5 -5
- package/dist/component/{bookings-address-rac-DDjZGEhk.js → bookings-address-rac-BsAUAgUH.js} +1 -1
- package/dist/component/{bookings-email-rac-Dy2vh3dy.js → bookings-email-rac-DL0Q3omz.js} +1 -1
- package/dist/component/{bookings-first-name-rac-fDHMNznn.js → bookings-first-name-rac-C3eHsd6U.js} +1 -1
- package/dist/component/{bookings-header-rac-DLOeNNQf.js → bookings-header-rac-YVCqWtfu.js} +1 -1
- package/dist/component/{bookings-last-name-rac-Bx19ROVT.js → bookings-last-name-rac-BzBQBIMy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-8FbvPiv1.js → bookings-login-bar-rac-MJvhVfsH.js} +1 -1
- package/dist/component/{bookings-phone-rac-CvPQgtvq.js → bookings-phone-rac-BTEB2Mzf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CO8bHRpD.js → bookings-rich-text-rac-BopQG6gV.js} +1 -1
- package/dist/component/calendar-icon-DOeHn3jt.js +19 -0
- package/dist/component/{checkbox-field-rac-tzsGw10P.js → checkbox-field-rac-NvQt_qcN.js} +6 -6
- package/dist/component/{checkbox-group-field-headless-CL18dpkq.js → checkbox-group-field-headless-CwLaBukh.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-BmbxaprJ.js → checkbox-group-field-rac-BKQhos1K.js} +6 -6
- package/dist/component/{checkbox-group-rac-shsbUvRc.js → checkbox-group-rac-DMeC2rsZ.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-DOxE4UQg.js → checkbox-indicator-module-classes-Cozvs_kk.js} +1 -1
- package/dist/component/{checkbox-rac-CobYYayd.js → checkbox-rac-Dea1HbEL.js} +1 -1
- package/dist/component/{contacts-address-rac-BoDqJCi1.js → contacts-address-rac-B64jiofc.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-GAujbm-z.js → contacts-birthdate-rac-CM4GjTBV.js} +1 -1
- package/dist/component/{contacts-company-rac-CLcEz04V.js → contacts-company-rac-DTf9dwuR.js} +1 -1
- package/dist/component/{contacts-email-rac-D9q7TJwy.js → contacts-email-rac-B2vhNF_y.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BAecbeNQ.js → contacts-first-name-rac-C5ywHnnX.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Ccrw8BDa.js → contacts-last-name-rac-C2JbeG_J.js} +1 -1
- package/dist/component/{contacts-phone-rac-DA2N033V.js → contacts-phone-rac-Dm0PS175.js} +1 -1
- package/dist/component/{contacts-position-rac-0lAd-nCW.js → contacts-position-rac-t6bWP1Yh.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DB2ssF-E.js → contacts-subscribe-rac-D5EWQfGj.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B-Sn92Ho.js → contacts-tax-id-rac-CXqezyXg.js} +1 -1
- package/dist/component/{date-availability-CtfWLvii.js → date-availability-CtrbZvl3.js} +1 -1
- package/dist/component/date-input-field-rac-CPLAqaMS.js +365 -0
- package/dist/component/{date-input-rac-BnWwBe2i.js → date-input-rac-DjQc-F8G.js} +1 -1
- package/dist/component/date-picker-field-rac-pA2HwauY.js +386 -0
- package/dist/component/{date-picker-rac-BhI6jOQE.js → date-picker-rac-B6M3C8dN.js} +1 -1
- package/dist/component/date-time-input-field-rac-Qz6g31Eu.js +507 -0
- package/dist/component/{date-time-input-rac-DAbopLQt.js → date-time-input-rac-D7bS3bUX.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-D_HLv0tP.js → dext-checkbox-group-rac-caVwDBtB.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BnBTlqEI.js → dext-checkbox-rac-CMxPnPT3.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Co_yfhuz.js → dext-date-picker-rac-5WBCluMk.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BSpUehb2.js → dext-date-time-input-rac-C5d1PKMu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DPApx74L.js → dext-dropdown-rac-BPeVs1gI.js} +1 -1
- package/dist/component/{dext-email-rac-Dns6jFl4.js → dext-email-rac-BTXfUaaY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DfN-xRID.js → dext-number-input-rac-DJt_dDVj.js} +1 -1
- package/dist/component/{dext-phone-rac-b5Ix3aTQ.js → dext-phone-rac-DDtneNPi.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BAwIkDsJ.js → dext-radio-group-rac-DzLW_As4.js} +2 -2
- package/dist/component/{dext-rating-input-rac-mwQpCQUI.js → dext-rating-input-rac-0wwq1TR3.js} +1 -1
- package/dist/component/{dext-tags-rac-BGmElgw8.js → dext-tags-rac-Cj7nIZWu.js} +2 -2
- package/dist/component/{dext-text-area-rac-DN5HPqdg.js → dext-text-area-rac-D4Ej9MYY.js} +1 -1
- package/dist/component/{dext-text-input-rac-DEyDRhQ2.js → dext-text-input-rac-DgqBl2cb.js} +1 -1
- package/dist/component/{dext-url-input-rac-B1o3BAZE.js → dext-url-input-rac-CH-5gGxA.js} +1 -1
- package/dist/component/dismiss-icon-ejA47noY.js +69 -0
- package/dist/component/{donation-rac-Dp6PmATz.js → donation-rac-BwpE1YTR.js} +6 -6
- package/dist/component/dropdown-field-rac-CeywMN1E.js +40 -0
- package/dist/component/{dropdown-rac-eqQW-Z9k.js → dropdown-rac-DiXJLvXK.js} +1 -1
- package/dist/component/{ecom-address-rac-Q02N1v6i.js → ecom-address-rac-MD0hbW1w.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CmqVje9n.js → ecom-subscription-checkbox-rac-BssVeeXB.js} +2 -2
- package/dist/component/{email-input-field-rac-HmrdF3g7.js → email-input-field-rac-BXoueQNf.js} +4 -4
- package/dist/component/{events-repeater-rac-BSML2My0.js → events-repeater-rac-fm6lHaJ2.js} +6 -6
- package/dist/component/{events-rsvp-rac-0pI3cb2e.js → events-rsvp-rac-QV9f5chX.js} +4 -4
- package/dist/component/{field-error-headless-B3U_Gymg.js → field-error-headless-BIzDViIC.js} +1 -1
- package/dist/component/{field-label-headless-Cyy9_5qJ.js → field-label-headless-D_ubs4wp.js} +1 -1
- package/dist/component/field-rac.module-D0QzJXUv.js +32 -0
- package/dist/component/{file-upload-rac-hR9TZqk2.js → file-upload-rac-Csmt20hK.js} +5 -5
- package/dist/component/{fixed-payment-rac-CghZp6bR.js → fixed-payment-rac-BXr53Q8H.js} +4 -4
- package/dist/component/{form-BmSV4tOz.js → form-Dnq7LxSl.js} +1701 -1688
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C7LDm89o.js → header-field-rac-9750XSxD.js} +2 -2
- package/dist/component/{header-rac-BNNzF5wQ.js → header-rac-DGSENeOk.js} +1 -1
- package/dist/component/{image-choice-rac-DLgxkKIZ.js → image-choice-rac-HX8H18Z3.js} +5 -5
- package/dist/component/{index-Dg8Fefid.js → index-pgW3uSoZ.js} +2 -2
- package/dist/component/{index-B8ObIJtL.js → index-vs-qkVQt.js} +4 -4
- package/dist/component/{isObjectLike-oBQcCfqW.js → isObjectLike-DoUrU0Hj.js} +1 -1
- package/dist/component/multiline-address-field-rac-B3gKz3u_.js +1818 -0
- package/dist/component/{multiline-address-rac-8MZkKfqY.js → multiline-address-rac-BBign7ot.js} +1 -1
- package/dist/component/native-select-BbxBpe3S.js +32 -0
- package/dist/component/{number-input-field-rac-Dmp8pNIq.js → number-input-field-rac-CO6DG443.js} +5 -5
- package/dist/component/{number-input-rac-2cN_bN_s.js → number-input-rac-C_Ndaqs4.js} +1 -1
- package/dist/component/{password-rac-CFdC1hoi.js → password-rac-pq-CaSkt.js} +5 -5
- package/dist/component/{payment-input-rac-BWElGzuv.js → payment-input-rac-Dco8O86k.js} +5 -5
- package/dist/component/phone-input-field-rac-BmcADPkC.js +558 -0
- package/dist/component/{phone-rac-CE9-90C3.js → phone-rac-B3aFMUMq.js} +1 -1
- package/dist/component/{product-list-rac-QU7Ocwvy.js → product-list-rac-Cw21coVk.js} +6 -6
- package/dist/component/{quiz-radio-group-rac-Hm7B7RlU.js → quiz-radio-group-rac-ChkNtxix.js} +1 -1
- package/dist/component/{radio-button-module-classes-CcGF7N_Y.js → radio-button-module-classes-BtiG6yqb.js} +3 -3
- package/dist/component/{radio-group-field-rac-Bk1JBBts.js → radio-group-field-rac-6SefZCE6.js} +5 -5
- package/dist/component/{radio-group-rac-D_YZnpID.js → radio-group-rac-BRhOFR2j.js} +1 -1
- package/dist/component/{rating-input-field-rac-zvA6QBGo.js → rating-input-field-rac-DaVnkb6k.js} +5 -5
- package/dist/component/{rating-input-rac-CXVQUoi-.js → rating-input-rac-B-2pZ61H.js} +1 -1
- package/dist/component/{rich-content-rac.module-CnZ4lMBG.js → rich-content-rac.module-C6LD--Ql.js} +1 -1
- package/dist/component/{rich-text-field-rac-DYQgVXdV.js → rich-text-field-rac-C-rfA6pQ.js} +2 -2
- package/dist/component/{rich-text-rac-Dk8396e-.js → rich-text-rac-1s5CGO8u.js} +1 -1
- package/dist/component/service-dropdown-rac-Bcr83doj.js +150 -0
- package/dist/component/{services-multi-choice-rac-D1RiVaLW.js → services-multi-choice-rac-C9nSuz9x.js} +7 -7
- package/dist/component/{signature-rac-DcGKMX84.js → signature-rac-pgob6vV_.js} +5 -5
- package/dist/component/{submit-button-rac-DbMxQlNH.js → submit-button-rac-CzcFB8hM.js} +2 -2
- package/dist/component/{tags-field-rac-Bi4lKutL.js → tags-field-rac-BBFxSNch.js} +6 -6
- package/dist/component/{tags-rac-DDCPnT8M.js → tags-rac-DkwugVvK.js} +1 -1
- package/dist/component/{text-area-field-rac-cre_K0MD.js → text-area-field-rac-DHT-fc0i.js} +5 -5
- package/dist/component/{text-area-rac-61wsMj-j.js → text-area-rac-cTq-i-bf.js} +1 -1
- package/dist/component/{text-input-field-rac-CV5_ba0x.js → text-input-field-rac-D3v-e_5R.js} +4 -4
- package/dist/component/{text-input-headless-kRv3KpSL.js → text-input-headless-B-DwvpWg.js} +3 -3
- package/dist/component/{text-input-rac-CwqZ6NXO.js → text-input-rac-CpG9qt33.js} +1 -1
- package/dist/component/time-input-rac-iL1G8Uwo.js +212 -0
- package/dist/component/to-native-time-Co_gOLkc.js +9 -0
- package/dist/component/{url-input-field-rac-C1JL_m6D.js → url-input-field-rac-1P81rK_4.js} +5 -5
- package/dist/component/{url-input-rac-C1CiGrCn.js → url-input-rac-D9c0BJKG.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-COGEk5d6.js → use-dropdown-option-class-name-CyC7rDCE.js} +3 -3
- package/dist/component/use-dropdown-trigger-class-name-BvRCjLXG.js +137 -0
- package/dist/component/{use-element-state-class-name-pSOX0Y0p.js → use-element-state-class-name-Cpdx_lRm.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-DGEpOAdi.js → use-hoverable-input-class-name-zEk2Vnct.js} +3 -3
- package/dist/component/{use-is-forced-open-dropdown-DPG1e5E9.js → use-is-forced-open-dropdown-_YI6RNG3.js} +1 -1
- package/dist/component/use-native-mobile-input-Czyhb-0V.js +31 -0
- package/dist/component/use-native-state-class-name-B0m2ghbS.js +18 -0
- package/dist/component/{use-service-options-base-BgIZ94V9.js → use-service-options-base-CbFG_r1u.js} +1 -1
- package/dist/component/use-text-input-class-name-CL-b4_Ph.js +6 -0
- package/package.json +3 -2
- package/dist/component/date-input-field-rac-CiAaOiYY.js +0 -309
- package/dist/component/date-picker-field-rac-Dg-chlTL.js +0 -320
- package/dist/component/date-time-input-field-rac-CbDvEPIp.js +0 -441
- package/dist/component/dropdown-field-rac-DY3GGJgP.js +0 -36
- package/dist/component/field-rac.module-DcyJyi2B.js +0 -25
- package/dist/component/multiline-address-field-rac-CgH7lDce.js +0 -1738
- package/dist/component/phone-input-field-rac-CsJGw_OE.js +0 -520
- package/dist/component/service-dropdown-rac-BSXYuBPJ.js +0 -145
- package/dist/component/time-input-rac-DuQar6zW.js +0 -161
- package/dist/component/use-dropdown-trigger-class-name-D6c-3Lyw.js +0 -98
- package/dist/component/use-text-input-class-name-BcbHdFV-.js +0 -6
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
|
-
import b from "classnames";
|
|
3
|
-
import t, { useMemo as A, useState as T, useRef as F, useEffect as k, useCallback as Z, createContext as ne, useContext as Y, useId as Ee } from "react";
|
|
4
|
-
import { bv as fe, bY as D, bF as oe, bX as he, bN as w, bK as re, bP as ge, bW as be, X as Oe, am as _e, a3 as Q, M as Ne, I as Le, a5 as Pe, a4 as Se, a2 as Ie } from "./form-BmSV4tOz.js";
|
|
5
|
-
import { UNSAFE_PortalProvider as ve } from "react-aria";
|
|
6
|
-
import { Dialog as ae, OverlayTriggerStateContext as Fe, ModalOverlay as De, Modal as we, SearchField as Be, Group as U, ListBoxItem as Re, DialogTrigger as xe, Select as Me, Input as se, Autocomplete as je } from "react-aria-components";
|
|
7
|
-
import ce, { AsYouType as $e, isValidPhoneNumber as Ae, isSupportedCountry as Te } from "libphonenumber-js";
|
|
8
|
-
import "libphonenumber-js/metadata.min.json";
|
|
9
|
-
import { f as h, a as S } from "./find-child-C60k4CxG.js";
|
|
10
|
-
import { D as Ve, E as ke } from "./field-error-headless-B3U_Gymg.js";
|
|
11
|
-
import { L as He } from "./field-label-headless-Cyy9_5qJ.js";
|
|
12
|
-
import { N as Ue, S as qe } from "./non-modal-popover-D-u13tmp.js";
|
|
13
|
-
import { u as Ke } from "./use-invoke-callback-UH73A_J3.js";
|
|
14
|
-
import { d as Ye } from "./use-is-forced-open-dropdown-DPG1e5E9.js";
|
|
15
|
-
import { V as Ge, a as ze } from "./use-dropdown-option-class-name-COGEk5d6.js";
|
|
16
|
-
import { C as J } from "./calling-country-codes-PyWuOTmF.js";
|
|
17
|
-
import { C as We } from "./chevron-down-icon-CcpVm6B-.js";
|
|
18
|
-
import { E as Xe } from "./error-icon-hZxQ6DEy.js";
|
|
19
|
-
import { H as ee } from "./custom-focus-class-_483Pkwp.js";
|
|
20
|
-
import { s as O } from "./field-rac.module-DcyJyi2B.js";
|
|
21
|
-
import { u as te } from "./use-hoverable-input-class-name-DGEpOAdi.js";
|
|
22
|
-
function q(e) {
|
|
23
|
-
const n = e ? ce(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
|
-
if (r)
|
|
25
|
-
return r;
|
|
26
|
-
const o = new $e();
|
|
27
|
-
return e && o.input(e), o.getCountry();
|
|
28
|
-
}
|
|
29
|
-
function G(e) {
|
|
30
|
-
var n;
|
|
31
|
-
return e && ((n = fe.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
32
|
-
}
|
|
33
|
-
function $(e) {
|
|
34
|
-
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
35
|
-
}
|
|
36
|
-
function K(e, n) {
|
|
37
|
-
if (e && n)
|
|
38
|
-
try {
|
|
39
|
-
const r = ce(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
40
|
-
if (o && Ae(o))
|
|
41
|
-
return o.replace(/\s+/g, "");
|
|
42
|
-
} catch {
|
|
43
|
-
}
|
|
44
|
-
return e;
|
|
45
|
-
}
|
|
46
|
-
const Ze = (e, n) => {
|
|
47
|
-
var i, u;
|
|
48
|
-
const r = e.value;
|
|
49
|
-
if (!r)
|
|
50
|
-
return;
|
|
51
|
-
const { defaultCountry: o, validation: a } = n, c = (u = (i = a == null ? void 0 : a.string) == null ? void 0 : i.phoneOptions) == null ? void 0 : u.allowedCountryCodes, l = q(r) || o || ((c == null ? void 0 : c.length) === 1 ? c[0] : void 0);
|
|
52
|
-
return $(K(r, l)) ?? void 0;
|
|
53
|
-
};
|
|
54
|
-
function Qe() {
|
|
55
|
-
const { t: e } = D(), { language: n } = oe();
|
|
56
|
-
return A(() => Object.keys(J).reduce((o, a) => {
|
|
57
|
-
const c = J[a], l = G(c), i = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
58
|
-
return l && Te(a) && o.push({
|
|
59
|
-
countryName: i,
|
|
60
|
-
longCountryCode: c,
|
|
61
|
-
shortCountryCode: a,
|
|
62
|
-
callingCode: l
|
|
63
|
-
}), o;
|
|
64
|
-
}, []).sort((o, a) => o.countryName.localeCompare(a.countryName, n)), [
|
|
65
|
-
e,
|
|
66
|
-
n
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
function Je(e, n) {
|
|
70
|
-
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
71
|
-
}
|
|
72
|
-
function et(e, n) {
|
|
73
|
-
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
74
|
-
return !!(H(r, n) || H(o, n) || H(a, n));
|
|
75
|
-
}
|
|
76
|
-
function H(e, n) {
|
|
77
|
-
return e.toLowerCase().includes(n.toLowerCase());
|
|
78
|
-
}
|
|
79
|
-
function tt({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
80
|
-
const [a, c] = T(e || ""), l = F($(e ?? null) ?? ""), [i, u] = T(n);
|
|
81
|
-
he(() => {
|
|
82
|
-
c(""), l.current = "", u(n), o("");
|
|
83
|
-
});
|
|
84
|
-
const p = A(() => q(a), [
|
|
85
|
-
a
|
|
86
|
-
]);
|
|
87
|
-
k(() => {
|
|
88
|
-
const m = e ?? "";
|
|
89
|
-
m !== l.current && (c(m), l.current = m);
|
|
90
|
-
}, [
|
|
91
|
-
e
|
|
92
|
-
]), k(() => {
|
|
93
|
-
n && !i && u(n);
|
|
94
|
-
}, [
|
|
95
|
-
n,
|
|
96
|
-
i
|
|
97
|
-
]), k(() => {
|
|
98
|
-
u(n ?? p);
|
|
99
|
-
}, [
|
|
100
|
-
p,
|
|
101
|
-
n
|
|
102
|
-
]);
|
|
103
|
-
const C = Z((m) => {
|
|
104
|
-
if (c(m), !m) {
|
|
105
|
-
l.current = "", o(null);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const E = q(m);
|
|
109
|
-
u((y) => {
|
|
110
|
-
const P = E || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), N = $(K(m, P));
|
|
111
|
-
return l.current = N ?? "", o(N), E || y;
|
|
112
|
-
});
|
|
113
|
-
}, [
|
|
114
|
-
r,
|
|
115
|
-
o
|
|
116
|
-
]), d = Z((m) => {
|
|
117
|
-
u(m), c((E) => {
|
|
118
|
-
const y = $(K(E, m));
|
|
119
|
-
return l.current = y ?? "", o(y), E;
|
|
120
|
-
});
|
|
121
|
-
}, [
|
|
122
|
-
o
|
|
123
|
-
]);
|
|
124
|
-
return {
|
|
125
|
-
currentValue: a,
|
|
126
|
-
selectedCountryCode: i,
|
|
127
|
-
handlePhoneChange: C,
|
|
128
|
-
handleCountryCodeChange: d
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
132
|
-
const e = Y(le);
|
|
133
|
-
if (!e)
|
|
134
|
-
throw new Error("Phone input components must be used within PhoneInput component");
|
|
135
|
-
return e;
|
|
136
|
-
}, ue = /* @__PURE__ */ ne(null), z = () => {
|
|
137
|
-
const e = Y(ue);
|
|
138
|
-
if (!e)
|
|
139
|
-
throw new Error("Option sub-components must be used within Option component");
|
|
140
|
-
return e;
|
|
141
|
-
}, W = ({ longCountryCode: e, className: n }) => {
|
|
142
|
-
function r(c, l) {
|
|
143
|
-
const i = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", p = `${c}${l === "2x" ? "_2x" : ""}.png`;
|
|
144
|
-
return `${i}${p}`;
|
|
145
|
-
}
|
|
146
|
-
const o = r(e, "1x"), a = r(e, "2x");
|
|
147
|
-
return /* @__PURE__ */ t.createElement("img", {
|
|
148
|
-
src: o,
|
|
149
|
-
srcSet: `${o} 1x, ${a} 2x`,
|
|
150
|
-
alt: "",
|
|
151
|
-
"aria-hidden": "true",
|
|
152
|
-
loading: "lazy",
|
|
153
|
-
className: n
|
|
154
|
-
});
|
|
155
|
-
}, s = ({ children: e }) => {
|
|
156
|
-
var L, v;
|
|
157
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = w(), [i, u] = T(null), p = (v = (L = l == null ? void 0 : l.string) == null ? void 0 : L.phoneOptions) == null ? void 0 : v.allowedCountryCodes, C = Qe(), d = A(() => Je(C, p), [
|
|
158
|
-
C,
|
|
159
|
-
p
|
|
160
|
-
]), m = A(() => d.map((j) => j.shortCountryCode), [
|
|
161
|
-
d
|
|
162
|
-
]), { currentValue: E, selectedCountryCode: y, handlePhoneChange: P, handleCountryCodeChange: N } = tt({
|
|
163
|
-
value: r,
|
|
164
|
-
defaultCountryCode: c,
|
|
165
|
-
allowedCountryCodes: m,
|
|
166
|
-
onChange: o
|
|
167
|
-
}), B = h(e, s.Label), R = h(e, s.Control), x = h(e, s.Description), M = h(e, s.Error), I = {
|
|
168
|
-
currentValue: E,
|
|
169
|
-
selectedCountryCode: y,
|
|
170
|
-
handlePhoneChange: P,
|
|
171
|
-
handleCountryCodeChange: N,
|
|
172
|
-
countryCodes: m,
|
|
173
|
-
countries: d,
|
|
174
|
-
popoverContainer: i
|
|
175
|
-
};
|
|
176
|
-
return /* @__PURE__ */ t.createElement(le.Provider, {
|
|
177
|
-
value: I
|
|
178
|
-
}, /* @__PURE__ */ t.createElement(a, {
|
|
179
|
-
fieldId: n,
|
|
180
|
-
renderLabel: () => B,
|
|
181
|
-
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
182
|
-
ref: u,
|
|
183
|
-
style: {
|
|
184
|
-
display: "contents"
|
|
185
|
-
}
|
|
186
|
-
}), R),
|
|
187
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, M, x)
|
|
188
|
-
}));
|
|
189
|
-
}, X = ({ children: e, className: n }) => {
|
|
190
|
-
const { labelId: r } = re(), { hasError: o, disabled: a, readOnly: c } = w(), { t: l } = D(), { selectedCountryCode: i, countries: u } = _(), p = Ee(), C = i ? u.find((y) => y.shortCountryCode === i) : void 0, d = C && G(C.longCountryCode) || "", m = l("field.phone.country-code.aria-label"), E = C ? `${m}, ${C.countryName}, ${d}` : m;
|
|
191
|
-
return /* @__PURE__ */ t.createElement(qe, {
|
|
192
|
-
isDisabled: a || c,
|
|
193
|
-
id: p,
|
|
194
|
-
"aria-label": E,
|
|
195
|
-
"aria-labelledby": r ? `${r} ${p}` : void 0,
|
|
196
|
-
className: n,
|
|
197
|
-
"data-invalid": o || void 0
|
|
198
|
-
}, e);
|
|
199
|
-
}, nt = ({ className: e }) => {
|
|
200
|
-
const { selectedCountryCode: n, countries: r } = _(), o = r.find((a) => a.shortCountryCode === n);
|
|
201
|
-
return o ? /* @__PURE__ */ t.createElement(W, {
|
|
202
|
-
className: e,
|
|
203
|
-
longCountryCode: o.longCountryCode
|
|
204
|
-
}) : null;
|
|
205
|
-
}, ot = ({ children: e, className: n }) => {
|
|
206
|
-
const { selectedCountryCode: r, countries: o } = _();
|
|
207
|
-
return o.some((c) => c.shortCountryCode === r) ? null : /* @__PURE__ */ t.createElement("span", {
|
|
208
|
-
className: n
|
|
209
|
-
}, e);
|
|
210
|
-
};
|
|
211
|
-
X.Flag = nt;
|
|
212
|
-
X.EmptyState = ot;
|
|
213
|
-
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
214
|
-
const { triggerRef: l, optionsRef: i, isForcedOpen: u, isOpen: p } = c, { popoverContainer: C } = _(), d = h(e, g.Search);
|
|
215
|
-
if (!p)
|
|
216
|
-
return null;
|
|
217
|
-
const m = /* @__PURE__ */ t.createElement(ie, {
|
|
218
|
-
isForcedOpen: u
|
|
219
|
-
}, e);
|
|
220
|
-
return /* @__PURE__ */ t.createElement(ve, {
|
|
221
|
-
getContainer: () => C
|
|
222
|
-
}, /* @__PURE__ */ t.createElement(Ue, {
|
|
223
|
-
ref: i,
|
|
224
|
-
triggerRef: l,
|
|
225
|
-
className: n,
|
|
226
|
-
placement: o,
|
|
227
|
-
offset: a,
|
|
228
|
-
containerPadding: 0
|
|
229
|
-
}, d && !u ? /* @__PURE__ */ t.createElement(ae, {
|
|
230
|
-
"aria-label": r
|
|
231
|
-
}, m) : m));
|
|
232
|
-
}, rt = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...c }) => {
|
|
233
|
-
const { optionsRef: l } = c, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), p = Y(Fe);
|
|
234
|
-
return /* @__PURE__ */ t.createElement(De, {
|
|
235
|
-
className: r,
|
|
236
|
-
isDismissable: !0
|
|
237
|
-
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(we, {
|
|
238
|
-
ref: l,
|
|
239
|
-
className: n
|
|
240
|
-
}, /* @__PURE__ */ t.createElement(ae, {
|
|
241
|
-
"aria-label": o
|
|
242
|
-
}, /* @__PURE__ */ t.createElement(ie, {
|
|
243
|
-
listBoxProps: {
|
|
244
|
-
"aria-label": o,
|
|
245
|
-
selectionMode: "single",
|
|
246
|
-
selectedKeys: i ? [
|
|
247
|
-
i
|
|
248
|
-
] : [],
|
|
249
|
-
onSelectionChange: (C) => {
|
|
250
|
-
const [d] = C === "all" ? [] : C;
|
|
251
|
-
d && u(d), p == null || p.close();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}, e)))));
|
|
255
|
-
}, ie = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
256
|
-
const { countries: o } = _(), a = h(e, g.Option), c = h(e, g.Search), l = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(Ge, {
|
|
257
|
-
isForcedOpen: r === !0,
|
|
258
|
-
...n,
|
|
259
|
-
renderEmptyState: l ? () => l : void 0
|
|
260
|
-
}, o.map((u) => {
|
|
261
|
-
const p = G(u.longCountryCode) || "";
|
|
262
|
-
return S(a, {
|
|
263
|
-
key: u.shortCountryCode,
|
|
264
|
-
countryCode: u.shortCountryCode,
|
|
265
|
-
dialingCode: p,
|
|
266
|
-
countryName: u.countryName,
|
|
267
|
-
longCountryCode: u.longCountryCode
|
|
268
|
-
});
|
|
269
|
-
}));
|
|
270
|
-
return c ? /* @__PURE__ */ t.createElement(je, {
|
|
271
|
-
filter: (u, p, C) => {
|
|
272
|
-
const d = o.find((m) => m.shortCountryCode === C.key);
|
|
273
|
-
return !!d && et(d, p);
|
|
274
|
-
}
|
|
275
|
-
}, r ? S(c, {
|
|
276
|
-
autoFocus: !1
|
|
277
|
-
}) : c, i) : i;
|
|
278
|
-
};
|
|
279
|
-
g.Popover = g;
|
|
280
|
-
g.Modal = rt;
|
|
281
|
-
const me = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
282
|
-
const { autoFocus: a = !0 } = o;
|
|
283
|
-
return /* @__PURE__ */ t.createElement(Be, {
|
|
284
|
-
"aria-label": r,
|
|
285
|
-
autoFocus: a
|
|
286
|
-
}, /* @__PURE__ */ t.createElement(U, {
|
|
287
|
-
className: e
|
|
288
|
-
}, n));
|
|
289
|
-
}, at = ({ className: e, placeholder: n }) => /* @__PURE__ */ t.createElement(se, {
|
|
290
|
-
className: e,
|
|
291
|
-
placeholder: n
|
|
292
|
-
});
|
|
293
|
-
me.Input = at;
|
|
294
|
-
g.Search = me;
|
|
295
|
-
const st = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("div", {
|
|
296
|
-
className: n
|
|
297
|
-
}, e);
|
|
298
|
-
g.EmptyState = st;
|
|
299
|
-
const V = ({ children: e, className: n, ...r }) => {
|
|
300
|
-
const { countryCode: o, dialingCode: a, countryName: c, longCountryCode: l } = r, i = {
|
|
301
|
-
countryCode: o,
|
|
302
|
-
dialingCode: a,
|
|
303
|
-
countryName: c,
|
|
304
|
-
longCountryCode: l
|
|
305
|
-
}, u = e || /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(pe, null), /* @__PURE__ */ t.createElement(Ce, null), /* @__PURE__ */ t.createElement(de, null));
|
|
306
|
-
return /* @__PURE__ */ t.createElement(Re, {
|
|
307
|
-
className: n,
|
|
308
|
-
id: o,
|
|
309
|
-
textValue: `${c} ${a}`
|
|
310
|
-
}, /* @__PURE__ */ t.createElement(ue.Provider, {
|
|
311
|
-
value: i
|
|
312
|
-
}, u));
|
|
313
|
-
}, pe = ({ className: e }) => {
|
|
314
|
-
const { longCountryCode: n } = z();
|
|
315
|
-
return /* @__PURE__ */ t.createElement(W, {
|
|
316
|
-
className: e,
|
|
317
|
-
longCountryCode: n
|
|
318
|
-
});
|
|
319
|
-
}, Ce = ({ className: e }) => {
|
|
320
|
-
const { countryName: n } = z();
|
|
321
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
322
|
-
className: e
|
|
323
|
-
}, n);
|
|
324
|
-
}, de = ({ className: e }) => {
|
|
325
|
-
const { dialingCode: n } = z();
|
|
326
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
327
|
-
className: e
|
|
328
|
-
}, n);
|
|
329
|
-
};
|
|
330
|
-
V.Flag = pe;
|
|
331
|
-
V.Name = Ce;
|
|
332
|
-
V.Code = de;
|
|
333
|
-
g.Option = V;
|
|
334
|
-
const ct = ({ className: e }) => {
|
|
335
|
-
const { t: n } = D(), { inputId: r, ariaDescribedBy: o } = re(), { id: a, placeholder: c, disabled: l, readOnly: i, required: u, label: p, hasError: C } = w(), { currentValue: d, handlePhoneChange: m } = _(), E = F(null);
|
|
336
|
-
return ge(() => {
|
|
337
|
-
var y;
|
|
338
|
-
(y = E.current) == null || y.focus({
|
|
339
|
-
preventScroll: !0
|
|
340
|
-
});
|
|
341
|
-
}, a), be(E, Ze), /* @__PURE__ */ t.createElement(se, {
|
|
342
|
-
ref: E,
|
|
343
|
-
id: r,
|
|
344
|
-
type: "tel",
|
|
345
|
-
autoComplete: "tel",
|
|
346
|
-
value: d,
|
|
347
|
-
onChange: (y) => m(y.target.value),
|
|
348
|
-
disabled: l,
|
|
349
|
-
readOnly: i,
|
|
350
|
-
required: u,
|
|
351
|
-
"aria-label": `${p}. ${n("field.phone.aria-label")}`,
|
|
352
|
-
"aria-describedby": o,
|
|
353
|
-
"aria-invalid": C,
|
|
354
|
-
placeholder: c,
|
|
355
|
-
className: e
|
|
356
|
-
});
|
|
357
|
-
}, lt = ({ children: e, ...n }) => {
|
|
358
|
-
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = w(), [u, p] = T(!1), { t: C } = D(), { selectedCountryCode: d, handleCountryCodeChange: m } = _(), E = o || u && !a && !c;
|
|
359
|
-
return /* @__PURE__ */ t.createElement(Me, {
|
|
360
|
-
"aria-label": C("field.phone.country-code.aria-label"),
|
|
361
|
-
value: d ?? null,
|
|
362
|
-
onChange: (y) => m(y),
|
|
363
|
-
isDisabled: a || c,
|
|
364
|
-
isInvalid: i,
|
|
365
|
-
isRequired: l,
|
|
366
|
-
placeholder: "",
|
|
367
|
-
isOpen: E,
|
|
368
|
-
allowsEmptyCollection: !0,
|
|
369
|
-
onOpenChange: o ? void 0 : p
|
|
370
|
-
}, h(e, s.CountryButton), S(h(e, s.CountryOptions.Popover), {
|
|
371
|
-
...r,
|
|
372
|
-
isOpen: E
|
|
373
|
-
}));
|
|
374
|
-
}, ut = ({ children: e, ...n }) => {
|
|
375
|
-
const r = n;
|
|
376
|
-
return /* @__PURE__ */ t.createElement(xe, null, h(e, s.CountryButton), S(h(e, s.CountryOptions.Modal), r));
|
|
377
|
-
}, it = ({ children: e, className: n }) => {
|
|
378
|
-
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: p, onBlur: C } = w(), d = Ke(C), { countries: m } = _(), E = h(e, s.CountryDrawer), y = h(e, s.CountryPopover), P = h(e, s.PhoneNumber), N = m.length > 1, B = Ye(c) && !!y && N, R = typeof n == "function" ? ({ isHovered: I, isFocusWithin: L }) => n({
|
|
379
|
-
hasCountryOptions: N,
|
|
380
|
-
isHovered: I,
|
|
381
|
-
isFocusWithin: L
|
|
382
|
-
}) : n, x = {
|
|
383
|
-
triggerRef: r,
|
|
384
|
-
optionsRef: o,
|
|
385
|
-
isForcedOpen: B
|
|
386
|
-
}, M = {
|
|
387
|
-
onFocus: () => {
|
|
388
|
-
a.current || (a.current = !0, p == null || p());
|
|
389
|
-
},
|
|
390
|
-
onBlur: (I) => {
|
|
391
|
-
var v, j;
|
|
392
|
-
const L = I.relatedTarget;
|
|
393
|
-
!((v = r.current) != null && v.contains(L)) && !((j = o.current) != null && j.contains(L)) && (a.current = !1, d());
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
return m.length === 1 ? /* @__PURE__ */ t.createElement(U, {
|
|
397
|
-
ref: r,
|
|
398
|
-
className: R,
|
|
399
|
-
isDisabled: l,
|
|
400
|
-
isInvalid: i,
|
|
401
|
-
...M
|
|
402
|
-
}, u && /* @__PURE__ */ t.createElement(W, {
|
|
403
|
-
longCountryCode: m[0].longCountryCode
|
|
404
|
-
}), P) : /* @__PURE__ */ t.createElement(U, {
|
|
405
|
-
ref: r,
|
|
406
|
-
className: R,
|
|
407
|
-
isDisabled: l,
|
|
408
|
-
isInvalid: i,
|
|
409
|
-
...M
|
|
410
|
-
}, !B && S(E, x), S(y, x), P);
|
|
411
|
-
};
|
|
412
|
-
s.Label = He;
|
|
413
|
-
s.Control = it;
|
|
414
|
-
s.CountryButton = X;
|
|
415
|
-
s.CountryDrawer = ut;
|
|
416
|
-
s.CountryPopover = lt;
|
|
417
|
-
s.CountryOptions = g;
|
|
418
|
-
s.PhoneNumber = ct;
|
|
419
|
-
s.Description = Ve;
|
|
420
|
-
s.Error = ke;
|
|
421
|
-
const mt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
422
|
-
width: 24,
|
|
423
|
-
height: 24,
|
|
424
|
-
viewBox: "0 0 24 24",
|
|
425
|
-
fill: "currentColor",
|
|
426
|
-
"aria-hidden": "true",
|
|
427
|
-
...e
|
|
428
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
429
|
-
fillRule: "evenodd",
|
|
430
|
-
d: "M11.5,19 C11.331,19 11.166,18.985 11,18.975 L11,16.5 C11,16.224 10.776,16 10.5,16 L9.5,16 C9.224,16 9,15.775 9,15.5 L9,12.5 C9,12.366 8.947,12.238 8.852,12.145 L4.804,8.14 C6.04,5.688 8.573,4 11.5,4 C12.76,4 13.946,4.315 14.989,4.866 L15,6.497 C15.001,6.631 14.949,6.757 14.855,6.853 C14.76,6.947 14.634,7 14.5,7 L12.339,7 C12.207,7 12.08,7.053 11.986,7.146 L10.146,8.983 C10.053,9.077 10,9.204 10,9.337 L10,10.5 C10,11.325 10.672,11.999 11.499,12 L15.293,12 L17,13.707 L17,16.582 C15.629,18.064 13.674,19 11.5,19 M4,11.5 C4,10.673 4.14,9.879 4.388,9.135 L8,12.709 L8,15.5 C8,16.327 8.673,17 9.5,17 L10,17 L10,18.849 C6.581,18.152 4,15.122 4,11.5 M19,11.5 C19,12.856 18.632,14.127 18,15.226 L18,13.5 C18,13.367 17.947,13.24 17.854,13.146 L15.854,11.146 C15.76,11.053 15.633,11 15.5,11 L11.5,11 C11.224,11 11,10.775 11,10.5 L11,9.544 L12.546,8 L14.5,8 C14.902,8 15.281,7.843 15.564,7.557 C15.848,7.271 16.003,6.892 16,6.49 L15.993,5.51 C17.814,6.879 19,9.051 19,11.5 M11.5,3 C6.813,3 3,6.813 3,11.5 C3,16.187 6.813,20 11.5,20 C16.187,20 20,16.187 20,11.5 C20,6.813 16.187,3 11.5,3"
|
|
431
|
-
})), pt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
432
|
-
width: 24,
|
|
433
|
-
height: 24,
|
|
434
|
-
viewBox: "0 0 24 24",
|
|
435
|
-
fill: "currentColor",
|
|
436
|
-
"aria-hidden": "true",
|
|
437
|
-
...e
|
|
438
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
439
|
-
fillRule: "evenodd",
|
|
440
|
-
d: "M6.6108,14.3887 C5.5718,13.3497 4.9998,11.9687 4.9998,10.4997 C4.9998,9.0317 5.5718,7.6507 6.6108,6.6117 C7.6498,5.5727 9.0308,4.9997 10.4998,4.9997 C11.9688,4.9997 13.3498,5.5727 14.3888,6.6117 C15.4278,7.6507 15.9998,9.0317 15.9998,10.4997 C15.9998,11.9687 15.4278,13.3497 14.3888,14.3887 C13.3498,15.4277 11.9688,15.9997 10.4998,15.9997 C9.0308,15.9997 7.6498,15.4277 6.6108,14.3887 L6.6108,14.3887 Z M20.0028,19.2957 L15.4328,14.7247 C16.4438,13.5477 16.9998,12.0687 16.9998,10.4997 C16.9998,8.7637 16.3238,7.1317 15.0958,5.9047 C13.8688,4.6767 12.2358,3.9997 10.4998,3.9997 C8.7638,3.9997 7.1318,4.6767 5.9038,5.9047 C4.6758,7.1317 3.9998,8.7637 3.9998,10.4997 C3.9998,12.2367 4.6758,13.8677 5.9038,15.0957 C7.1318,16.3237 8.7638,16.9997 10.4998,16.9997 C12.0688,16.9997 13.5478,16.4437 14.7258,15.4317 L19.2958,20.0027 L20.0028,19.2957 Z"
|
|
441
|
-
})), Ct = "_control_o9wij_1", dt = "_countryButton_o9wij_9", yt = "_drawerButton_o9wij_25", Et = "_popoverButton_o9wij_34", ft = "_chevron_o9wij_39", ht = "_globeIcon_o9wij_48", gt = "_searchIcon_o9wij_56", bt = "_flag_o9wij_61", Ot = "_option_o9wij_67", _t = "_phoneNumber_o9wij_80", Nt = "_countryOptions_o9wij_106", Lt = "_countrySearch_o9wij_123", Pt = "_mobileDrawer_o9wij_131", St = "_name_o9wij_140", It = "_code_o9wij_144", vt = "_mobileOverlay_o9wij_161", f = {
|
|
442
|
-
control: Ct,
|
|
443
|
-
countryButton: dt,
|
|
444
|
-
drawerButton: yt,
|
|
445
|
-
popoverButton: Et,
|
|
446
|
-
chevron: ft,
|
|
447
|
-
globeIcon: ht,
|
|
448
|
-
searchIcon: gt,
|
|
449
|
-
flag: bt,
|
|
450
|
-
option: Ot,
|
|
451
|
-
phoneNumber: _t,
|
|
452
|
-
countryOptions: Nt,
|
|
453
|
-
countrySearch: Lt,
|
|
454
|
-
mobileDrawer: Pt,
|
|
455
|
-
name: St,
|
|
456
|
-
code: It,
|
|
457
|
-
mobileOverlay: vt
|
|
458
|
-
}, Ft = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(ye, {
|
|
459
|
-
content: e,
|
|
460
|
-
locale: n
|
|
461
|
-
}), Dt = () => /* @__PURE__ */ t.createElement("span", {
|
|
462
|
-
className: f.chevron,
|
|
463
|
-
"aria-hidden": "true"
|
|
464
|
-
}, /* @__PURE__ */ t.createElement(We, null)), Qt = () => {
|
|
465
|
-
const e = ze(Se, O.selectOptionWithoutFocusRing, f.option, ee), n = te(Ie, [
|
|
466
|
-
f.control
|
|
467
|
-
]), r = te(Pe, [
|
|
468
|
-
f.countrySearch
|
|
469
|
-
]), { t: o } = D(), { PortalContainer: a } = oe(), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
470
|
-
className: r,
|
|
471
|
-
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
472
|
-
}, /* @__PURE__ */ t.createElement(pt, {
|
|
473
|
-
className: f.searchIcon
|
|
474
|
-
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Search.Input, {
|
|
475
|
-
className: b(O.innerInput, ee),
|
|
476
|
-
placeholder: o("field.phone.country-search-input.placeholder")
|
|
477
|
-
})), l = /* @__PURE__ */ t.createElement(s.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), i = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
478
|
-
className: f.flag
|
|
479
|
-
}), /* @__PURE__ */ t.createElement(s.CountryButton.EmptyState, null, /* @__PURE__ */ t.createElement(mt, {
|
|
480
|
-
className: f.globeIcon
|
|
481
|
-
})), /* @__PURE__ */ t.createElement(Dt, null)), u = /* @__PURE__ */ t.createElement(s.CountryOptions.Option, {
|
|
482
|
-
className: e
|
|
483
|
-
}, /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Flag, {
|
|
484
|
-
className: f.flag
|
|
485
|
-
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Name, {
|
|
486
|
-
className: f.name
|
|
487
|
-
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Code, {
|
|
488
|
-
className: f.code
|
|
489
|
-
}));
|
|
490
|
-
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
491
|
-
className: b(Oe, O.label)
|
|
492
|
-
}, /* @__PURE__ */ t.createElement(s.Label.Required, {
|
|
493
|
-
className: b(_e, O.requiredMark)
|
|
494
|
-
})), /* @__PURE__ */ t.createElement(s.Control, {
|
|
495
|
-
className: ({ hasCountryOptions: p, ...C }) => n(C)
|
|
496
|
-
}, /* @__PURE__ */ t.createElement(s.CountryDrawer, null, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
497
|
-
className: b(f.countryButton, f.drawerButton)
|
|
498
|
-
}, i), /* @__PURE__ */ t.createElement(s.CountryOptions.Modal, {
|
|
499
|
-
className: b(Q, O.selectPopover, f.mobileDrawer),
|
|
500
|
-
overlayClassName: f.mobileOverlay,
|
|
501
|
-
portalContainer: a,
|
|
502
|
-
"aria-label": o("field.phone.country-code.aria-label")
|
|
503
|
-
}, c, l, u)), /* @__PURE__ */ t.createElement(s.CountryPopover, null, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
504
|
-
className: b(f.countryButton, f.popoverButton)
|
|
505
|
-
}, i), /* @__PURE__ */ t.createElement(s.CountryOptions.Popover, {
|
|
506
|
-
className: b(Q, O.selectPopover, f.countryOptions),
|
|
507
|
-
placement: "bottom start",
|
|
508
|
-
offset: 0,
|
|
509
|
-
"aria-label": o("field.phone.country-code.aria-label")
|
|
510
|
-
}, c, l, u)), /* @__PURE__ */ t.createElement(s.PhoneNumber, {
|
|
511
|
-
className: b(O.innerInput, f.phoneNumber)
|
|
512
|
-
})), /* @__PURE__ */ t.createElement(s.Error, {
|
|
513
|
-
className: b(Ne, O.error)
|
|
514
|
-
}, /* @__PURE__ */ t.createElement(Xe, null), /* @__PURE__ */ t.createElement(s.Error.Text, null)), /* @__PURE__ */ t.createElement(s.Description, {
|
|
515
|
-
className: b(Le, O.description)
|
|
516
|
-
}, Ft));
|
|
517
|
-
};
|
|
518
|
-
export {
|
|
519
|
-
Qt as P
|
|
520
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import o, { useRef as T, useMemo as _, useCallback as C, useEffect as b } from "react";
|
|
2
|
-
import { RicosViewer as w } from "@wix/ricos/viewer";
|
|
3
|
-
import E from "classnames";
|
|
4
|
-
import { bJ as P, bY as A, F as M, bN as y, bF as V, aN as x, X as H, am as U, J as W, M as k, I as q } from "./form-BmSV4tOz.js";
|
|
5
|
-
import { u as B } from "./use-service-options-base-BgIZ94V9.js";
|
|
6
|
-
import { D as u, u as J } from "./use-dropdown-trigger-class-name-D6c-3Lyw.js";
|
|
7
|
-
import { C as Y } from "./chevron-down-icon-CcpVm6B-.js";
|
|
8
|
-
import { E as Q } from "./error-icon-hZxQ6DEy.js";
|
|
9
|
-
import { H as X } from "./custom-focus-class-_483Pkwp.js";
|
|
10
|
-
import { s as i } from "./field-rac.module-DcyJyi2B.js";
|
|
11
|
-
import { u as j } from "./use-dropdown-option-class-name-COGEk5d6.js";
|
|
12
|
-
const z = "00000000-0000-0000-0000-000000000000", G = (e) => {
|
|
13
|
-
const { actions: t } = P(), { t: D } = A(), { addOther: n, addOtherLabel: p } = e, c = p || D("add-other.default-other-option-label"), a = T(!0), d = _(() => {
|
|
14
|
-
var s;
|
|
15
|
-
return ((s = e.options) == null ? void 0 : s.map((m) => m.id ?? "")) ?? [];
|
|
16
|
-
}, [
|
|
17
|
-
e.options
|
|
18
|
-
]), O = C((s) => n ? [
|
|
19
|
-
...s,
|
|
20
|
-
{
|
|
21
|
-
value: c,
|
|
22
|
-
label: c,
|
|
23
|
-
id: z
|
|
24
|
-
}
|
|
25
|
-
] : s, [
|
|
26
|
-
n,
|
|
27
|
-
c
|
|
28
|
-
]), { isLoading: f, options: l, isEmpty: h, shouldRender: I, setIsLoading: S, setOptions: F, setIsEmpty: g, processOptions: R } = B({
|
|
29
|
-
fieldType: M.SERVICES_DROPDOWN,
|
|
30
|
-
isEditor: e.isEditor,
|
|
31
|
-
postProcessOptions: O
|
|
32
|
-
}), L = C(async () => {
|
|
33
|
-
if (a.current && (t != null && t.fetchServices) && d.length > 0) {
|
|
34
|
-
a.current = !1, S(!0);
|
|
35
|
-
let s;
|
|
36
|
-
try {
|
|
37
|
-
s = await t.fetchServices({
|
|
38
|
-
serviceIds: d
|
|
39
|
-
});
|
|
40
|
-
} catch (m) {
|
|
41
|
-
console.error(m);
|
|
42
|
-
}
|
|
43
|
-
if (s) {
|
|
44
|
-
const m = R(s);
|
|
45
|
-
g(!n && m.length === 0), F(m);
|
|
46
|
-
} else
|
|
47
|
-
a.current = !0;
|
|
48
|
-
S(!1);
|
|
49
|
-
}
|
|
50
|
-
}, [
|
|
51
|
-
t,
|
|
52
|
-
d,
|
|
53
|
-
R,
|
|
54
|
-
n,
|
|
55
|
-
S,
|
|
56
|
-
F,
|
|
57
|
-
g
|
|
58
|
-
]);
|
|
59
|
-
b(() => {
|
|
60
|
-
if (!e.isEditor && l.length > 0) {
|
|
61
|
-
const s = n ? l.length - 1 : l.length;
|
|
62
|
-
g(s === 0);
|
|
63
|
-
}
|
|
64
|
-
}, [
|
|
65
|
-
l,
|
|
66
|
-
n,
|
|
67
|
-
g,
|
|
68
|
-
e.isEditor
|
|
69
|
-
]);
|
|
70
|
-
const N = C(() => {
|
|
71
|
-
e.onFocus && e.onFocus(), a.current && L();
|
|
72
|
-
}, [
|
|
73
|
-
L,
|
|
74
|
-
e.onFocus
|
|
75
|
-
]), v = C(
|
|
76
|
-
(s) => {
|
|
77
|
-
e.onChange && e.onChange(s), a.current = !0;
|
|
78
|
-
},
|
|
79
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
80
|
-
[
|
|
81
|
-
e.onChange
|
|
82
|
-
]
|
|
83
|
-
);
|
|
84
|
-
return {
|
|
85
|
-
isLoading: f,
|
|
86
|
-
options: l,
|
|
87
|
-
isEmpty: h,
|
|
88
|
-
onFocus: N,
|
|
89
|
-
onChange: v,
|
|
90
|
-
shouldRender: I
|
|
91
|
-
};
|
|
92
|
-
}, r = ({ children: e }) => {
|
|
93
|
-
const t = y(), { addOther: D } = t, n = V(), p = t.isEditor || n.isEditor || n.isComposer, { isLoading: c, options: a, isEmpty: d, onFocus: O, onChange: f, shouldRender: l } = G({
|
|
94
|
-
...t,
|
|
95
|
-
isEditor: p
|
|
96
|
-
}), h = _(() => ({
|
|
97
|
-
...t,
|
|
98
|
-
options: c ? [] : a,
|
|
99
|
-
isLoading: c,
|
|
100
|
-
onFocus: O,
|
|
101
|
-
onChange: f
|
|
102
|
-
}), [
|
|
103
|
-
t,
|
|
104
|
-
a,
|
|
105
|
-
c,
|
|
106
|
-
O,
|
|
107
|
-
f
|
|
108
|
-
]);
|
|
109
|
-
return !p && d && !D || !l ? null : /* @__PURE__ */ o.createElement(x.Provider, {
|
|
110
|
-
value: {
|
|
111
|
-
v2: h
|
|
112
|
-
}
|
|
113
|
-
}, /* @__PURE__ */ o.createElement(u, null, e));
|
|
114
|
-
};
|
|
115
|
-
r.Label = u.Label;
|
|
116
|
-
r.Trigger = u.Trigger;
|
|
117
|
-
r.Options = u.Options;
|
|
118
|
-
r.Description = u.Description;
|
|
119
|
-
r.Error = u.Error;
|
|
120
|
-
const K = ({ content: e, locale: t }) => /* @__PURE__ */ o.createElement(w, {
|
|
121
|
-
content: e,
|
|
122
|
-
locale: t
|
|
123
|
-
}), Z = () => {
|
|
124
|
-
const e = J(i.dropdownTrigger), t = j(X);
|
|
125
|
-
return /* @__PURE__ */ o.createElement(r, null, /* @__PURE__ */ o.createElement(r.Label, {
|
|
126
|
-
className: E(H, i.label)
|
|
127
|
-
}, /* @__PURE__ */ o.createElement(r.Label.Required, {
|
|
128
|
-
className: E(U, i.requiredMark)
|
|
129
|
-
})), /* @__PURE__ */ o.createElement(r.Trigger, {
|
|
130
|
-
className: e
|
|
131
|
-
}, /* @__PURE__ */ o.createElement(Y, {
|
|
132
|
-
className: i.dropdownIcon
|
|
133
|
-
})), /* @__PURE__ */ o.createElement(r.Options, {
|
|
134
|
-
className: E(W, i.selectPopover, i.dropdownPopover)
|
|
135
|
-
}, /* @__PURE__ */ o.createElement(r.Options.Option, {
|
|
136
|
-
className: t
|
|
137
|
-
})), /* @__PURE__ */ o.createElement(r.Error, {
|
|
138
|
-
className: E(k, i.error)
|
|
139
|
-
}, /* @__PURE__ */ o.createElement(Q, null), /* @__PURE__ */ o.createElement(r.Error.Text, null)), /* @__PURE__ */ o.createElement(r.Description, {
|
|
140
|
-
className: E(q, i.description)
|
|
141
|
-
}, K));
|
|
142
|
-
}, me = () => /* @__PURE__ */ o.createElement(Z, null);
|
|
143
|
-
export {
|
|
144
|
-
me as ServiceDropdownRAC
|
|
145
|
-
};
|