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