Liferay.Loader.define("layout-taglib@16.0.1/select_layout/js/SelectLayout.es",["module","exports","require","@frontend-taglib-clay$clayui/empty-state","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./SelectLayoutTree.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/empty-state")),r=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),u=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),c=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireWildcard(a("liferay!frontend-js-react-web$react"))),i=a("./SelectLayoutTree.es");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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const SelectLayout=({itemSelectorSaveEvent:e,multiSelection:t,nodes:a,selectedLayoutIds:l})=>{const[o,f]=(0,c.useState)(),[d,s]=(0,c.useState)(0),y=!a.length;return c.default.createElement(u.default.ContainerFluid,{className:"p-0 select-layout"},c.default.createElement(r.default.Group,{className:"m-0 p-3 select-layout-filter"},c.default.createElement(r.ClayInput.Group,null,c.default.createElement(r.ClayInput.GroupItem,{prepend:!0},c.default.createElement(r.ClayInput,{"aria-label":Liferay.Language.get("search"),className:"input-group-inset input-group-inset-after",disabled:y,onChange:e=>f(e.target.value),placeholder:"".concat(Liferay.Language.get("search")),type:"text"}),c.default.createElement(r.ClayInput.GroupInsetItem,{after:!0},c.default.createElement("div",{className:"link-monospaced"},c.default.createElement(n.default,{symbol:"search"})))))),y?c.default.createElement(EmptyState,null):c.default.createElement(c.default.Fragment,null,Boolean(d)&&t&&c.default.createElement(u.default.Container,{className:"align-items-center d-flex layout-tree-count-feedback px-3",containerElement:"section",fluid:!0},c.default.createElement("div",{className:"container p-0"},c.default.createElement("p",{className:"m-0 text-2"},d>1?"".concat(d," ").concat(Liferay.Language.get("items-selected")):"".concat(d," ").concat(Liferay.Language.get("item-selected"))))),c.default.createElement(i.SelectLayoutTree,{filter:o,itemSelectorSaveEvent:e,items:a,multiSelection:t,onItemsCountChange:s,selectedLayoutIds:l})))},EmptyState=()=>c.default.createElement(u.default.Sheet,null,c.default.createElement(l.default,{className:"mt-0",description:Liferay.Language.get("there-are-no-pages"),imgSrc:"".concat(themeDisplay.getPathThemeImages(),"/states/empty_state.gif"),title:Liferay.Language.get("no-results-found")}));var o=SelectLayout;t.default=o}}));
//# sourceMappingURL=SelectLayout.es.js.map