Liferay.Loader.define("data-engine-taglib@3.3.26/data_layout_builder/js/components/search-input/SearchInput.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r("@frontend-taglib-clay$clayui/button"),a=r("@frontend-taglib-clay$clayui/form"),l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var f=l.default.forwardRef(((e,t)=>{let{clearButton:r=!0,onChange:u=(()=>{}),onSubmit:f=(()=>{}),searchText:i=""}=e,y=c(e,["clearButton","onChange","onSubmit","searchText"]);const[p,s]=(0,l.useState)(i),d=(0,l.useRef)(null),b=t||d;(0,l.useEffect)((()=>{s(i)}),[i]);const g=()=>{s(""),u(""),b.current.focus()};let m=l.default.createElement(n.ClayButtonWithIcon,o({displayType:"unstyled",key:"searcgButton",onClick:e=>f(p),symbol:"search"},y));return r&&p&&(m=l.default.createElement(n.ClayButtonWithIcon,{displayType:"unstyled",key:"clearButton",onClick:g,symbol:"times"})),l.default.createElement(a.ClayInput.Group,null,l.default.createElement(a.ClayInput.GroupItem,null,l.default.createElement(a.ClayInput,o({"aria-label":Liferay.Language.get("search"),className:"input-group-inset input-group-inset-after",onChange:({target:{value:e}})=>{s(e),u(e)},placeholder:"".concat(Liferay.Language.get("search"),"..."),ref:b,type:"text",value:p},y)),l.default.createElement(a.ClayInput.GroupInsetItem,{after:!0},m)))}));t.default=f}}));
//# sourceMappingURL=SearchInput.es.js.map