/**
 * @file Widget component
 * @author liangxiaojun(liangxiaojun@derbysoft.com)
 */

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import Paper from '../Paper';

class Widget extends Component {

    constructor(props, ...restArgs) {
        super(props, ...restArgs);
    }

    render() {

        const {children, className, style, depth} = this.props,

            widgetClassName = classNames('widget', {
                [className]: className
            });

        return (
            <Paper className={widgetClassName}
                   style={style}
                   depth={depth}>
                {children}
            </Paper>
        );

    }
};

Widget.propTypes = {

    /**
     * The CSS class name of the root element.
     */
    className: PropTypes.string,

    /**
     * Override the styles of the root element.
     */
    style: PropTypes.object,

    /**
     * This number represents the zDepth of the root element shadow.
     */
    depth: PropTypes.number

};

Widget.defaultProps = {

    className: '',
    style: null,

    depth: 1

};

export default Widget;
@@ -124,44 +124,8 @@
 t';%0A
-import PropTypes from 'prop-types';%0A
 impo
@@ -189,16 +189,78 @@
 aper';%0A%0A
+import PureRender from '../_vendors/PureRender';%0A%0A@PureRender%0A
 class Wi
@@ -752,24 +752,121 @@
 %0A%0A    %7D%0A%7D;%0A%0A
+if (process.env.NODE_ENV === 'development') %7B%0A%0A    const PropTypes = require('prop-types');%0A%0A    
 Widget.propT
@@ -875,28 +875,36 @@
 es = %7B%0A%0A    
-/**%0A
+    /**%0A    
      * The C
@@ -939,27 +939,35 @@
 ement.%0A     
+   
+ 
 */%0A
+    
     classNam
@@ -988,16 +988,20 @@
 tring,%0A%0A
+    
     /**%0A
@@ -1005,16 +1005,20 @@
 **%0A     
+   
+ 
 * Overri
@@ -1053,27 +1053,35 @@
 ement.%0A     
-*/%0A
+    */%0A    
     style: P
@@ -1098,28 +1098,36 @@
 bject,%0A%0A    
+   
+ 
 /**%0A
+    
      * This 
@@ -1188,23 +1188,31 @@
 w.%0A     
-*/%0A
+    */%0A   
     
+ 
 depth: P
@@ -1228,20 +1228,27 @@
 number%0A%0A
+    
 %7D;%0A%0A
+%7D%0A%0A
 Widget.d
@@ -1267,46 +1267,8 @@
 = %7B%0A
-%0A    className: '',%0A    style: null,%0A%0A
     
@@ -1276,17 +1276,16 @@
 epth: 1%0A
-%0A
 %7D;%0A%0Aexpo

update Widget