diff --git a/.eslintrc.js b/.eslintrc.js index 24a48e6993..8ccedb6db1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,7 +28,6 @@ const eslintrc = { 'arrow-body-style': 0, 'react/sort-comp': 0, 'react/prop-types': 0, - 'react/jsx-closing-bracket-location': 0, 'react/jsx-first-prop-new-line': 0, 'import/no-unresolved': 0, 'no-param-reassign': 0, diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md index f61a98e965..fb3e14ccd1 100644 --- a/components/alert/demo/closable.md +++ b/components/alert/demo/closable.md @@ -16,11 +16,13 @@ ReactDOM.render(
+ onClose={onClose} + /> + onClose={onClose} + />
, mountNode); ```` diff --git a/components/alert/demo/description.md b/components/alert/demo/description.md index 482392b975..e597381225 100644 --- a/components/alert/demo/description.md +++ b/components/alert/demo/description.md @@ -11,17 +11,21 @@ import { Alert } from 'antd'; ReactDOM.render(
+ type="success" + /> + type="info" + /> + type="warning" + /> + type="error" + />
, mountNode); ```` diff --git a/components/alert/demo/icon.md b/components/alert/demo/icon.md index 94239144c5..cfb36a42cc 100644 --- a/components/alert/demo/icon.md +++ b/components/alert/demo/icon.md @@ -16,20 +16,24 @@ ReactDOM.render(
+ showIcon + /> + showIcon + /> + showIcon + /> + showIcon + />
, mountNode); ```` diff --git a/components/alert/index.jsx b/components/alert/index.jsx index d73a84f2d7..c87fbc31e7 100644 --- a/components/alert/index.jsx +++ b/components/alert/index.jsx @@ -82,7 +82,8 @@ export default class Alert extends React.Component { + onEnd={this.animationEnd} + >
{showIcon ? : null} {message} diff --git a/components/badge/index.jsx b/components/badge/index.jsx index dfb3ba0a78..3a84859580 100644 --- a/components/badge/index.jsx +++ b/components/badge/index.jsx @@ -46,11 +46,13 @@ export default class Badge extends React.Component { + transitionAppear + > { hidden ? null : + count={count} style={style} + /> } diff --git a/components/breadcrumb/demo/router.md b/components/breadcrumb/demo/router.md index 1d355758f5..e99a2425dd 100644 --- a/components/breadcrumb/demo/router.md +++ b/components/breadcrumb/demo/router.md @@ -37,7 +37,8 @@ function Home(props) { marginTop: 15, paddingBottom: 15, borderBottom: '1px dashed #ccc', - }}> + }} + > 点击上面的导航切换页面,面包屑在下面:
diff --git a/components/button/button.jsx b/components/button/button.jsx index 63325af2d4..b75b54c40f 100644 --- a/components/button/button.jsx +++ b/components/button/button.jsx @@ -104,7 +104,8 @@ export default class Button extends React.Component { type={htmlType || 'button'} className={classes} onMouseUp={this.handleMouseUp} - onClick={this.handleClick}> + onClick={this.handleClick} + > {iconType ? : null}{kids} ); diff --git a/components/calendar/Header.jsx b/components/calendar/Header.jsx index 53c1728977..289ee638a6 100644 --- a/components/calendar/Header.jsx +++ b/components/calendar/Header.jsx @@ -45,7 +45,8 @@ export default class Header extends React.Component { dropdownMenuStyle={{ minWidth: 103 }} className={`${prefixCls}-year-select`} onChange={this.onYearChange} - value={String(year)}> + value={String(year)} + > {options} ); @@ -69,7 +70,8 @@ export default class Header extends React.Component { dropdownMatchSelectWidth={false} className={`${prefixCls}-month-select`} value={String(month)} - onChange={this.onMonthChange}> + onChange={this.onMonthChange} + > {options} ); diff --git a/components/calendar/demo/custom-render.md b/components/calendar/demo/custom-render.md index 472e072a9d..e0470ee64c 100644 --- a/components/calendar/demo/custom-render.md +++ b/components/calendar/demo/custom-render.md @@ -26,6 +26,7 @@ function monthCellRender(value) { ReactDOM.render( + dateCellRender={dateCellRender} monthCellRender={monthCellRender} + /> , mountNode); ```` diff --git a/components/calendar/index.jsx b/components/calendar/index.jsx index d7cd687fb5..b7f68eb3f5 100644 --- a/components/calendar/index.jsx +++ b/components/calendar/index.jsx @@ -139,7 +139,8 @@ export default class Calendar extends React.Component { locale={locale.lang} prefixCls={prefixCls} onTypeChange={this.setType} - onValueChange={this.setValue} /> + onValueChange={this.setValue} + /> + dateCellRender={this.dateCellRender} + /> ); } diff --git a/components/card/demo/grid.md b/components/card/demo/grid.md index 62d2ae23c2..f087fd453c 100644 --- a/components/card/demo/grid.md +++ b/components/card/demo/grid.md @@ -35,11 +35,11 @@ ReactDOM.render( ````css /* Increase grid spacing of 16px */ -.code-box-demo .row { +.code-box-demo .ant-row { margin-left: -8px; margin-right: -8px; } -.code-box-demo .row > div { +.code-box-demo .ant-row > div { padding: 0 8px; } ```` diff --git a/components/cascader/demo/custom-render.md b/components/cascader/demo/custom-render.md index 67ea032c61..2205e03f74 100644 --- a/components/cascader/demo/custom-render.md +++ b/components/cascader/demo/custom-render.md @@ -56,6 +56,7 @@ ReactDOM.render( options={options} defaultValue={['zhejiang', 'hangzhou', 'xihu']} displayRender={displayRender} - style={{ width: 200 }} /> + style={{ width: 200 }} + /> , mountNode); ```` diff --git a/components/cascader/demo/hover.md b/components/cascader/demo/hover.md index 659986a07f..888c07c6b9 100644 --- a/components/cascader/demo/hover.md +++ b/components/cascader/demo/hover.md @@ -43,6 +43,7 @@ function displayRender(label) { ReactDOM.render( + displayRender={displayRender} onChange={onChange} + /> , mountNode); ```` diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx index e86e66580e..fca5778849 100644 --- a/components/cascader/index.jsx +++ b/components/cascader/index.jsx @@ -80,7 +80,8 @@ export default class Cascader extends React.Component { const clearIcon = (allowClear && !disabled && this.state.value.length > 0) ? : null; + onClick={this.clearSelection} + /> : null; const arrowCls = classNames({ [`${prefixCls}-picker-arrow`]: true, [`${prefixCls}-picker-arrow-expand`]: this.state.popupVisible, @@ -99,17 +100,20 @@ export default class Cascader extends React.Component { value={this.state.value} popupVisible={this.state.popupVisible} onPopupVisibleChange={this.handlePopupVisibleChange} - onChange={this.handleChange}> + onChange={this.handleChange} + > {children || + className={pickerCls} + > 0 ? null : placeholder} className={`${prefixCls}-input ant-input ${sizeCls}`} value={null} disabled={disabled} - readOnly /> + readOnly + /> {this.getLabel()} {clearIcon} diff --git a/components/checkbox/Group.jsx b/components/checkbox/Group.jsx index 392e7e8b2a..49089a261c 100644 --- a/components/checkbox/Group.jsx +++ b/components/checkbox/Group.jsx @@ -64,7 +64,8 @@ export default class CheckboxGroup extends React.Component { this.toggleOption(option)} - className="ant-checkbox-group-item" key={option.value}> + className="ant-checkbox-group-item" key={option.value} + > {option.label} ) diff --git a/components/checkbox/demo/controller.md b/components/checkbox/demo/controller.md index 19ccd6e2e6..3b650b22bf 100644 --- a/components/checkbox/demo/controller.md +++ b/components/checkbox/demo/controller.md @@ -22,18 +22,21 @@ const App = React.createClass({

+ onChange={this.onChange} + > {label}

diff --git a/components/date-picker/RangePicker.jsx b/components/date-picker/RangePicker.jsx index b2d4f5c141..f0ce8005e0 100644 --- a/components/date-picker/RangePicker.jsx +++ b/components/date-picker/RangePicker.jsx @@ -126,14 +126,16 @@ export default class RangePicker extends React.Component { onChange={props.handleInputChange} value={start ? props.getFormatter().format(start) : ''} placeholder={startPlaceholder} - className="ant-calendar-range-picker-input" /> + className="ant-calendar-range-picker-input" + /> ~ + className="ant-calendar-range-picker-input" + /> ); diff --git a/components/date-picker/createPicker.jsx b/components/date-picker/createPicker.jsx index 71163b8daf..a80af44052 100644 --- a/components/date-picker/createPicker.jsx +++ b/components/date-picker/createPicker.jsx @@ -94,7 +94,8 @@ export default function createPicker(TheCalendar) { onChange={props.handleInputChange} value={value ? props.getFormatter().format(value) : ''} placeholder={placeholder} - className={props.pickerInputClass} /> + className={props.pickerInputClass} + /> ); diff --git a/components/date-picker/demo/start-end.md b/components/date-picker/demo/start-end.md index 5f50ec665d..5f488460c0 100644 --- a/components/date-picker/demo/start-end.md +++ b/components/date-picker/demo/start-end.md @@ -45,11 +45,13 @@ const DateRange = React.createClass({ + onChange={this.onStartChange} + /> + onChange={this.onEndChange} + /> ); }, diff --git a/components/date-picker/wrapPicker.jsx b/components/date-picker/wrapPicker.jsx index c7dc6d5e58..63601a35d6 100644 --- a/components/date-picker/wrapPicker.jsx +++ b/components/date-picker/wrapPicker.jsx @@ -103,7 +103,7 @@ export default function wrapPicker(Picker, defaultFormat) { placeholder={locale.timePickerLocale.placeholder} locale={locale.timePickerLocale} transitionName="slide-up" - /> + /> ) : null; return ( diff --git a/components/dropdown/demo/overlay-visible.md b/components/dropdown/demo/overlay-visible.md index 61e0a29780..42259d92f6 100644 --- a/components/dropdown/demo/overlay-visible.md +++ b/components/dropdown/demo/overlay-visible.md @@ -33,7 +33,8 @@ const OverlayVisible = React.createClass({ return ( + visible={this.state.visible} + > 鼠标移入 diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index b4bfff3c24..4eacd47a60 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -33,8 +33,8 @@ export default class FormItem extends React.Component { return ''; } const { span, offset } = colDef; - const col = span ? `col-${span}` : ''; - const offsetCol = offset ? ` col-offset-${offset}` : ''; + const col = span ? `ant-col-${span}` : ''; + const offsetCol = offset ? ` ant-col-offset-${offset}` : ''; return col + offsetCol; } diff --git a/components/form/demo/advanced-search-form.md b/components/form/demo/advanced-search-form.md index 0999e9089c..526462e04e 100644 --- a/components/form/demo/advanced-search-form.md +++ b/components/form/demo/advanced-search-form.md @@ -18,19 +18,22 @@ ReactDOM.render( + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > @@ -38,19 +41,22 @@ ReactDOM.render( + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > @@ -58,19 +64,22 @@ ReactDOM.render( + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > + wrapperCol={{ span: 14 }} + > @@ -96,7 +105,7 @@ ReactDOM.render( } /* 由于输入标签长度不确定,所以需要微调使之看上去居中 */ -.ant-advanced-search-form > .row { +.ant-advanced-search-form > .ant-row { position: relative; left: -6px; } diff --git a/components/form/demo/form-controls.md b/components/form/demo/form-controls.md index a6ad4c69fc..e7ce2d2f12 100644 --- a/components/form/demo/form-controls.md +++ b/components/form/demo/form-controls.md @@ -23,7 +23,8 @@ ReactDOM.render( id="control-input" label="输入框" labelCol={{ span: 6 }} - wrapperCol={{ span: 14 }}> + wrapperCol={{ span: 14 }} + > @@ -31,7 +32,8 @@ ReactDOM.render( id="control-textarea" label="文本域" labelCol={{ span: 6 }} - wrapperCol={{ span: 14 }}> + wrapperCol={{ span: 14 }} + > @@ -39,7 +41,8 @@ ReactDOM.render( id="select" label="Select 选择器" labelCol={{ span: 6 }} - wrapperCol={{ span: 14 }}> + wrapperCol={{ span: 14 }} + > + label="密码" + > diff --git a/components/form/demo/horizontal-form.md b/components/form/demo/horizontal-form.md index e4f212ad20..4bfffdcd29 100644 --- a/components/form/demo/horizontal-form.md +++ b/components/form/demo/horizontal-form.md @@ -26,17 +26,20 @@ let Demo = React.createClass({
+ label="用户名" + >

大眼萌 minion

+ label="密码" + > + label="您的性别" + > 男的 女的 @@ -45,12 +48,14 @@ let Demo = React.createClass({ + help="随便写点什么" + > 卖身华府 }> + label={卖身华府 } + > 同意 diff --git a/components/form/demo/inline-form.md b/components/form/demo/inline-form.md index 838662d99d..c29ec7f01d 100644 --- a/components/form/demo/inline-form.md +++ b/components/form/demo/inline-form.md @@ -20,14 +20,18 @@ let Demo = React.createClass({ return ( + label="账户" + > + {...getFieldProps('userName')} + /> + label="密码" + > + {...getFieldProps('password')} + /> 记住我 diff --git a/components/form/demo/input-group.md b/components/form/demo/input-group.md index 06efc8fbe8..427cfcd3ed 100644 --- a/components/form/demo/input-group.md +++ b/components/form/demo/input-group.md @@ -16,7 +16,8 @@ ReactDOM.render( + wrapperCol={{ span: 16 }} + > @@ -24,14 +25,16 @@ ReactDOM.render( label="标签输入框" labelCol={{ span: 6 }} validateStatus="success" - wrapperCol={{ span: 16 }}> + wrapperCol={{ span: 16 }} + > + wrapperCol={{ span: 16 }} + >
@@ -48,7 +51,8 @@ ReactDOM.render( + wrapperCol={{ span: 16 }} + > @@ -68,7 +72,8 @@ ReactDOM.render( + wrapperCol={{ span: 16 }} + > diff --git a/components/form/demo/mix.md b/components/form/demo/mix.md index 88bb45045b..cec75b2602 100644 --- a/components/form/demo/mix.md +++ b/components/form/demo/mix.md @@ -46,16 +46,19 @@ let Demo = React.createClass({ + wrapperCol={{ span: 10 }} + > + {...getFieldProps('inputNumber', { initialValue: 3 })} + /> 台机器 + wrapperCol={{ span: 10 }} + >

唧唧复唧唧木兰当户织呀

链接文字 @@ -66,7 +69,8 @@ let Demo = React.createClass({ label="Switch 开关" labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} - required> + required + > @@ -74,7 +78,8 @@ let Demo = React.createClass({ label="Slider 滑动输入条" labelCol={{ span: 8 }} wrapperCol={{ span: 10 }} - required> + required + > @@ -82,9 +87,11 @@ let Demo = React.createClass({ label="Select 选择器" labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} - required> + required + > + hasFeedback + > + hasFeedback + > + onContextMenu={noop} onPaste={noop} onCopy={noop} onCut={noop} + /> + hasFeedback + > + onContextMenu={noop} onPaste={noop} onCopy={noop} onCut={noop} + /> + label="备注" + > diff --git a/components/form/demo/validate-customized.md b/components/form/demo/validate-customized.md index 03a023d82e..051bca24d2 100644 --- a/components/form/demo/validate-customized.md +++ b/components/form/demo/validate-customized.md @@ -145,7 +145,8 @@ let Demo = React.createClass({ + label="密码" + > + label="确认密码" + > + label="国籍" + > @@ -134,7 +136,8 @@ let Demo = React.createClass({ + label="性别" + > @@ -144,44 +147,53 @@ let Demo = React.createClass({ + label="兴趣爱好" + > 吃饭饭 + })} + >吃饭饭 睡觉觉 + })} + >睡觉觉 打豆豆 + })} + >打豆豆 + label="生日" + > + label="选一个时间" + > + label="8~12间的质数" + > + label="选择地址" + > + wrapperCol={{ span: 12, offset: 7 }} + >     diff --git a/components/form/demo/validate-static.md b/components/form/demo/validate-static.md index ee765aaa48..6f6775d97e 100644 --- a/components/form/demo/validate-static.md +++ b/components/form/demo/validate-static.md @@ -22,7 +22,8 @@ ReactDOM.render( labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} validateStatus="error" - help="请输入数字和字母组合"> + help="请输入数字和字母组合" + > @@ -30,7 +31,8 @@ ReactDOM.render( label="警告校验" labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} - validateStatus="warning"> + validateStatus="warning" + > @@ -40,7 +42,8 @@ ReactDOM.render( wrapperCol={{ span: 12 }} hasFeedback validateStatus="validating" - help="信息审核中..."> + help="信息审核中..." + > @@ -49,7 +52,8 @@ ReactDOM.render( labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} hasFeedback - validateStatus="success"> + validateStatus="success" + > @@ -58,7 +62,8 @@ ReactDOM.render( labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} hasFeedback - validateStatus="warning"> + validateStatus="warning" + > @@ -68,14 +73,16 @@ ReactDOM.render( wrapperCol={{ span: 12 }} hasFeedback validateStatus="error" - help="请输入数字和字母组合"> + help="请输入数字和字母组合" + > + help + > diff --git a/components/input/Input.jsx b/components/input/Input.jsx index 003768f3f4..fa9a5f0a14 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -99,12 +99,14 @@ export default class Input extends React.Component { case 'textarea': return (