diff --git a/js/Accordion.js b/js/Accordion.js index 1b7a15f..898005d 100644 --- a/js/Accordion.js +++ b/js/Accordion.js @@ -78,14 +78,24 @@ const Accordion = React.createClass({ }, render() { + let { + className, + inset, + ...props + } = this.props; let classSet = this.getClassSet(); - classSet[this.prefixClass('inset')] = this.props.inset; + delete props.classPrefix; + delete props.activeKey; + delete props.defaultActiveKey; + delete props.onAction; + + classSet[this.prefixClass('inset')] = inset; return (
{this.renderItems()}
@@ -93,7 +103,7 @@ const Accordion = React.createClass({ } }); -Accordion.Item = React.createClass({ +const AccordionItem = React.createClass({ mixins: [ClassNameMixin, CollapseMixin], propTypes: { @@ -165,4 +175,6 @@ Accordion.Item = React.createClass({ } }); +Accordion.Item = AccordionItem; + export default Accordion; diff --git a/js/Badge.js b/js/Badge.js index 4931df0..9a8aa38 100644 --- a/js/Badge.js +++ b/js/Badge.js @@ -33,6 +33,11 @@ const Badge = React.createClass({ href, ...props } = this.props; + + delete props.classPrefix; + delete props.amStyle; + delete props.rounded; + Component = href ? 'a' : Component; return ( diff --git a/js/Button.js b/js/Button.js index 254ac3d..81550ff 100644 --- a/js/Button.js +++ b/js/Button.js @@ -30,6 +30,17 @@ const Button = React.createClass({ }; }, + removeUnknownProp(props) { + delete props.classPrefix; + delete props.amStyle; + delete props.amSize; + delete props.hollow; + delete props.block; + delete props.active; + + return props; + }, + renderAnchor(classes) { let { href, @@ -43,7 +54,7 @@ const Button = React.createClass({ return ( {children} diff --git a/js/ButtonGroup.js b/js/ButtonGroup.js index ef32567..59e4dac 100644 --- a/js/ButtonGroup.js +++ b/js/ButtonGroup.js @@ -37,6 +37,8 @@ const ButtonGroup = React.createClass({ ...props } = this.props; + delete props.classPrefix; + classSet[this.prefixClass('stacked')] = stacked; classSet[this.prefixClass('justify')] = justify; diff --git a/js/ButtonToolbar.js b/js/ButtonToolbar.js index 559d9ce..40a3ac0 100644 --- a/js/ButtonToolbar.js +++ b/js/ButtonToolbar.js @@ -1,5 +1,4 @@ import React, { - cloneElement, PropTypes, } from 'react'; import classNames from 'classnames'; @@ -22,13 +21,20 @@ const ButtonToolbar = React.createClass({ render() { let classSet = this.getClassSet(); + let { + className, + children, + ...props + } = this.props; + + delete props.classPrefix; return (
- {this.props.children} + {children}
); } diff --git a/js/Card.js b/js/Card.js index ec0159c..7032c09 100644 --- a/js/Card.js +++ b/js/Card.js @@ -50,6 +50,8 @@ const Card = React.createClass({ ...props } = this.props; + delete props.classPrefix; + return (
count - 1) { if (!this.props.loop) { @@ -113,7 +113,7 @@ const Slider = React.createClass({ prev(e) { e && e.preventDefault(); - var index = this.getActiveIndex() - 1; + let index = this.getActiveIndex() - 1; if (index < 0) { if (!this.props.loop) { @@ -298,6 +298,16 @@ const Slider = React.createClass({ ...props } = this.props; + delete props.classPrefix; + delete props.onAction; + delete props.pager; + delete props.controls; + delete props.slide; + delete props.interval; + delete props.pauseOnHover; + delete props.prevIcon; + delete props.nextIcon; + // TODO: 优化 swipe,左右方向阻止默认事件,垂直方向不阻止 return ( {}, }; }, @@ -105,7 +110,8 @@ TabBar.Item = React.createClass({ return badge ? ( + rounded + > {badge} ) : null; @@ -145,7 +151,15 @@ TabBar.Item = React.createClass({ className, ...props } = this.props; + + delete props.classPrefix; + delete props.badge; + delete props.badgeStyle; + delete props.eventKey; + delete props.onAction; + Component = this.props.href ? 'a' : Component; + // TODO: how to display badge when icon not set? return ( @@ -162,4 +176,6 @@ TabBar.Item = React.createClass({ } }); +TabBar.Item = TabBarItem; + export default TabBar; diff --git a/js/Tabs.js b/js/Tabs.js index 128f577..ab50f93 100644 --- a/js/Tabs.js +++ b/js/Tabs.js @@ -16,6 +16,7 @@ const Tabs = React.createClass({ activeKey: PropTypes.any, defaultActiveKey: PropTypes.any, onAction: PropTypes.func, + inset: PropTypes.bool, }, getDefaultProps() { @@ -143,7 +144,7 @@ const Tabs = React.createClass({ return ( @@ -168,6 +169,12 @@ const Tabs = React.createClass({ ...props } = this.props; + delete props.classPrefix; + delete props.activeKey; + delete props.defaultActiveKey; + delete props.inset; + delete props.onAction; + return (
{ styles.map((amStyle, i) => { @@ -39,7 +38,6 @@ const BadgeExample = React.createClass({ { styles.map((amStyle, i) => { diff --git a/kitchen-sink/pages/ButtonExample.js b/kitchen-sink/pages/ButtonExample.js index 56bda87..9940c38 100644 --- a/kitchen-sink/pages/ButtonExample.js +++ b/kitchen-sink/pages/ButtonExample.js @@ -15,14 +15,12 @@ const ButtonExample = React.createClass({

基本样式

@@ -34,7 +32,6 @@ const ButtonExample = React.createClass({ @@ -42,7 +39,6 @@ const ButtonExample = React.createClass({ diff --git a/kitchen-sink/pages/SliderExample.js b/kitchen-sink/pages/SliderExample.js index ac4ef19..ac3c964 100644 --- a/kitchen-sink/pages/SliderExample.js +++ b/kitchen-sink/pages/SliderExample.js @@ -86,7 +86,7 @@ const sliderCaption = ( const sliderThumbs = ( {data.map(function(item, i) { return ( diff --git a/package.json b/package.json index 1decc08..053b3a3 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "clipboard": "^1.5.12", "css-loader": "^0.23.1", "del": "^2.2.1", - "eslint": "^2.12.0", + "eslint": "^3.0.0", "eslint-config-airbnb": "^9.0.1", "eslint-plugin-import": "^1.10.0", "eslint-plugin-jsx-a11y": "^1.4.2", @@ -73,9 +73,9 @@ "marked": "^0.3.5", "node-sass-import-once": "^1.2.0", "postcss-loader": "^0.9.1", - "react": "^15.1.0", - "react-addons-css-transition-group": "^15.1.0", - "react-dom": "^15.1.0", + "react": "^15.2.0", + "react-addons-css-transition-group": "^15.2.0", + "react-dom": "^15.2.0", "react-router": "^2.5.1", "run-sequence": "^1.2.2", "sass-loader": "^4.0.0", @@ -91,8 +91,8 @@ "classnames": "^2.2.5" }, "peerDependencies": { - "react": "^15.1.0", - "react-dom": "^15.1.0", - "react-addons-css-transition-group": "^15.1.0" + "react": "^15.2.0", + "react-dom": "^15.2.0", + "react-addons-css-transition-group": "^15.2.0" } }