diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md
index 6ea553cfb9..6b32aa4938 100644
--- a/CHANGELOG.en-US.md
+++ b/CHANGELOG.en-US.md
@@ -15,6 +15,41 @@ timeline: true
---
+## 3.19.3
+
+`2019-06-06`
+
+- 📝 Add FAQ for DatePicker/RangePicker with `mode` cannot be selected. [#16984](https://github.com/ant-design/ant-design/pull/16984)
+- 🐞 Fix Breadcrumb validateDOMNesting warning. [#16929](https://github.com/ant-design/ant-design/pull/16929)
+- 🐞 Fix Breadcrumb path error when `children` is selected. [#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
+- 🐞 Fix InputNumber with `number` type display native spinner. [#16926](https://github.com/ant-design/ant-design/pull/16926)
+- 🐞 Fix Transfer render Empty when customize without data. [#16925](https://github.com/ant-design/ant-design/pull/16925)
+- 🐞 **Fix Table header extra vertical scrollbar problem.** [#16950](https://github.com/ant-design/ant-design/pull/16950)
+- 🐞 Fix Table miss `border-radius` in Firefox. [#16957](https://github.com/ant-design/ant-design/pull/16957)
+- 🐞 Fix Table error when `rowSelection.getCheckboxProps()` has no return value. [#15224](https://github.com/ant-design/ant-design/pull/15224)
+- 🐞 Fix Table abnormal scrollbar in Chrome when using `title` and `rowSelection`.
+ [#16934](https://github.com/ant-design/ant-design/pull/16934)
+- 🐞 Fix Divider `orientation="center"` style. [#16988](https://github.com/ant-design/ant-design/pull/16988)
+- 🐞 Fix Cascader error when type space. [#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
+- 🐞 Fix missing spanish translations. [#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
+- TypeScript
+ - 🐞 Fix Upload `RcFile` definition. [#16851](https://github.com/ant-design/ant-design/pull/16851)
+ - ⚡️ Export `TextProps` type in Typography. [#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
+
+## 3.19.2
+
+`2019-06-01`
+
+- 🐞 Fix Tabs vertical card mode not scrollable. [#16825](https://github.com/ant-design/ant-design/pull/16825)
+- 🐞 Fix Transfer warn `setStart` on an unmounted component. [#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
+- 💄 Using less variables `@error-color`, `@warning-color` instead of `@text-color-danger`, `@text-color-warning`. [#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
+- 💄 Add warning if Menu use `inlineCollapsed` under Sider. [#16826](https://github.com/ant-design/ant-design/pull/16826)
+- TypeScript
+ - ⚡️ Add `forceSubmenuRender` into MenuProps. [#16827](https://github.com/ant-design/ant-design/pull/16827)
+ - ⚡️ Export `TypographyProps` type. [#16835](https://github.com/ant-design/ant-design/pull/16835)
+ - ⚡️ Add `onChange` prop type definition to Steps. [#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
+ - ⚡️ Add `webkitRelativePath` prop type definition to Upload. [#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
+
## 3.19.1
`2019-05-27`
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 797829cc2b..e31721aeb7 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -15,6 +15,40 @@ timeline: true
---
+## 3.19.3
+
+`2019-06-06`
+
+- 📝 增加 DatePicker/RangePicker 指定 `mode` 后无法选择的文档说明。[#16984](https://github.com/ant-design/ant-design/pull/16984)
+- 🐞 修复 Breadcrumb 的 `validateDOMNesting` 警告信息。[#16929](https://github.com/ant-design/ant-design/pull/16929)
+- 🐞 修复 Breadcrumb 选中子路由时浏览器路径问题。[#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
+- 🐞 修复 InputNumber 设置 `number` 类型时会展示原生按钮的问题。[#16926](https://github.com/ant-design/ant-design/pull/16926)
+- 🐞 修复 Transfer 在自定义列表为空时展示 Empty 样式。[#16925](https://github.com/ant-design/ant-design/pull/16925)
+- 🐞 **修复 Table 头部多余的垂直滚动条样式。**[#16950](https://github.com/ant-design/ant-design/pull/16950)
+- 🐞 修复 Table 的 `rowSelection.getCheckboxProps()` 在没有返回值时报错的问题。[#15224](https://github.com/ant-design/ant-design/pull/15224)
+- 🐞 修复 Firefox 的 Table 丢失 `border-radius` 样式问题。[#16957](https://github.com/ant-design/ant-design/pull/16957)
+- 🐞 修复 Table 当 `title` 和 `rowSelection` 同时指定时在 Chrome 下滚动条异常的问题。[#16934](https://github.com/ant-design/ant-design/pull/16934)
+- 🐞 修复 Divider `orientation="center"` 时样式错位的问题。[#16988](https://github.com/ant-design/ant-design/pull/16988)
+- 🐞 修复 Cascader 搜索时不支持空格输入的问题。[#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
+- 🐞 修复部分组件的西班牙语言翻译。[#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
+- TypeScript
+ - 🐞 修复 Upload 的 `RcFile` 类型定义。[#16851](https://github.com/ant-design/ant-design/pull/16851)
+ - ⚡️ 导出 Typography 中 `TextProps` 的类型定义。[#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
+
+## 3.19.2
+
+`2019-06-01`
+
+- 🐞 修复 Tabs 在垂直卡片模式下标签不能滚动的问题。[#16825](https://github.com/ant-design/ant-design/pull/16825)
+- 🐞 修复 Transfer 组件在 unmount 时 `setState` 警告。[#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
+- 💄 使用 Less 变量 `@error-color`、`@warning-color` 代替 `@text-color-danger`、`@text-color-warning`。[#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
+- 💄 增加在 Sider 内 Menu 使用 `inlineCollapsed` 时的提示信息。[#16826](https://github.com/ant-design/ant-design/pull/16826)
+- TypeScript
+ - ⚡️ 增加 Menu 中 `forceSubMenuRender` 类型定义。[#16827](https://github.com/ant-design/ant-design/pull/16827)
+ - ⚡️ 导出 Typography 类型定义。[#16835](https://github.com/ant-design/ant-design/pull/16835)
+ - ⚡️ 增加 Steps 中的 `onChange` 类型定义。[#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
+ - ⚡️ 增加 Upload 中 `webkitRelativePath` 类型定义。[#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
+
## 3.19.1
`2019-05-27`
diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
index f30f2613f6..1069a87819 100644
--- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
@@ -443,6 +443,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
>
- 更多
+ more
);
@@ -78,7 +78,7 @@ const options = dataSource
{group.children.map(opt => (
{opt.title}
- {opt.count} 人 关注
+ {opt.count} people
))}
@@ -86,7 +86,7 @@ const options = dataSource
.concat([
- 查看所有结果
+ View all results
,
]);
diff --git a/components/auto-complete/demo/uncertain-category.md b/components/auto-complete/demo/uncertain-category.md
index 28e6822472..dec42e5128 100644
--- a/components/auto-complete/demo/uncertain-category.md
+++ b/components/auto-complete/demo/uncertain-category.md
@@ -42,7 +42,7 @@ function renderOption(item) {
- {item.query} 在
+ Found {item.query} on
{item.category}
- 区块中
-
约 {item.count} 个结果
+
{item.count} results
);
@@ -85,7 +84,12 @@ class Complete extends React.Component {
>
+
}
@@ -116,10 +120,6 @@ ReactDOM.render( , mountNode);
padding-right: 62px;
}
-.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
- right: 0;
-}
-
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md
index 70e4a9f8cb..6d2edb45b0 100644
--- a/components/auto-complete/index.zh-CN.md
+++ b/components/auto-complete/index.zh-CN.md
@@ -31,6 +31,7 @@ const dataSource = ['12345', '23456', '34567'];
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 |
| disabled | 是否禁用 | boolean | false |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
+| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
| placeholder | 输入框提示 | string | - |
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 |
diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx
index 8a6a39c765..24d3066e26 100755
--- a/components/breadcrumb/Breadcrumb.tsx
+++ b/components/breadcrumb/Breadcrumb.tsx
@@ -70,6 +70,24 @@ export default class Breadcrumb extends React.Component {
'see: https://u.ant.design/item-render.',
);
}
+
+ getPath = (path: string, params: any) => {
+ path = (path || '').replace(/^\//, '');
+ Object.keys(params).forEach(key => {
+ path = path.replace(`:${key}`, params[key]);
+ });
+ return path;
+ }
+
+ addChildPath = (paths: string[], childPath: string = '', params: any) => {
+ const originalPaths = [...paths];
+ const path = this.getPath(childPath, params);
+ if (path) {
+ originalPaths.push(path);
+ }
+ return originalPaths;
+ }
+
genForRoutes = ({
routes = [],
params = {},
@@ -78,11 +96,7 @@ export default class Breadcrumb extends React.Component {
}: BreadcrumbProps) => {
const paths: string[] = [];
return routes.map(route => {
- route.path = route.path || '';
- let path = route.path.replace(/^\//, '');
- Object.keys(params).forEach(key => {
- path = path.replace(`:${key}`, params[key]);
- });
+ const path = this.getPath(route.path, params);
if (path) {
paths.push(path);
@@ -93,10 +107,12 @@ export default class Breadcrumb extends React.Component {
overlay = (
{route.children.map(child => (
-
- {itemRender(child, params, routes, paths)}
-
- ))}
+
+ {
+ itemRender(child, params, routes, this.addChildPath(paths, child.path, params))
+ }
+
+ ))}
);
}
diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx
index 851f92199e..37936f4f81 100644
--- a/components/breadcrumb/BreadcrumbItem.tsx
+++ b/components/breadcrumb/BreadcrumbItem.tsx
@@ -71,10 +71,10 @@ export default class BreadcrumbItem extends React.Component
-
+
{breadcrumbItem}
-
+
);
}
diff --git a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap
index 1f82c45588..c5cb3931cc 100644
--- a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap
+++ b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap
@@ -71,42 +71,43 @@ exports[`Breadcrumb should render a menu 1`] = `
-
-
-
+
+ first
+
+
+
+
+
+
+
+
+
- first
-
-
-
-
-
-
-
-
- /
+ /
+
-
-
-
- Ant Design
-
-
- /
-
+
+
+ /
+
+
`;
diff --git a/components/breadcrumb/demo/overlay.md b/components/breadcrumb/demo/overlay.md
index 0789262d9b..11f839c0e5 100644
--- a/components/breadcrumb/demo/overlay.md
+++ b/components/breadcrumb/demo/overlay.md
@@ -37,18 +37,16 @@ const menu = (
);
ReactDOM.render(
- ,
+
+ Ant Design
+
+ Component
+
+
+ General
+
+ Button
+ ,
mountNode,
);
```
diff --git a/components/button/demo/basic.md b/components/button/demo/basic.md
index d1a0621650..98fbfa3666 100644
--- a/components/button/demo/basic.md
+++ b/components/button/demo/basic.md
@@ -7,11 +7,11 @@ title:
## zh-CN
-按钮有四种类型:主按钮、次按钮、虚线按钮、危险按钮。主按钮在同一个操作区域最多出现一次。
+按钮有五种类型:主按钮、次按钮、虚线按钮、危险按钮和链接按钮。主按钮在同一个操作区域最多出现一次。
## en-US
-There are `primary` button, `default` button, `dashed` button and `danger` button in antd.
+There are `primary` button, `default` button, `dashed` button, `danger` button and `link` button in antd.
```jsx
import { Button } from 'antd';
diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx
index 676e7e95f3..17fc1dbbe5 100644
--- a/components/cascader/index.tsx
+++ b/components/cascader/index.tsx
@@ -292,7 +292,8 @@ class Cascader extends React.Component {
};
handleKeyDown = (e: React.KeyboardEvent) => {
- if (e.keyCode === KeyCode.BACKSPACE) {
+ // SPACE => https://github.com/ant-design/ant-design/issues/16871
+ if (e.keyCode === KeyCode.BACKSPACE || e.keyCode === KeyCode.SPACE) {
e.stopPropagation();
}
};
diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less
index 6e136528a0..2e7d5ea1f2 100644
--- a/components/checkbox/style/mixin.less
+++ b/components/checkbox/style/mixin.less
@@ -175,7 +175,7 @@
// 半选状态
.@{checkbox-prefix-cls}-indeterminate {
.@{checkbox-inner-prefix-cls} {
- background-color: #fff;
+ background-color: @component-background;
border-color: @border-color-base;
}
.@{checkbox-inner-prefix-cls}::after {
diff --git a/components/collapse/style/index.less b/components/collapse/style/index.less
index 45a3416252..47d016cc2d 100644
--- a/components/collapse/style/index.less
+++ b/components/collapse/style/index.less
@@ -37,9 +37,7 @@
top: 50%;
left: @padding-md;
display: inline-block;
- margin-top: 2px;
font-size: @font-size-sm;
- line-height: 46px;
transform: translateY(-50%);
& svg {
diff --git a/components/comment/style/index.less b/components/comment/style/index.less
index 78548a27ab..b83a734477 100644
--- a/components/comment/style/index.less
+++ b/components/comment/style/index.less
@@ -27,25 +27,25 @@
position: relative;
flex: 1 1 auto;
min-width: 1px;
- font-size: 14px;
+ font-size: @comment-font-size-base;
word-wrap: break-word;
&-author {
display: flex;
justify-content: flex-start;
margin-bottom: 4px;
- font-size: 14px;
+ font-size: @comment-font-size-base;
& > a,
& > span {
height: 18px;
padding-right: 8px;
- font-size: 12px;
+ font-size: @comment-font-size-sm;
line-height: 18px;
}
&-name {
color: @comment-author-name-color;
- font-size: 14px;
+ font-size: @comment-font-size-base;
transition: color 0.3s;
> * {
color: @comment-author-name-color;
@@ -76,7 +76,7 @@
> span {
padding-right: 10px;
color: @comment-action-color;
- font-size: 12px;
+ font-size: @comment-font-size-sm;
cursor: pointer;
transition: color 0.3s;
user-select: none;
diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap
index 902e5564ae..abe53c9504 100644
--- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap
+++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap
@@ -8175,6 +8175,7 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
= createReactContext({
+const ConfigContext = createReactContext({
// We provide a default function for Context without provider
getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => {
if (customizePrefixCls) return customizePrefixCls;
diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md
index ab98720446..a4b9922b50 100644
--- a/components/date-picker/index.en-US.md
+++ b/components/date-picker/index.en-US.md
@@ -135,3 +135,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
margin: 0 8px 12px 0;
}
+
+## FAQ
+
+- [When set mode to DatePicker/RangePicker, cannot select year or month anymore?](/docs/react/faq#When-set-mode-to-DatePicker/RangePicker,-cannot-select-year-or-month-anymore?)
diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md
index 21fc1d72d1..41f8361903 100644
--- a/components/date-picker/index.zh-CN.md
+++ b/components/date-picker/index.zh-CN.md
@@ -138,3 +138,7 @@ moment.locale('zh-cn');
margin: 0 8px 12px 0;
}
+
+## FAQ
+
+- [当我指定了 DatePicker/RangePicker 的 `mode` 属性后,点击后无法选择年份/月份?](/docs/react/faq-cn#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)
diff --git a/components/date-picker/locale/ar_EG.tsx b/components/date-picker/locale/ar_EG.tsx
index fcdaa12adc..ad840b669b 100644
--- a/components/date-picker/locale/ar_EG.tsx
+++ b/components/date-picker/locale/ar_EG.tsx
@@ -11,6 +11,10 @@ const locale = {
timePickerLocale: {
...TimePickerLocale,
},
+ dateFormat: 'DD-MM-YYYY',
+ monthFormat: 'MM-YYYY',
+ dateTimeFormat: 'DD-MM-YYYY HH:mm:ss',
+ weekFormat: 'wo-YYYY',
};
// All settings at:
diff --git a/components/divider/__tests__/__snapshots__/demo.test.js.snap b/components/divider/__tests__/__snapshots__/demo.test.js.snap
index 9e7906d16f..22c9b07680 100644
--- a/components/divider/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/divider/__tests__/__snapshots__/demo.test.js.snap
@@ -12,7 +12,7 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
= props => (
const {
prefixCls: customizePrefixCls,
type = 'horizontal',
- orientation = '',
+ orientation = 'center',
className,
children,
dashed,
diff --git a/components/divider/style/index.less b/components/divider/style/index.less
index bb3110481c..78fab57b2d 100644
--- a/components/divider/style/index.less
+++ b/components/divider/style/index.less
@@ -18,6 +18,7 @@
margin: 0 8px;
vertical-align: middle;
}
+
&-horizontal {
display: block;
clear: both;
@@ -27,7 +28,7 @@
margin: 24px 0;
}
- &-horizontal&-with-text,
+ &-horizontal&-with-text-center,
&-horizontal&-with-text-left,
&-horizontal&-with-text-right {
display: table;
@@ -89,7 +90,7 @@
background: none;
border-top: 1px dashed @border-color-split;
}
- &-horizontal&-with-text&-dashed,
+ &-horizontal&-with-text-center&-dashed,
&-horizontal&-with-text-left&-dashed,
&-horizontal&-with-text-right&-dashed {
border-top: 0;
diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx
index 9723d6b35e..c0aa13d6cd 100644
--- a/components/drawer/index.tsx
+++ b/components/drawer/index.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import RcDrawer from 'rc-drawer';
-import createReactContext, { Context } from '@ant-design/create-react-context';
+import createReactContext from '@ant-design/create-react-context';
import warning from '../_util/warning';
import classNames from 'classnames';
import Icon from '../icon';
import { withConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { tuple } from '../_util/type';
-const DrawerContext: Context = createReactContext(null);
+const DrawerContext = createReactContext(null);
type EventType = React.MouseEvent | React.MouseEvent;
diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less
index 2c249ea90c..024684b1aa 100644
--- a/components/dropdown/style/index.less
+++ b/components/dropdown/style/index.less
@@ -102,7 +102,7 @@
&-selected,
&-selected > a {
- color: @primary-color;
+ color: @dropdown-selected-color;
background-color: @item-active-bg;
}
diff --git a/components/form/context.ts b/components/form/context.ts
index 9caf0828fc..1a9508000b 100644
--- a/components/form/context.ts
+++ b/components/form/context.ts
@@ -1,4 +1,4 @@
-import createReactContext, { Context } from '@ant-design/create-react-context';
+import createReactContext from '@ant-design/create-react-context';
import { ColProps } from '../grid/col';
import { FormLabelAlign } from './FormItem';
@@ -10,7 +10,7 @@ export interface FormContextProps {
wrapperCol?: ColProps;
}
-export const FormContext: Context = createReactContext({
+export const FormContext = createReactContext({
labelAlign: 'right',
vertical: false,
});
diff --git a/components/input-number/style/index.less b/components/input-number/style/index.less
index 597c38ac39..8cf7efed1f 100644
--- a/components/input-number/style/index.less
+++ b/components/input-number/style/index.less
@@ -77,8 +77,14 @@
border-radius: @border-radius-base;
outline: 0;
transition: all 0.3s linear;
- -moz-appearance: textfield;
+ -moz-appearance: textfield !important;
.placeholder();
+
+ &[type='number']::-webkit-inner-spin-button,
+ &[type='number']::-webkit-outer-spin-button {
+ margin: 0;
+ -webkit-appearance: none;
+ }
}
&-lg {
diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less
index f8a917d4d1..0bc2b8f0c6 100644
--- a/components/input/style/mixin.less
+++ b/components/input/style/mixin.less
@@ -8,11 +8,13 @@
height: @input-height-lg;
padding: @input-padding-vertical-lg @input-padding-horizontal-lg;
font-size: @font-size-lg;
+ line-height: @input-height-lg;
}
.input-sm() {
height: @input-height-sm;
padding: @input-padding-vertical-sm @input-padding-horizontal-sm;
+ line-height: @input-height-sm;
}
// input status
@@ -49,7 +51,7 @@
padding: @input-padding-vertical-base @input-padding-horizontal-base;
color: @input-color;
font-size: @font-size-base;
- line-height: @line-height-base;
+ line-height: @input-height-base;
background-color: @input-bg;
background-image: none;
border: @border-width-base @border-style-base @input-border-color;
diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx
index 8a03fdb73d..8b2e829757 100644
--- a/components/layout/layout.tsx
+++ b/components/layout/layout.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
-import createContext, { Context } from '@ant-design/create-react-context';
+import createContext from '@ant-design/create-react-context';
import { SiderProps } from './Sider';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
@@ -19,7 +19,7 @@ export interface LayoutContextProps {
removeSider: (id: string) => void;
};
}
-export const LayoutContext: Context = createContext({
+export const LayoutContext = createContext({
siderHook: {
addSider: () => null,
removeSider: () => null,
diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
index 58ed236d84..e602e45bf0 100644
--- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
+++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
@@ -7523,6 +7523,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
= createContext({
+export const MenuContext = createContext({
inlineCollapsed: false,
});
diff --git a/components/menu/style/index.less b/components/menu/style/index.less
index 78b21fb68b..acbfdef49e 100644
--- a/components/menu/style/index.less
+++ b/components/menu/style/index.less
@@ -43,6 +43,10 @@
padding 0.15s @ease-in-out;
}
+ &-submenu-selected {
+ color: @menu-highlight-color;
+ }
+
&-item:active,
&-submenu-title:active {
background: @menu-item-active-bg;
diff --git a/components/message/demo/other.md b/components/message/demo/other.md
index fb6fd3aadc..bf4089d5ef 100644
--- a/components/message/demo/other.md
+++ b/components/message/demo/other.md
@@ -17,15 +17,15 @@ Messages of success, error and warning types.
import { message, Button } from 'antd';
const success = () => {
- message.success('This is a message of success');
+ message.success('This is a success message');
};
const error = () => {
- message.error('This is a message of error');
+ message.error('This is an error message');
};
const warning = () => {
- message.warning('This is message of warning');
+ message.warning('This is a warning message');
};
ReactDOM.render(
diff --git a/components/modal/__tests__/__snapshots__/Modal.test.js.snap b/components/modal/__tests__/__snapshots__/Modal.test.js.snap
index 426532fc28..d2d8fa5417 100644
--- a/components/modal/__tests__/__snapshots__/Modal.test.js.snap
+++ b/components/modal/__tests__/__snapshots__/Modal.test.js.snap
@@ -28,6 +28,7 @@ exports[`Modal render correctly 1`] = `
{
const titlePrefixCls = `${prefixCls}-title-view`;
if (title || subTitle || tags || extra) {
return (
-
+
{title &&
{title} }
{subTitle &&
{subTitle} }
{tags &&
{tags} }
diff --git a/components/page-header/style/index.less b/components/page-header/style/index.less
index 82535759c0..c47cb73d41 100644
--- a/components/page-header/style/index.less
+++ b/components/page-header/style/index.less
@@ -65,10 +65,10 @@
top: 16px;
right: @page-header-padding-horizontal;
> * {
- margin-right: 8px;
+ margin-left: 8px;
}
- > *:last-child {
- margin-right: 0;
+ > *:first-child {
+ margin-left: 0;
}
}
}
diff --git a/components/pagination/index.en-US.md b/components/pagination/index.en-US.md
index 6174db2ce0..a3b0a70d16 100644
--- a/components/pagination/index.en-US.md
+++ b/components/pagination/index.en-US.md
@@ -31,6 +31,7 @@ A long list can be divided into several pages by `Pagination`, and only one page
| showLessItems | show less page items | boolean | false | |
| showQuickJumper | determine whether you can jump to pages directly | boolean \| `{ goButton: ReactNode }` | false | |
| showSizeChanger | determine whether `pageSize` can be changed | boolean | false | |
+| showTitle | show page items title | boolean | true | |
| showTotal | to display the total number and range | Function(total, range) | - | |
| simple | whether to use simple mode | boolean | - | |
| size | specify the size of `Pagination`, can be set to `small` | string | "" | |
diff --git a/components/style/themes/default.less b/components/style/themes/default.less
index 00e3fd42ae..f9c51a11be 100644
--- a/components/style/themes/default.less
+++ b/components/style/themes/default.less
@@ -47,8 +47,6 @@
@code-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
@text-color: fade(@black, 65%);
@text-color-secondary: fade(@black, 45%);
-@text-color-warning: @gold-7;
-@text-color-danger: @red-7;
@text-color-inverse: @white;
@icon-color: inherit;
@icon-color-hover: fade(@black, 75%);
@@ -155,7 +153,7 @@
@btn-primary-bg: @primary-color;
@btn-default-color: @text-color;
-@btn-default-bg: #fff;
+@btn-default-bg: @component-background;
@btn-default-border: @border-color-base;
@btn-danger-color: @error-color;
@@ -188,6 +186,10 @@
@checkbox-check-color: #fff;
@checkbox-border-width: @border-width-base;
+// Dropdown
+
+@dropdown-selected-color: @primary-color;
+
// Empty
@empty-font-size: @font-size-base;
@@ -311,7 +313,7 @@
@input-placeholder-color: hsv(0, 0, 75%);
@input-color: @text-color;
@input-border-color: @border-color-base;
-@input-bg: #fff;
+@input-bg: @component-background;
@input-number-handler-active-bg: #f4f4f4;
@input-addon-bg: @background-color-light;
@input-hover-border-color: @primary-color;
@@ -341,7 +343,7 @@
// Popover
// ---
// Popover body background color
-@popover-bg: #fff;
+@popover-bg: @component-background;
// Popover text color
@popover-color: @text-color;
// Popover maximum width
@@ -381,6 +383,7 @@
@menu-item-active-bg: @item-active-bg;
@menu-item-active-border-width: 3px;
@menu-item-group-title-color: @text-color-secondary;
+
// dark theme
@menu-dark-color: @text-color-secondary-dark;
@menu-dark-bg: @layout-header-background;
@@ -459,6 +462,8 @@
// ---
@comment-padding-base: 16px 0;
@comment-nest-indent: 44px;
+@comment-font-size-base: @font-size-base;
+@comment-font-size-sm: @font-size-sm;
@comment-author-name-color: @text-color-secondary;
@comment-author-time-color: #ccc;
@comment-action-color: @text-color-secondary;
diff --git a/components/table/Table.tsx b/components/table/Table.tsx
index c6273fb374..ed5eab8828 100755
--- a/components/table/Table.tsx
+++ b/components/table/Table.tsx
@@ -156,7 +156,8 @@ export default class Table
extends React.Component, TableState<
const key = this.getRecordKey(item, index);
// Cache checkboxProps
if (!this.CheckboxPropsCache[key]) {
- const checkboxProps = (this.CheckboxPropsCache[key] = rowSelection.getCheckboxProps(item));
+ this.CheckboxPropsCache[key] = rowSelection.getCheckboxProps(item) || {};
+ const checkboxProps = this.CheckboxPropsCache[key];
warning(
!('checked' in checkboxProps) && !('defaultChecked' in checkboxProps),
'Table',
@@ -413,6 +414,9 @@ export default class Table extends React.Component, TableState<
if (!column.sorter) {
return;
}
+
+ const pagination = { ...this.state.pagination };
+
const sortDirections = column.sortDirections || (this.props.sortDirections as SortOrder[]);
const { sortOrder, sortColumn } = this.state;
// 只同时允许一列进行排序,否则会导致排序顺序的逻辑问题
@@ -427,7 +431,14 @@ export default class Table extends React.Component, TableState<
newSortOrder = sortDirections[0];
}
+ if (this.props.pagination) {
+ // Reset current prop
+ pagination.current = 1;
+ pagination.onChange!(pagination.current);
+ }
+
const newState = {
+ pagination,
sortOrder: newSortOrder,
sortColumn: newSortOrder ? column : null,
};
diff --git a/components/table/__tests__/Table.sorter.test.js b/components/table/__tests__/Table.sorter.test.js
index 2200810841..7d3abdfc79 100644
--- a/components/table/__tests__/Table.sorter.test.js
+++ b/components/table/__tests__/Table.sorter.test.js
@@ -587,4 +587,23 @@ describe('Table.sorter', () => {
wrapper.find('.ant-table-column-sorters').simulate('click');
expect(renderedNames(wrapper)).toEqual(['Jack', 'Lucy', 'Tom', 'Jerry']);
});
+
+ it('pagination back', () => {
+ const onPageChange = jest.fn();
+ const onChange = jest.fn();
+
+ const wrapper = mount(
+ createTable({
+ pagination: {
+ pageSize: 2,
+ onChange: onPageChange,
+ },
+ onChange,
+ }),
+ );
+
+ wrapper.find('.ant-table-column-sorters').simulate('click');
+ expect(onChange.mock.calls[0][0].current).toBe(1);
+ expect(onPageChange.mock.calls[0][0]).toBe(1);
+ });
});
diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap
index 749e4ad733..e1b2d745c4 100755
--- a/components/table/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/table/__tests__/__snapshots__/demo.test.js.snap
@@ -8877,7 +8877,9 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
-
+
-
+
tr {
- // For Chrome extra space:
- // - https://github.com/ant-design/ant-design/issues/14926
- // - https://github.com/ant-design/ant-design/issues/16131
+ &-thead > tr > th {
+ color: @table-header-color;
+ font-weight: 500;
+ text-align: left;
background: @table-header-bg;
+ border-bottom: @border-width-base @border-style-base @border-color-split;
+ transition: background 0.3s ease;
- > th {
- color: @table-header-color;
- font-weight: 500;
- text-align: left;
- background: transparent;
- border-bottom: @border-width-base @border-style-base @border-color-split;
- transition: background 0.3s ease;
+ &[colspan] {
+ text-align: center;
+ }
- &[colspan] {
- text-align: center;
- }
+ .@{iconfont-css-prefix}-filter,
+ .@{table-prefix-cls}-filter-icon {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 28px;
+ height: 100%;
+ color: @table-header-icon-color;
+ font-size: @font-size-sm;
+ text-align: center;
+ cursor: pointer;
+ transition: all 0.3s;
- .@{iconfont-css-prefix}-filter,
- .@{table-prefix-cls}-filter-icon {
+ > svg {
position: absolute;
- top: 0;
- right: 0;
- width: 28px;
- height: 100%;
+ top: 50%;
+ left: 50%;
+ margin-top: -@font-size-sm / 2 + 1px;
+ margin-left: -@font-size-sm / 2;
+ }
+ }
+
+ .@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix}-filter {
+ color: @primary-color;
+ }
+
+ .@{table-prefix-cls}-column-sorter {
+ display: table-cell;
+ vertical-align: middle;
+
+ .@{table-prefix-cls}-column-sorter-inner {
+ height: 1em;
+ margin-top: 0.35em;
+ margin-left: 0.57142857em;
color: @table-header-icon-color;
- font-size: @font-size-sm;
+ line-height: 1em;
text-align: center;
- cursor: pointer;
transition: all 0.3s;
- > svg {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: -@font-size-sm / 2 + 1px;
- margin-left: -@font-size-sm / 2;
- }
- }
+ .@{table-prefix-cls}-column-sorter-up,
+ .@{table-prefix-cls}-column-sorter-down {
+ .iconfont-size-under-12px(11px);
- .@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix}-filter {
- color: @primary-color;
- }
-
- .@{table-prefix-cls}-column-sorter {
- display: table-cell;
- vertical-align: middle;
-
- .@{table-prefix-cls}-column-sorter-inner {
+ display: block;
height: 1em;
- margin-top: 0.35em;
- margin-left: 0.57142857em;
- color: @table-header-icon-color;
line-height: 1em;
- text-align: center;
transition: all 0.3s;
+ &.on {
+ color: @primary-color;
+ }
+ }
+
+ &-full {
+ margin-top: -0.15em;
.@{table-prefix-cls}-column-sorter-up,
.@{table-prefix-cls}-column-sorter-down {
- .iconfont-size-under-12px(11px);
-
- display: block;
- height: 1em;
- line-height: 1em;
- transition: all 0.3s;
- &.on {
- color: @primary-color;
- }
+ height: 0.5em;
+ line-height: 0.5em;
}
- &-full {
- margin-top: -0.15em;
-
- .@{table-prefix-cls}-column-sorter-up,
- .@{table-prefix-cls}-column-sorter-down {
- height: 0.5em;
- line-height: 0.5em;
- }
-
- .@{table-prefix-cls}-column-sorter-down {
- margin-top: 0.125em;
- }
+ .@{table-prefix-cls}-column-sorter-down {
+ margin-top: 0.125em;
}
}
}
+ }
- &.@{table-prefix-cls}-column-has-actions {
- position: relative;
- background-clip: padding-box; // For Firefox background bug, https://github.com/ant-design/ant-design/issues/12628
+ &.@{table-prefix-cls}-column-has-actions {
+ position: relative;
+ background-clip: padding-box; // For Firefox background bug, https://github.com/ant-design/ant-design/issues/12628
+ /* stylelint-disable-next-line */
+ -webkit-background-clip: border-box; // For Chrome extra space: https://github.com/ant-design/ant-design/issues/14926
- &.@{table-prefix-cls}-column-has-filters {
- // https://github.com/ant-design/ant-design/issues/12650
- padding-right: 30px !important;
+ &.@{table-prefix-cls}-column-has-filters {
+ // https://github.com/ant-design/ant-design/issues/12650
+ padding-right: 30px !important;
+ .@{iconfont-css-prefix}-filter,
+ .@{table-prefix-cls}-filter-icon {
+ &.@{table-prefix-cls}-filter-open {
+ color: @text-color-secondary;
+ background: @table-header-filter-active-bg;
+ }
+ }
+ // Very complicated styles logic but necessary
+ &:hover {
.@{iconfont-css-prefix}-filter,
.@{table-prefix-cls}-filter-icon {
- &.@{table-prefix-cls}-filter-open {
+ &:hover {
color: @text-color-secondary;
background: @table-header-filter-active-bg;
}
- }
- // Very complicated styles logic but necessary
- &:hover {
- .@{iconfont-css-prefix}-filter,
- .@{table-prefix-cls}-filter-icon {
- &:hover {
- color: @text-color-secondary;
- background: @table-header-filter-active-bg;
- }
- &:active {
- color: @text-color;
- }
+ &:active {
+ color: @text-color;
}
}
}
-
- &.@{table-prefix-cls}-column-has-sorters {
- cursor: pointer;
- &:hover {
- background: @table-header-sort-active-bg;
- .@{iconfont-css-prefix}-filter,
- .@{table-prefix-cls}-filter-icon {
- background: @table-header-sort-active-bg;
- }
- }
- &:active {
- .@{table-prefix-cls}-column-sorter-up:not(.on),
- .@{table-prefix-cls}-column-sorter-down:not(.on) {
- color: @text-color-secondary;
- }
- }
- }
- }
-
- .@{table-prefix-cls}-header-column {
- display: inline-block;
- vertical-align: top;
-
- .@{table-prefix-cls}-column-sorters {
- display: table;
-
- > .@{table-prefix-cls}-column-title {
- display: table-cell;
- vertical-align: middle;
- }
-
- > *:not(.@{table-prefix-cls}-column-sorter) {
- position: relative;
- }
- &::before {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background: transparent;
- transition: all 0.3s;
- content: '';
- }
- &:hover::before {
- background: rgba(0, 0, 0, 0.04);
- }
- }
}
&.@{table-prefix-cls}-column-has-sorters {
- user-select: none;
+ cursor: pointer;
+ &:hover {
+ background: @table-header-sort-active-bg;
+ .@{iconfont-css-prefix}-filter,
+ .@{table-prefix-cls}-filter-icon {
+ background: @table-header-sort-active-bg;
+ }
+ }
+ &:active {
+ .@{table-prefix-cls}-column-sorter-up:not(.on),
+ .@{table-prefix-cls}-column-sorter-down:not(.on) {
+ color: @text-color-secondary;
+ }
+ }
}
}
+
+ .@{table-prefix-cls}-header-column {
+ display: inline-block;
+ vertical-align: top;
+
+ .@{table-prefix-cls}-column-sorters {
+ display: table;
+
+ > .@{table-prefix-cls}-column-title {
+ display: table-cell;
+ vertical-align: middle;
+ }
+
+ > *:not(.@{table-prefix-cls}-column-sorter) {
+ position: relative;
+ }
+ &::before {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: transparent;
+ transition: all 0.3s;
+ content: '';
+ }
+ &:hover::before {
+ background: rgba(0, 0, 0, 0.04);
+ }
+ }
+ }
+
+ &.@{table-prefix-cls}-column-has-sorters {
+ user-select: none;
+ }
}
&-thead > tr:first-child > th {
@@ -248,6 +243,10 @@
}
}
+ &-thead > tr:hover {
+ background: none;
+ }
+
&-footer {
position: relative;
padding: @table-padding-vertical @table-padding-horizontal;
@@ -284,8 +283,8 @@
&-title + &-content {
position: relative;
- overflow: hidden;
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
+
.@{table-prefix-cls}-bordered & {
&,
table,
@@ -611,6 +610,32 @@
// Workaround for additional scroll bar on the table header
// https://github.com/ant-design/ant-design/issues/6515#issuecomment-419634369
opacity: 0.9999;
+
+ &::-webkit-scrollbar {
+ border: 1px solid @border-color-split;
+ border-width: 0 0 1px 0;
+ }
+ }
+
+ &-hide-scrollbar {
+ // https://github.com/ant-design/ant-design/issues/4637
+ // https://stackoverflow.com/a/54101063
+ // https://github.com/react-component/table/pull/333
+ scrollbar-color: transparent transparent;
+ &::-webkit-scrollbar {
+ background-color: transparent;
+ }
+ }
+
+ // optimize header style of borderd table after hide extra scrollbar
+ &-bordered&-fixed-header &-scroll &-header {
+ &::-webkit-scrollbar {
+ border: 1px solid @border-color-split;
+ border-width: 1px 1px 1px 0;
+ }
+ &.@{table-prefix-cls}-hide-scrollbar .@{table-prefix-cls}-thead > tr > th:last-child {
+ border-right-color: transparent;
+ }
}
&-fixed-left,
@@ -708,4 +733,15 @@
}
}
+/**
+* Another fix of Firefox:
+* - https://github.com/ant-design/ant-design/issues/12628
+* - https://github.com/ant-design/ant-design/issues/12628
+*/
+@supports (-moz-appearance: meterbar) {
+ .@{table-prefix-cls}-thead > tr > th.@{table-prefix-cls}-column-has-actions {
+ background-clip: padding-box;
+ }
+}
+
@import './size';
diff --git a/components/time-picker/style/index.less b/components/time-picker/style/index.less
index 372d2e91d7..0785200e0c 100644
--- a/components/time-picker/style/index.less
+++ b/components/time-picker/style/index.less
@@ -225,3 +225,14 @@
right: @control-padding-horizontal-sm - 1px;
}
}
+
+// Fix cursor height in safari
+// https://stackoverflow.com/q/3843408/3040605
+// https://browserstrangeness.github.io/css_hacks.html#safari
+@media not all and (min-resolution: 0.001dpcm) {
+ @supports (-webkit-appearance: none) and (stroke-color: transparent) {
+ .@{ant-prefix}-input {
+ line-height: @line-height-base;
+ }
+ }
+}
diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx
index 80f68ab2e1..ebbe21edc2 100644
--- a/components/transfer/list.tsx
+++ b/components/transfer/list.tsx
@@ -159,26 +159,25 @@ export default class TransferList extends React.Component
) : null;
- const searchNotFound = !filteredItems.length && (
- {notFoundContent}
- );
-
let listBody: React.ReactNode = bodyDom;
if (!listBody) {
- let bodyNode: React.ReactNode = searchNotFound;
- if (!bodyNode) {
- const { bodyContent, customize } = renderListNode(renderList, {
- ...omit(this.props, OmitProps),
- filteredItems,
- filteredRenderItems,
- selectedKeys: checkedKeys,
- });
+ let bodyNode: React.ReactNode;
- // We should wrap customize list body in a classNamed div to use flex layout.
- bodyNode = customize ? (
- {bodyContent}
- ) : (
+ const { bodyContent, customize } = renderListNode(renderList, {
+ ...omit(this.props, OmitProps),
+ filteredItems,
+ filteredRenderItems,
+ selectedKeys: checkedKeys,
+ });
+
+ // We should wrap customize list body in a classNamed div to use flex layout.
+ if (customize) {
+ bodyNode = {bodyContent}
;
+ } else {
+ bodyNode = filteredItems.length ? (
bodyContent
+ ) : (
+ {notFoundContent}
);
}
diff --git a/components/tree/style/index.less b/components/tree/style/index.less
index ca9053870a..da347b39f7 100644
--- a/components/tree/style/index.less
+++ b/components/tree/style/index.less
@@ -244,7 +244,8 @@
left: 12px;
width: 1px;
height: 100%;
- margin: 22px 0;
+ height: calc(100% - 22px); // Remove additional height if support
+ margin: 22px 0 0;
border-left: 1px solid @border-color-base;
content: ' ';
}
diff --git a/components/typography/Text.tsx b/components/typography/Text.tsx
index 5af5355d3b..25c816521a 100644
--- a/components/typography/Text.tsx
+++ b/components/typography/Text.tsx
@@ -2,7 +2,7 @@ import * as React from 'react';
import warning from '../_util/warning';
import Base, { BlockProps } from './Base';
-interface TextProps extends BlockProps {
+export interface TextProps extends BlockProps {
ellipsis?: boolean;
}
@@ -10,7 +10,7 @@ const Text: React.SFC = ({ ellipsis, ...restProps }) => {
warning(
typeof ellipsis !== 'object',
'Typography.Text',
- '`ellipsis` is only support boolean value.',
+ '`ellipsis` only supports boolean value.',
);
return ;
};
diff --git a/components/typography/style/index.less b/components/typography/style/index.less
index 30c75b8879..47c691b9b9 100644
--- a/components/typography/style/index.less
+++ b/components/typography/style/index.less
@@ -39,11 +39,11 @@
}
&&-warning {
- color: @text-color-warning;
+ color: @warning-color;
}
&&-danger {
- color: @text-color-danger;
+ color: @error-color;
}
&&-disabled {
diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx
index b46711ac72..0efe181cb0 100755
--- a/components/upload/interface.tsx
+++ b/components/upload/interface.tsx
@@ -8,7 +8,8 @@ export interface HttpRequestHeader {
export interface RcFile extends File {
uid: string;
- lastModifiedDate: Date;
+ readonly lastModifiedDate: Date;
+ readonly webkitRelativePath: string;
}
export interface UploadFile {
@@ -27,7 +28,6 @@ export interface UploadFile {
error?: any;
linkProps?: any;
type: string;
- webkitRelativePath?: string;
}
export interface UploadChangeParam {
@@ -59,7 +59,7 @@ export interface UploadProps {
name?: string;
defaultFileList?: Array;
fileList?: Array;
- action?: string | ((file: UploadFile) => string) | ((file: UploadFile) => PromiseLike);
+ action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike);
directory?: boolean;
data?: Object | ((file: UploadFile) => any);
headers?: HttpRequestHeader;
diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md
index ae94949773..01953e1eda 100644
--- a/docs/react/faq.en-US.md
+++ b/docs/react/faq.en-US.md
@@ -106,6 +106,19 @@ If you need some features which should not be included in antd, try to extend an
You can config `nonce` by [ConfigProvider](/components/config-provider/#Content-Security-Policy).
+### When set `mode` to DatePicker/RangePicker, cannot select year or month anymore?
+
+In real world development, you may need a YearPicker, MonthRangePicker or WeekRangePicker. You are trying to add `mode` to DatePicker/RangePicker expected to implement those pickers. However, the DatePicker/RangePicker cannot be selected and the panels won't close now!
+
+- Reproduce link: https://codesandbox.io/s/dank-brook-v1csy
+- Same issues:[#15572](https://github.com/ant-design/ant-design/issues/15572), [#16436](https://github.com/ant-design/ant-design/issues/16436), [#11938](https://github.com/ant-design/ant-design/issues/11938), [#11735](https://github.com/ant-design/ant-design/issues/11735), [#11586](https://github.com/ant-design/ant-design/issues/11586), [#10425](https://github.com/ant-design/ant-design/issues/10425), [#11053](https://github.com/ant-design/ant-design/issues/11053)
+
+Like [the explaination](https://github.com/ant-design/ant-design/issues/11586#issuecomment-429189877) here, that is because ` ` do not equal to `YearPicker`, ` ` do not equal to `MonthRangePicker` either. The `mode` property was added to support [showing time picker panel in DatePicker](https://github.com/ant-design/ant-design/issues/5190) in antd 3.0, which simply control the displayed panel and won't change the original date picking behavior of `DatePicker/RangePicker` (for instance you still need to click date cell to finish selection in a DatePicker, whatever the `mode` is).
+
+##### Workaround
+
+You can refer to [this article](https://juejin.im/post/5cf65c366fb9a07eca6968f9) or [this article](https://www.cnblogs.com/zyl-Tara/p/10197177.html), using `mode` and `onPanelChange` to encapsulate a `YearPicker` or `MonthRangePicker` for your needs. Or you can wait for our [antd@4.0](https://github.com/ant-design/ant-design/issues/16911), in which we are planing to [add more XxxPickers](https://github.com/ant-design/ant-design/issues/4524#issuecomment-480576884) for those requirments.
+
### How to spell Ant Design correctly?
- ✅ **Ant Design**: Capitalized with space, for the design language.
diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md
index 830f132088..086a6be067 100644
--- a/docs/react/faq.zh-CN.md
+++ b/docs/react/faq.zh-CN.md
@@ -110,6 +110,19 @@ import { Menu, Breadcrumb, Icon } from 'antd';
你可以通过 [ConfigProvider](/components/config-provider/#Content-Security-Policy) 来配置 `nonce` 属性。
+### 当我指定了 DatePicker/RangePicker 的 `mode` 属性后,点击后无法选择年份/月份?
+
+在业务开发中,你可能有年份选择,月份范围选择,周范围选择等需求,此时你给现有组件增加了 `mode` 属性,却发现无法进行点击选择行为,面板也不会关闭。
+
+- 重现链接:https://codesandbox.io/s/dank-brook-v1csy
+- 相同 issue:[#15572](https://github.com/ant-design/ant-design/issues/15572)、[#16436](https://github.com/ant-design/ant-design/issues/16436)、[#11938](https://github.com/ant-design/ant-design/issues/11938)、[#11735](https://github.com/ant-design/ant-design/issues/11735)、[#11586](https://github.com/ant-design/ant-design/issues/11586)、[#10425](https://github.com/ant-design/ant-design/issues/10425)、[#11053](https://github.com/ant-design/ant-design/issues/11053)
+
+就像[这个回复](https://github.com/ant-design/ant-design/issues/15572#issuecomment-475476135)里解释的一样,这是因为 ` ` 不等于 `YearPicker`,` ` 不等于 `MonthRangePicker`。 `mode` 属性是在 antd 3.0 时,为了控制面板展现状态而添加的属性,以支持[展示时间面板](https://github.com/ant-design/ant-design/issues/5190)等需求而添加的。`mode` 只会简单的改变当前显示的面板,不会修改默认的交互行为(比如 DatePicker 依然是点击日才会完成选择并关闭面板)。
+
+##### 解决办法
+
+你可以参照 [这篇文章](https://juejin.im/post/5cf65c366fb9a07eca6968f9) 或者 [这篇文章](https://www.cnblogs.com/zyl-Tara/p/10197177.html) 里的做法,利用 `mode` 和 `onPanelChange` 等方法去封装一个 `YearPicker` 等组件。我们计划在 [antd@4.0](https://github.com/ant-design/ant-design/issues/16911) 中直接[添加更多相关日期组件](https://github.com/ant-design/ant-design/issues/4524#issuecomment-480576884)来支持这些需求。
+
### 如何正确的拼写 Ant Design?
- ✅ **Ant Design**:用空格分隔的首字母大写单词,指代设计语言。
diff --git a/docs/spec/colors.zh-CN.md b/docs/spec/colors.zh-CN.md
index 47a476daa8..cea69b1a66 100644
--- a/docs/spec/colors.zh-CN.md
+++ b/docs/spec/colors.zh-CN.md
@@ -38,7 +38,7 @@ Ant Design 的色板还具备进一步拓展的能力。经过设计师和程序
### 中性色板
-中性色包含了黑、白、灰。在蚂蚁中后台的网页设计中被大量使用到,合理的选择中性色能够令页面信息具备良好的主次关系,助力阅读体验。Ant Design 的中性色板一共包含了从白到黑的 10 个颜色。
+中性色包含了黑、白、灰。在蚂蚁中后台的网页设计中被大量使用到,合理地选择中性色能够令页面信息具备良好的主次关系,助力阅读体验。Ant Design 的中性色板一共包含了从白到黑的 10 个颜色。
```__react
import Palette from '../../site/theme/template/Color/Palette';
@@ -99,7 +99,7 @@ ReactDOM.render( , mountNode);
-品牌色是体现产品特性和传播理念最直观的视觉元素之一。在色彩选取时,需要先明确品牌色在界面中的使用场景及范围。在基础色板中选择主色,我们建议选择色板从浅自深的第六个颜色作为主色。 Ant Design 的品牌色取自基础色板的蓝色,Hex 值为 1890FF,应用场景包括:关键行动点,操作状态、重要信息高亮,图形化等场景。
+品牌色是体现产品特性和传播理念最直观的视觉元素之一。在色彩选取时,需要先明确品牌色在界面中的使用场景及范围。在基础色板中选择主色,我们建议选择色板从浅至深的第六个颜色作为主色。 Ant Design 的品牌色取自基础色板的蓝色,Hex 值为 `#1890FF`,应用场景包括:关键行动点,操作状态、重要信息高亮,图形化等场景。
### 功能色
diff --git a/docs/spec/feedback.en-US.md b/docs/spec/feedback.en-US.md
index ed5319d5aa..8ed456fb8b 100644
--- a/docs/spec/feedback.en-US.md
+++ b/docs/spec/feedback.en-US.md
@@ -71,7 +71,7 @@ When the operation takes a while (usually more than 2 seconds) to complete, the
-
+
> Note: If the loading time is long, a cancel operation should be provided.
diff --git a/docs/spec/feedback.zh-CN.md b/docs/spec/feedback.zh-CN.md
index 8c5f9e484e..8b53862661 100644
--- a/docs/spec/feedback.zh-CN.md
+++ b/docs/spec/feedback.zh-CN.md
@@ -71,7 +71,7 @@ title: 反馈
-
+
> 注:若加载时间较长,应提供取消操作。
diff --git a/package.json b/package.json
index 50d567b26a..fe27ad3c0f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "antd",
- "version": "3.19.1",
+ "version": "3.19.3",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React components implementation",
"homepage": "http://ant.design/",
@@ -44,154 +44,155 @@
"dependencies": {
"@ant-design/create-react-context": "^0.2.4",
"@ant-design/icons": "~2.1.0",
- "@ant-design/icons-react": "~2.0.0",
- "@types/react-slick": "^0.23.3",
+ "@ant-design/icons-react": "~2.0.1",
+ "@types/react-slick": "^0.23.4",
"array-tree-filter": "^2.1.0",
"babel-runtime": "6.x",
"classnames": "~2.2.6",
- "copy-to-clipboard": "^3.0.8",
+ "copy-to-clipboard": "^3.2.0",
"css-animation": "^1.5.0",
"dom-closest": "^0.2.0",
"enquire.js": "^2.1.6",
"lodash": "^4.17.11",
"moment": "^2.24.0",
- "omit.js": "^1.0.0",
- "prop-types": "^15.6.2",
- "raf": "^3.4.0",
- "rc-animate": "^2.5.4",
- "rc-calendar": "~9.14.0",
- "rc-cascader": "~0.17.0",
- "rc-checkbox": "~2.1.5",
- "rc-collapse": "~1.11.1",
+ "omit.js": "^1.0.2",
+ "prop-types": "^15.7.2",
+ "raf": "^3.4.1",
+ "rc-animate": "^2.8.3",
+ "rc-calendar": "~9.15.0",
+ "rc-cascader": "~0.17.4",
+ "rc-checkbox": "~2.1.6",
+ "rc-collapse": "~1.11.3",
"rc-dialog": "~7.4.0",
- "rc-drawer": "~1.9.3",
+ "rc-drawer": "~1.9.8",
"rc-dropdown": "~2.4.1",
- "rc-editor-mention": "^1.1.7",
- "rc-form": "^2.4.0",
- "rc-input-number": "~4.4.0",
+ "rc-editor-mention": "^1.1.13",
+ "rc-form": "^2.4.5",
+ "rc-input-number": "~4.4.5",
"rc-mentions": "~0.3.1",
- "rc-menu": "~7.4.12",
- "rc-notification": "~3.3.0",
+ "rc-menu": "~7.4.23",
+ "rc-notification": "~3.3.1",
"rc-pagination": "~1.20.1",
"rc-progress": "~2.3.0",
"rc-rate": "~2.5.0",
- "rc-select": "~9.1.0",
- "rc-slider": "~8.6.5",
+ "rc-select": "~9.1.4",
+ "rc-slider": "~8.6.11",
"rc-steps": "~3.4.1",
"rc-switch": "~1.9.0",
- "rc-table": "~6.5.0",
- "rc-tabs": "~9.6.0",
- "rc-time-picker": "~3.6.1",
+ "rc-table": "~6.6.0",
+ "rc-tabs": "~9.6.4",
+ "rc-time-picker": "~3.6.6",
"rc-tooltip": "~3.7.3",
"rc-tree": "~2.1.0",
"rc-tree-select": "~2.9.1",
"rc-trigger": "^2.6.2",
- "rc-upload": "~2.6.0",
- "rc-util": "^4.5.1",
+ "rc-upload": "~2.6.7",
+ "rc-util": "^4.6.0",
"react-lazy-load": "^3.0.13",
"react-lifecycles-compat": "^3.0.4",
"react-slick": "~0.24.0",
- "resize-observer-polyfill": "^1.5.0",
+ "resize-observer-polyfill": "^1.5.1",
"shallowequal": "^1.1.0",
- "warning": "~4.0.2"
+ "warning": "~4.0.3"
},
"devDependencies": {
- "@ant-design/colors": "^3.0.0",
- "@sentry/browser": "^5.0.3",
- "@types/classnames": "^2.2.6",
- "@types/prop-types": "^15.5.6",
- "@types/react": "~16.8.1",
- "@types/react-dom": "^16.0.11",
- "@types/react-intl": "^2.3.14",
+ "@ant-design/colors": "^3.1.0",
+ "@packtracker/webpack-plugin": "^2.0.1",
+ "@sentry/browser": "^5.4.0",
+ "@types/classnames": "^2.2.8",
+ "@types/prop-types": "^15.7.1",
+ "@types/react": "~16.8.19",
+ "@types/react-dom": "^16.8.4",
+ "@types/react-intl": "^2.3.17",
"@types/warning": "^3.0.0",
"@yesmeck/offline-plugin": "^5.0.5",
- "ansi-styles": "^3.2.1",
- "antd-theme-generator": "^1.1.4",
+ "ansi-styles": "^4.0.0",
+ "antd-theme-generator": "^1.1.6",
"antd-tools": "^7.3.5",
"babel-eslint": "^10.0.1",
"babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "^1.2.4",
- "bisheng-plugin-antd": "^1.0.1",
+ "bisheng-plugin-antd": "^1.0.2",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^1.0.0",
"bisheng-plugin-toc": "^0.4.4",
"chalk": "^2.4.2",
- "commander": "^2.18.0",
+ "commander": "^2.20.0",
"cross-env": "^5.2.0",
"css-split-webpack-plugin": "^0.2.6",
"dekko": "^0.2.1",
- "docsearch.js": "^2.5.2",
+ "docsearch.js": "^2.6.3",
"enquire-js": "^0.2.1",
- "enzyme": "^3.7.0",
- "enzyme-adapter-react-16": "^1.6.0",
- "enzyme-to-json": "^3.3.4",
- "eslint": "^5.6.1",
+ "enzyme": "^3.10.0",
+ "enzyme-adapter-react-16": "^1.14.0",
+ "enzyme-to-json": "^3.3.5",
+ "eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
- "eslint-config-prettier": "^4.0.0",
- "eslint-plugin-babel": "^5.2.1",
- "eslint-plugin-import": "^2.17.1",
- "eslint-plugin-jest": "^22.4.1",
- "eslint-plugin-jsx-a11y": "^6.1.2",
- "eslint-plugin-markdown": "~1.0.0-beta.6",
- "eslint-plugin-react": "^7.11.1",
+ "eslint-config-prettier": "^4.3.0",
+ "eslint-plugin-babel": "^5.3.0",
+ "eslint-plugin-import": "^2.17.3",
+ "eslint-plugin-jest": "^22.6.4",
+ "eslint-plugin-jsx-a11y": "^6.2.1",
+ "eslint-plugin-markdown": "~1.0.0",
+ "eslint-plugin-react": "^7.13.0",
"eslint-tinker": "^0.5.0",
"fetch-jsonp": "^1.1.3",
- "glob": "^7.1.3",
+ "glob": "^7.1.4",
"immutability-helper": "^3.0.0",
"intersection-observer": "^0.7.0",
- "jest": "^24.0.0",
- "jsdom": "^15.0.0",
+ "jest": "^24.8.0",
+ "jsdom": "^15.1.1",
"jsonml.js": "^0.1.0",
- "lint-staged": "^8.0.2",
+ "lint-staged": "^8.1.7",
"logrocket": "^1.0.0",
"logrocket-react": "^3.0.0",
"lz-string": "^1.4.4",
- "majo": "^0.7.1",
+ "majo": "^0.8.0",
"mockdate": "^2.0.2",
- "node-fetch": "^2.3.0",
+ "node-fetch": "^2.6.0",
"pre-commit": "^1.2.2",
- "preact": "^8.3.1",
- "preact-compat": "^3.18.4",
- "prettier": "^1.17.0",
+ "preact": "^8.4.2",
+ "preact-compat": "^3.18.5",
+ "prettier": "^1.17.1",
"querystring": "^0.2.0",
- "rc-queue-anim": "^1.6.6",
- "rc-scroll-anim": "^2.5.7",
- "rc-tween-one": "^2.4.0",
+ "rc-queue-anim": "^1.6.12",
+ "rc-scroll-anim": "^2.5.8",
+ "rc-tween-one": "^2.4.1",
"react": "^16.5.2",
- "react-color": "^2.14.1",
+ "react-color": "^2.17.3",
"react-copy-to-clipboard": "^5.0.1",
- "react-dnd": "^7.0.2",
- "react-dnd-html5-backend": "^7.0.2",
+ "react-dnd": "^7.4.5",
+ "react-dnd-html5-backend": "^7.4.4",
"react-document-title": "^2.0.3",
"react-dom": "^16.5.2",
"react-github-button": "^0.1.11",
"react-highlight-words": "^0.16.0",
- "react-infinite-scroller": "^1.2.1",
- "react-intl": "^2.7.0",
+ "react-infinite-scroller": "^1.2.4",
+ "react-intl": "^2.9.0",
"react-resizable": "^1.8.0",
- "react-router-dom": "^5.0.0",
+ "react-router-dom": "^5.0.1",
"react-sticky": "^6.0.3",
- "react-test-renderer": "^16.6.3",
- "react-virtualized": "~9.21.0",
+ "react-test-renderer": "^16.8.6",
+ "react-virtualized": "~9.21.1",
"remark-cli": "^6.0.1",
- "remark-frontmatter": "^1.3.0",
+ "remark-frontmatter": "^1.3.1",
"remark-lint": "^6.0.4",
- "remark-parse": "^6.0.0",
+ "remark-parse": "^6.0.3",
"remark-preset-lint-recommended": "^3.0.2",
- "remark-stringify": "^6.0.0",
- "remark-yaml-config": "^4.0.2",
+ "remark-stringify": "^6.0.4",
+ "remark-yaml-config": "^4.0.3",
"reqwest": "^2.0.5",
- "rimraf": "^2.6.2",
+ "rimraf": "^2.6.3",
"scrollama": "^2.0.0",
- "simple-git": "^1.110.0",
- "stylelint": "^10.0.0",
- "stylelint-config-prettier": "^5.0.0",
- "stylelint-config-rational-order": "^0.1.0",
- "stylelint-config-standard": "^18.2.0",
- "stylelint-declaration-block-no-ignored-properties": "^2.0.0",
+ "simple-git": "^1.113.0",
+ "stylelint": "^10.0.1",
+ "stylelint-config-prettier": "^5.2.0",
+ "stylelint-config-rational-order": "^0.1.2",
+ "stylelint-config-standard": "^18.3.0",
+ "stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^3.0.0",
- "typescript": "~3.4.1",
- "unified": "^7.0.0",
+ "typescript": "~3.5.1",
+ "unified": "^7.1.0",
"xhr-mock": "^2.4.1",
"xhr2": "^0.2.0"
},
@@ -246,5 +247,11 @@
"es/**/style/*",
"lib/**/style/*",
"*.less"
+ ],
+ "browserslist": [
+ "last 2 version",
+ "Firefox ESR",
+ "> 1%",
+ "ie >= 9"
]
}
diff --git a/site/theme/en-US.js b/site/theme/en-US.js
index e629041997..201841bac6 100644
--- a/site/theme/en-US.js
+++ b/site/theme/en-US.js
@@ -12,7 +12,7 @@ module.exports = {
'app.header.menu.spec': 'Guidelines',
'app.header.menu.resource': 'Resources',
'app.header.menu.mobile': 'Mobile',
- 'app.header.menu.pro': 'Ant Design Pro',
+ 'app.header.menu.pro.v4': 'Ant Design Pro v4',
'app.header.menu.ecosystem': 'Ecosystem',
'app.header.lang': '中文',
'app.content.edit-page': 'Edit this page on GitHub!',
diff --git a/site/theme/static/toc.less b/site/theme/static/toc.less
index 5092d277a5..ed49ef636e 100644
--- a/site/theme/static/toc.less
+++ b/site/theme/static/toc.less
@@ -51,7 +51,8 @@ ul.toc > li {
.ant-affix {
z-index: 9;
max-height: ~'calc(100vh - 16px)';
- overflow: auto;
+ overflow-x: hidden;
+ overflow-y: auto;
background: #fff;
}
}
diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx
index 55eeea37be..957e197257 100644
--- a/site/theme/template/Layout/Header.jsx
+++ b/site/theme/template/Layout/Header.jsx
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Link } from 'bisheng/router';
import { FormattedMessage } from 'react-intl';
import classNames from 'classnames';
-import { Select, Menu, Row, Col, Icon, Popover, Input, Button } from 'antd';
+import { Select, Menu, Row, Col, Icon, Popover, Input, Button, Badge } from 'antd';
import Santa from './Santa';
import * as utils from '../utils';
import { version as antdVersion } from '../../../../package.json';
@@ -179,7 +179,11 @@ export default class Header extends React.Component {
}
+ title={
+
+
+
+ }
>
-
+
+
+
diff --git a/site/theme/zh-CN.js b/site/theme/zh-CN.js
index 40ff1bba64..8d4e84fcb6 100644
--- a/site/theme/zh-CN.js
+++ b/site/theme/zh-CN.js
@@ -12,7 +12,7 @@ module.exports = {
'app.header.menu.spec': '设计语言',
'app.header.menu.resource': '资源',
'app.header.menu.mobile': '移动版',
- 'app.header.menu.pro': 'Ant Design Pro',
+ 'app.header.menu.pro.v4': 'Ant Design Pro v4',
'app.header.menu.ecosystem': '生态',
'app.header.lang': 'English',
'app.content.edit-page': '在 GitHub 上编辑此页!',
diff --git a/webpack.config.js b/webpack.config.js
index 08d3c36c2d..9bd7822a4f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,6 +1,7 @@
/* eslint no-param-reassign: 0 */
// This config is for building dist files
const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
+const PacktrackerPlugin = require('@packtracker/webpack-plugin');
const { webpack } = getWebpackConfig;
@@ -35,6 +36,15 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
ignoreMomentLocale(config);
externalMoment(config);
addLocales(config);
+ // https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
+ config.plugins.push(
+ new PacktrackerPlugin({
+ project_token: '8adbb892-ee4a-4d6f-93bb-a03219fb6778',
+ upload: process.env.CI === 'true',
+ fail_build: true,
+ exclude_assets: name => !['antd.min.js', 'antd.min.css'].includes(name),
+ }),
+ );
});
}