Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/components/FormInfo.es",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/layout","data-engine-js-components-web","frontend-js-web","liferay!frontend-js-react-web$react","../eventTypes.es","../util/dom"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FormInfo=function FormInfo(){var e,t;const{portletNamespace:r}=(0,o.useConfig)(),{defaultLanguageId:d,editingLanguageId:c,localizedDescription:f,localizedName:s}=(0,o.useFormState)(),m=(0,o.useForm)(),p=(0,i.useRef)(null),y=(0,i.useRef)(null);return(0,i.useEffect)((()=>{p.current&&y.current&&(new l.autoSize(p.current),new l.autoSize(y.current))}),[]),i.default.createElement("div",{className:"ddm-form-basic-info"},i.default.createElement(a.default.ContainerFluid,{size:"xl"},i.default.createElement("h1",null,i.default.createElement(n.default.Group,null,i.default.createElement("textarea",{className:"ddm-form-name form-control",id:"nameEditor",name:"".concat(r,"nameEditor"),onChange:e=>m({payload:e.target.value,type:u.EVENT_TYPES.FORM_INFO.NAME_CHANGE}),onKeyDown:e=>{const t=e.which?e.which:e.keyCode;isForbiddenKey(e,120)&&91!==Number(t)&&e.preventDefault()},placeholder:Liferay.Language.get("untitled-form"),ref:p,style:{height:"100px"},value:null!==(e=s[c])&&void 0!==e?e:s[d]}))),i.default.createElement("h5",null,i.default.createElement(n.default.Group,null,i.default.createElement("textarea",{className:"ddm-form-description form-control",id:"descriptionEditor",name:"".concat(r,"descriptionEditor"),onChange:e=>m({payload:e.target.value,type:u.EVENT_TYPES.FORM_INFO.DESCRIPTION_CHANGE}),placeholder:Liferay.Language.get("add-a-short-description-for-this-form"),ref:y,style:{height:"24px"},value:null!==(t=f[c])&&void 0!==t?t:f[d]})))))};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/form")),a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/layout")),o=r("data-engine-js-components-web"),l=r("frontend-js-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 r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),u=r("../eventTypes.es"),d=r("../util/dom");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}}const isForbiddenKey=(e,t)=>{const r=e.which?e.which:e.keyCode;let n=!1;return e.target.innerText.length>=t&&(0,d.isModifyingKey)(r)&&!(0,d.isKeyInSet)(r,["BACKSPACE","DELETE","ESC","ENTER"])&&(n=!0),n}}}));
//# sourceMappingURL=FormInfo.es.js.map