mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
a567faeafb
@ -7,9 +7,12 @@
|
|||||||
"jest": true,
|
"jest": true,
|
||||||
"es6": true
|
"es6": true
|
||||||
},
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 6,
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true,
|
"jsx": true,
|
||||||
"experimentalObjectRestSpread": true
|
"experimentalObjectRestSpread": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"markdown",
|
"markdown",
|
||||||
@ -28,6 +31,8 @@
|
|||||||
"react/jsx-closing-bracket-location": 0,
|
"react/jsx-closing-bracket-location": 0,
|
||||||
"react/jsx-no-bind": 0,
|
"react/jsx-no-bind": 0,
|
||||||
"no-param-reassign": 0,
|
"no-param-reassign": 0,
|
||||||
"max-len": 0
|
"no-return-assign": 0,
|
||||||
|
"max-len": 0,
|
||||||
|
"consistent-return": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,6 @@ import ScrollNumber from './ScrollNumber';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
class AntBadge extends React.Component {
|
class AntBadge extends React.Component {
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { count, prefixCls, overflowCount, className, style, children } = this.props;
|
let { count, prefixCls, overflowCount, className, style, children } = this.props;
|
||||||
const dot = this.props.dot;
|
const dot = this.props.dot;
|
||||||
|
@ -15,6 +15,6 @@ function onPanelChange(value, mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Calendar onPanelChange={onPanelChange} locale={enUS}/>
|
<Calendar onPanelChange={onPanelChange} locale={enUS} />
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -92,7 +92,7 @@ class Calendar extends Component {
|
|||||||
locale={locale.lang}
|
locale={locale.lang}
|
||||||
prefixCls={prefixCls}
|
prefixCls={prefixCls}
|
||||||
onTypeChange={this.setType.bind(this)}
|
onTypeChange={this.setType.bind(this)}
|
||||||
onValueChange={this.setValue.bind(this)}/>
|
onValueChange={this.setValue.bind(this)} />
|
||||||
<FullCalendar
|
<FullCalendar
|
||||||
{...props}
|
{...props}
|
||||||
Select={noop}
|
Select={noop}
|
||||||
|
@ -18,13 +18,13 @@ const text = `
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Collapse accordion>
|
<Collapse accordion>
|
||||||
<Panel header={`This is panel header 1`} key="1">
|
<Panel header={'This is panel header 1'} key="1">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel header={`This is panel header 2`} key="2">
|
<Panel header={'This is panel header 2'} key="2">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel header={`This is panel header 3`} key="3">
|
<Panel header={'This is panel header 3'} key="3">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
|
@ -22,17 +22,17 @@ const text = `
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Collapse onChange={callback} accordion>
|
<Collapse onChange={callback} accordion>
|
||||||
<Panel header={`This is panel header 1`} key="1">
|
<Panel header={'This is panel header 1'} key="1">
|
||||||
<Collapse defaultActiveKey="1">
|
<Collapse defaultActiveKey="1">
|
||||||
<Panel header={`This is panel nest panel`} key="1">
|
<Panel header={'This is panel nest panel'} key="1">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel header={`This is panel header 2`} key="2">
|
<Panel header={'This is panel header 2'} key="2">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel header={`This is panel header 3`} key="3">
|
<Panel header={'This is panel header 3'} key="3">
|
||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
|
@ -74,7 +74,7 @@ export default React.createClass({
|
|||||||
timePicker = (<TimePicker
|
timePicker = (<TimePicker
|
||||||
prefixCls="ant-time-picker"
|
prefixCls="ant-time-picker"
|
||||||
placeholder={locale.lang.timePlaceholder}
|
placeholder={locale.lang.timePlaceholder}
|
||||||
transitionName="slide-up"/>);
|
transitionName="slide-up" />);
|
||||||
}
|
}
|
||||||
|
|
||||||
const calendarClassName = classNames({
|
const calendarClassName = classNames({
|
||||||
@ -151,15 +151,15 @@ export default React.createClass({
|
|||||||
onChange={this.handleInputChange}
|
onChange={this.handleInputChange}
|
||||||
value={start && this.getFormatter().format(start)}
|
value={start && this.getFormatter().format(start)}
|
||||||
placeholder={startPlaceholder}
|
placeholder={startPlaceholder}
|
||||||
className="ant-calendar-range-picker-input"/>
|
className="ant-calendar-range-picker-input" />
|
||||||
<span className="ant-calendar-range-picker-separator"> ~ </span>
|
<span className="ant-calendar-range-picker-separator"> ~ </span>
|
||||||
<input
|
<input
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onChange={this.handleInputChange}
|
onChange={this.handleInputChange}
|
||||||
value={end && this.getFormatter().format(end)}
|
value={end && this.getFormatter().format(end)}
|
||||||
placeholder={endPlaceholder}
|
placeholder={endPlaceholder}
|
||||||
className="ant-calendar-range-picker-input"/>
|
className="ant-calendar-range-picker-input" />
|
||||||
<span className="ant-calendar-picker-icon"/>
|
<span className="ant-calendar-picker-icon" />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ function createPicker(TheCalendar, defaultFormat) {
|
|||||||
const timePicker = this.props.showTime ? (<TimePicker
|
const timePicker = this.props.showTime ? (<TimePicker
|
||||||
prefixCls="ant-time-picker"
|
prefixCls="ant-time-picker"
|
||||||
placeholder={locale.lang.timePlaceholder}
|
placeholder={locale.lang.timePlaceholder}
|
||||||
transitionName="slide-up"/>)
|
transitionName="slide-up" />)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const disabledTime = this.props.showTime ? this.props.disabledTime : null;
|
const disabledTime = this.props.showTime ? this.props.disabledTime : null;
|
||||||
@ -139,8 +139,8 @@ function createPicker(TheCalendar, defaultFormat) {
|
|||||||
value={value && this.getFormatter().format(value)}
|
value={value && this.getFormatter().format(value)}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
style={this.props.style}
|
style={this.props.style}
|
||||||
className={`ant-calendar-picker-input ant-input${sizeClass}`}/>
|
className={`ant-calendar-picker-input ant-input${sizeClass}`} />
|
||||||
<span className="ant-calendar-picker-icon"/>
|
<span className="ant-calendar-picker-icon" />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ const menu = (
|
|||||||
<Menu.Item key="1">
|
<Menu.Item key="1">
|
||||||
<a target="_blank" href="http://www.taobao.com/">第二个菜单项</a>
|
<a target="_blank" href="http://www.taobao.com/">第二个菜单项</a>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider/>
|
<Menu.Divider />
|
||||||
<Menu.Item key="3" disabled>第三个菜单项(不可用)</Menu.Item>
|
<Menu.Item key="3" disabled>第三个菜单项(不可用)</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
@ -17,7 +17,7 @@ const menu = (
|
|||||||
<Menu.Item key="1">
|
<Menu.Item key="1">
|
||||||
<a href="http://www.taobao.com/">第二个菜单项</a>
|
<a href="http://www.taobao.com/">第二个菜单项</a>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider/>
|
<Menu.Divider />
|
||||||
<Menu.Item key="3">第三个菜单项</Menu.Item>
|
<Menu.Item key="3">第三个菜单项</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
@ -58,6 +58,8 @@ class FormItem extends React.Component {
|
|||||||
} else if (getFieldValue(field) !== undefined) {
|
} else if (getFieldValue(field) !== undefined) {
|
||||||
return 'success';
|
return 'success';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
renderValidateWrapper(c1, c2, c3) {
|
renderValidateWrapper(c1, c2, c3) {
|
||||||
|
@ -1,14 +1,3 @@
|
|||||||
function merge() {
|
|
||||||
const ret = {};
|
|
||||||
const args = [].slice.call(arguments, 0);
|
|
||||||
args.forEach((a) => {
|
|
||||||
Object.keys(a).forEach((k) => {
|
|
||||||
ret[k] = a[k];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ValueMixin = {
|
const ValueMixin = {
|
||||||
setValue(field, e) {
|
setValue(field, e) {
|
||||||
let v = e;
|
let v = e;
|
||||||
@ -24,7 +13,10 @@ const ValueMixin = {
|
|||||||
const newFormData = {};
|
const newFormData = {};
|
||||||
newFormData[field] = v;
|
newFormData[field] = v;
|
||||||
this.setState({
|
this.setState({
|
||||||
formData: merge(this.state.formData, newFormData),
|
formData: {
|
||||||
|
...this.state.formData,
|
||||||
|
...newFormData,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -18,14 +18,14 @@ ReactDOM.render(
|
|||||||
label="标签输入框:"
|
label="标签输入框:"
|
||||||
labelCol={{ span: 6 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 16 }}>
|
wrapperCol={{ span: 16 }}>
|
||||||
<Input addonBefore="Http://" defaultValue="mysite.com" id="site1"/>
|
<Input addonBefore="Http://" defaultValue="mysite.com" id="site1" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label="标签输入框:"
|
label="标签输入框:"
|
||||||
labelCol={{ span: 6 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 16 }}>
|
wrapperCol={{ span: 16 }}>
|
||||||
<Input addonBefore="Http://" addonAfter=".com" defaultValue="mysite" id="site2"/>
|
<Input addonBefore="Http://" addonAfter=".com" defaultValue="mysite" id="site2" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
|
@ -63,7 +63,7 @@ let Demo = React.createClass({
|
|||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 8 }}
|
||||||
wrapperCol={{ span: 10 }}
|
wrapperCol={{ span: 10 }}
|
||||||
required>
|
required>
|
||||||
<Slider marks={['A', 'B', 'C', 'D', 'E', 'F', 'G']} {...getFieldProps('slider')}/>
|
<Slider marks={['A', 'B', 'C', 'D', 'E', 'F', 'G']} {...getFieldProps('slider')} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
@ -85,7 +85,7 @@ let Demo = React.createClass({
|
|||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 8 }}
|
||||||
required>
|
required>
|
||||||
<Col span="6">
|
<Col span="6">
|
||||||
<DatePicker {...getFieldProps('startDate')}/>
|
<DatePicker {...getFieldProps('startDate')} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="1">
|
<Col span="1">
|
||||||
<p className="ant-form-split">-</p>
|
<p className="ant-form-split">-</p>
|
||||||
@ -100,7 +100,7 @@ let Demo = React.createClass({
|
|||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 8 }}
|
||||||
wrapperCol={{ span: 16 }}
|
wrapperCol={{ span: 16 }}
|
||||||
required>
|
required>
|
||||||
<TimePicker {...getFieldProps('time')}/>
|
<TimePicker {...getFieldProps('time')} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
|
@ -114,7 +114,7 @@ class BasicDemo extends React.Component {
|
|||||||
],
|
],
|
||||||
trigger: ['onBlur', 'onChange'],
|
trigger: ['onBlur', 'onChange'],
|
||||||
}]
|
}]
|
||||||
})}/>
|
})} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
@ -129,7 +129,7 @@ class BasicDemo extends React.Component {
|
|||||||
{ validator: this.checkPass.bind(this) },
|
{ validator: this.checkPass.bind(this) },
|
||||||
],
|
],
|
||||||
})}
|
})}
|
||||||
onContextMenu={noop} onPaste={noop} onCopy={noop} onCut={noop}/>
|
onContextMenu={noop} onPaste={noop} onCopy={noop} onCut={noop} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
@ -147,7 +147,7 @@ class BasicDemo extends React.Component {
|
|||||||
}, {
|
}, {
|
||||||
validator: this.checkPass2.bind(this),
|
validator: this.checkPass2.bind(this),
|
||||||
}],
|
}],
|
||||||
})}/>
|
})} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
@ -159,7 +159,7 @@ class BasicDemo extends React.Component {
|
|||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '真的不打算写点什么吗?' },
|
{ required: true, message: '真的不打算写点什么吗?' },
|
||||||
],
|
],
|
||||||
})}/>
|
})} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem wrapperCol={{ span: 12, offset: 7 }} >
|
<FormItem wrapperCol={{ span: 12, offset: 7 }} >
|
||||||
|
@ -99,7 +99,7 @@ class Input extends React.Component {
|
|||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
inputClassName = props.className ? props.className : inputClassName;
|
inputClassName = props.className ? props.className : inputClassName;
|
||||||
return <input {...props} placeholder={placeholder} className={inputClassName} ref="input"/>;
|
return <input {...props} placeholder={placeholder} className={inputClassName} ref="input" />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,5 +55,5 @@ const Test = React.createClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(<Test/>, mountNode);
|
ReactDOM.render(<Test />, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -56,5 +56,5 @@ const Test = React.createClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(<Test/>, mountNode);
|
ReactDOM.render(<Test />, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -38,7 +38,7 @@ const Test = React.createClass({
|
|||||||
<div className="ant-form-item" key="password">
|
<div className="ant-form-item" key="password">
|
||||||
<label htmlFor="password" className="col-6" required>密码:</label>
|
<label htmlFor="password" className="col-6" required>密码:</label>
|
||||||
<div className="col-14">
|
<div className="col-14">
|
||||||
<input className="ant-input" type="password" id="password" placeholder="请输入密码"/>
|
<input className="ant-input" type="password" id="password" placeholder="请输入密码" />
|
||||||
</div>
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
<div className="ant-form-item ant-form-item-compact" key="sex">
|
<div className="ant-form-item ant-form-item-compact" key="sex">
|
||||||
|
@ -29,7 +29,7 @@ const App = React.createClass({
|
|||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
<QueueAnim type={['right', 'left']} className="demo-router-wrap">
|
<QueueAnim type={['right', 'left']} className="demo-router-wrap">
|
||||||
{React.cloneElement(this.props.children || <Home/>, { key })}
|
{React.cloneElement(this.props.children || <Home />, { key })}
|
||||||
</QueueAnim>
|
</QueueAnim>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -17,7 +17,7 @@ const App = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
console.log(`radio checked`, e.target.value);
|
console.log('radio checked', e.target.value);
|
||||||
this.setState({
|
this.setState({
|
||||||
value: e.target.value
|
value: e.target.value
|
||||||
});
|
});
|
||||||
|
@ -59,9 +59,7 @@ let FilterMenu = React.createClass({
|
|||||||
const keyPathOfSelectedItem = this.state.keyPathOfSelectedItem;
|
const keyPathOfSelectedItem = this.state.keyPathOfSelectedItem;
|
||||||
const containSelected = Object.keys(keyPathOfSelectedItem).some(key => {
|
const containSelected = Object.keys(keyPathOfSelectedItem).some(key => {
|
||||||
const keyPath = keyPathOfSelectedItem[key];
|
const keyPath = keyPathOfSelectedItem[key];
|
||||||
if (keyPath.indexOf(item.value) >= 0) {
|
return keyPath.indexOf(item.value) >= 0;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
const subMenuCls = containSelected ? 'ant-dropdown-submenu-contain-selected' : '';
|
const subMenuCls = containSelected ? 'ant-dropdown-submenu-contain-selected' : '';
|
||||||
return (
|
return (
|
||||||
|
@ -134,8 +134,8 @@ let AntTable = React.createClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof column.sorter === 'function') {
|
if (typeof column.sorter === 'function') {
|
||||||
sorter = function () {
|
sorter = function (...args) {
|
||||||
let result = column.sorter.apply(this, arguments);
|
let result = column.sorter.apply(this, args);
|
||||||
if (sortOrder === 'ascend') {
|
if (sortOrder === 'ascend') {
|
||||||
return result;
|
return result;
|
||||||
} else if (sortOrder === 'descend') {
|
} else if (sortOrder === 'descend') {
|
||||||
@ -296,7 +296,7 @@ let AntTable = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Radio disabled={props.disabled}
|
<Radio disabled={props.disabled}
|
||||||
onChange={this.handleRadioSelect.bind(this, record, rowIndex)}
|
onChange={this.handleRadioSelect.bind(this, record, rowIndex)}
|
||||||
value={rowIndex} checked={checked}/>
|
value={rowIndex} checked={checked} />
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ let AntTable = React.createClass({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Checkbox checked={checked} disabled={props.disabled}
|
<Checkbox checked={checked} disabled={props.disabled}
|
||||||
onChange={this.handleSelect.bind(this, record, rowIndex)}/>
|
onChange={this.handleSelect.bind(this, record, rowIndex)} />
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ let AntTable = React.createClass({
|
|||||||
filterDropdown = (
|
filterDropdown = (
|
||||||
<FilterDropdown locale={locale} column={column}
|
<FilterDropdown locale={locale} column={column}
|
||||||
selectedKeys={colFilters}
|
selectedKeys={colFilters}
|
||||||
confirmFilter={this.handleFilter}/>
|
confirmFilter={this.handleFilter} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (column.sorter) {
|
if (column.sorter) {
|
||||||
@ -427,12 +427,12 @@ let AntTable = React.createClass({
|
|||||||
<span className={`ant-table-column-sorter-up ${isAscend ? 'on' : 'off'}`}
|
<span className={`ant-table-column-sorter-up ${isAscend ? 'on' : 'off'}`}
|
||||||
title="↑"
|
title="↑"
|
||||||
onClick={this.toggleSortOrder.bind(this, 'ascend', column)}>
|
onClick={this.toggleSortOrder.bind(this, 'ascend', column)}>
|
||||||
<Icon type="caret-up"/>
|
<Icon type="caret-up" />
|
||||||
</span>
|
</span>
|
||||||
<span className={`ant-table-column-sorter-down ${isDescend ? 'on' : 'off'}`}
|
<span className={`ant-table-column-sorter-down ${isDescend ? 'on' : 'off'}`}
|
||||||
title="↓"
|
title="↓"
|
||||||
onClick={this.toggleSortOrder.bind(this, 'descend', column)}>
|
onClick={this.toggleSortOrder.bind(this, 'descend', column)}>
|
||||||
<Icon type="caret-down"/>
|
<Icon type="caret-down" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -517,10 +517,7 @@ let AntTable = React.createClass({
|
|||||||
// 否则进行读取分页数据
|
// 否则进行读取分页数据
|
||||||
if (data.length > pageSize || pageSize === Number.MAX_VALUE) {
|
if (data.length > pageSize || pageSize === Number.MAX_VALUE) {
|
||||||
data = data.filter((item, i) => {
|
data = data.filter((item, i) => {
|
||||||
if (i >= (current - 1) * pageSize &&
|
return i >= (current - 1) * pageSize && i < current * pageSize;
|
||||||
i < current * pageSize) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
@ -575,7 +572,7 @@ let AntTable = React.createClass({
|
|||||||
if (!data || data.length === 0) {
|
if (!data || data.length === 0) {
|
||||||
emptyText = (
|
emptyText = (
|
||||||
<div className="ant-table-placeholder">
|
<div className="ant-table-placeholder">
|
||||||
<Icon type="frown"/>{locale.emptyText}
|
<Icon type="frown" />{locale.emptyText}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
emptyClass = ' ant-table-empty';
|
emptyClass = ' ant-table-empty';
|
||||||
|
@ -29,7 +29,7 @@ class AntTabs extends React.Component {
|
|||||||
let { prefixCls, size, tabPosition, animation, type,
|
let { prefixCls, size, tabPosition, animation, type,
|
||||||
children, tabBarExtraContent } = this.props;
|
children, tabBarExtraContent } = this.props;
|
||||||
let className = classNames({
|
let className = classNames({
|
||||||
[this.props.className]: !!this. props.className,
|
[this.props.className]: !!this.props.className,
|
||||||
[`${prefixCls}-mini`]: size === 'small' || size === 'mini',
|
[`${prefixCls}-mini`]: size === 'small' || size === 'mini',
|
||||||
[`${prefixCls}-vertical`]: tabPosition === 'left' || tabPosition === 'right',
|
[`${prefixCls}-vertical`]: tabPosition === 'left' || tabPosition === 'right',
|
||||||
[`${prefixCls}-card`]: type.indexOf('card') >= 0,
|
[`${prefixCls}-card`]: type.indexOf('card') >= 0,
|
||||||
|
@ -33,6 +33,7 @@ class Transfer extends Component {
|
|||||||
leftDataSource.splice(index, 1);
|
leftDataSource.splice(index, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
})[0]);
|
})[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -181,14 +182,14 @@ class Transfer extends Component {
|
|||||||
searchPlaceholder={searchPlaceholder}
|
searchPlaceholder={searchPlaceholder}
|
||||||
body={body}
|
body={body}
|
||||||
footer={footer}
|
footer={footer}
|
||||||
prefixCls={`${prefixCls}-list`}/>
|
prefixCls={`${prefixCls}-list`} />
|
||||||
<Operation rightActive={rightActive}
|
<Operation rightActive={rightActive}
|
||||||
rightArrowText={operations[0]}
|
rightArrowText={operations[0]}
|
||||||
moveToRight={this.moveTo.bind(this, 'right')}
|
moveToRight={this.moveTo.bind(this, 'right')}
|
||||||
leftActive={leftActive}
|
leftActive={leftActive}
|
||||||
leftArrowText={operations[1]}
|
leftArrowText={operations[1]}
|
||||||
moveToLeft={this.moveTo.bind(this, 'left')}
|
moveToLeft={this.moveTo.bind(this, 'left')}
|
||||||
className={`${prefixCls}-operation`}/>
|
className={`${prefixCls}-operation`} />
|
||||||
<List titleText={titles[1]}
|
<List titleText={titles[1]}
|
||||||
dataSource={rightDataSource}
|
dataSource={rightDataSource}
|
||||||
filter={rightFilter}
|
filter={rightFilter}
|
||||||
@ -205,7 +206,7 @@ class Transfer extends Component {
|
|||||||
searchPlaceholder={searchPlaceholder}
|
searchPlaceholder={searchPlaceholder}
|
||||||
body={body}
|
body={body}
|
||||||
footer={footer}
|
footer={footer}
|
||||||
prefixCls={`${prefixCls}-list`}/>
|
prefixCls={`${prefixCls}-list`} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -81,21 +81,19 @@ class TransferList extends Component {
|
|||||||
[`${prefixCls}-with-footer`]: !!footerDom,
|
[`${prefixCls}-with-footer`]: !!footerDom,
|
||||||
});
|
});
|
||||||
|
|
||||||
const showItems = dataSource.map((item) => {
|
const showItems = dataSource.filter((item) => {
|
||||||
// apply filter
|
|
||||||
const itemText = this.props.render(item);
|
const itemText = this.props.render(item);
|
||||||
const filterResult = this.matchFilter(itemText, filter);
|
const filterResult = this.matchFilter(itemText, filter);
|
||||||
|
return !!filterResult;
|
||||||
|
}).map((item) => {
|
||||||
const renderedText = this.props.render(item);
|
const renderedText = this.props.render(item);
|
||||||
|
|
||||||
if (filterResult) {
|
|
||||||
return (
|
return (
|
||||||
<li onClick={this.handleSelect.bind(this, item)} key={item.key} title={renderedText}>
|
<li onClick={this.handleSelect.bind(this, item)} key={item.key} title={renderedText}>
|
||||||
<Checkbox checked={checkedKeys.some(key => key === item.key)} />
|
<Checkbox checked={checkedKeys.some(key => key === item.key)} />
|
||||||
{renderedText}
|
{renderedText}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
}).filter(item => !!item);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={listCls} {...this.props}>
|
<div className={listCls} {...this.props}>
|
||||||
@ -104,7 +102,7 @@ class TransferList extends Component {
|
|||||||
prefixCls: 'ant-transfer',
|
prefixCls: 'ant-transfer',
|
||||||
checked: checkStatus === 'all',
|
checked: checkStatus === 'all',
|
||||||
checkPart: checkStatus === 'part',
|
checkPart: checkStatus === 'part',
|
||||||
checkable: <span className={`ant-transfer-checkbox-inner`}></span>
|
checkable: <span className={'ant-transfer-checkbox-inner'}></span>
|
||||||
})}<span className={`${prefixCls}-header-selected`}><span>{(checkedKeys.length > 0 ? `${checkedKeys.length}/` : '') + dataSource.length} 条</span>
|
})}<span className={`${prefixCls}-header-selected`}><span>{(checkedKeys.length > 0 ? `${checkedKeys.length}/` : '') + dataSource.length} 条</span>
|
||||||
<span className={`${prefixCls}-header-title`}>{titleText}</span></span>
|
<span className={`${prefixCls}-header-title`}>{titleText}</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,10 +4,6 @@ function noop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Search extends Component {
|
class Search extends Component {
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
this.props.onChange(e);
|
this.props.onChange(e);
|
||||||
}
|
}
|
||||||
@ -22,7 +18,7 @@ class Search extends Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<input placeholder={placeholder} className={ `${prefixCls} ant-input` } value={ value } ref="input"
|
<input placeholder={placeholder} className={ `${prefixCls} ant-input` } value={ value } ref="input"
|
||||||
onChange={this.handleChange.bind(this)}/>
|
onChange={this.handleChange.bind(this)} />
|
||||||
{ value && value.length > 0 ?
|
{ value && value.length > 0 ?
|
||||||
<a href="#" className={ `${prefixCls}-action` } onClick={this.handleClear.bind(this)}>
|
<a href="#" className={ `${prefixCls}-action` } onClick={this.handleClear.bind(this)}>
|
||||||
<Icon type="cross-circle" />
|
<Icon type="cross-circle" />
|
||||||
|
@ -117,7 +117,7 @@ const Demo = React.createClass({
|
|||||||
</TreeNode>
|
</TreeNode>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return <TreeNode key={item.key} title={item.key}/>;
|
return <TreeNode key={item.key} title={item.key} />;
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<Tree checkable multiple={this.props.multiple} defaultExpandAll
|
<Tree checkable multiple={this.props.multiple} defaultExpandAll
|
||||||
|
@ -28,7 +28,7 @@ ReactDOM.render(
|
|||||||
<div className="ant-upload-text">上传照片</div>
|
<div className="ant-upload-text">上传照片</div>
|
||||||
</Upload>
|
</Upload>
|
||||||
<a href="https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png" target="_blank" className="upload-example">
|
<a href="https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png" target="_blank" className="upload-example">
|
||||||
<img src="https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png"/>
|
<img src="https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png" />
|
||||||
<span>示例</span>
|
<span>示例</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -235,7 +235,7 @@ const AntUpload = React.createClass({
|
|||||||
uploadList = (
|
uploadList = (
|
||||||
<UploadList listType={this.props.listType}
|
<UploadList listType={this.props.listType}
|
||||||
items={this.state.fileList}
|
items={this.state.fileList}
|
||||||
onRemove={this.handleManualRemove}/>
|
onRemove={this.handleManualRemove} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (type === 'drag') {
|
if (type === 'drag') {
|
||||||
@ -292,7 +292,7 @@ const AntUpload = React.createClass({
|
|||||||
|
|
||||||
AntUpload.Dragger = React.createClass({
|
AntUpload.Dragger = React.createClass({
|
||||||
render() {
|
render() {
|
||||||
return <AntUpload {...this.props} type="drag" style={{ height: this.props.height }}/>;
|
return <AntUpload {...this.props} type="drag" style={{ height: this.props.height }} />;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
10
package.json
10
package.json
@ -86,12 +86,12 @@
|
|||||||
"css-loader": "^0.23.0",
|
"css-loader": "^0.23.0",
|
||||||
"cz-conventional-changelog": "^1.1.5",
|
"cz-conventional-changelog": "^1.1.5",
|
||||||
"es3ify-loader": "^0.1.0",
|
"es3ify-loader": "^0.1.0",
|
||||||
"eslint": "^1.1.0",
|
"eslint": "^2.2.0",
|
||||||
"eslint-config-airbnb": "latest",
|
"eslint-config-airbnb": "^6.0.1",
|
||||||
"eslint-plugin-babel": "^3.0.0",
|
"eslint-plugin-babel": "^3.0.0",
|
||||||
"eslint-plugin-markdown": "*",
|
"eslint-plugin-markdown": "*",
|
||||||
"eslint-plugin-react": "^3.3.1",
|
"eslint-plugin-react": "^4.0.0",
|
||||||
"eslint-tinker": "~0.2.0",
|
"eslint-tinker": "^0.3.1",
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"gh-pages": "^0.9.0",
|
"gh-pages": "^0.9.0",
|
||||||
"history": "^1.17.0",
|
"history": "^1.17.0",
|
||||||
@ -130,7 +130,7 @@
|
|||||||
"just-deploy": "npm run site && node scripts/deploy.js",
|
"just-deploy": "npm run site && node scripts/deploy.js",
|
||||||
"lint": "npm run srclint && npm run mdlint && npm run lesshint",
|
"lint": "npm run srclint && npm run mdlint && npm run lesshint",
|
||||||
"srclint": "eslint components test index.js --ext '.js,.jsx'",
|
"srclint": "eslint components test index.js --ext '.js,.jsx'",
|
||||||
"mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM,mountNode' --rule 'no-console: 0,eol-last: 0'",
|
"mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM,mountNode' --rule 'no-console: 0, eol-last: 0, prefer-rest-params: 0'",
|
||||||
"lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'",
|
"lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'",
|
||||||
"eslint-fix": "eslint --fix components test index.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
|
"eslint-fix": "eslint --fix components test index.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
|
||||||
"test": "npm run lint && webpack && npm run jest",
|
"test": "npm run lint && webpack && npm run jest",
|
||||||
|
Loading…
Reference in New Issue
Block a user