import React from 'react'; import { classSet } from 'rc-util'; import { isCssAnimationSupported } from 'css-animation'; const AntSpin = React.createClass({ getDefaultProps() { return { size: 'default' }; }, propTypes: { className: React.PropTypes.string, size: React.PropTypes.oneOf(['small', 'default', 'large']) }, isNestedPattern() { return this.props.children ? true : false; }, render() { const prefix = 'ant-spin'; const nestedStatus = this.isNestedPattern(); const { className, size, ...others } = this.props; const sizeCls = ({ 'large': 'lg', 'small': 'sm' })[size] || ''; let loadingClassName = classSet({ 'ant-spin-nested-loading': nestedStatus }); let spinClassName = classSet({ 'ant-spin': true, [className]: !!className }); let spinEl; if (!isCssAnimationSupported) { // not support for animation, just use text instead spinEl =