Liferay.Loader.define("data-engine-js-components-web@1.0.87/js/core/components/PageRenderer/Layout.es",["module","exports","require","liferay!frontend-js-react-web$react","../../../utils/formId.es","../../hooks/useConfig.es","../../hooks/useEvaluate.es","../../hooks/useForm.es","../../hooks/usePage.es","../../thunks/fieldBlur.es","../../thunks/fieldChange.es","../../thunks/fieldFocus.es","../../utils/merge-variants.es","../Field/Field.es","./VariantsContext.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.Layout=function Layout({components:e,editable:t,itemPath:r,rows:m,viewMode:h}){const{containerElement:v,pageIndex:y}=(0,s.usePage)(),{activePage:b,defaultLanguageId:P}=(0,u.useFormState)(),{allowNestedFields:w,submitButtonId:x}=(0,a.useConfig)(),_=(0,i.useEvaluate)(d.default),k=(0,u.useForm)(),O=(0,n.useContext)(g.VariantsContext),j=null!=e?e:(0,f.mergeVariants)(t,O);return n.default.createElement(j.Rows,{activePage:b,editable:t,itemPath:r,pageIndex:y,rows:m},(({index:e,row:a})=>n.default.createElement(j.Row,{itemPath:[...r,e],key:e,row:a},(i=>{let{column:u,index:s}=i,d=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}(i,["column","index"]);return n.default.createElement(j.Column,_extends({activePage:b,allowNestedFields:w,column:u,editable:t,index:s,itemPath:[...r,e,s],key:s,pageIndex:y,row:a,rowIndex:e,viewMode:h},d),(a=>{var i,u;return n.default.createElement(p.Field,_extends({},a,{activePage:b,defaultLanguageId:P,editable:t,itemPath:[...r,e,s,a.index],key:null!==(i=null===(u=a.field)||void 0===u?void 0:u.instanceId)&&void 0!==i?i:a.field.name,onBlur:(e,t)=>k((0,l.default)({activePage:b,focusDuration:t,formId:(0,o.getFormId)((0,o.getFormNode)(v.current)),properties:e})),onChange:e=>k(_({properties:e,submitButtonId:x})),onFocus:e=>k((0,c.default)({activePage:b,formId:(0,o.getFormId)((0,o.getFormNode)(v.current)),properties:e})),pageIndex:y}))}))}))))};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("../../../utils/formId.es"),a=r("../../hooks/useConfig.es"),i=r("../../hooks/useEvaluate.es"),u=r("../../hooks/useForm.es"),s=r("../../hooks/usePage.es"),l=_interopRequireDefault(r("../../thunks/fieldBlur.es")),d=_interopRequireDefault(r("../../thunks/fieldChange.es")),c=_interopRequireDefault(r("../../thunks/fieldFocus.es")),f=r("../../utils/merge-variants.es"),p=r("../Field/Field.es"),g=r("./VariantsContext.es");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}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)}}}));
//# sourceMappingURL=Layout.es.js.map