diff --git a/components/affix/index.tsx b/components/affix/index.tsx index d4b70ec732..bbdf2a02d3 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -2,7 +2,6 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import addEventListener from 'rc-util/lib/Dom/addEventListener'; import classNames from 'classnames'; -import warning from 'warning'; import assign from 'object-assign'; import shallowequal from 'shallowequal'; @@ -182,8 +181,6 @@ export default class Affix extends React.Component { } componentDidMount() { - warning(!('offset' in this.props), '`offset` prop of Affix is deprecated, use `offsetTop` instead.'); - const target = this.props.target; this.setTargetEventListeners(target); } diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index 2117e961c7..cbab5d7685 100644 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { cloneElement } from 'react'; +import warning from 'warning'; import BreadcrumbItem from './BreadcrumbItem'; export interface BreadcrumbProps { @@ -50,6 +51,15 @@ export default class Breadcrumb extends React.Component { nameRender: React.PropTypes.func, }; + constructor(props) { + super(); + + warning( + !('linkRender' in props || 'nameRender' in props), + '`linkRender` and `nameRender` is removed, please use `itemRender` instead.' + ); + } + render() { let crumbs; const { separator, prefixCls, routes, params, children, itemRender } = this.props; diff --git a/components/form/demo/dynamic-form-item.md b/components/form/demo/dynamic-form-item.md index 8fa5a6f09d..0c7f36a325 100644 --- a/components/form/demo/dynamic-form-item.md +++ b/components/form/demo/dynamic-form-item.md @@ -81,7 +81,7 @@ let Demo = React.createClass({ ); }); return ( -
+ {formItems} diff --git a/components/form/demo/form-in-modal.md b/components/form/demo/form-in-modal.md index a73b69d89a..fa33641f0b 100644 --- a/components/form/demo/form-in-modal.md +++ b/components/form/demo/form-in-modal.md @@ -47,7 +47,7 @@ let Demo = React.createClass({
- + + - + diff --git a/components/form/demo/validate-other.md b/components/form/demo/validate-other.md index 41973df38e..f31d2747c7 100644 --- a/components/form/demo/validate-other.md +++ b/components/form/demo/validate-other.md @@ -77,7 +77,7 @@ let Demo = React.createClass({ wrapperCol: { span: 12 }, }; return ( - + > render', getFieldValue('mention') === this.state.initValue); return ( - + - + {getFieldDecorator('mention', { + rules: [ + { validator: this.checkMention }, + ], + initialValue: this.state.initValue, + })( + + )} diff --git a/components/notification/index.en-US.md b/components/notification/index.en-US.md index a51f24dc7e..ebfd85fbe2 100644 --- a/components/notification/index.en-US.md +++ b/components/notification/index.en-US.md @@ -2,7 +2,7 @@ category: Components type: Views noinstant: true -english: -tification +title: Notification --- To display a notification message globally. diff --git a/components/notification/index.zh-CN.md b/components/notification/index.zh-CN.md index 30c72f419b..6c4276360f 100644 --- a/components/notification/index.zh-CN.md +++ b/components/notification/index.zh-CN.md @@ -1,9 +1,9 @@ --- category: Components -chinese: 通知提醒框 type: Views noinstant: true -english: Notification +title: Notification +subtitle: 通知提醒框 --- 全局展示通知提醒信息。 diff --git a/components/popover/index.tsx b/components/popover/index.tsx index aa97033003..a2a2e5bed5 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import Tooltip from '../tooltip'; import getPlacements from './placements'; -import warning from 'warning'; const placements = getPlacements(); @@ -29,8 +28,6 @@ export interface PopoverProps { getTooltipContainer?: (triggerNode: React.ReactNode) => React.ReactNode; /** content of popup-container */ content?: React.ReactNode; - /** keep overlay for compatibility */ - overlay?: React.ReactNode; style?: React.CSSProperties; transitionName?: string; } @@ -63,22 +60,14 @@ export default class Popover extends React.Component { return (this.refs as any).tooltip.getPopupDomNode(); } - componentDidMount() { - if ('overlay' in this.props) { - warning(false, '`overlay` prop of Popover is deprecated, use `content` instead.'); - } - } - getOverlay() { - // use content replace overlay - // keep overlay for compatibility - const { title, prefixCls, overlay, content } = this.props; + const { title, prefixCls, content } = this.props; return (
{title &&
{title}
}
- {content || overlay} + {content}
); diff --git a/components/progress/index.tsx b/components/progress/index.tsx index 56d8445475..1e77982d82 100644 --- a/components/progress/index.tsx +++ b/components/progress/index.tsx @@ -1,17 +1,3 @@ -import * as React from 'react'; import Progress from './progress'; -import warning from 'warning'; -const AntProgress = Progress; - -// For downward compatibility -AntProgress.Line = (props) => { - warning(false, ' is deprecated, use instead.'); - return ; -}; -AntProgress.Circle = (props) => { - warning(false, ' is deprecated, use instead.'); - return ; -}; - -export default AntProgress; +export default Progress; diff --git a/components/slider/index.tsx b/components/slider/index.tsx index 8c86c86298..b1b0e01d13 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { PropTypes } from 'react'; import RcSlider from 'rc-slider'; -import splitObject from '../_util/splitObject'; interface SliderMarks { [key: number]: React.ReactNode | { @@ -23,8 +22,8 @@ export interface SliderProps { defaultValue?: SliderValue; included?: boolean; disabled?: boolean; - onChange?: (value: SliderValue) => any; - onAfterChange?: (value: SliderValue) => any; + onChange?: (value: SliderValue) => void; + onAfterChange?: (value: SliderValue) => void; tipFormatter?: void | ((value: number) => React.ReactNode); } @@ -37,40 +36,9 @@ export default class Slider extends React.Component { static propTypes = { prefixCls: PropTypes.string, tipTransitionName: PropTypes.string, - included: PropTypes.bool, - marks: PropTypes.object, }; render() { - const [{isIncluded, marks, index, defaultIndex}, others] = splitObject(this.props, - ['isIncluded', 'marks', 'index', 'defaultIndex']); - - if (isIncluded !== undefined) { - // 兼容 `isIncluded` - others.included = isIncluded; - } - - if (Array.isArray(marks)) { - // 兼容当 marks 为数组的情况 - others.min = 0; - others.max = marks.length - 1; - others.step = 1; - - if (index !== undefined) { - others.value = index; - } - if (defaultIndex !== undefined) { - others.defaultValue = defaultIndex; - } - - others.marks = {}; - marks.forEach((val, idx) => { - others.marks[idx] = val; - }); - } else { - others.marks = marks; - } - - return ; + return ; } } diff --git a/components/spin/index.tsx b/components/spin/index.tsx index 0b290057b0..495f13e6e9 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -3,7 +3,6 @@ import { PropTypes } from 'react'; import { findDOMNode } from 'react-dom'; import classNames from 'classnames'; import isCssAnimationSupported from '../_util/isCssAnimationSupported'; -import warning from 'warning'; import splitObject from '../_util/splitObject'; import omit from 'object.omit'; @@ -33,7 +32,7 @@ export default class Spin extends React.Component { constructor(props) { super(props); - const spinning = this.getSpinning(props); + const spinning = props.spinning; this.state = { spinning, }; @@ -44,7 +43,6 @@ export default class Spin extends React.Component { } componentDidMount() { - warning(!('spining' in this.props), '`spining` property of Popover is a spell mistake, use `spinning` instead.'); if (!isCssAnimationSupported()) { // Show text in IE8/9 findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`; @@ -57,18 +55,9 @@ export default class Spin extends React.Component { } } - getSpinning(props) { - // Backwards support - if ('spining' in props) { - warning(false, '`spining` property of Spin is a spell mistake, use `spinning` instead.'); - return props.spining; - } - return props.spinning; - } - componentWillReceiveProps(nextProps) { - const currentSpinning = this.getSpinning(this.props); - const spinning = this.getSpinning(nextProps); + const currentSpinning = this.props.spinning; + const spinning = nextProps.spinning; if (this.debounceTimeout) { clearTimeout(this.debounceTimeout); }