Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectField/Fields",["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,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Fields({apiURL:e,creationMenu:t,formName:a,id:c,items:d,objectDefinitionExternalReferenceCode:f,style:u,url:s}){const[b,y]=(0,o.useState)();(0,o.useEffect)((()=>{(async()=>{const e=await n.API.getObjectDefinitionByExternalReferenceCode(f);y(e.defaultLanguageId)})()}),[f]);const p=_objectSpread(_objectSpread({},l.defaultDataSetProps),{},{apiURL:e,creationMenu:t,customDataRenderers:{objectFieldLabelDataRenderer:function objectFieldLabelDataRenderer({itemData:e,openSidePanel:t,value:a}){return o.default.createElement("div",{className:"table-list-title"},o.default.createElement("a",{href:"#",onClick:()=>{t({url:(0,l.formatActionURL)(s,e.id)})}},(0,n.getLocalizableLabel)(b,a)))},objectFieldMandatoryDataRenderer:function objectFieldMandatoryDataRenderer({itemData:e}){return e.required?Liferay.Language.get("yes"):Liferay.Language.get("no")},objectFieldSourceDataRenderer:function objectFieldSourceDataRenderer({itemData:e}){return o.default.createElement("strong",{className:(0,i.default)(e.system?"label-info":"label-warning","label")},e.system?Liferay.Language.get("system"):Liferay.Language.get("custom"))}},formName:a,id:c,itemsActions:d,namespace:"_com_liferay_object_web_internal_object_definitions_portlet_ObjectDefinitionsPortlet_",onActionDropdownItemClick({action:e,itemData:t}){"deleteObjectField"===e.data.id&&Liferay.fire("deleteObjectField",{itemData:t})},portletId:"com_liferay_object_web_internal_object_definitions_portlet_ObjectDefinitionsPortlet",style:u,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:"businessType",label:Liferay.Language.get("type"),localizeLabel:!0,sortable:!1},{contentRenderer:"objectFieldMandatoryDataRenderer",expand:!1,fieldName:"mandatory",label:Liferay.Language.get("mandatory"),localizeLabel:!0,sortable:!1},{contentRenderer:"objectFieldSourceDataRenderer",expand:!1,fieldName:"source",label:Liferay.Language.get("source"),localizeLabel:!0,sortable:!1}]},thumbnail:"table"}]});return o.default.createElement(r.FrontendDataSet,p)};var r=a("@liferay/frontend-data-set-web"),n=a("@liferay/object-js-components-web"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("liferay!frontend-js-react-web$classnames")),o=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={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=r?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(a,n,i):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),l=a("../../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 a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}}}));
//# sourceMappingURL=Fields.js.map