{
[`${prefixCls}-vertical`]: tabPosition === 'left' || tabPosition === 'right',
[`${prefixCls}-card`]: type.indexOf('card') >= 0,
[`${prefixCls}-${type}`]: true,
- [`${prefixCls}-no-animation`]: !animated,
+ [`${prefixCls}-no-animation`]: !tabPaneAnimated,
});
// only card type tabs can be added and closed
let childrenWithClose;
diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md
index 9b3543eb0a..70a8f16df7 100644
--- a/components/tabs/index.zh-CN.md
+++ b/components/tabs/index.zh-CN.md
@@ -37,7 +37,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。
| tabPosition | 页签位置,可选值有 `top` `right` `bottom` `left` | string | 'top' |
| onEdit | 新增和删除页签的回调,在 `type="editable-card"` 时有效 | (targetKey, action): void | 无 |
| hideAdd | 是否隐藏加号图标,在 `type="editable-card"` 时有效 | boolean | false |
-| animated | 是否使用动画切换 Tabs,在 `tabPosition=top|bottom` 时有效 | boolean \| {inkBar:boolean, tabPane:boolean} | true |
+| animated | 是否使用动画切换 Tabs,在 `tabPosition=top|bottom` 时有效 | boolean \| {inkBar:boolean, tabPane:boolean} | true, 当 type="card" 时为 false |
### Tabs.TabPane
diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx
index fb9ae34877..6dbc9af55a 100644
--- a/components/tag/CheckableTag.tsx
+++ b/components/tag/CheckableTag.tsx
@@ -5,7 +5,7 @@ export interface CheckableTagProps {
prefixCls?: string;
className?: string;
checked: boolean;
- onChange?: (checked: Boolean) => void;
+ onChange?: (checked: boolean) => void;
}
export default class CheckableTag extends React.Component
{
diff --git a/components/upload/UploadList.tsx b/components/upload/UploadList.tsx
index 341cd7a9aa..261f719ed3 100644
--- a/components/upload/UploadList.tsx
+++ b/components/upload/UploadList.tsx
@@ -4,10 +4,10 @@ import Icon from '../icon';
import Tooltip from '../tooltip';
import Progress from '../progress';
import classNames from 'classnames';
-import { UploadListProps } from './interface';
+import { UploadListProps, UploadFile } from './interface';
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
-const previewFile = (file, callback) => {
+const previewFile = (file: File, callback: Function) => {
const reader = new FileReader();
reader.onloadend = () => callback(reader.result);
reader.readAsDataURL(file);
@@ -25,14 +25,14 @@ export default class UploadList extends React.Component {
showPreviewIcon: true,
};
- handleClose = (file) => {
+ handleClose = (file: UploadFile) => {
const onRemove = this.props.onRemove;
if (onRemove) {
onRemove(file);
}
}
- handlePreview = (file, e) => {
+ handlePreview = (file: UploadFile, e) => {
const { onPreview } = this.props;
if (!onPreview) {
return;
diff --git a/components/upload/index.en-US.md b/components/upload/index.en-US.md
index 2264b0736f..d75c8ee419 100644
--- a/components/upload/index.en-US.md
+++ b/components/upload/index.en-US.md
@@ -32,7 +32,7 @@ Uploading is the process of publishing information (web pages, text, pictures, v
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported by old IE**。 | (file, fileList) => `boolean | Promise` | - |
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | Function | - |
| onChange | A callback function, can be executed when uploading state is changing. See [onChange](#onChange) | Function | - |
-| listType | Built-in stylesheets, support for two types: `text` or `picture` | string | 'text'|
+| listType | Built-in stylesheets, support for three types: `text`, `picture` or `picture-card` | string | 'text'|
| onPreview | A callback function, will be executed when file link or preview icon is clicked. | Function(file) | - |
| onRemove | A callback function, will be executed when removing file button is clicked, remove event will be prevented when return value is `false` or a Promise which resolve(false) or reject. | Function(file): `boolean | Promise` | - |
| supportServerRender | Need to be turned on while the server side is rendering.| boolean | false |
diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md
index 8acf9de584..147edec66c 100644
--- a/components/upload/index.zh-CN.md
+++ b/components/upload/index.zh-CN.md
@@ -32,8 +32,8 @@ title: Upload
| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | 无 |
| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传。**注意:该方法不支持老 IE**。 | (file, fileList) => `boolean | Promise` | 无 |
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function | 无 |
-| onChange | 上传文件改变时的状态,详见 onChange | Function | 无 |
-| listType | 上传列表的内建样式,支持两种基本样式 `text` or `picture` | string | 'text'|
+| onChange | 上传文件改变时的状态,详见 [onChange](#onChange) | Function | 无 |
+| listType | 上传列表的内建样式,支持三种基本样式 `text`, `picture` 和 `picture-card` | string | 'text'|
| onPreview | 点击文件链接或预览图标时的回调 | Function(file) | 无 |
| onRemove | 点击移除文件时的回调,返回值为 false 时不移除。支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不移除。 | Function(file): `boolean | Promise` | 无 |
| supportServerRender | 服务端渲染时需要打开这个 | boolean | false |
diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx
index a1db752bec..7774c6a6e6 100755
--- a/components/upload/interface.tsx
+++ b/components/upload/interface.tsx
@@ -6,7 +6,7 @@ export interface HttpRequestHeader {
[key: string]: string;
}
-export interface File {
+export interface UploadFile {
uid: number;
size: number;
name: string;
@@ -21,8 +21,8 @@ export interface File {
}
export interface UploadChangeParam {
- file: File;
- fileList: Array;
+ file: UploadFile;
+ fileList: Array;
event?: { percent: number };
}
@@ -41,20 +41,20 @@ export interface UploadLocale {
export interface UploadProps {
type?: 'drag' | 'select';
name?: string;
- defaultFileList?: Array;
- fileList?: Array;
+ defaultFileList?: Array;
+ fileList?: Array;
action?: string;
- data?: Object | ((file: File) => any);
+ data?: Object | ((file: UploadFile) => any);
headers?: HttpRequestHeader;
showUploadList?: boolean | ShowUploadListInterface;
multiple?: boolean;
accept?: string;
- beforeUpload?: (file: File, FileList: File[]) => boolean | PromiseLike;
+ beforeUpload?: (file: UploadFile, FileList: UploadFile[]) => boolean | PromiseLike;
onChange?: (info: UploadChangeParam) => void;
listType?: 'text' | 'picture' | 'picture-card';
className?: string;
- onPreview?: (file: File) => void;
- onRemove?: (file: File) => void | boolean;
+ onPreview?: (file: UploadFile) => void;
+ onRemove?: (file: UploadFile) => void | boolean;
supportServerRender?: boolean;
style?: React.CSSProperties;
disabled?: boolean;
@@ -66,9 +66,9 @@ export interface UploadProps {
export interface UploadListProps {
listType?: 'text' | 'picture' | 'picture-card';
- onPreview?: (file: File) => void;
- onRemove?: (file: File) => void | boolean;
- items?: Array;
+ onPreview?: (file: UploadFile) => void;
+ onRemove?: (file: UploadFile) => void | boolean;
+ items?: Array;
progressAttr?: Object;
prefixCls?: string;
showRemoveIcon?: boolean;
diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md
index 936666026f..5d5e3125b8 100644
--- a/docs/react/use-with-create-react-app.en-US.md
+++ b/docs/react/use-with-create-react-app.en-US.md
@@ -246,5 +246,6 @@ Finally, we used antd with create-react-app successfully, you can learn these pr
There are a lot of great boilerplates like create-react-app in React community. There are some source code samples of importing antd in them if you encounter some problems.
- [create-react-app-antd](https://github.com/ant-design/create-react-app-antd)
+- [comerc/cra-ts-antd](https://github.com/comerc/cra-ts-antd)
- [react-boilerplate/react-boilerplate](https://github.com/ant-design/react-boilerplate)
- [kriasoft/react-starter-kit](https://github.com/ant-design/react-starter-kit)
diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx
index 32409fee15..ef761594cf 100644
--- a/site/theme/template/Layout/Header.jsx
+++ b/site/theme/template/Layout/Header.jsx
@@ -152,6 +152,7 @@ export default class Header extends React.Component {
dropdownMatchSelectWidth={false}
defaultValue={antdVersion}
onChange={this.handleVersionChange}
+ getPopupContainer={trigger => trigger.parentNode}
>
{versionOptions}
,