Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/page_editor/plugins/fragments-widgets/components/TabCollection",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/config/constants/fragmentsDisplayStyles","../../../app/config/index","../../../common/components/Collapse","../../../core/hooks/useSessionState","./TabItem"],(function(e,t,l){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=TabCollection;var a=_interopRequireDefault(l("liferay!frontend-js-react-web$prop-types")),o=_interopRequireDefault(l("liferay!frontend-js-react-web$react")),n=l("../../../app/config/constants/fragmentsDisplayStyles"),i=l("../../../app/config/index"),r=_interopRequireDefault(l("../../../common/components/Collapse")),s=l("../../../core/hooks/useSessionState"),c=_interopRequireDefault(l("./TabItem"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function TabCollection({collection:e,displayStyle:t,initialOpen:l,isSearchResult:a}){const[n,d]=(0,s.useSessionState)("".concat(i.config.portletNamespace,"_fragment-collection_").concat(e.collectionId,"_open"),l);return o.default.createElement(r.default,{key:e.collectionId,label:e.label,onOpen:e=>{d(e)},open:a||n},e.collections&&e.collections.map(((e,l)=>o.default.createElement(TabCollection,{collection:e,displayStyle:t,initialOpen:!1,isSearchResult:a,key:l}))),o.default.createElement("ul",{className:"list-unstyled page-editor__fragments-widgets__tab-collection-".concat(t," pb-2 w-100")},e.children.map((e=>{var l;return o.default.createElement(o.default.Fragment,{key:e.itemId},o.default.createElement(c.default,{displayStyle:t,item:e,key:e.itemId}),(null===(l=e.portletItems)||void 0===l?void 0:l.length)&&o.default.createElement(TabPortletItems,{item:e}))}))))}TabCollection.proptypes={collection:a.default.shape({children:a.default.array,collectionId:a.default.string,label:a.default.string}).isRequired,displayStyle:a.default.oneOf(Object.values(n.FRAGMENTS_DISPLAY_STYLES)),isSearchResult:a.default.bool,open:a.default.bool};const TabPortletItems=({item:e})=>o.default.createElement("ul",{className:"d-flex flex-wrap list-unstyled w-100"},e.portletItems.map(((e,t)=>o.default.createElement(c.default,{item:e,key:t}))));TabPortletItems.proptypes={data:a.default.shape({instanceable:a.default.bool,portletId:a.default.string,portletItemId:a.default.string,used:a.default.bool}).isRequired,disabled:a.default.bool,icon:a.default.string,itemId:a.default.string,label:a.default.string,portletItems:a.default.array,preview:a.default.string,type:a.default.string}}}));
//# sourceMappingURL=TabCollection.js.map