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

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

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

export default class CircularLoading extends Component {

    static Size = {
        DEFAULT: '',
        SMALL: 'small',
        LARGE: 'large'
    };
    static 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

    };
    static defaultProps = {

        className: '',
        style: null,

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

    };

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

    render() {

        const {className, style, size, theme, type, weight} = this.props,

            loadingClassName = (size ? ` circular-loading-size-${size}` : '') + (className ? ' ' + className : ''),
            border = {
                borderWidth: weight
            };

        return (

            <div className={'circular-loading' + loadingClassName}
                 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>

        );

    }
};
@@ -208,23 +208,8 @@
 ';%0A%0A
-export default 
 clas
@@ -345,981 +345,8 @@
   %7D;
-%0A    static propTypes = %7B%0A%0A        /**%0A         * The CSS class name of the root element.%0A         */%0A        className: PropTypes.string,%0A%0A        /**%0A         * Override the styles of the root element.%0A         */%0A        style: PropTypes.object,%0A%0A        /**%0A         * Set the size of loading,can use small or large.%0A         */%0A        size: PropTypes.oneOf(Util.enumerateValue(CircularLoading.Size)),%0A%0A        /**%0A         * Set the theme of loading,can use highlight,success,error,warning.%0A         */%0A        theme: PropTypes.string,%0A%0A        /**%0A         * Set the CircularLoading border-width.%0A         */%0A        weight: PropTypes.number,%0A%0A        /**%0A         * Set the border style of CircularLoading,can use solid,dotted.%0A         */%0A        type: PropTypes.string%0A%0A    %7D;%0A    static defaultProps = %7B%0A%0A        className: '',%0A        style: null,%0A%0A        size: CircularLoading.Size.DEFAULT,%0A        theme: '',%0A        width: '1',%0A        type: 'solid'%0A%0A    %7D;
 %0A%0A  
@@ -1560,8 +1560,898 @@
     %7D%0A%7D;
+%0A%0ACircularLoading.propTypes = %7B%0A%0A    /**%0A     * The CSS class name of the root element.%0A     */%0A    className: PropTypes.string,%0A%0A    /**%0A     * Override the styles of the root element.%0A     */%0A    style: PropTypes.object,%0A%0A    /**%0A     * Set the size of loading,can use small or large.%0A     */%0A    size: PropTypes.oneOf(Util.enumerateValue(CircularLoading.Size)),%0A%0A    /**%0A     * Set the theme of loading,can use highlight,success,error,warning.%0A     */%0A    theme: PropTypes.string,%0A%0A    /**%0A     * Set the CircularLoading border-width.%0A     */%0A    weight: PropTypes.number,%0A%0A    /**%0A     * Set the border style of CircularLoading,can use solid,dotted.%0A     */%0A    type: PropTypes.string%0A%0A%7D;%0A%0ACircularLoading.defaultProps = %7B%0A%0A    className: '',%0A    style: null,%0A%0A    size: CircularLoading.Size.DEFAULT,%0A    theme: '',%0A    width: '1',%0A    type: 'solid'%0A%0A%7D;%0A%0Aexport default CircularLoading;

update CircularLoading