iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://www.informationweek.com/build/_shared/chunk-LWE7ZKCZ.js
import{a as b}from"/build/_shared/chunk-YBPFZZVB.js";import{a as g,qa as E}from"/build/_shared/chunk-KID4GLZA.js";import{L as h}from"/build/_shared/chunk-SJXV5VAW.js";import{a as v}from"/build/_shared/chunk-63EVRDSK.js";import{e as a}from"/build/_shared/chunk-ADMCF34Z.js";var l=a(E()),t=a(v());var o=a(h()),c=(0,g.cn)("ChangeLocationBar"),S=({variant:r,defaultValue:n,classNames:i,classNameButton:L,handleChangeLocation:d,placeholderText:p,submitText:B,resetValueToDefault:u=!1})=>{let s=(0,t.useRef)(null),[m,f]=(0,t.useState)(n||"");(0,t.useEffect)(()=>{!n||!u&&typeof m>"u"||f(n)},[u,n]),(0,t.useEffect)(()=>{r!=="commodities"&&s.current?.focus()},[r]);let C=e=>{e.preventDefault(),d(m)};return(0,o.jsxs)(b,{className:c({variant:(0,l.default)(r)},[i?.wrapper]),"data-component":"search-bar",method:"get",onSubmit:e=>C(e),children:[(0,o.jsx)("input",{ref:s,className:c("Input",[i?.input]),placeholder:p,title:"Zip code must be number","aria-label":p,type:"text",onChange:e=>f(e.target.value),value:m,minLength:3,required:!0,pattern:"^\\d+$","data-testid":"input-field"}),(0,o.jsx)("button",{className:c("SearchButton",[i?.searchBtn,L]),type:"submit","aria-label":"ChangeLocation","data-component":"button",children:B})]})};export{S as a};