Liferay.Loader.define("@liferay/object-web@1.0.145/js/components/Layout/LayoutScreen/ObjectLayoutBox",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/modal","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","../objectLayoutContext","./HeaderDropdown","./ModalAddObjectLayoutField","./ObjectLayoutRows"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectLayoutBox=function ObjectLayoutBox({boxIndex:e,collapsable:t,label:a,objectLayoutRows:b,tabIndex:y,type:s}){const[{enableCategorization:p,isViewOnly:g},j]=(0,u.useLayoutContext)(),[L,O]=(0,d.useState)(!1),{observer:m,onClose:x}=(0,n.useModal)({onClose:()=>O(!1)}),_="categorization"===s&&!p||g;return d.default.createElement(d.default.Fragment,null,d.default.createElement(r.Panel,null,d.default.createElement(r.PanelHeader,{contentRight:d.default.createElement(d.default.Fragment,null,d.default.createElement(o.ClayToggle,{"aria-label":Liferay.Language.get("collapsible"),disabled:_,label:Liferay.Language.get("collapsible"),onToggle:t=>{j({payload:{attribute:{key:"collapsable",value:t},boxIndex:e,tabIndex:y},type:u.TYPES.CHANGE_OBJECT_LAYOUT_BOX_ATTRIBUTE})},toggled:t}),"regular"===s&&d.default.createElement(l.default,{className:"ml-4",disabled:g,displayType:"secondary",onClick:()=>O(!0),small:!0},Liferay.Language.get("add-field")),d.default.createElement(c.HeaderDropdown,{deleteElement:()=>{j({payload:{boxIndex:e,tabIndex:y},type:u.TYPES.DELETE_OBJECT_LAYOUT_BOX_CATEGORIZATION})},disabled:_})),disabled:_,title:a,type:s}),!!(null==b?void 0:b.length)&&d.default.createElement(r.PanelBody,null,d.default.createElement(f.ObjectLayoutRows,{boxIndex:e,objectLayoutRows:b,tabIndex:y}))),L&&d.default.createElement(i.default,{boxIndex:e,observer:m,onClose:x,tabIndex:y}))};var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),o=a("@frontend-taglib-clay$clayui/form"),n=a("@frontend-taglib-clay$clayui/modal"),r=a("@liferay/object-js-components-web"),d=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 o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=l?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(a,o,n):a[o]=e[o]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),u=a("../objectLayoutContext"),c=a("./HeaderDropdown"),i=_interopRequireDefault(a("./ModalAddObjectLayoutField")),f=a("./ObjectLayoutRows");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=ObjectLayoutBox.js.map