Skip to content

Commit

Permalink
Merge branch 'feature' into feat/narrow-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
AshoneA committed Mar 28, 2020
2 parents 0e65ee1 + 2cfad04 commit 9dddb8e
Show file tree
Hide file tree
Showing 192 changed files with 9,262 additions and 11,563 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/mirror.yml
@@ -0,0 +1,15 @@
name: Mirror

on: [push]

jobs:
to_gitee:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
git@gitee.com:ant-design/ant-design.git
ssh_private_key:
${{ secrets.GITEE_SSH_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .prettierrc
Expand Up @@ -3,6 +3,7 @@
"trailingComma": "all",
"printWidth": 100,
"proseWrap": "never",
"arrowParens": "avoid",
"overrides": [
{
"files": ".prettierrc",
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.en-US.md
Expand Up @@ -15,6 +15,45 @@ timeline: true

---

## 4.0.4

`2020-03-23`

- 🐞 Fix AutoComplete clear icon overlap issue on search icon. [#22310](https://github.com/ant-design/ant-design/pull/22310)
- 🐞 Fix Button align issue when is `disabled` and wrapped by Tooltip. [#22461](https://github.com/ant-design/ant-design/pull/22461)
- 🐞 Fix Cascader search need to press down arrow twice to select item. [#22216](https://github.com/ant-design/ant-design/pull/22216) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🐞 Fix Carousel cannot works on Snowpack. [#22507](https://github.com/ant-design/ant-design/pull/22507)
- 🐞 Fix ConfigProvider `componentSize` not works on DatePicker.RangePicker. [#22486](https://github.com/ant-design/ant-design/pull/22486)
- 🐞 Fix Descriptions cannot fit to small container width. [#22407](https://github.com/ant-design/ant-design/pull/22407)
- ⚡️ Optimization Form.Item with multiple noStyle children Form.Item message collection performance. [#22410](https://github.com/ant-design/ant-design/pull/22410)
- 🐞 Fix Grid broken style using Col without `span`. [#22455](https://github.com/ant-design/ant-design/pull/22455)
- 💄 Add InputNumber RTL style. [#22434](https://github.com/ant-design/ant-design/pull/22434)
- Menu
- 🛠 Menu inherit `line-height` from header. [#16142](https://github.com/ant-design/ant-design/pull/16142) [@sheerun](https://github.com/sheerun)
- 🐞 Fix Menu unexpected scrollbar when show and hide. [#22248](https://github.com/ant-design/ant-design/pull/22248)
- 🐞 Fix Progress Dashboard won't allow `gapDeg` to be `0`. [#22462](https://github.com/ant-design/ant-design/pull/22462) [@thisrabbit](https://github.com/thisrabbit)
- 🛠 Adjust Radio.Group logic that `value` is `undefined` should be uncontrolled mode. [#22245](https://github.com/ant-design/ant-design/pull/22245)
- ⚡️ Reduce Row unnecessary render when `gutter` is array. [#22475](https://github.com/ant-design/ant-design/pull/22475) [@dolfje](https://github.com/dolfje)
- 💄 Tweak RangePicker arrow shadow style. [#22406](https://github.com/ant-design/ant-design/pull/22406)
- 🐞 Fix Select dropdown menu vertical padding. [#22251](https://github.com/ant-design/ant-design/pull/22251)
- 🐞 Fix Slider tooltip crash when with `nullable` value. [#22482](https://github.com/ant-design/ant-design/pull/22482)
- Table
- 🐞 Fix Table ColumnGroup with controlled `sorterOrder` not working issue. [#22450](https://github.com/ant-design/ant-design/pull/22450)
- 🐞 Fix Table border radius style. [#22413](https://github.com/ant-design/ant-design/pull/22413) [@akshatmittal](https://github.com/akshatmittal)
- 🐞 Fix Table fixed column height issue. [#22367](https://github.com/ant-design/ant-design/pull/22367)
- 🐞Fix Table row expand icon show error in ipad. [#22334](https://github.com/ant-design/ant-design/pull/22334) [@BugHiding](https://github.com/BugHiding)
- 🛠 Table `column.filter` support `boolean` value. [#22277](https://github.com/ant-design/ant-design/pull/22277) [@xudongdev](https://github.com/xudongdev)
- 🐞 Fix Table filter no working when only set `onFilter`. [#22317](https://github.com/ant-design/ant-design/pull/22317)
- 🐞 Fix TreeSelect `treeIcon` not working. [#22437](https://github.com/ant-design/ant-design/pull/22437)
- 🐞 Refactor DirectoryTree to fix deprecated warning. [#22318](https://github.com/ant-design/ant-design/pull/22318)
- 🐞 Fix Typography nest list style issue. [#22284](https://github.com/ant-design/ant-design/pull/22284)
- 🐞 Adjust Upload `onChange` return `fileList` is immutable data to avoid render issue. [#22322](https://github.com/ant-design/ant-design/pull/22322)
- 🌎 Localization
- 🇩🇪 Updated German locale. [#22270](https://github.com/ant-design/ant-design/pull/22270) [@iChebbi](https://github.com/iChebbi)
- 🇫🇷 Update French locale. [#22238](https://github.com/ant-design/ant-design/pull/22238) [@abenhamdine](https://github.com/abenhamdine)
- Typescript
- 🐞 Omit Table `getCheckboxProps` typeof `checked`. [#22391](https://github.com/ant-design/ant-design/pull/22391) [@geekrainy](https://github.com/geekrainy)

## 4.0.3

`2020-03-14`
Expand Down
41 changes: 40 additions & 1 deletion CHANGELOG.zh-CN.md
Expand Up @@ -15,6 +15,45 @@ timeline: true

---

## 4.0.4

`2020-03-23`

- 🐞 修复 AutoComplete 下使用 Search 时清除图标和搜索图标重叠样式异常的问题。[#22310](https://github.com/ant-design/ant-design/pull/22310)
- 🐞 修复 Button 为 `disabled` 时被 Tooltip 包裹时的对齐问题。[#22461](https://github.com/ant-design/ant-design/pull/22461)
- 🐞 修复 Cascader 搜索时需要按两次向下箭头才能选中问题。[#22216](https://github.com/ant-design/ant-design/pull/22216) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🐞 修复 Carousel 无法使用 Snowpack 构建的问题。[#22507](https://github.com/ant-design/ant-design/pull/22507)
- 🐞 修复 ConfigProvider `componentSize` 对 DatePicker.RangePicker 无效的问题。[#22486](https://github.com/ant-design/ant-design/pull/22486)
- 🐞 修复 Descriptions 在小尺寸下无法自适应的问题。[#22407](https://github.com/ant-design/ant-design/pull/22407)
- 🐞 修复 Grid 下使用不带 `span` 的 Col 时样式错乱的问题。[#22455](https://github.com/ant-design/ant-design/pull/22455)
- ⚡️ 优化 Form.Item 有多个 `noStyle` 子 Form.Item 时信息收集性能。[#22410](https://github.com/ant-design/ant-design/pull/22410)
- 💄 增加 InputNumber RTL 模式样式。[#22434](https://github.com/ant-design/ant-design/pull/22434)
- Menu
- 🛠 Menu 继承标题的 `line-height`[#16142](https://github.com/ant-design/ant-design/pull/16142) [@sheerun](https://github.com/sheerun)
- 🐞 修复 Menu 子菜单展开/收起时会出现滚动条的问题。[#22248](https://github.com/ant-design/ant-design/pull/22248)
- 🐞 修复 Progress 仪表盘状进度条传入 `gapDeg``0` 时仍然有缺口的问题。[#22462](https://github.com/ant-design/ant-design/pull/22462) [@thisrabbit](https://github.com/thisrabbit)
- 🛠 调整 Radio.Group 逻辑,`value``undefined` 时为非受控状态。[#22245](https://github.com/ant-design/ant-design/pull/22245)
- 💄 微调 RangePicker 箭头阴影样式。[#22406](https://github.com/ant-design/ant-design/pull/22406)
- ⚡️ 减少 Row 在 `gutter` 是数组时非必要的额外渲染。[#22475](https://github.com/ant-design/ant-design/pull/22475) [@dolfje](https://github.com/dolfje)
- 🐞 修复 Select 下拉菜单的上下 padding。[#22251](https://github.com/ant-design/ant-design/pull/22251)
- 🐞 修复 Slider 使用 `nullable` 值时弹出提示会崩溃的问题。[#22482](https://github.com/ant-design/ant-design/pull/22482)
- Table
- 🐞 修复 Table ColumnGroup 使用受控 `sorterOrder` 无效的问题。[#22450](https://github.com/ant-design/ant-design/pull/22450)
- 🐞 修复 Table 边框圆角样式问题。[#22413](https://github.com/ant-design/ant-design/pull/22413) [@akshatmittal](https://github.com/akshatmittal)
- 🐞 修复 Table 固定列高度样式问题。[#22367](https://github.com/ant-design/ant-design/pull/22367)
- 🐞 修复 Table 展开行按钮在 ipad 下的样式问题。[#22334](https://github.com/ant-design/ant-design/pull/22334) [@BugHiding](https://github.com/BugHiding)
- 🐞 修复 Table 在只设置 `onFilter` 时过滤无效的问题。[#22317](https://github.com/ant-design/ant-design/pull/22317)
- 🛠 Table `column.filter` 的 value 定义可以支持 `boolean`[#22277](https://github.com/ant-design/ant-design/pull/22277) [@xudongdev](https://github.com/xudongdev)
- 🐞 重构 DirectoryTree 以修复废弃 API 警告信息。[#22318](https://github.com/ant-design/ant-design/pull/22318)
- 🐞 修复 TreeSelect `treeIcon` 无效的问题。[#22437](https://github.com/ant-design/ant-design/pull/22437)
- 🐞 修复 Typography 嵌套列表的样式问题。[#22284](https://github.com/ant-design/ant-design/pull/22284)
- 🐞 调整 Upload `onChange` 返回参数 `fileList` 为不可变数据以解决渲染问题。[#22322](https://github.com/ant-design/ant-design/pull/22322)
- 🌎 国际化
- 🇩🇪 更新德语国际化。[#22270](https://github.com/ant-design/ant-design/pull/22270) [@iChebbi](https://github.com/iChebbi)
- 🇫🇷 更新法语国际化。[#22238](https://github.com/ant-design/ant-design/pull/22238) [@abenhamdine](https://github.com/abenhamdine)
- Typescript
- 🐞 移除 Table `getCheckboxProps``checked` 类型定义。[#22391](https://github.com/ant-design/ant-design/pull/22391) [@geekrainy](https://github.com/geekrainy)

## 4.0.3

`2020-03-14`
Expand All @@ -32,7 +71,7 @@ timeline: true
- 🐞 修复 ConfigProvider 没有作用在 Table 过滤弹框上的问题。[#22133](https://github.com/ant-design/ant-design/pull/22133)
- 🐞 修复 Table 树形结构下展开与固定列配合的样式问题。[#22131](https://github.com/ant-design/ant-design/pull/22131)
- 🐞 修复 Table 选择列固定时展开列不固定的问题。[#22087](https://github.com/ant-design/ant-design/pull/22087)
- 🐞 修复 Table 过滤菜单重置失效的问题。[#22079](https://github.com/ant-design/ant-design/pull/22079) [@shaodahong](https://github.com/shaodahong)
- 🐞 修复 Table 过滤菜单重置失效的问题。[#22079](https://github.com/ant-design/ant-design/pull/22079)
- 🐞 修复 Table 筛选子菜单高度溢出屏幕的问题。[#22230](https://github.com/ant-design/ant-design/pull/22230)
- Form
- 💄 优化 Form 的响应式和盒模型表现。[#21907](https://github.com/ant-design/ant-design/pull/21907) [@shaodahong](https://github.com/shaodahong)
Expand Down
1 change: 1 addition & 0 deletions README-pt_BR.md
Expand Up @@ -102,6 +102,7 @@ Veja [i18n](http://ant.design/docs/react/i18n).
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) para relatório de erros
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](http://ant.design/docs/react/customize-theme)
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)

## ⌨️ Desenvolvimento

Expand Down
7 changes: 6 additions & 1 deletion README-zh_CN.md
Expand Up @@ -72,9 +72,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'

你也可以使用 [babel-plugin-import](https://ant.design/docs/react/getting-started-cn#按需加载)

### 🌈 定制主题

参考 [定制主题](https://ant.design/docs/react/customize-theme-cn) 文档。

### 🛡 TypeScript

参考 [在 TypeScript 中使用](https://ant.design/docs/react/use-in-typescript-cn)
参考 [在 TypeScript 中使用](https://ant.design/docs/react/use-in-typescript-cn)

## 🌍 国际化

Expand Down Expand Up @@ -103,6 +107,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [CodeSandbox 模板](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [定制主题](http://ant.design/docs/react/customize-theme-cn)
- [成为社区协作成员](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)

## ⌨️ 本地开发

Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -102,6 +102,7 @@ See [i18n](http://ant.design/docs/react/i18n).
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](http://ant.design/docs/react/customize-theme)
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)

## ⌨️ Development

Expand Down
1 change: 1 addition & 0 deletions components/__tests__/__snapshots__/index.test.js.snap
Expand Up @@ -50,6 +50,7 @@ Array [
"Select",
"Skeleton",
"Slider",
"Space",
"Spin",
"Steps",
"Switch",
Expand Down
45 changes: 45 additions & 0 deletions components/alert/__tests__/index.test.js
@@ -1,7 +1,10 @@
import React from 'react';
import { mount } from 'enzyme';
import Alert from '..';
import Tooltip from '../../tooltip';
import Popconfirm from '../../popconfirm';
import rtlTest from '../../../tests/shared/rtlTest';
import { sleep } from '../../../tests/utils';

const { ErrorBoundary } = Alert;

Expand Down Expand Up @@ -66,4 +69,46 @@ describe('Alert', () => {
// eslint-disable-next-line jest/no-standalone-expect
expect(wrapper.render()).toMatchSnapshot();
});

it('could be used with Tooltip', async () => {
jest.useRealTimers();
const wrapper = mount(
<Tooltip title="xxx" mouseEnterDelay={0}>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
/>
</Tooltip>,
);
wrapper.find('.ant-alert').simulate('mouseenter');
await sleep(0);
expect(
wrapper
.find(Tooltip)
.instance()
.getPopupDomNode(),
).toBeTruthy();
jest.useFakeTimers();
});

it('could be used with Popconfirm', async () => {
jest.useRealTimers();
const wrapper = mount(
<Popconfirm title="xxx">
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
/>
</Popconfirm>,
);
wrapper.find('.ant-alert').simulate('click');
await sleep(0);
expect(
wrapper
.find(Popconfirm)
.instance()
.getPopupDomNode(),
).toBeTruthy();
jest.useFakeTimers();
});
});
16 changes: 15 additions & 1 deletion components/alert/index.tsx
Expand Up @@ -42,6 +42,9 @@ export interface AlertProps {
className?: string;
banner?: boolean;
icon?: React.ReactNode;
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
onClick?: React.MouseEventHandler<HTMLDivElement>;
}

export interface AlertState {
Expand Down Expand Up @@ -103,6 +106,9 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
className = '',
style,
icon,
onMouseEnter,
onMouseLeave,
onClick,
} = this.props;
let { closable, type, showIcon } = this.props;
const { closing, closed } = this.state;
Expand Down Expand Up @@ -173,7 +179,15 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
transitionName={`${prefixCls}-slide-up`}
onEnd={this.animationEnd}
>
<div data-show={!closing} className={alertCls} style={style} {...dataOrAriaProps}>
<div
data-show={!closing}
className={alertCls}
style={style}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={onClick}
{...dataOrAriaProps}
>
{showIcon ? iconNode : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>
Expand Down
Expand Up @@ -450,7 +450,7 @@ exports[`renders ./components/avatar/demo/dynamic.md correctly 1`] = `
</span>
<button
class="ant-btn ant-btn-sm"
style="margin-left:16px;vertical-align:middle"
style="margin:0 16px;vertical-align:middle"
type="button"
>
<span>
Expand Down
6 changes: 5 additions & 1 deletion components/avatar/demo/dynamic.md
Expand Up @@ -33,7 +33,11 @@ const Autoset: React.FC = () => {
<Avatar style={{ backgroundColor: color, verticalAlign: 'middle' }} size="large">
{user}
</Avatar>
<Button size="small" style={{ marginLeft: 16, verticalAlign: 'middle' }} onClick={changeUser}>
<Button
size="small"
style={{ margin: '0 16px', verticalAlign: 'middle' }}
onClick={changeUser}
>
Change
</Button>
</div>
Expand Down
7 changes: 7 additions & 0 deletions components/badge/style/rtl.less
Expand Up @@ -15,6 +15,7 @@
.@{badge-prefix-cls}-rtl & {
right: auto;
left: 0;
direction: ltr;
transform: translate(-50%, -50%);
transform-origin: 0% 0%;
}
Expand Down Expand Up @@ -48,6 +49,12 @@
animation-name: antZoomBadgeOutRtl;
}
}

&-not-a-wrapper {
.@{badge-prefix-cls}-count {
transform: none;
}
}
}

@keyframes antZoomBadgeInRtl {
Expand Down
2 changes: 1 addition & 1 deletion components/button/button-group.tsx
Expand Up @@ -10,7 +10,7 @@ export interface ButtonGroupProps {
prefixCls?: string;
}

const ButtonGroup: React.SFC<ButtonGroupProps> = props => (
const ButtonGroup: React.FC<ButtonGroupProps> = props => (
<ConfigConsumer>
{({ getPrefixCls, direction }: ConfigConsumerProps) => {
const { prefixCls: customizePrefixCls, size, className, ...others } = props;
Expand Down
4 changes: 4 additions & 0 deletions components/button/index.zh-CN.md
Expand Up @@ -69,3 +69,7 @@ subtitle: 按钮
background: rgba(255, 255, 255, 0.2);
}
</style>

## 设计指引

- [我的按钮究竟该放哪儿!?| Ant Design 4.0 系列分享](https://zhuanlan.zhihu.com/p/109644406)
6 changes: 5 additions & 1 deletion components/button/style/index.less
Expand Up @@ -227,8 +227,12 @@
}

// https://github.com/ant-design/ant-design/issues/12681
// same method as Select
&:empty {
vertical-align: top;
display: inline-block;
width: 0;
visibility: hidden;
content: '\a0';
}
}

Expand Down
3 changes: 2 additions & 1 deletion components/button/style/rtl.less
Expand Up @@ -70,7 +70,8 @@
> span + span,
& + .@{btnClassName},
& + & {
.@{btnClassName}-rtl& {
.@{btnClassName}-rtl&,
.@{btnClassName}-group-rtl& {
margin-right: -1px;
margin-left: auto;
}
Expand Down
18 changes: 9 additions & 9 deletions components/calendar/__tests__/__snapshots__/demo.test.js.snap
Expand Up @@ -1888,20 +1888,20 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
class="ant-picker-calendar ant-picker-calendar-mini"
>
<div
style="padding:10px"
style="padding:8px"
>
<div
style="margin-bottom:10px"
<h4
class="ant-typography"
>
Custom header
</div>
Custom header
</h4>
<div
class="ant-row"
style="margin-left:-4px;margin-right:-4px;flex-wrap:nowrap"
style="margin-left:-4px;margin-right:-4px"
>
<div
class="ant-col"
style="padding-left:4px;padding-right:4px;flex:none"
style="padding-left:4px;padding-right:4px"
>
<div
class="ant-radio-group ant-radio-group-outline ant-radio-group-small"
Expand Down Expand Up @@ -1949,7 +1949,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
<div
class="ant-col"
style="padding-left:4px;padding-right:4px;flex:auto"
style="padding-left:4px;padding-right:4px"
>
<div
class="ant-select my-year-select ant-select-sm ant-select-single ant-select-show-arrow"
Expand Down Expand Up @@ -2011,7 +2011,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
<div
class="ant-col"
style="padding-left:4px;padding-right:4px;flex:auto"
style="padding-left:4px;padding-right:4px"
>
<div
class="ant-select ant-select-sm ant-select-single ant-select-show-arrow"
Expand Down

0 comments on commit 9dddb8e

Please sign in to comment.