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