Liferay.Loader.define("data-engine-js-components-web@1.0.89/js/core/components/PageRenderer/DefaultVariant.es",["module","exports","require","@frontend-taglib-clay$clayui/layout","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../hooks/useForm.es"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.Container=Container,a.Page=Page,a.PageHeader=PageHeader,a.Row=Row,a.Rows=Rows,a.Column=void 0;var r=_interopRequireDefault(t("@frontend-taglib-clay$clayui/layout")),n=_interopRequireDefault(t("liferay!frontend-js-react-web$classnames")),l=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_getRequireWildcardCache();if(a&&a.has(e))return a.get(e);var t={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(t,n,l):t[n]=e[n]}t.default=e,a&&a.set(e,t);return t}(t("liferay!frontend-js-react-web$react")),d=t("../../hooks/useForm.es");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}}function _extends(){return(_extends=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}const e="com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormAdminPortlet";function Container({activePage:e,children:a,isBuilder:t=!0,pageIndex:r}){return l.default.createElement("div",{className:(0,n.default)("fade tab-pane",{"active show":e===r,hide:e!==r}),role:"tabpanel"},t?l.default.createElement("div",{className:"form-builder-layout"},a):a)}Container.displayName="DefaultVariant.Container";const i=(0,l.forwardRef)((({children:a,className:t,column:i,columnClassName:o,index:u,onClick:c,onMouseLeave:f,onMouseOver:s,pageIndex:m,rowIndex:p,viewMode:g},y)=>{const{portletId:w}=(0,d.useFormState)(),v=i.fields[0],_="fieldset"===(null==v?void 0:v.type),h=(null==v?void 0:v.ddmStructureId)&&_;return l.default.createElement(r.default.Col,_extends({},{"data-ddm-field-column":u,"data-ddm-field-page":m,"data-ddm-field-row":p},{className:(0,n.default)("col-ddm",o),key:u,md:i.size,onClick:c,onMouseLeave:f,onMouseOver:s,ref:y}),!!i.fields.length&&l.default.createElement("div",{className:(0,n.default)("ddm-field-container ddm-target h-100",{"ddm-fieldset":!!h,"fields-group":!!_},t),"data-field-name":v.fieldName},i.fields.map(((t,r)=>(g&&w.includes(e)&&(t.predefinedValue=""),"function"==typeof a?a({field:t,index:r}):a)))))}));function Page({children:e,forceAriaUpdate:a,header:t,invalidFormMessage:r,pageIndex:n}){return l.default.createElement("div",{className:"active ddm-form-page lfr-ddm-form-page","data-ddm-page":n},r&&l.default.createElement("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only"},r,l.default.createElement("span",{"aria-hidden":"true"},a)),t,e)}function PageHeader({description:e,title:a}){return l.default.createElement(l.default.Fragment,null,a&&l.default.createElement("h2",{className:"lfr-ddm-form-page-title",tabIndex:0},a),e&&l.default.createElement("h3",{className:"lfr-ddm-form-page-description",tabIndex:0},e))}function Row({children:e,index:a,row:t}){return l.default.createElement("div",{className:"position-relative row",key:a},t.columns.map(((a,t)=>e({column:a,index:t}))))}function Rows({children:e,rows:a}){return a?a.map(((a,t)=>l.default.createElement("div",{className:"ddm-row",key:t},e({index:t,row:a})))):null}a.Column=i,i.displayName="DefaultVariant.Column",Page.displayName="DefaultVariant.Page",PageHeader.displayName="DefaultVariant.PageHeader",Row.displayName="DefaultVariant.Row",Rows.displayName="DefaultVariant.Rows"}}));
//# sourceMappingURL=DefaultVariant.es.js.map