BasicLayout.js 1.8 KB

1
  1. var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a};import React from'react';import Module from'../Module';import Modules from'../index.js';import{Row,Col}from'react-materialize';import'./BasicLayout.css';class BasicLayout extends Module{constructor(a){super(a),this.ghost(this.getId()+'BLTOP'),this.ghost(this.getId()+'BLLEFT'),this.ghost(this.getId()+'BLRIGHT'),this.ghost(this.getId()+'BLCONTENT'),this.ghost(this.getId()+'BLNavbar','Navbar'),this.ModuleSystem.refresh()}ghost(a,b='Container'){if(!this.ModuleSystem.has(a)){let c={children:[],ctor:b,id:a,key:'key'+Math.random()};this.ModuleSystem.loadModule(c)}}render(){let{Container:a,Navbar:b}=Modules,c=this.leftMenu.value,d=this.rightMenu.value,e=12-c-d;return[React.createElement(a,{width:'100%',className:'container',key:'BL'},React.createElement(Row,{className:'BLtop'},React.createElement(Col,{s:12},this.ModuleSystem.render(this.getId()+'BLNavbar'))),React.createElement(Row,{className:'BLmain'},React.createElement(Col,{s:c,className:'BLLeftMenu'},this.ModuleSystem.render(this.getId()+'BLLEFT')),React.createElement(Col,{s:e,className:'BLContent'},this.ModuleSystem.render(this.getId()+'BLCONTENT')),React.createElement(Col,{s:d,className:'BLRightMenu'},this.ModuleSystem.render(this.getId()+'BLRIGHT'))),React.createElement(Row,{className:'BLfooter'},React.createElement(Col,{s:c},'asd'),React.createElement(Col,{s:e},'eqw'),React.createElement(Col,{s:d},'123'))),super.render()]}}BasicLayout.EditPosition='top-center',BasicLayout.Inputs=_extends({},Module.Inputs,{leftMenu:{type:Module.Types.Number,required:!0,defaultValue:3},rightMenu:{type:Module.Types.Number,required:!0,defaultValue:3}}),BasicLayout.Category='Layout';export default BasicLayout;