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

import Util from '../_vendors/Util';

import './CircularLoading.css';

export default class CircularLoading extends Component {

    static Size = {
        DEFAULT: '',
        SMALL: 'small',
        LARGE: 'large'
    };

    constructor(props) {
        super(props);
    }

    render() {

        const {className, style, size, theme, type, weight} = this.props;
        const border = {
            borderWidth: weight
        };

        return (

            <div className={`circular-loading circular-loading-size-${size} ${className}`}
                 type={type}
                 style={style}>

                <div className="spinner">
                    <div className={`${theme} circle left border-${type}`}>
                        <div className={`${type ? type : 'solid'}`}
                             style={border}>

                        </div>
                    </div>
                    <div className="gap">
                        <div></div>
                    </div>
                    <div className={`${theme} circle right border-${type}`}>
                        <div className={`${type ? type : 'solid'}`}
                             style={border}>

                        </div>
                    </div>
                </div>

            </div>

        );

    }
};

CircularLoading.propTypes = {

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

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

    /**
     * Set the size of loading,can use small or large.
     */
    size: PropTypes.oneOf(Util.enumerateValue(CircularLoading.Size)),

    /**
     * Set the theme of loading,can use highlight,success,error,warning.
     */
    theme: PropTypes.string,

    /**
     * Set the CircularLoading border-width.
     */
    weight: PropTypes.number,

    /**
     * Set the border style of CircularLoading,can use solid,dotted.
     */
    type: PropTypes.string

};

CircularLoading.defaultProps = {

    className: '',
    style: null,

    size: CircularLoading.Size.DEFAULT,
    theme: '',
    width: '1',
    type: 'solid'

};
@@ -316,16 +316,29 @@
 or(props
+, ...restArgs
 ) %7B%0A    
@@ -352,16 +352,29 @@
 er(props
+, ...restArgs
 );%0A    %7D

optimize CircularLoading