Liferay.Loader.define("portal-search-web@6.0.73/js/components/select_sxp_blueprint_modal/ManagementToolbar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","frontend-js-components-web","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=f(a("@frontend-taglib-clay$clayui/button")),r=a("@frontend-taglib-clay$clayui/drop-down"),o=a("@frontend-taglib-clay$clayui/form"),u=(n=a("@frontend-taglib-clay$clayui/icon"))&&n.__esModule?n:{default:n},c=a("frontend-js-components-web"),d=a("frontend-js-web"),s=f(a("liferay!frontend-js-react-web$react"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}var m=({filterItems:e,loading:t,onChangeSortOrder:a,onSearch:n,searchValue:i,sortOrder:f,totalCount:m})=>{const[y,p]=(0,s.useState)(i),[b,g]=(0,s.useState)(!1);return s.default.createElement(s.default.Fragment,null,s.default.createElement(c.ManagementToolbar.Container,null,s.default.createElement(c.ManagementToolbar.ItemList,null,s.default.createElement(r.ClayDropDownWithItems,{items:e,trigger:s.default.createElement(l.default,{className:"nav-link",disabled:t,displayType:"unstyled"},s.default.createElement("span",{className:"navbar-breakpoint-down-d-none"},s.default.createElement("span",{className:"navbar-text-truncate"},Liferay.Language.get("filter-and-order")),s.default.createElement(u.default,{className:"inline-item inline-item-after",symbol:"caret-bottom"})),s.default.createElement("span",{className:"navbar-breakpoint-d-none"},s.default.createElement(u.default,{symbol:"filter"})))}),s.default.createElement(c.ManagementToolbar.Item,null,s.default.createElement(l.default,{className:"nav-link nav-link-monospaced",disabled:t,displayType:"unstyled",onClick:a},"asc"===f?s.default.createElement(u.default,{symbol:"order-list-up"}):s.default.createElement(u.default,{symbol:"order-list-down"})))),s.default.createElement(c.ManagementToolbar.Search,{showMobile:b},s.default.createElement(o.ClayInput.Group,null,s.default.createElement(o.ClayInput.GroupItem,null,s.default.createElement(o.ClayInput,{"aria-label":Liferay.Language.get("search"),className:"form-control input-group-inset input-group-inset-after",disabled:t,onChange:e=>{p(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),n(y))},placeholder:Liferay.Language.get("search"),type:"text",value:y}),s.default.createElement(o.ClayInput.GroupInsetItem,{after:!0,tag:"span"},s.default.createElement(l.ClayButtonWithIcon,{className:"navbar-breakpoint-d-none",displayType:"unstyled",onClick:()=>g(!1),symbol:"times"}),s.default.createElement(l.ClayButtonWithIcon,{disabled:t,displayType:"unstyled",onClick:()=>n(y),symbol:"search"}))))),s.default.createElement(c.ManagementToolbar.ItemList,null,s.default.createElement(c.ManagementToolbar.Item,{className:"navbar-breakpoint-d-none"},s.default.createElement(l.default,{className:"nav-link nav-link-monospaced",displayType:"unstyled",onClick:()=>g(!0)},s.default.createElement(u.default,{symbol:"search"}))))),!!i&&!t&&s.default.createElement(c.ManagementToolbar.ResultsBar,null,s.default.createElement(c.ManagementToolbar.ResultsBarItem,null,s.default.createElement("span",{className:"component-text text-truncate-inline"},s.default.createElement("span",{className:"text-truncate"},(0,d.sub)(1===m?Liferay.Language.get("x-result-for-x"):Liferay.Language.get("x-results-for-x"),[m,i])))),s.default.createElement(c.ManagementToolbar.ResultsBarItem,null,s.default.createElement(l.default,{className:"component-link tbar-link",displayType:"unstyled",onClick:()=>{n(""),p("")}},Liferay.Language.get("clear")))))};t.default=m}}));
//# sourceMappingURL=ManagementToolbar.js.map