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