Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectRelationship/Relationships",["module","exports","require","@liferay/frontend-data-set-web","@liferay/object-js-components-web","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../utils/fds"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Relationships({apiURL:e,creationMenu:t,formName:r,id:c,items:f,objectDefinitionExternalReferenceCode:d,style:b,url:s}){const[u,p]=(0,l.useState)();(0,l.useEffect)((()=>{(async()=>{const e=await n.API.getObjectDefinitionByExternalReferenceCode(d);p(e.defaultLanguageId)})()}),[d]);const y=_objectSpread(_objectSpread({},o.defaultDataSetProps),{},{apiURL:e,creationMenu:t,customDataRenderers:{ObjectFieldHierarchyDataRenderer:function ObjectFieldHierarchyDataRenderer({itemData:e}){return l.default.createElement("strong",{className:(0,i.default)(e.reverse?"label-info":"label-success","label")},e.reverse?Liferay.Language.get("child"):Liferay.Language.get("parent"))},objectFieldLabelDataRenderer:function objectFieldLabelDataRenderer({itemData:e,openSidePanel:t,value:r}){return l.default.createElement("div",{className:"table-list-title"},l.default.createElement("a",{href:"#",onClick:()=>{t({url:(0,o.formatActionURL)(s,e.id)})}},(0,n.getLocalizableLabel)(u,r)))}},formName:r,id:c,itemsActions:f,namespace:"_com_liferay_object_web_internal_object_definitions_portlet_ObjectDefinitionsPortlet_",onActionDropdownItemClick({action:e,itemData:t}){"deleteObjectRelationship"===e.data.id&&Liferay.fire("deleteObjectRelationship",{itemData:t})},portletId:"com_liferay_object_web_internal_object_definitions_portlet_ObjectDefinitionsPortlet",style:b,views:[{contentRenderer:"table",label:"Table",name:"table",schema:{fields:[{contentRenderer:"objectFieldLabelDataRenderer",expand:!1,fieldName:"label",label:Liferay.Language.get("label"),localizeLabel:!0,sortable:!0},{expand:!1,fieldName:"objectDefinitionName2",label:Liferay.Language.get("related-object"),localizeLabel:!0,sortable:!1},{expand:!1,fieldName:"type",label:Liferay.Language.get("type"),localizeLabel:!0,sortable:!1},{contentRenderer:"ObjectFieldHierarchyDataRenderer",expand:!1,fieldName:"hierarchy",label:Liferay.Language.get("hierarchy"),localizeLabel:!0,sortable:!1}]},thumbnail:"table"}]});return l.default.createElement(a.FrontendDataSet,y)};var a=r("@liferay/frontend-data-set-web"),n=r("@liferay/object-js-components-web"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("liferay!frontend-js-react-web$classnames")),l=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 r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=r("../../utils/fds");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=Relationships.js.map