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