Liferay.Loader.define("@liferay/object-web@1.0.145/js/components/ObjectField/EditObjectField",["module","exports","require","@frontend-taglib-clay$clayui/tabs","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","./EditObjectField.scss","./Tabs/Advanced/AdvancedTab","./Tabs/BasicInfo/BasicInfo","./useObjectFieldForm"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function EditObjectField({filterOperators:t,forbiddenChars:a,forbiddenLastChars:c,forbiddenNames:s,isApproved:f,isDefaultStorageType:u,objectDefinitionExternalReferenceCode:b,objectField:p,objectFieldTypes:y,objectName:j,objectRelationshipId:g,readOnly:m,workflowStatusJSONArray:O}){const[v,h]=(0,i.useState)(0),{errors:F,handleChange:w,handleSubmit:_,setValues:L,values:E}=(0,d.useObjectFieldForm)({forbiddenChars:a,forbiddenLastChars:c,forbiddenNames:s,initialValues:p,onSubmit:async e=>{let{id:t}=e,a=function _objectWithoutProperties(e,t){if(null==e)return{};var a,r,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var a,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)a=i[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)a=i[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(e,["id"]);delete a.listTypeDefinitionId,delete a.system;try{await n.API.save("/o/object-admin/v1.0/object-fields/".concat(t),a),(0,n.saveAndReload)(),(0,n.openToast)({message:Liferay.Language.get("the-object-field-was-updated-successfully")})}catch(e){(0,n.openToast)({message:e.message,type:"danger"})}}});Liferay.FeatureFlags["LPS-159913"]&&e.length<2&&e.push(Liferay.Language.get("advanced"));return i.default.createElement(n.SidePanelForm,{className:"lfr-objects__edit-object-field",onSubmit:_,readOnly:m,title:Liferay.Language.get("field")},i.default.createElement(r.default,{className:"side-panel-iframe__tabs"},e.map(((e,t)=>i.default.createElement(r.default.Item,{active:v===t,key:t,onClick:()=>h(t)},e)))),i.default.createElement(r.default.Content,{activeIndex:v,fade:!0},i.default.createElement(r.default.TabPane,null,i.default.createElement(o.BasicInfo,{errors:F,filterOperators:t,handleChange:w,isApproved:f,isDefaultStorageType:u,objectDefinitionExternalReferenceCode:b,objectFieldTypes:y,objectName:j,objectRelationshipId:g,readOnly:m,setValues:L,values:E,workflowStatusJSONArray:O})),Liferay.FeatureFlags["LPS-159913"]?i.default.createElement(r.default.TabPane,null,i.default.createElement(l.AdvancedTab,{setValues:L,values:E})):i.default.createElement(i.default.Fragment,null)))};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("@frontend-taglib-clay$clayui/tabs")),n=a("@liferay/object-js-components-web"),i=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"));a("./EditObjectField.scss");var l=a("./Tabs/Advanced/AdvancedTab"),o=a("./Tabs/BasicInfo/BasicInfo"),d=a("./useObjectFieldForm");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e=[Liferay.Language.get("basic-info")]}}));
//# sourceMappingURL=EditObjectField.js.map