Liferay.Loader.define("data-engine-js-components-web@1.0.79/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){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.MetalComponentAdapter=function(t){let{onBlur:r,onChange:n,onFocus:p,type:c}=t,d=i(t,["onBlur","onChange","onFocus","type"]);const{activePage:y,editable:g,pageIndex:b}=(0,f.usePage)(),v=(0,s.useForm)(),{spritemap:O}=(0,u.useConfig)(),h=(0,o.useRef)(null),m=(0,o.useRef)(null);return(0,o.useEffect)((()=>(!h.current&&m.current&&(h.current=new l.default({activePage:y,editable:g,field:d,onBlur:r,onChange:n,onFocus:p,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:b,spritemap:O,type:c},m.current)),()=>{h.current&&h.current.dispose()})),[]),(0,o.useEffect)((()=>{h.current&&h.current.setState({activePage:y,editable:g,field:d,onChange:n,pageIndex:b,spritemap:O})}),[y,g,n,b,O,d]),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=p();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/useConfig.es"),s=r("../../hooks/useForm.es"),f=r("../../hooks/usePage.es"),l=(n=r("./MetalFieldAdapter.es"))&&n.__esModule?n:{default:n};function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function c(){return(c=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 i(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=i(e,["forwardRef"]);return o.default.createElement("div",c({ref:t},r))}}}}));
//# sourceMappingURL=MetalComponentAdapter.es.js.map