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 Container from'./Container';import'./ExtendableContainer.css';class ExtendableContainer extends Module{constructor(a){super(a),this.state={extended:!1}}toggle(){this.setState({extended:!this.state.extended})}render(){let a={};for(var b in Container.Inputs)a[b]=this[b].value;return console.log(this.props,this.header.value),this.props.inverse?React.createElement('div',{key:'closeIt'+this.header.value,className:`ExtendableContainer ${Object.getPrototypeOf(this)===ExtendableContainer.prototype?this.props.className:''}`,style:this.props.style},React.createElement('div',{className:`ExtendableContainerContent ${this.state.extended?'show':''}`},super.render()),React.createElement('div',{onClick:()=>this.toggle(),className:'ExtendableContainerHeader'},this.header.value),super.render(!1)):React.createElement('div',{key:'openIt'+this.header.value,className:`ExtendableContainer ${Object.getPrototypeOf(this)===ExtendableContainer.prototype?this.props.className:''}`,style:this.props.style},React.createElement('div',{onClick:()=>this.toggle(),className:'ExtendableContainerHeader'},this.header.value||'asd'),React.createElement('div',{className:`ExtendableContainerContent ${this.state.extended?'show':''}`},React.createElement(Container,_extends({},a,{style:{padding:3}}),this.props.children||'')),super.render(!1))}}ExtendableContainer.Inputs=_extends({},Container.Inputs,{header:{type:Module.Types.Text,defaultValue:'Header'}}),ExtendableContainer.Category='Basic';export default ExtendableContainer;
|