mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
Merge branch 'master' into feature-3.5.0
This commit is contained in:
commit
04a5cc2a8b
@ -19,7 +19,6 @@ matrix:
|
||||
- env: REACT=15 TEST_TYPE=test:es
|
||||
- env: REACT=15 TEST_TYPE=test:dom
|
||||
- env: REACT=15 TEST_TYPE=test:node
|
||||
- env: REACT=16 TEST_TYPE=bisheng:build
|
||||
|
||||
before_script:
|
||||
- scripts/install-react.sh
|
||||
|
@ -57,9 +57,9 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
if ('noHovering' in this.props) {
|
||||
warning(
|
||||
!this.props.noHovering,
|
||||
'`noHovering` of Card is deperated, you can remove it safely or use `hoverable` instead.',
|
||||
'`noHovering` of Card is deprecated, you can remove it safely or use `hoverable` instead.',
|
||||
);
|
||||
warning(!!this.props.noHovering, '`noHovering={false}` of Card is deperated, use `hoverable` instead.');
|
||||
warning(!!this.props.noHovering, '`noHovering={false}` of Card is deprecated, use `hoverable` instead.');
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {
|
||||
@ -73,14 +73,14 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
if (!this.container) {
|
||||
return;
|
||||
}
|
||||
// 936 is a magic card width pixer number indicated by designer
|
||||
const WIDTH_BOUDARY_PX = 936;
|
||||
if (this.container.offsetWidth >= WIDTH_BOUDARY_PX && !this.state.widerPadding) {
|
||||
// 936 is a magic card width pixel number indicated by designer
|
||||
const WIDTH_BOUNDARY_PX = 936;
|
||||
if (this.container.offsetWidth >= WIDTH_BOUNDARY_PX && !this.state.widerPadding) {
|
||||
this.setState({ widerPadding: true }, () => {
|
||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||
});
|
||||
}
|
||||
if (this.container.offsetWidth < WIDTH_BOUDARY_PX && this.state.widerPadding) {
|
||||
if (this.container.offsetWidth < WIDTH_BOUNDARY_PX && this.state.widerPadding) {
|
||||
this.setState({ widerPadding: false }, () => {
|
||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 基础列表
|
||||
zh-CN: 基础列表
|
||||
en-US: Basic list
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 栅格列表
|
||||
zh-CN: 栅格列表
|
||||
en-US: Grid
|
||||
---
|
||||
|
||||
|
@ -38,7 +38,7 @@ class InfiniteListExample extends React.Component {
|
||||
},
|
||||
});
|
||||
}
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.getData((res) => {
|
||||
this.setState({
|
||||
data: res.results,
|
||||
|
@ -46,7 +46,7 @@ class VirtualizedExample extends React.Component {
|
||||
},
|
||||
});
|
||||
}
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.getData((res) => {
|
||||
this.setState({
|
||||
data: res.results,
|
||||
@ -129,7 +129,7 @@ class VirtualizedExample extends React.Component {
|
||||
<List>
|
||||
{
|
||||
data.length > 0 && (
|
||||
<WindowScroller scrollElement={null}>
|
||||
<WindowScroller>
|
||||
{infiniteLoader}
|
||||
</WindowScroller>
|
||||
)
|
||||
|
@ -101,7 +101,7 @@ export default class List extends React.Component<ListProps> {
|
||||
return renderItem(item, index);
|
||||
}
|
||||
|
||||
isSomethingAfterLastTtem() {
|
||||
isSomethingAfterLastItem() {
|
||||
const { loadMore, pagination, footer } = this.props;
|
||||
return !!(loadMore || pagination || footer);
|
||||
}
|
||||
@ -160,7 +160,7 @@ export default class List extends React.Component<ListProps> {
|
||||
[`${prefixCls}-bordered`]: bordered,
|
||||
[`${prefixCls}-loading`]: isLoading,
|
||||
[`${prefixCls}-grid`]: grid,
|
||||
[`${prefixCls}-something-after-last-item`]: this.isSomethingAfterLastTtem(),
|
||||
[`${prefixCls}-something-after-last-item`]: this.isSomethingAfterLastItem(),
|
||||
});
|
||||
|
||||
const paginationContent = (
|
||||
@ -170,7 +170,7 @@ export default class List extends React.Component<ListProps> {
|
||||
);
|
||||
|
||||
let childrenContent;
|
||||
childrenContent = isLoading && (<div style={{ minHeight: 53 }} />);
|
||||
childrenContent = isLoading && <div style={{ minHeight: 53 }} />;
|
||||
if (dataSource.length > 0) {
|
||||
const items = dataSource.map((item: any, index: number) => this.renderItem(item, index));
|
||||
const childrenList = React.Children.map(items, (child: any, index) => React.cloneElement(child, {
|
||||
|
@ -137,7 +137,7 @@
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
&-something-after-last-item &-item:last-child {
|
||||
&-something-after-last-item .@{ant-prefix}-spin-container > &-item:last-child {
|
||||
border-bottom: 1px solid @border-color-split;
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@
|
||||
border-bottom: none;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 16px;
|
||||
&-content {
|
||||
display: block;
|
||||
}
|
||||
|
@ -1553,7 +1553,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
title="Previous Page"
|
||||
title="上一页"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@ -1608,7 +1608,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
aria-disabled="false"
|
||||
class=" ant-pagination-next"
|
||||
tabindex="0"
|
||||
title="Next Page"
|
||||
title="下一页"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@ -1635,9 +1635,9 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-select-selection-selected-value"
|
||||
style="display:block;opacity:1"
|
||||
title="10 / page"
|
||||
title="10 条/页"
|
||||
>
|
||||
10 / page
|
||||
10 条/页
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
|
@ -125,8 +125,8 @@ class App extends React.Component {
|
||||
<div>
|
||||
<div className="change-locale">
|
||||
<span style={{ marginRight: 16 }}>Change locale of components: </span>
|
||||
<Radio.Group defaultValue={null} onChange={this.changeLocale}>
|
||||
<Radio.Button key="en" value={null}>English</Radio.Button>
|
||||
<Radio.Group defaultValue={undefined} onChange={this.changeLocale}>
|
||||
<Radio.Button key="en" value={undefined}>English</Radio.Button>
|
||||
<Radio.Button key="cn" value={zhCN}>中文</Radio.Button>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@ Wrap your app with `LocaleProvider`, and apply the corresponding language packag
|
||||
|
||||
````jsx
|
||||
import { Pagination, LocaleProvider } from 'antd';
|
||||
import enUS from 'antd/lib/locale-provider/en_US';
|
||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||
|
||||
const App = () => (
|
||||
<div>
|
||||
@ -24,7 +24,7 @@ const App = () => (
|
||||
);
|
||||
|
||||
ReactDOM.render(
|
||||
<LocaleProvider locale={enUS}>
|
||||
<LocaleProvider locale={zhCN}>
|
||||
<App />
|
||||
</LocaleProvider>
|
||||
, mountNode);
|
||||
|
@ -44,6 +44,12 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
||||
antLocale: PropTypes.object,
|
||||
};
|
||||
|
||||
constructor(props: LocaleProviderProps) {
|
||||
super(props);
|
||||
setMomentLocale(props.locale);
|
||||
changeConfirmLocale(props.locale && props.locale.Modal);
|
||||
}
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
antLocale: {
|
||||
@ -53,11 +59,6 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
setMomentLocale(this.props.locale);
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: LocaleProviderProps) {
|
||||
const { locale } = this.props;
|
||||
const nextLocale = nextProps.locale;
|
||||
|
@ -69,6 +69,7 @@ The properties of the object are follows:
|
||||
| title | Title | string\|ReactNode | - |
|
||||
| width | Width of the modal dialog | string\|number | 416 |
|
||||
| zIndex | The `z-index` of the Modal | Number | 1000 |
|
||||
| keyboard | Whether support press esc to close | Boolean | true |
|
||||
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
||||
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
||||
|
||||
|
@ -36,6 +36,7 @@ title: Modal
|
||||
| width | 宽度 | string\|number | 520 |
|
||||
| wrapClassName | 对话框外层容器的类名 | string | - |
|
||||
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 |
|
||||
| keyboard | 是否支持键盘esc关闭 | boolean | true |
|
||||
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
|
||||
| onOk | 点击确定回调 | function(e) | 无 |
|
||||
|
||||
|
@ -293,13 +293,13 @@ describe('Upload List', () => {
|
||||
{
|
||||
name: 'image',
|
||||
status: 'done',
|
||||
uid: -6,
|
||||
uid: -7,
|
||||
url: 'https://cdn.xxx.com/xx.xx/aaa.png',
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
status: 'done',
|
||||
uid: -6,
|
||||
uid: -8,
|
||||
url: 'https://cdn.xxx.com/xx.xx/aaa.png',
|
||||
thumbUrl: 'data:image/png;base64,UEsDBAoAAAAAADYZYkwAAAAAAAAAAAAAAAAdAAk',
|
||||
},
|
||||
|
@ -37,8 +37,6 @@ elif [ "$TEST_TYPE" = test:dom ]; then
|
||||
if [ "$REACT" = 16 ]; then
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
fi
|
||||
elif [ "$TEST_TYPE" = bisheng:build ]; then
|
||||
npm run site
|
||||
elif [ "$TEST_TYPE" = test:node ]; then
|
||||
run_test_node
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user