Liferay.Loader.define("data-engine-js-components-web@1.0.86/js/core/components/Field/MetalComponentAdapter.es",["module","exports","require","liferay!frontend-js-react-web$react","../../actions/eventTypes.es","../../hooks/useConfig.es","../../hooks/useForm.es","../../hooks/usePage.es","./MetalFieldAdapter.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.MetalComponentAdapter=function MetalComponentAdapter(e){let{onBlur:t,onChange:r,onFocus:c,type:l}=e,p=_objectWithoutProperties(e,["onBlur","onChange","onFocus","type"]);const{activePage:d,editable:f,pageIndex:y}=(0,s.usePage)(),g=(0,u.useForm)(),{spritemap:h}=(0,a.useConfig)(),b=(0,n.useRef)(null),P=(0,n.useRef)(null);return(0,n.useEffect)((()=>(!b.current&&P.current&&(b.current=new i.default({activePage:d,editable:f,field:p,onBlur:t,onChange:r,onFocus:c,onRemoved:(e,t)=>g({payload:t,type:o.EVENT_TYPES.FIELD.REMOVED}),onRepeated:(e,t)=>g({payload:t,type:o.EVENT_TYPES.FIELD.REPEATED}),pageIndex:y,spritemap:h,type:l},P.current)),()=>{b.current&&b.current.dispose()})),[]),(0,n.useEffect)((()=>{b.current&&b.current.setState({activePage:d,editable:f,field:p,onChange:r,pageIndex:y,spritemap:h})}),[d,f,r,y,h,p]),n.default.createElement(NoRender,{forwardRef:P})};var n=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 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")),o=r("../../actions/eventTypes.es"),a=r("../../hooks/useConfig.es"),u=r("../../hooks/useForm.es"),s=r("../../hooks/usePage.es"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("./MetalFieldAdapter.es"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _extends(){return(_extends=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 _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=function _objectWithoutPropertiesLoose(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 NoRender extends n.default.Component{shouldComponentUpdate(){return!1}render(){const e=this.props,{forwardRef:t}=e,r=_objectWithoutProperties(e,["forwardRef"]);return n.default.createElement("div",_extends({ref:t},r))}}}}));
//# sourceMappingURL=MetalComponentAdapter.es.js.map