@ebay/ui-core-react 9.3.0 → 9.4.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/combobox-WL3ek9fM.js +1 -0
- package/common/dropdown.d.ts +2 -21
- package/common/dropdown.d.ts.map +1 -1
- package/common/floating-ui.d.ts +48 -0
- package/common/floating-ui.d.ts.map +1 -0
- package/common/tooltip-utils/tooltip-content.d.ts +4 -1
- package/common/tooltip-utils/tooltip-content.d.ts.map +1 -1
- package/dropdown-B-M6HUau.js +1 -0
- package/ebay-accordion/index.js +1 -1
- package/ebay-chips-combobox/index.js +1 -1
- package/ebay-combobox/index.js +1 -1
- package/ebay-date-textbox/index.js +1 -1
- package/ebay-details/ebay-details.d.ts +2 -1
- package/ebay-details/ebay-details.d.ts.map +1 -1
- package/ebay-details/index.js +1 -1
- package/ebay-details-GQ3atM4S.js +1 -0
- package/ebay-fake-menu-button/index.js +1 -1
- package/ebay-file-preview-card/index.js +1 -1
- package/ebay-file-preview-card-group/index.js +1 -1
- package/ebay-filter-menu-button/index.js +1 -1
- package/ebay-infotip/ebay-infotip.d.ts +4 -0
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/index.js +1 -1
- package/ebay-item-tile/index.js +1 -1
- package/ebay-item-tile-group/index.js +1 -1
- package/ebay-listbox-button/index.js +1 -1
- package/ebay-menu-button/index.js +1 -1
- package/ebay-pagination/index.js +1 -1
- package/ebay-phone-input/index.js +1 -1
- package/ebay-split-button/index.js +1 -1
- package/ebay-svg/index.js +1 -1
- package/ebay-tooltip/ebay-tooltip.d.ts +4 -0
- package/ebay-tooltip/ebay-tooltip.d.ts.map +1 -1
- package/ebay-tooltip/index.js +1 -1
- package/ebay-tourtip/ebay-tourtip.d.ts +4 -0
- package/ebay-tourtip/ebay-tourtip.d.ts.map +1 -1
- package/ebay-tourtip/index.js +1 -1
- package/ebay-video/index.js +1 -1
- package/ebay-video/video.d.ts.map +1 -1
- package/{file-preview-card-C28-H6Zw.js → file-preview-card-C7kSASWO.js} +1 -1
- package/floating-ui-Co2mY5Do.js +1 -0
- package/icons/ebay-icon-arrows-expand-16/index.js +1 -1
- package/icons/ebay-icon-arrows-expand-24/index.js +1 -1
- package/icons/ebay-icon-feedback-error-16/index.js +1 -1
- package/icons/ebay-icon-feedback-error-24/index.js +1 -1
- package/{item-tile-Dd22jWQA.js → item-tile-BYQuvbj4.js} +1 -1
- package/listbox-button-sULPe7qi.js +2 -0
- package/menu-button-Cw_SMZjv.js +1 -0
- package/menu-button-label-Dc7U65G0.js +1 -0
- package/package.json +1 -1
- package/use-tooltip-V_RbL4vM.js +1 -0
- package/combobox-Ck8qituJ.js +0 -1
- package/dropdown-B6wMNyjP.js +0 -1
- package/ebay-details-BEt1xrPn.js +0 -1
- package/listbox-button-Dx-GGxsh.js +0 -2
- package/menu-button-label-DRo395A5.js +0 -1
- package/menu-button-tvdOBhp1.js +0 -1
- package/use-tooltip-Bsf51pP_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e0=require("../tslib.es6-C4EgNkz1.js"),n0=require("classnames"),a=require("react"),U=require("../listbox-button-Dx-GGxsh.js"),b=require("../textbox-DAip4ToD.js");require("../icon-I30uh1Ov.js");require("../icon-button-AJ6dtyvc.js");const l0=require("../flag-DU-1tRv6.js"),G={AC:{countryCode:"AC",callingCode:"247",mask:"00000"},AD:{countryCode:"AD",callingCode:"376",mask:"000 000"},AE:{countryCode:"AE",callingCode:"971",mask:"000 000 0000"},AF:{countryCode:"AF",callingCode:"93",mask:"000 000 0000"},AG:{countryCode:"AG",callingCode:"1",mask:"(000) 000-0000"},AI:{countryCode:"AI",callingCode:"1",mask:"(000) 000-0000"},AL:{countryCode:"AL",callingCode:"355",mask:"000 000 0000"},AM:{countryCode:"AM",callingCode:"374",mask:"000 000000"},AO:{countryCode:"AO",callingCode:"244",mask:"000 000 000"},AR:{countryCode:"AR",callingCode:"54",mask:"000 00-0000-0000"},AS:{countryCode:"AS",callingCode:"1",mask:"(000) 000-0000"},AT:{countryCode:"AT",callingCode:"43",mask:"0000 000000"},AU:{countryCode:"AU",callingCode:"61",mask:"0000 000 000"},AW:{countryCode:"AW",callingCode:"297",mask:"000 0000"},AX:{countryCode:"AX",callingCode:"358",mask:"000 0000000"},AZ:{countryCode:"AZ",callingCode:"994",mask:"000 000 00 00"},BA:{countryCode:"BA",callingCode:"387",mask:"000 000 000"},BB:{countryCode:"BB",callingCode:"1",mask:"(000) 000-0000"},BD:{countryCode:"BD",callingCode:"880",mask:"00000-000000"},BE:{countryCode:"BE",callingCode:"32",mask:"0000 00 00 00"},BF:{countryCode:"BF",callingCode:"226",mask:"00 00 00 00"},BG:{countryCode:"BG",callingCode:"359",mask:"000 000 000"},BH:{countryCode:"BH",callingCode:"973",mask:"0000 0000"},BI:{countryCode:"BI",callingCode:"257",mask:"00 00 00 00"},BJ:{countryCode:"BJ",callingCode:"229",mask:"00 00 00 00 00"},BL:{countryCode:"BL",callingCode:"590",mask:"0000 00 00 00"},BM:{countryCode:"BM",callingCode:"1",mask:"(000) 000-0000"},BN:{countryCode:"BN",callingCode:"673",mask:"000 0000"},BO:{countryCode:"BO",callingCode:"591",mask:"00000000"},BQ:{countryCode:"BQ",callingCode:"599",mask:"000 0000"},BR:{countryCode:"BR",callingCode:"55",mask:"(00) 00000-0000"},BS:{countryCode:"BS",callingCode:"1",mask:"(000) 000-0000"},BT:{countryCode:"BT",callingCode:"975",mask:"00 00 00 00"},BW:{countryCode:"BW",callingCode:"267",mask:"00 000 000"},BY:{countryCode:"BY",callingCode:"375",mask:"0 000 000-00-00"},BZ:{countryCode:"BZ",callingCode:"501",mask:"000-0000"},CA:{countryCode:"CA",callingCode:"1",mask:"(000) 000-0000"},CC:{countryCode:"CC",callingCode:"61",mask:"0000 000 000"},CD:{countryCode:"CD",callingCode:"243",mask:"0000 000 000"},CF:{countryCode:"CF",callingCode:"236",mask:"00 00 00 00"},CG:{countryCode:"CG",callingCode:"242",mask:"00 000 0000"},CH:{countryCode:"CH",callingCode:"41",mask:"000 000 00 00"},CI:{countryCode:"CI",callingCode:"225",mask:"00 00 00 0000"},CK:{countryCode:"CK",callingCode:"682",mask:"00 000"},CL:{countryCode:"CL",callingCode:"56",mask:"(0) 0000 0000"},CM:{countryCode:"CM",callingCode:"237",mask:"0 00 00 00 00"},CN:{countryCode:"CN",callingCode:"86",mask:"000 0000 0000"},CO:{countryCode:"CO",callingCode:"57",mask:"000 0000000"},CR:{countryCode:"CR",callingCode:"506",mask:"0000 0000"},CU:{countryCode:"CU",callingCode:"53",mask:"00 0000000"},CV:{countryCode:"CV",callingCode:"238",mask:"000 00 00"},CW:{countryCode:"CW",callingCode:"599",mask:"0 000 0000"},CX:{countryCode:"CX",callingCode:"61",mask:"0000 000 000"},CY:{countryCode:"CY",callingCode:"357",mask:"00 000000"},CZ:{countryCode:"CZ",callingCode:"420",mask:"000 000 000"},DE:{countryCode:"DE",callingCode:"49",mask:"00000 0000000"},DJ:{countryCode:"DJ",callingCode:"253",mask:"00 00 00 00"},DK:{countryCode:"DK",callingCode:"45",mask:"00 00 00 00"},DM:{countryCode:"DM",callingCode:"1",mask:"(000) 000-0000"},DO:{countryCode:"DO",callingCode:"1",mask:"(000) 000-0000"},DZ:{countryCode:"DZ",callingCode:"213",mask:"0000 00 00 00"},EC:{countryCode:"EC",callingCode:"593",mask:"000 000 0000"},EE:{countryCode:"EE",callingCode:"372",mask:"0000 0000"},EG:{countryCode:"EG",callingCode:"20",mask:"000 00000000"},EH:{countryCode:"EH",callingCode:"212",mask:"0000-000000"},ER:{countryCode:"ER",callingCode:"291",mask:"00 000 000"},ES:{countryCode:"ES",callingCode:"34",mask:"000 00 00 00"},ET:{countryCode:"ET",callingCode:"251",mask:"000 000 0000"},FI:{countryCode:"FI",callingCode:"358",mask:"000 0000000"},FJ:{countryCode:"FJ",callingCode:"679",mask:"000 0000"},FK:{countryCode:"FK",callingCode:"500",mask:"00000"},FM:{countryCode:"FM",callingCode:"691",mask:"000 0000"},FO:{countryCode:"FO",callingCode:"298",mask:"000000"},FR:{countryCode:"FR",callingCode:"33",mask:"00 00 00 00 00"},GA:{countryCode:"GA",callingCode:"241",mask:"00 00 00 00"},GB:{countryCode:"GB",callingCode:"44",mask:"00000 000000"},GD:{countryCode:"GD",callingCode:"1",mask:"(000) 000-0000"},GE:{countryCode:"GE",callingCode:"995",mask:"000 00 00 00"},GF:{countryCode:"GF",callingCode:"594",mask:"0000 00 00 00"},GG:{countryCode:"GG",callingCode:"44",mask:"00000 000000"},GH:{countryCode:"GH",callingCode:"233",mask:"000 000 0000"},GI:{countryCode:"GI",callingCode:"350",mask:"00000000"},GL:{countryCode:"GL",callingCode:"299",mask:"00 00 00"},GM:{countryCode:"GM",callingCode:"220",mask:"000 0000"},GN:{countryCode:"GN",callingCode:"224",mask:"000 00 00 00"},GP:{countryCode:"GP",callingCode:"590",mask:"0000 00 00 00"},GQ:{countryCode:"GQ",callingCode:"240",mask:"000 000 000"},GR:{countryCode:"GR",callingCode:"30",mask:"000 000 0000"},GT:{countryCode:"GT",callingCode:"502",mask:"0000 0000"},GU:{countryCode:"GU",callingCode:"1",mask:"(000) 000-0000"},GW:{countryCode:"GW",callingCode:"245",mask:"000 000 000"},GY:{countryCode:"GY",callingCode:"592",mask:"000 0000"},HK:{countryCode:"HK",callingCode:"852",mask:"0000 0000"},HN:{countryCode:"HN",callingCode:"504",mask:"0000-0000"},HR:{countryCode:"HR",callingCode:"385",mask:"000 000 0000"},HT:{countryCode:"HT",callingCode:"509",mask:"00 00 0000"},HU:{countryCode:"HU",callingCode:"36",mask:"00 00 000 0000"},ID:{countryCode:"ID",callingCode:"62",mask:"0000-000-000"},IE:{countryCode:"IE",callingCode:"353",mask:"000 000 0000"},IL:{countryCode:"IL",callingCode:"972",mask:"000-000-0000"},IM:{countryCode:"IM",callingCode:"44",mask:"00000 000000"},IN:{countryCode:"IN",callingCode:"91",mask:"000000 00000"},IO:{countryCode:"IO",callingCode:"246",mask:"000 0000"},IQ:{countryCode:"IQ",callingCode:"964",mask:"0000 000 0000"},IR:{countryCode:"IR",callingCode:"98",mask:"0000 000 0000"},IS:{countryCode:"IS",callingCode:"354",mask:"000 0000"},IT:{countryCode:"IT",callingCode:"39",mask:"000 000 0000"},JE:{countryCode:"JE",callingCode:"44",mask:"00000 000000"},JM:{countryCode:"JM",callingCode:"1",mask:"(000) 000-0000"},JO:{countryCode:"JO",callingCode:"962",mask:"00 0000 0000"},JP:{countryCode:"JP",callingCode:"81",mask:"000-0000-0000"},KE:{countryCode:"KE",callingCode:"254",mask:"0000 000000"},KG:{countryCode:"KG",callingCode:"996",mask:"0000 000 000"},KH:{countryCode:"KH",callingCode:"855",mask:"000 000 000"},KI:{countryCode:"KI",callingCode:"686",mask:"00000000"},KM:{countryCode:"KM",callingCode:"269",mask:"000 00 00"},KN:{countryCode:"KN",callingCode:"1",mask:"(000) 000-0000"},KP:{countryCode:"KP",callingCode:"850",mask:"0000 000 0000"},KR:{countryCode:"KR",callingCode:"82",mask:"000-0000-0000"},KW:{countryCode:"KW",callingCode:"965",mask:"000 00000"},KY:{countryCode:"KY",callingCode:"1",mask:"(000) 000-0000"},KZ:{countryCode:"KZ",callingCode:"7",mask:"0 (000) 000 0000"},LA:{countryCode:"LA",callingCode:"856",mask:"000 00 000 000"},LB:{countryCode:"LB",callingCode:"961",mask:"00 000 000"},LC:{countryCode:"LC",callingCode:"1",mask:"(000) 000-0000"},LI:{countryCode:"LI",callingCode:"423",mask:"000 000 000"},LK:{countryCode:"LK",callingCode:"94",mask:"000 000 0000"},LR:{countryCode:"LR",callingCode:"231",mask:"000 000 0000"},LS:{countryCode:"LS",callingCode:"266",mask:"0000 0000"},LT:{countryCode:"LT",callingCode:"370",mask:"(0-000) 00000"},LU:{countryCode:"LU",callingCode:"352",mask:"000 000 000"},LV:{countryCode:"LV",callingCode:"371",mask:"00 000 000"},LY:{countryCode:"LY",callingCode:"218",mask:"000-0000000"},MA:{countryCode:"MA",callingCode:"212",mask:"0000-000000"},MC:{countryCode:"MC",callingCode:"377",mask:"00 00 00 00 00"},MD:{countryCode:"MD",callingCode:"373",mask:"0000 00 000"},ME:{countryCode:"ME",callingCode:"382",mask:"000 000 000"},MF:{countryCode:"MF",callingCode:"590",mask:"0000 00 00 00"},MG:{countryCode:"MG",callingCode:"261",mask:"000 00 000 00"},MH:{countryCode:"MH",callingCode:"692",mask:"000-0000"},MK:{countryCode:"MK",callingCode:"389",mask:"000 000 000"},ML:{countryCode:"ML",callingCode:"223",mask:"00 00 00 00"},MM:{countryCode:"MM",callingCode:"95",mask:"00 000 0000"},MN:{countryCode:"MN",callingCode:"976",mask:"0000 0000"},MO:{countryCode:"MO",callingCode:"853",mask:"0000 0000"},MP:{countryCode:"MP",callingCode:"1",mask:"(000) 000-0000"},MQ:{countryCode:"MQ",callingCode:"596",mask:"0000 00 00 00"},MR:{countryCode:"MR",callingCode:"222",mask:"00 00 00 00"},MS:{countryCode:"MS",callingCode:"1",mask:"(000) 000-0000"},MT:{countryCode:"MT",callingCode:"356",mask:"0000 0000"},MU:{countryCode:"MU",callingCode:"230",mask:"0000 0000"},MV:{countryCode:"MV",callingCode:"960",mask:"000-0000"},MW:{countryCode:"MW",callingCode:"265",mask:"0000 00 00 00"},MX:{countryCode:"MX",callingCode:"52",mask:"000 000 0000"},MY:{countryCode:"MY",callingCode:"60",mask:"000-000 0000"},MZ:{countryCode:"MZ",callingCode:"258",mask:"00 000 0000"},NA:{countryCode:"NA",callingCode:"264",mask:"000 000 0000"},NC:{countryCode:"NC",callingCode:"687",mask:"00.00.00"},NE:{countryCode:"NE",callingCode:"227",mask:"00 00 00 00"},NF:{countryCode:"NF",callingCode:"672",mask:"0 00000"},NG:{countryCode:"NG",callingCode:"234",mask:"0000 000 0000"},NI:{countryCode:"NI",callingCode:"505",mask:"0000 0000"},NL:{countryCode:"NL",callingCode:"31",mask:"00 00000000"},NO:{countryCode:"NO",callingCode:"47",mask:"00 00 00 00"},NP:{countryCode:"NP",callingCode:"977",mask:"000-0000000"},NR:{countryCode:"NR",callingCode:"674",mask:"000 0000"},NU:{countryCode:"NU",callingCode:"683",mask:"000 0000"},NZ:{countryCode:"NZ",callingCode:"64",mask:"000 000 0000"},OM:{countryCode:"OM",callingCode:"968",mask:"0000 0000"},PA:{countryCode:"PA",callingCode:"507",mask:"0000-0000"},PE:{countryCode:"PE",callingCode:"51",mask:"000 000 000"},PF:{countryCode:"PF",callingCode:"689",mask:"00 00 00 00"},PG:{countryCode:"PG",callingCode:"675",mask:"0000 0000"},PH:{countryCode:"PH",callingCode:"63",mask:"0000 000 0000"},PK:{countryCode:"PK",callingCode:"92",mask:"0000 0000000"},PL:{countryCode:"PL",callingCode:"48",mask:"000 000 000"},PM:{countryCode:"PM",callingCode:"508",mask:"000 00 00"},PR:{countryCode:"PR",callingCode:"1",mask:"(000) 000-0000"},PS:{countryCode:"PS",callingCode:"970",mask:"0000 000 000"},PT:{countryCode:"PT",callingCode:"351",mask:"000 000 000"},PW:{countryCode:"PW",callingCode:"680",mask:"000 0000"},PY:{countryCode:"PY",callingCode:"595",mask:"0000 000000"},QA:{countryCode:"QA",callingCode:"974",mask:"0000 0000"},RE:{countryCode:"RE",callingCode:"262",mask:"0000 00 00 00"},RO:{countryCode:"RO",callingCode:"40",mask:"0000 000 000"},RS:{countryCode:"RS",callingCode:"381",mask:"000 0000000"},RU:{countryCode:"RU",callingCode:"7",mask:"0 (000) 000-00-00"},RW:{countryCode:"RW",callingCode:"250",mask:"0000 000 000"},SA:{countryCode:"SA",callingCode:"966",mask:"000 000 0000"},SB:{countryCode:"SB",callingCode:"677",mask:"00 00000"},SC:{countryCode:"SC",callingCode:"248",mask:"0 000 000"},SD:{countryCode:"SD",callingCode:"249",mask:"000 000 0000"},SE:{countryCode:"SE",callingCode:"46",mask:"000-000 00 00"},SG:{countryCode:"SG",callingCode:"65",mask:"0000 0000"},SH:{countryCode:"SH",callingCode:"290",mask:"00000"},SI:{countryCode:"SI",callingCode:"386",mask:"000 000 000"},SJ:{countryCode:"SJ",callingCode:"47",mask:"00 00 00 00"},SK:{countryCode:"SK",callingCode:"421",mask:"0000 000 000"},SL:{countryCode:"SL",callingCode:"232",mask:"(000) 000000"},SM:{countryCode:"SM",callingCode:"378",mask:"00 00 00 00"},SN:{countryCode:"SN",callingCode:"221",mask:"00 000 00 00"},SO:{countryCode:"SO",callingCode:"252",mask:"0 0000000"},SR:{countryCode:"SR",callingCode:"597",mask:"000-0000"},SS:{countryCode:"SS",callingCode:"211",mask:"0000 000 000"},ST:{countryCode:"ST",callingCode:"239",mask:"000 0000"},SV:{countryCode:"SV",callingCode:"503",mask:"0000 0000"},SX:{countryCode:"SX",callingCode:"1",mask:"(000) 000-0000"},SY:{countryCode:"SY",callingCode:"963",mask:"0000 000 000"},SZ:{countryCode:"SZ",callingCode:"268",mask:"0000 0000"},TA:{countryCode:"TA",callingCode:"290",mask:"0000"},TC:{countryCode:"TC",callingCode:"1",mask:"(000) 000-0000"},TD:{countryCode:"TD",callingCode:"235",mask:"00 00 00 00"},TG:{countryCode:"TG",callingCode:"228",mask:"00 00 00 00"},TH:{countryCode:"TH",callingCode:"66",mask:"000 000 0000"},TJ:{countryCode:"TJ",callingCode:"992",mask:"00 000 0000"},TK:{countryCode:"TK",callingCode:"690",mask:"0000"},TL:{countryCode:"TL",callingCode:"670",mask:"0000 0000"},TM:{countryCode:"TM",callingCode:"993",mask:"0 00 000000"},TN:{countryCode:"TN",callingCode:"216",mask:"00 000 000"},TO:{countryCode:"TO",callingCode:"676",mask:"000 0000"},TR:{countryCode:"TR",callingCode:"90",mask:"0000 000 00 00"},TT:{countryCode:"TT",callingCode:"1",mask:"(000) 000-0000"},TV:{countryCode:"TV",callingCode:"688",mask:"00 0000"},TW:{countryCode:"TW",callingCode:"886",mask:"0000 000 000"},TZ:{countryCode:"TZ",callingCode:"255",mask:"0000 000 000"},UA:{countryCode:"UA",callingCode:"380",mask:"000 000 0000"},UG:{countryCode:"UG",callingCode:"256",mask:"0000 000000"},US:{countryCode:"US",callingCode:"1",mask:"(000) 000-0000"},UY:{countryCode:"UY",callingCode:"598",mask:"000 000 000"},UZ:{countryCode:"UZ",callingCode:"998",mask:"00 000 00 00"},VA:{countryCode:"VA",callingCode:"39",mask:"000 000 0000"},VC:{countryCode:"VC",callingCode:"1",mask:"(000) 000-0000"},VE:{countryCode:"VE",callingCode:"58",mask:"0000-0000000"},VG:{countryCode:"VG",callingCode:"1",mask:"(000) 000-0000"},VI:{countryCode:"VI",callingCode:"1",mask:"(000) 000-0000"},VN:{countryCode:"VN",callingCode:"84",mask:"0000 000 000"},VU:{countryCode:"VU",callingCode:"678",mask:"000 0000"},WF:{countryCode:"WF",callingCode:"681",mask:"00 00 00"},WS:{countryCode:"WS",callingCode:"685",mask:"00 00000"},XK:{countryCode:"XK",callingCode:"383",mask:"000 000 000"},YE:{countryCode:"YE",callingCode:"967",mask:"0000 000 000"},YT:{countryCode:"YT",callingCode:"262",mask:"0000 00 00 00"},ZA:{countryCode:"ZA",callingCode:"27",mask:"000 000 0000"},ZM:{countryCode:"ZM",callingCode:"260",mask:"000 0000000"},ZW:{countryCode:"ZW",callingCode:"263",mask:"000 000 0000"}};function a0(n,c,l,t=!1){const C=V(n,c),r=c0(C,n,l,t);return{maskedValue:C,cursorPosition:r}}function A(n){return n.replace(/\D+/g,"")}function V(n,c){const l=A(n);let t="",C=0;if(l.length){for(const r of c)if(r==="0"){if(t+=l[C++],C===l.length)break}else t+=r;C<l.length&&(t+=" "+l.slice(C))}return t}function c0(n,c,l,t){const C=l===c.length;if(t||!C){const r=c.slice(0,l),i=c.slice(l);if(n.startsWith(r))return l;if(n.endsWith(i))return n.length-i.length;{const y=F(r);let g=0,S=0;for(;S<y.length;)F(n[g])&&S++,g++;return g}}}function F(n){return n.replace(/[.,\\/#!$%^&*;:{}=+\-_`~()\s]/g,"")}const C0=n=>n||(typeof navigator<"u"?navigator.language:"en-US"),d0=n=>{var{countryCode:c,value:l,defaultValue:t="",locale:C,floatingLabel:r,disabled:i,readonly:y,invalid:g,className:S,onFocus:f,onBlur:B,onChange:T,onInputChange:I,onKeyDown:K,onKeyPress:N,onKeyUp:L,onExpand:O,onCollapse:v}=n,H=e0.__rest(n,["countryCode","value","defaultValue","locale","floatingLabel","disabled","readonly","invalid","className","onFocus","onBlur","onChange","onInputChange","onKeyDown","onKeyPress","onKeyUp","onExpand","onCollapse"]);const P=l!==void 0,m=a.useMemo(()=>{const o=C0(C),e=new Intl.DisplayNames([o],{type:"region"});return Object.keys(G).map(u=>{var d;return[u,(d=e.of(u))!==null&&d!==void 0?d:""]}).sort(([,u],[,d])=>u.localeCompare(d))},[C]),[R,p]=a.useState(()=>{if(c){const o=m.findIndex(([e])=>e===c.toUpperCase());return o!==-1?o:0}return 0}),[W,Z]=a.useState(t),E=a.useRef(null),k=a.useRef(null);a.useEffect(()=>{if(c){const o=m.findIndex(([e])=>e===c.toUpperCase());p(o!==-1?o:0)}},[c,m]);const M=(o=R)=>{const[e]=m[o];return G[e]};a.useEffect(()=>{k.current!==null&&E.current&&(E.current.setSelectionRange(k.current,k.current),k.current=null)});const Y=()=>P?l:W,x=()=>{const o=Y();return o?V(o,M().mask):""},s=o=>{const e=o?.maskedValue!==void 0?o?.maskedValue:x();return{value:e,rawValue:A(e),callingCode:M(o?.index).callingCode,countryCode:M(o?.index).countryCode}},J=(o,{index:e})=>{p(e),T&&T(o,s({index:e}))},w=o=>{f&&f(o,s())},Q=o=>{B&&B(o,s())},X=o=>{T&&T(o,s())},q=o=>{const e=o.target,u=e.value,d=e.selectionStart||0,o0=o.nativeEvent&&"inputType"in o.nativeEvent?/delete.*Backward/.test(o.nativeEvent.inputType):!1,{maskedValue:D,cursorPosition:h}=a0(u,M().mask,d,o0);h!==void 0&&(k.current=h),P||Z(A(D)),I&&I(o,s({maskedValue:D}))},_=o=>{K&&K(o,s())},j=o=>{N&&N(o,s())},$=o=>{L&&L(o,s())},z=m.map(([o,e],u)=>{const d=G[o];return a.createElement(U.ListboxOption,{key:o,value:`${e}-${d.callingCode}`,selected:u===R,icon:a.createElement(l0.EbayFlagIcon,{flag:d.countryCode.toLowerCase()})},a.createElement("span",null,e," ( + ",d.callingCode," )"))});return a.createElement("span",Object.assign({},H,{className:n0("phone-input",S,{"phone-input--disabled":i,"phone-input--readonly":y,"phone-input--error":g})}),a.createElement(U.ListboxButton,{split:"start",disabled:y||i,onChange:J,onExpand:O,onCollapse:v},z),a.createElement(b.EbayTextbox,{type:"tel",value:x(),disabled:i,floatingLabel:r,floatingLabelStatic:!0,readOnly:y,invalid:g,onBlur:Q,onFocus:w,onKeyDown:_,onKeyPress:j,onKeyUp:$,onChange:X,onInputChange:q,ref:E},a.createElement(b.EbayTextboxPrefixText,{id:"phone-prefix"},"+ ",M().callingCode)))};exports.EbayPhoneInput=d0;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e0=require("../tslib.es6-C4EgNkz1.js"),n0=require("classnames"),a=require("react"),U=require("../listbox-button-sULPe7qi.js"),b=require("../textbox-DAip4ToD.js");require("../icon-I30uh1Ov.js");require("../icon-button-AJ6dtyvc.js");const l0=require("../flag-DU-1tRv6.js"),G={AC:{countryCode:"AC",callingCode:"247",mask:"00000"},AD:{countryCode:"AD",callingCode:"376",mask:"000 000"},AE:{countryCode:"AE",callingCode:"971",mask:"000 000 0000"},AF:{countryCode:"AF",callingCode:"93",mask:"000 000 0000"},AG:{countryCode:"AG",callingCode:"1",mask:"(000) 000-0000"},AI:{countryCode:"AI",callingCode:"1",mask:"(000) 000-0000"},AL:{countryCode:"AL",callingCode:"355",mask:"000 000 0000"},AM:{countryCode:"AM",callingCode:"374",mask:"000 000000"},AO:{countryCode:"AO",callingCode:"244",mask:"000 000 000"},AR:{countryCode:"AR",callingCode:"54",mask:"000 00-0000-0000"},AS:{countryCode:"AS",callingCode:"1",mask:"(000) 000-0000"},AT:{countryCode:"AT",callingCode:"43",mask:"0000 000000"},AU:{countryCode:"AU",callingCode:"61",mask:"0000 000 000"},AW:{countryCode:"AW",callingCode:"297",mask:"000 0000"},AX:{countryCode:"AX",callingCode:"358",mask:"000 0000000"},AZ:{countryCode:"AZ",callingCode:"994",mask:"000 000 00 00"},BA:{countryCode:"BA",callingCode:"387",mask:"000 000 000"},BB:{countryCode:"BB",callingCode:"1",mask:"(000) 000-0000"},BD:{countryCode:"BD",callingCode:"880",mask:"00000-000000"},BE:{countryCode:"BE",callingCode:"32",mask:"0000 00 00 00"},BF:{countryCode:"BF",callingCode:"226",mask:"00 00 00 00"},BG:{countryCode:"BG",callingCode:"359",mask:"000 000 000"},BH:{countryCode:"BH",callingCode:"973",mask:"0000 0000"},BI:{countryCode:"BI",callingCode:"257",mask:"00 00 00 00"},BJ:{countryCode:"BJ",callingCode:"229",mask:"00 00 00 00 00"},BL:{countryCode:"BL",callingCode:"590",mask:"0000 00 00 00"},BM:{countryCode:"BM",callingCode:"1",mask:"(000) 000-0000"},BN:{countryCode:"BN",callingCode:"673",mask:"000 0000"},BO:{countryCode:"BO",callingCode:"591",mask:"00000000"},BQ:{countryCode:"BQ",callingCode:"599",mask:"000 0000"},BR:{countryCode:"BR",callingCode:"55",mask:"(00) 00000-0000"},BS:{countryCode:"BS",callingCode:"1",mask:"(000) 000-0000"},BT:{countryCode:"BT",callingCode:"975",mask:"00 00 00 00"},BW:{countryCode:"BW",callingCode:"267",mask:"00 000 000"},BY:{countryCode:"BY",callingCode:"375",mask:"0 000 000-00-00"},BZ:{countryCode:"BZ",callingCode:"501",mask:"000-0000"},CA:{countryCode:"CA",callingCode:"1",mask:"(000) 000-0000"},CC:{countryCode:"CC",callingCode:"61",mask:"0000 000 000"},CD:{countryCode:"CD",callingCode:"243",mask:"0000 000 000"},CF:{countryCode:"CF",callingCode:"236",mask:"00 00 00 00"},CG:{countryCode:"CG",callingCode:"242",mask:"00 000 0000"},CH:{countryCode:"CH",callingCode:"41",mask:"000 000 00 00"},CI:{countryCode:"CI",callingCode:"225",mask:"00 00 00 0000"},CK:{countryCode:"CK",callingCode:"682",mask:"00 000"},CL:{countryCode:"CL",callingCode:"56",mask:"(0) 0000 0000"},CM:{countryCode:"CM",callingCode:"237",mask:"0 00 00 00 00"},CN:{countryCode:"CN",callingCode:"86",mask:"000 0000 0000"},CO:{countryCode:"CO",callingCode:"57",mask:"000 0000000"},CR:{countryCode:"CR",callingCode:"506",mask:"0000 0000"},CU:{countryCode:"CU",callingCode:"53",mask:"00 0000000"},CV:{countryCode:"CV",callingCode:"238",mask:"000 00 00"},CW:{countryCode:"CW",callingCode:"599",mask:"0 000 0000"},CX:{countryCode:"CX",callingCode:"61",mask:"0000 000 000"},CY:{countryCode:"CY",callingCode:"357",mask:"00 000000"},CZ:{countryCode:"CZ",callingCode:"420",mask:"000 000 000"},DE:{countryCode:"DE",callingCode:"49",mask:"00000 0000000"},DJ:{countryCode:"DJ",callingCode:"253",mask:"00 00 00 00"},DK:{countryCode:"DK",callingCode:"45",mask:"00 00 00 00"},DM:{countryCode:"DM",callingCode:"1",mask:"(000) 000-0000"},DO:{countryCode:"DO",callingCode:"1",mask:"(000) 000-0000"},DZ:{countryCode:"DZ",callingCode:"213",mask:"0000 00 00 00"},EC:{countryCode:"EC",callingCode:"593",mask:"000 000 0000"},EE:{countryCode:"EE",callingCode:"372",mask:"0000 0000"},EG:{countryCode:"EG",callingCode:"20",mask:"000 00000000"},EH:{countryCode:"EH",callingCode:"212",mask:"0000-000000"},ER:{countryCode:"ER",callingCode:"291",mask:"00 000 000"},ES:{countryCode:"ES",callingCode:"34",mask:"000 00 00 00"},ET:{countryCode:"ET",callingCode:"251",mask:"000 000 0000"},FI:{countryCode:"FI",callingCode:"358",mask:"000 0000000"},FJ:{countryCode:"FJ",callingCode:"679",mask:"000 0000"},FK:{countryCode:"FK",callingCode:"500",mask:"00000"},FM:{countryCode:"FM",callingCode:"691",mask:"000 0000"},FO:{countryCode:"FO",callingCode:"298",mask:"000000"},FR:{countryCode:"FR",callingCode:"33",mask:"00 00 00 00 00"},GA:{countryCode:"GA",callingCode:"241",mask:"00 00 00 00"},GB:{countryCode:"GB",callingCode:"44",mask:"00000 000000"},GD:{countryCode:"GD",callingCode:"1",mask:"(000) 000-0000"},GE:{countryCode:"GE",callingCode:"995",mask:"000 00 00 00"},GF:{countryCode:"GF",callingCode:"594",mask:"0000 00 00 00"},GG:{countryCode:"GG",callingCode:"44",mask:"00000 000000"},GH:{countryCode:"GH",callingCode:"233",mask:"000 000 0000"},GI:{countryCode:"GI",callingCode:"350",mask:"00000000"},GL:{countryCode:"GL",callingCode:"299",mask:"00 00 00"},GM:{countryCode:"GM",callingCode:"220",mask:"000 0000"},GN:{countryCode:"GN",callingCode:"224",mask:"000 00 00 00"},GP:{countryCode:"GP",callingCode:"590",mask:"0000 00 00 00"},GQ:{countryCode:"GQ",callingCode:"240",mask:"000 000 000"},GR:{countryCode:"GR",callingCode:"30",mask:"000 000 0000"},GT:{countryCode:"GT",callingCode:"502",mask:"0000 0000"},GU:{countryCode:"GU",callingCode:"1",mask:"(000) 000-0000"},GW:{countryCode:"GW",callingCode:"245",mask:"000 000 000"},GY:{countryCode:"GY",callingCode:"592",mask:"000 0000"},HK:{countryCode:"HK",callingCode:"852",mask:"0000 0000"},HN:{countryCode:"HN",callingCode:"504",mask:"0000-0000"},HR:{countryCode:"HR",callingCode:"385",mask:"000 000 0000"},HT:{countryCode:"HT",callingCode:"509",mask:"00 00 0000"},HU:{countryCode:"HU",callingCode:"36",mask:"00 00 000 0000"},ID:{countryCode:"ID",callingCode:"62",mask:"0000-000-000"},IE:{countryCode:"IE",callingCode:"353",mask:"000 000 0000"},IL:{countryCode:"IL",callingCode:"972",mask:"000-000-0000"},IM:{countryCode:"IM",callingCode:"44",mask:"00000 000000"},IN:{countryCode:"IN",callingCode:"91",mask:"000000 00000"},IO:{countryCode:"IO",callingCode:"246",mask:"000 0000"},IQ:{countryCode:"IQ",callingCode:"964",mask:"0000 000 0000"},IR:{countryCode:"IR",callingCode:"98",mask:"0000 000 0000"},IS:{countryCode:"IS",callingCode:"354",mask:"000 0000"},IT:{countryCode:"IT",callingCode:"39",mask:"000 000 0000"},JE:{countryCode:"JE",callingCode:"44",mask:"00000 000000"},JM:{countryCode:"JM",callingCode:"1",mask:"(000) 000-0000"},JO:{countryCode:"JO",callingCode:"962",mask:"00 0000 0000"},JP:{countryCode:"JP",callingCode:"81",mask:"000-0000-0000"},KE:{countryCode:"KE",callingCode:"254",mask:"0000 000000"},KG:{countryCode:"KG",callingCode:"996",mask:"0000 000 000"},KH:{countryCode:"KH",callingCode:"855",mask:"000 000 000"},KI:{countryCode:"KI",callingCode:"686",mask:"00000000"},KM:{countryCode:"KM",callingCode:"269",mask:"000 00 00"},KN:{countryCode:"KN",callingCode:"1",mask:"(000) 000-0000"},KP:{countryCode:"KP",callingCode:"850",mask:"0000 000 0000"},KR:{countryCode:"KR",callingCode:"82",mask:"000-0000-0000"},KW:{countryCode:"KW",callingCode:"965",mask:"000 00000"},KY:{countryCode:"KY",callingCode:"1",mask:"(000) 000-0000"},KZ:{countryCode:"KZ",callingCode:"7",mask:"0 (000) 000 0000"},LA:{countryCode:"LA",callingCode:"856",mask:"000 00 000 000"},LB:{countryCode:"LB",callingCode:"961",mask:"00 000 000"},LC:{countryCode:"LC",callingCode:"1",mask:"(000) 000-0000"},LI:{countryCode:"LI",callingCode:"423",mask:"000 000 000"},LK:{countryCode:"LK",callingCode:"94",mask:"000 000 0000"},LR:{countryCode:"LR",callingCode:"231",mask:"000 000 0000"},LS:{countryCode:"LS",callingCode:"266",mask:"0000 0000"},LT:{countryCode:"LT",callingCode:"370",mask:"(0-000) 00000"},LU:{countryCode:"LU",callingCode:"352",mask:"000 000 000"},LV:{countryCode:"LV",callingCode:"371",mask:"00 000 000"},LY:{countryCode:"LY",callingCode:"218",mask:"000-0000000"},MA:{countryCode:"MA",callingCode:"212",mask:"0000-000000"},MC:{countryCode:"MC",callingCode:"377",mask:"00 00 00 00 00"},MD:{countryCode:"MD",callingCode:"373",mask:"0000 00 000"},ME:{countryCode:"ME",callingCode:"382",mask:"000 000 000"},MF:{countryCode:"MF",callingCode:"590",mask:"0000 00 00 00"},MG:{countryCode:"MG",callingCode:"261",mask:"000 00 000 00"},MH:{countryCode:"MH",callingCode:"692",mask:"000-0000"},MK:{countryCode:"MK",callingCode:"389",mask:"000 000 000"},ML:{countryCode:"ML",callingCode:"223",mask:"00 00 00 00"},MM:{countryCode:"MM",callingCode:"95",mask:"00 000 0000"},MN:{countryCode:"MN",callingCode:"976",mask:"0000 0000"},MO:{countryCode:"MO",callingCode:"853",mask:"0000 0000"},MP:{countryCode:"MP",callingCode:"1",mask:"(000) 000-0000"},MQ:{countryCode:"MQ",callingCode:"596",mask:"0000 00 00 00"},MR:{countryCode:"MR",callingCode:"222",mask:"00 00 00 00"},MS:{countryCode:"MS",callingCode:"1",mask:"(000) 000-0000"},MT:{countryCode:"MT",callingCode:"356",mask:"0000 0000"},MU:{countryCode:"MU",callingCode:"230",mask:"0000 0000"},MV:{countryCode:"MV",callingCode:"960",mask:"000-0000"},MW:{countryCode:"MW",callingCode:"265",mask:"0000 00 00 00"},MX:{countryCode:"MX",callingCode:"52",mask:"000 000 0000"},MY:{countryCode:"MY",callingCode:"60",mask:"000-000 0000"},MZ:{countryCode:"MZ",callingCode:"258",mask:"00 000 0000"},NA:{countryCode:"NA",callingCode:"264",mask:"000 000 0000"},NC:{countryCode:"NC",callingCode:"687",mask:"00.00.00"},NE:{countryCode:"NE",callingCode:"227",mask:"00 00 00 00"},NF:{countryCode:"NF",callingCode:"672",mask:"0 00000"},NG:{countryCode:"NG",callingCode:"234",mask:"0000 000 0000"},NI:{countryCode:"NI",callingCode:"505",mask:"0000 0000"},NL:{countryCode:"NL",callingCode:"31",mask:"00 00000000"},NO:{countryCode:"NO",callingCode:"47",mask:"00 00 00 00"},NP:{countryCode:"NP",callingCode:"977",mask:"000-0000000"},NR:{countryCode:"NR",callingCode:"674",mask:"000 0000"},NU:{countryCode:"NU",callingCode:"683",mask:"000 0000"},NZ:{countryCode:"NZ",callingCode:"64",mask:"000 000 0000"},OM:{countryCode:"OM",callingCode:"968",mask:"0000 0000"},PA:{countryCode:"PA",callingCode:"507",mask:"0000-0000"},PE:{countryCode:"PE",callingCode:"51",mask:"000 000 000"},PF:{countryCode:"PF",callingCode:"689",mask:"00 00 00 00"},PG:{countryCode:"PG",callingCode:"675",mask:"0000 0000"},PH:{countryCode:"PH",callingCode:"63",mask:"0000 000 0000"},PK:{countryCode:"PK",callingCode:"92",mask:"0000 0000000"},PL:{countryCode:"PL",callingCode:"48",mask:"000 000 000"},PM:{countryCode:"PM",callingCode:"508",mask:"000 00 00"},PR:{countryCode:"PR",callingCode:"1",mask:"(000) 000-0000"},PS:{countryCode:"PS",callingCode:"970",mask:"0000 000 000"},PT:{countryCode:"PT",callingCode:"351",mask:"000 000 000"},PW:{countryCode:"PW",callingCode:"680",mask:"000 0000"},PY:{countryCode:"PY",callingCode:"595",mask:"0000 000000"},QA:{countryCode:"QA",callingCode:"974",mask:"0000 0000"},RE:{countryCode:"RE",callingCode:"262",mask:"0000 00 00 00"},RO:{countryCode:"RO",callingCode:"40",mask:"0000 000 000"},RS:{countryCode:"RS",callingCode:"381",mask:"000 0000000"},RU:{countryCode:"RU",callingCode:"7",mask:"0 (000) 000-00-00"},RW:{countryCode:"RW",callingCode:"250",mask:"0000 000 000"},SA:{countryCode:"SA",callingCode:"966",mask:"000 000 0000"},SB:{countryCode:"SB",callingCode:"677",mask:"00 00000"},SC:{countryCode:"SC",callingCode:"248",mask:"0 000 000"},SD:{countryCode:"SD",callingCode:"249",mask:"000 000 0000"},SE:{countryCode:"SE",callingCode:"46",mask:"000-000 00 00"},SG:{countryCode:"SG",callingCode:"65",mask:"0000 0000"},SH:{countryCode:"SH",callingCode:"290",mask:"00000"},SI:{countryCode:"SI",callingCode:"386",mask:"000 000 000"},SJ:{countryCode:"SJ",callingCode:"47",mask:"00 00 00 00"},SK:{countryCode:"SK",callingCode:"421",mask:"0000 000 000"},SL:{countryCode:"SL",callingCode:"232",mask:"(000) 000000"},SM:{countryCode:"SM",callingCode:"378",mask:"00 00 00 00"},SN:{countryCode:"SN",callingCode:"221",mask:"00 000 00 00"},SO:{countryCode:"SO",callingCode:"252",mask:"0 0000000"},SR:{countryCode:"SR",callingCode:"597",mask:"000-0000"},SS:{countryCode:"SS",callingCode:"211",mask:"0000 000 000"},ST:{countryCode:"ST",callingCode:"239",mask:"000 0000"},SV:{countryCode:"SV",callingCode:"503",mask:"0000 0000"},SX:{countryCode:"SX",callingCode:"1",mask:"(000) 000-0000"},SY:{countryCode:"SY",callingCode:"963",mask:"0000 000 000"},SZ:{countryCode:"SZ",callingCode:"268",mask:"0000 0000"},TA:{countryCode:"TA",callingCode:"290",mask:"0000"},TC:{countryCode:"TC",callingCode:"1",mask:"(000) 000-0000"},TD:{countryCode:"TD",callingCode:"235",mask:"00 00 00 00"},TG:{countryCode:"TG",callingCode:"228",mask:"00 00 00 00"},TH:{countryCode:"TH",callingCode:"66",mask:"000 000 0000"},TJ:{countryCode:"TJ",callingCode:"992",mask:"00 000 0000"},TK:{countryCode:"TK",callingCode:"690",mask:"0000"},TL:{countryCode:"TL",callingCode:"670",mask:"0000 0000"},TM:{countryCode:"TM",callingCode:"993",mask:"0 00 000000"},TN:{countryCode:"TN",callingCode:"216",mask:"00 000 000"},TO:{countryCode:"TO",callingCode:"676",mask:"000 0000"},TR:{countryCode:"TR",callingCode:"90",mask:"0000 000 00 00"},TT:{countryCode:"TT",callingCode:"1",mask:"(000) 000-0000"},TV:{countryCode:"TV",callingCode:"688",mask:"00 0000"},TW:{countryCode:"TW",callingCode:"886",mask:"0000 000 000"},TZ:{countryCode:"TZ",callingCode:"255",mask:"0000 000 000"},UA:{countryCode:"UA",callingCode:"380",mask:"000 000 0000"},UG:{countryCode:"UG",callingCode:"256",mask:"0000 000000"},US:{countryCode:"US",callingCode:"1",mask:"(000) 000-0000"},UY:{countryCode:"UY",callingCode:"598",mask:"000 000 000"},UZ:{countryCode:"UZ",callingCode:"998",mask:"00 000 00 00"},VA:{countryCode:"VA",callingCode:"39",mask:"000 000 0000"},VC:{countryCode:"VC",callingCode:"1",mask:"(000) 000-0000"},VE:{countryCode:"VE",callingCode:"58",mask:"0000-0000000"},VG:{countryCode:"VG",callingCode:"1",mask:"(000) 000-0000"},VI:{countryCode:"VI",callingCode:"1",mask:"(000) 000-0000"},VN:{countryCode:"VN",callingCode:"84",mask:"0000 000 000"},VU:{countryCode:"VU",callingCode:"678",mask:"000 0000"},WF:{countryCode:"WF",callingCode:"681",mask:"00 00 00"},WS:{countryCode:"WS",callingCode:"685",mask:"00 00000"},XK:{countryCode:"XK",callingCode:"383",mask:"000 000 000"},YE:{countryCode:"YE",callingCode:"967",mask:"0000 000 000"},YT:{countryCode:"YT",callingCode:"262",mask:"0000 00 00 00"},ZA:{countryCode:"ZA",callingCode:"27",mask:"000 000 0000"},ZM:{countryCode:"ZM",callingCode:"260",mask:"000 0000000"},ZW:{countryCode:"ZW",callingCode:"263",mask:"000 000 0000"}};function a0(n,c,l,t=!1){const C=V(n,c),r=c0(C,n,l,t);return{maskedValue:C,cursorPosition:r}}function A(n){return n.replace(/\D+/g,"")}function V(n,c){const l=A(n);let t="",C=0;if(l.length){for(const r of c)if(r==="0"){if(t+=l[C++],C===l.length)break}else t+=r;C<l.length&&(t+=" "+l.slice(C))}return t}function c0(n,c,l,t){const C=l===c.length;if(t||!C){const r=c.slice(0,l),i=c.slice(l);if(n.startsWith(r))return l;if(n.endsWith(i))return n.length-i.length;{const y=F(r);let g=0,S=0;for(;S<y.length;)F(n[g])&&S++,g++;return g}}}function F(n){return n.replace(/[.,\\/#!$%^&*;:{}=+\-_`~()\s]/g,"")}const C0=n=>n||(typeof navigator<"u"?navigator.language:"en-US"),d0=n=>{var{countryCode:c,value:l,defaultValue:t="",locale:C,floatingLabel:r,disabled:i,readonly:y,invalid:g,className:S,onFocus:f,onBlur:B,onChange:T,onInputChange:I,onKeyDown:K,onKeyPress:N,onKeyUp:L,onExpand:O,onCollapse:v}=n,H=e0.__rest(n,["countryCode","value","defaultValue","locale","floatingLabel","disabled","readonly","invalid","className","onFocus","onBlur","onChange","onInputChange","onKeyDown","onKeyPress","onKeyUp","onExpand","onCollapse"]);const P=l!==void 0,m=a.useMemo(()=>{const o=C0(C),e=new Intl.DisplayNames([o],{type:"region"});return Object.keys(G).map(u=>{var d;return[u,(d=e.of(u))!==null&&d!==void 0?d:""]}).sort(([,u],[,d])=>u.localeCompare(d))},[C]),[R,p]=a.useState(()=>{if(c){const o=m.findIndex(([e])=>e===c.toUpperCase());return o!==-1?o:0}return 0}),[W,Z]=a.useState(t),E=a.useRef(null),k=a.useRef(null);a.useEffect(()=>{if(c){const o=m.findIndex(([e])=>e===c.toUpperCase());p(o!==-1?o:0)}},[c,m]);const M=(o=R)=>{const[e]=m[o];return G[e]};a.useEffect(()=>{k.current!==null&&E.current&&(E.current.setSelectionRange(k.current,k.current),k.current=null)});const Y=()=>P?l:W,x=()=>{const o=Y();return o?V(o,M().mask):""},s=o=>{const e=o?.maskedValue!==void 0?o?.maskedValue:x();return{value:e,rawValue:A(e),callingCode:M(o?.index).callingCode,countryCode:M(o?.index).countryCode}},J=(o,{index:e})=>{p(e),T&&T(o,s({index:e}))},w=o=>{f&&f(o,s())},Q=o=>{B&&B(o,s())},X=o=>{T&&T(o,s())},q=o=>{const e=o.target,u=e.value,d=e.selectionStart||0,o0=o.nativeEvent&&"inputType"in o.nativeEvent?/delete.*Backward/.test(o.nativeEvent.inputType):!1,{maskedValue:D,cursorPosition:h}=a0(u,M().mask,d,o0);h!==void 0&&(k.current=h),P||Z(A(D)),I&&I(o,s({maskedValue:D}))},_=o=>{K&&K(o,s())},j=o=>{N&&N(o,s())},$=o=>{L&&L(o,s())},z=m.map(([o,e],u)=>{const d=G[o];return a.createElement(U.ListboxOption,{key:o,value:`${e}-${d.callingCode}`,selected:u===R,icon:a.createElement(l0.EbayFlagIcon,{flag:d.countryCode.toLowerCase()})},a.createElement("span",null,e," ( + ",d.callingCode," )"))});return a.createElement("span",Object.assign({},H,{className:n0("phone-input",S,{"phone-input--disabled":i,"phone-input--readonly":y,"phone-input--error":g})}),a.createElement(U.ListboxButton,{split:"start",disabled:y||i,onChange:J,onExpand:O,onCollapse:v},z),a.createElement(b.EbayTextbox,{type:"tel",value:x(),disabled:i,floatingLabel:r,floatingLabelStatic:!0,readOnly:y,invalid:g,onBlur:Q,onFocus:w,onKeyDown:_,onKeyPress:j,onKeyUp:$,onChange:X,onInputChange:q,ref:E},a.createElement(b.EbayTextboxPrefixText,{id:"phone-prefix"},"+ ",M().callingCode)))};exports.EbayPhoneInput=d0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../tslib.es6-C4EgNkz1.js"),n=require("react"),i=require("../utils-C9NL3q0j.js"),g=require("../button-xYFMCdP0.js"),s=require("../menu-button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../tslib.es6-C4EgNkz1.js"),n=require("react"),i=require("../utils-C9NL3q0j.js"),g=require("../button-xYFMCdP0.js"),s=require("../menu-button-Cw_SMZjv.js"),x=require("../menu-Bvnencku.js");require("classnames");const q=a=>{var{a11yMenuText:l,children:o,type:u,bodyState:t,a11yButtonLoadingText:y,onCollapse:d,onExpand:p,onSelect:c=()=>{},onChange:b=()=>{}}=a,e=S.__rest(a,["a11yMenuText","children","type","bodyState","a11yButtonLoadingText","onCollapse","onExpand","onSelect","onChange"]);const r=[x.EbayMenuItem,s.EbayMenuButtonSeparator],m=i.filterBy(o,B=>!r.includes(B.type)),E=i.filterByType(o,r);return n.createElement("span",{className:"split-button"},n.createElement(g.EbayButton,Object.assign({"aria-label":t==="loading"?y:void 0},e,{ref:void 0,split:"start",bodyState:t==="expand"?void 0:t}),m),n.createElement(s.EbayMenuButton,{priority:e.priority,disabled:e.disabled,transparent:e.transparent,partiallyDisabled:e.partiallyDisabled,size:e.size,type:u,split:"end",reverse:!0,a11yText:l,onCollapse:d,onExpand:p,onSelect:c,onChange:b},E))};exports.EbaySplitButton=q;
|