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';const UNIT_REGEX=/[A-Z]/g;class FluidContainer extends Module{constructor(a){super(a),this.state={children:[],text:this.text.value||''},this.mode=a._mode,this.text.onUpdate(a=>{this.setState({text:a})})}render(){let a=this.background.value||'',b=this.text.value||'',c=this.width.value?this.width.value:'auto',d=this.height.value?this.height.value:'auto';return React.createElement('div',{className:` ${Object.getPrototypeOf(this)===FluidContainer.prototype?this.ClassName.value+' '+this.props.className||'':''}`,style:_extends({background:a,width:c,height:d},this.props.style)},this.state.text,super.render())}}FluidContainer.EditPosition='top-left',FluidContainer.Inputs=_extends({},Module.Inputs,{width:{type:Module.Types.Text,required:!0,defaultValue:'auto'},height:{type:Module.Types.Text,required:!1,defaultValue:'auto',comment:'Setting this comment here to show the power!'},background:{type:Module.Types.Text,required:!1,comment:'Setting bg color!'},text:{type:Module.Types.Text,required:!1,comment:'Text for Fluidcontainer'},ClassName:{type:Module.Types.Text,required:!1}}),FluidContainer.Outputs={custom:{}},FluidContainer.Category='Basic';export default FluidContainer;
|