Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/core/components/Field/MetalComponentAdapter.es",["module","exports","require","liferay!frontend-js-react-web$react","../../actions/eventTypes.es","../../hooks/useForm.es","../../hooks/usePage.es","./MetalFieldAdapter.es"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.MetalComponentAdapter=function(t){let{onBlur:r,onChange:n,onFocus:f,type:p}=t,i=c(t,["onBlur","onChange","onFocus","type"]);const{activePage:d,editable:y,pageIndex:g,spritemap:b}=(0,s.usePage)(),v=(0,u.useForm)(),O=(0,o.useRef)(null),m=(0,o.useRef)(null);return(0,o.useEffect)((()=>(!O.current&&m.current&&(O.current=new l.default({activePage:d,editable:y,field:i,onBlur:r,onChange:n,onFocus:f,onRemoved:(e,t)=>v({payload:t,type:a.EVENT_TYPES.FIELD.REMOVED}),onRepeated:(e,t)=>v({payload:t,type:a.EVENT_TYPES.FIELD.REPEATED}),pageIndex:g,spritemap:b,type:p},m.current)),()=>{O.current&&O.current.dispose()})),[]),(0,o.useEffect)((()=>{O.current&&O.current.setState({activePage:d,editable:y,field:i,onChange:n,pageIndex:g,spritemap:b})}),[d,y,n,g,b,i]),o.default.createElement(e,{forwardRef:m})};var o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("../../actions/eventTypes.es"),u=r("../../hooks/useForm.es"),s=r("../../hooks/usePage.es"),l=(n=r("./MetalFieldAdapter.es"))&&n.__esModule?n:{default:n};function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}class e extends o.default.Component{shouldComponentUpdate(){return!1}render(){const e=this.props,{forwardRef:t}=e,r=c(e,["forwardRef"]);return o.default.createElement("div",p({ref:t},r))}}}}));
//# sourceMappingURL=MetalComponentAdapter.es.js.map