Browse Source

Merge pull request #66 from ustccjw/master

use es6 module import/export
pull/69/head
偏右 9 years ago
parent
commit
a4b26a8ea8
  1. 9
      components/checkbox/index.jsx
  2. 8
      components/collapse/index.jsx
  3. 8
      components/dropdown/index.jsx
  4. 8
      components/input-number/index.jsx
  5. 8
      components/modal/confirm.jsx
  6. 8
      components/modal/index.jsx
  7. 12
      components/pagination/index.jsx
  8. 9
      components/progress/index.jsx
  9. 8
      components/radio/group.jsx
  10. 8
      components/radio/index.jsx
  11. 8
      components/select/index.jsx
  12. 8
      components/slider/index.jsx
  13. 8
      components/steps/index.jsx
  14. 8
      components/switch/index.jsx
  15. 4
      components/table/index.jsx
  16. 8
      components/tabs/index.jsx
  17. 6
      components/tooltip/index.jsx

9
components/checkbox/index.jsx

@ -1,11 +1,10 @@
var Checkbox = require('rc-checkbox');
var React = require('react');
var AntCheckbox = React.createClass({
import Checkbox from 'rc-checkbox';
import React from 'react';
export default React.createClass({
getDefaultProps() {
return {prefixCls: 'ant-checkbox'};
}, render() {
return <Checkbox {...this.props}/>;
}
});
module.exports = AntCheckbox;

8
components/collapse/index.jsx

@ -1,6 +1,6 @@
var Collapse = require('rc-collapse');
var React = require('react');
var prefixCls = 'ant-collapse';
import Collapse from 'rc-collapse';
import React from 'react';
const prefixCls = 'ant-collapse';
class AntCollapse extends React.Component {
render() {
@ -14,4 +14,4 @@ AntCollapse.defaultProps = {
AntCollapse.Panel = Collapse.Panel;
module.exports = AntCollapse;
export default AntCollapse;

8
components/dropdown/index.jsx

@ -1,7 +1,7 @@
var React = require('react');
var Dropdown = require('rc-dropdown');
import React from 'react';
import Dropdown from 'rc-dropdown';
var AntDropdown = React.createClass({
export default React.createClass({
getDefaultProps: function () {
return {
transitionName: 'slide-up',
@ -14,5 +14,3 @@ var AntDropdown = React.createClass({
);
}
});
module.exports = AntDropdown;

8
components/input-number/index.jsx

@ -1,7 +1,7 @@
var InputNumber = require('rc-input-number');
var React = require('react');
import InputNumber from 'rc-input-number';
import React from 'react';
var AntInputNumber = React.createClass({
export default React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-input-number'
@ -11,5 +11,3 @@ var AntInputNumber = React.createClass({
return <InputNumber style={{width: 90}} {...this.props} />;
}
});
module.exports = AntInputNumber;

8
components/modal/confirm.jsx

@ -1,8 +1,8 @@
var React = require('react');
var Dialog = require('rc-dialog');
import React from 'react';
import Dialog from 'rc-dialog';
var div;
module.exports = function (props) {
export default function (props) {
var d;
props = props || {};
props.iconClassName = props.iconClassName || 'anticon-exclamation-circle';
@ -82,4 +82,4 @@ module.exports = function (props) {
</Dialog>, div, function () {
d = this;
});
};
}

8
components/modal/index.jsx

@ -1,9 +1,9 @@
var React = require('react');
var Dialog = require('rc-dialog');
import React from 'react';
import Dialog from 'rc-dialog';
function noop() {
}
var Modal = React.createClass({
export default React.createClass({
getInitialState() {
return {
visible: false,
@ -57,5 +57,3 @@ var Modal = React.createClass({
return <Dialog transitionName="zoom" onBeforeClose={props.onCancel} visible={this.state.visible} maskAnimation="fade" width="500" footer={footer} {...props} ref="d" />;
}
});
module.exports = Modal;

12
components/pagination/index.jsx

@ -1,10 +1,10 @@
let React = require('react');
let Pagination = require('rc-pagination');
let Select = require('rc-select');
import React from 'react';
import Pagination from 'rc-pagination';
import Select from 'rc-select';
let prefixCls = 'ant-pagination';
const prefixCls = 'ant-pagination';
class AntPagination extends React.Component {
export default class AntPagination extends React.Component {
render() {
return <Pagination selectComponentClass={Select}
selectPrefixCls="ant-select"
@ -12,5 +12,3 @@ class AntPagination extends React.Component {
{...this.props} />;
}
}
module.exports = AntPagination;

9
components/progress/index.jsx

@ -1,7 +1,6 @@
var Progressline = require('rc-progress').Line;
var Progresscircle = require('rc-progress').Circle;
var React = require('react');
var assign = require('object-assign');
import {Line as Progressline, Circle as Progresscircle} from 'rc-progress';
import React from 'react';
import assign from 'object-assign';
var Line = React.createClass({
getDefaultProps() {
@ -129,7 +128,7 @@ var Circle = React.createClass({
}
});
module.exports = {
export default {
Line: Line,
Circle: Circle
};

8
components/radio/group.jsx

@ -1,5 +1,5 @@
var React = require('react');
var Radio = require('./index');
import React from 'react';
import Radio from './index';
function getCheckedValue(children) {
var checkedValue = null;
@ -11,7 +11,7 @@ function getCheckedValue(children) {
return checkedValue;
}
var AntRadioGroup = React.createClass({
export default React.createClass({
getDefaultProps: function () {
return {
prefixCls: 'ant-radio-group',
@ -58,5 +58,3 @@ var AntRadioGroup = React.createClass({
this.props.onChange(ev);
}
});
module.exports = AntRadioGroup;

8
components/radio/index.jsx

@ -1,7 +1,7 @@
var Radio = require('rc-radio');
var React = require('react');
import Radio from 'rc-radio';
import React from 'react';
var AntRadio = React.createClass({
export default React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-radio'
@ -16,5 +16,3 @@ var AntRadio = React.createClass({
);
}
});
module.exports = AntRadio;

8
components/select/index.jsx

@ -1,7 +1,7 @@
var React = require('react');
var Select = require('rc-select');
import React from 'react';
import Select from 'rc-select';
module.exports = React.createClass({
export default React.createClass({
getDefaultProps: function () {
return {
prefixCls: 'ant-select',
@ -17,4 +17,4 @@ module.exports = React.createClass({
}
});
module.exports.Option = Select.Option;
export const Option = Select.Option;

8
components/slider/index.jsx

@ -1,7 +1,7 @@
var React = require('react');
var Slider = require('rc-slider');
import React from 'react';
import Slider from 'rc-slider';
var AntSlider = React.createClass({
export default React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-slider'
@ -11,5 +11,3 @@ var AntSlider = React.createClass({
return <Slider {...this.props}/>;
}
});
module.exports = AntSlider;

8
components/steps/index.jsx

@ -1,7 +1,7 @@
var React = require('react');
var Steps = require('rc-steps');
import React from 'react';
import Steps from 'rc-steps';
var AntSteps = React.createClass({
const AntSteps = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-steps',
@ -21,4 +21,4 @@ var AntSteps = React.createClass({
});
AntSteps.Step = Steps.Step;
module.exports = AntSteps;
export default AntSteps;

8
components/switch/index.jsx

@ -1,7 +1,7 @@
var Switch = require('rc-switch');
var React = require('react');
import Switch from 'rc-switch';
import React from 'react';
var AntSwitch = React.createClass({
export default React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-switch'
@ -11,5 +11,3 @@ var AntSwitch = React.createClass({
return <Switch {...this.props}/>;
}
});
module.exports = AntSwitch;

4
components/table/index.jsx

@ -7,7 +7,7 @@ import FilterMenu from './filterMenu';
import Pagination from '../pagination';
import objectAssign from 'object-assign';
let AntTable = React.createClass({
export default React.createClass({
getInitialState() {
//
if (Array.isArray(this.props.dataSource)) {
@ -340,5 +340,3 @@ let AntTable = React.createClass({
</div>;
}
});
export default AntTable;

8
components/tabs/index.jsx

@ -1,6 +1,6 @@
var Tabs = require('rc-tabs');
var React = require('react');
var prefixCls = 'ant-tabs';
import Tabs from 'rc-tabs';
import React from 'react';
const prefixCls = 'ant-tabs';
class AntTabs extends React.Component {
render() {
@ -19,4 +19,4 @@ AntTabs.defaultProps = {
AntTabs.TabPane = Tabs.TabPane;
module.exports = AntTabs;
export default AntTabs;

6
components/tooltip/index.jsx

@ -1,7 +1,7 @@
var React = require('react');
var Tooltip = require('rc-tooltip');
import React from 'react';
import Tooltip from 'rc-tooltip';
module.exports = React.createClass({
export default React.createClass({
getDefaultProps() {
return {
placement: 'top'

Loading…
Cancel
Save