Liferay.Loader.define("@liferay/object-web@1.0.108/js/components/Layout/LayoutScreen/ModalAddObjectLayoutBox",["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"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=f(t("@frontend-taglib-clay$clayui/button")),n=f(t("@frontend-taglib-clay$clayui/form")),r=f(t("@frontend-taglib-clay$clayui/modal")),u=t("@liferay/object-js-components-web"),o=f(t("liferay!frontend-js-react-web$react")),d=t("../objectLayoutContext");function f(e){return e&&e.__esModule?e:{default:e}}var c=({observer:e,onClose:a,tabIndex:t})=>{const[,f]=(0,d.useLayoutContext)(),{errors:c,handleChange:i,handleSubmit:y,values:m}=(0,u.useForm)({initialValues:{name:""},onSubmit:e=>{f({payload:{name:{[Liferay.ThemeDisplay.getDefaultLanguageId()]:e.name},tabIndex:t,type:"regular"},type:d.TYPES.ADD_OBJECT_LAYOUT_BOX}),a()},validate:e=>{const a={};return e.name||(a.name=Liferay.Language.get("required")),a}});return o.default.createElement(r.default,{observer:e},o.default.createElement(n.default,{onSubmit:y},o.default.createElement(r.default.Header,null,Liferay.Language.get("add-block")),o.default.createElement(r.default.Body,null,o.default.createElement(u.Input,{error:c.name,id:"inputName",label:Liferay.Language.get("label"),name:"name",onChange:i,required:!0,value:m.name})),o.default.createElement(r.default.Footer,{last:o.default.createElement(l.default.Group,{spaced:!0},o.default.createElement(l.default,{displayType:"secondary",onClick:a},Liferay.Language.get("cancel")),o.default.createElement(l.default,{type:"submit"},Liferay.Language.get("save")))})))};a.default=c}}));
//# sourceMappingURL=ModalAddObjectLayoutBox.js.map