Card.js 1.2 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'./Card.css';const UNIT_REGEX=/[A-Z]/g;class Card extends Module{constructor(a){super(a),this.state={children:[],text:this.header.value||''},this.mode=a._mode}render(){let a=this.header.value||'',b=this.width.value?this.width.value:'auto',c=this.height.value?this.height.value:'auto',d=this.image.value;return React.createElement('div',{className:`card shadow-sm ${Object.getPrototypeOf(this)===Card.prototype?this.props.className||'':''}`,style:{width:b,height:c}},d?React.createElement('img',{class:'card-img-top',src:d,alt:'Card image cap'}):'',React.createElement('div',{className:'card-body'},React.createElement('div',{className:'card-title'},a),super.render()))}}Card.EditPosition='center',Card.Inputs=_extends({},Module.Inputs,{width:{type:Module.Types.Number,required:!0,defaultValue:'auto'},height:{type:Module.Types.Number,required:!1,defaultValue:'auto'},header:{type:Module.Types.Text,required:!1,defaultValue:''},image:{type:Module.Types.Text,required:!1,defaultValue:''}}),Card.Category='theme';export default Card;