Merge pull request #30544 from ant-design/master

chore: merge master into feature
This commit is contained in:
afc163 2021-05-17 09:30:31 +08:00 committed by GitHub
commit 3aad6ee882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 149 additions and 36 deletions

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install pretty-quick --staged

View File

@ -15,6 +15,28 @@ timeline: true
---
## 4.15.5
`2021-05-10`
- 🐞 Fix Upload crashes if `beforeUpload` returns `false` in IE. [#30391](https://github.com/ant-design/ant-design/pull/30391) [@OleksandrAntonenko1](https://github.com/OleksandrAntonenko1)
- Calendar
- 🐞 Fix Calendar broken style inside Form.Item. [#30442](https://github.com/ant-design/ant-design/pull/30442)
- 🐞 Fix Calendar throws error when set `value` to `null` or `undefined`. [#30442](https://github.com/ant-design/ant-design/pull/30442)
- Table
- 🐞 Fix Table call `confirm({ closeDropdown: true })` in `filterDropdown` should not trigger `onFilterDropdownVisibleChange`. [#30457](https://github.com/ant-design/ant-design/pull/30457)
- 🐞 Fix Table broken expand icon style in Windows Firefox. [#30410](https://github.com/ant-design/ant-design/pull/30410)
- 🐞 Fix Dropdown.Button don't support `mouseEnterDelay` and `mouseLeaveDelay`. [#30452](https://github.com/ant-design/ant-design/pull/30452)
- 💄 Optimize Rate focus behavior from `:focus` to `:focus-visible`. [#30451](https://github.com/ant-design/ant-design/pull/30451)
- 🐞 Fix Steps with progress get cut at the bottom. [#30373](https://github.com/ant-design/ant-design/pull/30373) [@fachreza73](https://github.com/fachreza73)
- 🐞 Fix the problem that setting `locale` in DatePicker cannot override ConfigProvider `locale`. [#30380](https://github.com/ant-design/ant-design/pull/30380) [@Map1en](https://github.com/Map1en)
- Locale
- 🇫🇮 Update DatePicker Finnish locale. [#30433](https://github.com/ant-design/ant-design/pull/30433) [@hiiri](https://github.com/hiiri)
- 🇫🇷 Update French locale with missing messages. [#30436](https://github.com/ant-design/ant-design/pull/30436) [@LoicUV](https://github.com/LoicUV)
- 🇷🇸 Update Serbian locale. [#30401](https://github.com/ant-design/ant-design/pull/30401) [@vmedar](https://github.com/vmedar)
- TypeScript
- 🤖 Export Tooltip `zIndex` prop typescript definition. [#30432](https://github.com/ant-design/ant-design/pull/30432)
## 4.15.4
`2021-04-30`

View File

@ -15,6 +15,28 @@ timeline: true
---
## 4.15.5
`2021-05-10`
- 🐞 修复 Upload 在 IE 下,`beforeUpload` 返回 `false` 的报错问题。[#30391](https://github.com/ant-design/ant-design/pull/30391) [@OleksandrAntonenko1](https://github.com/OleksandrAntonenko1)
- Calendar
- 🐞 修复 Calendar 在 Form.Item 下样式错乱的问题。[#30442](https://github.com/ant-design/ant-design/pull/30442)
- 🐞 修复 Calendar `value` 设置 `null``undefined` 时报错的问题。[#30442](https://github.com/ant-design/ant-design/pull/30442)。[#30442](https://github.com/ant-design/ant-design/pull/30442)
- Table
- 🐞 修复 Table `filterDropdown` 调用 `confirm({ closeDropdown: true })` 时也会触发 `onFilterDropdownVisibleChange` 的问题。[#30457](https://github.com/ant-design/ant-design/pull/30457)
- 🐞 修复 Table 展开图标在 Windows Firefox 下显示异常的问题。[#30410](https://github.com/ant-design/ant-design/pull/30410)
- 🐞 修复 Dropdown.Button 不支持 `mouseEnterDelay``mouseLeaveDelay` 的问题。[#30452](https://github.com/ant-design/ant-design/pull/30452)
- 💄 优化 Rate 聚焦行为从 `:focus``:focus-visible`。[#30451](https://github.com/ant-design/ant-design/pull/30451)
- 🐞 修复 Steps 进度条圆圈在底部被切掉的问题。[#30373](https://github.com/ant-design/ant-design/pull/30373) [@fachreza73](https://github.com/fachreza73)
- 🐞 修复在 DatePicker 里设置 `locale` 不能覆盖 ConfigProvider `locale` 的问题。[#30380](https://github.com/ant-design/ant-design/pull/30380) [@Map1en](https://github.com/Map1en)
- 国际化
- 🇫🇮 改进 DatePicker 芬兰语国际化。[#30433](https://github.com/ant-design/ant-design/pull/30433) [@hiiri](https://github.com/hiiri)
- 🇫🇷 更新法语国际化。[#30436](https://github.com/ant-design/ant-design/pull/30436) [@LoicUV](https://github.com/LoicUV)
- 🇷🇸 更新塞尔维亚语国际化。[#30401](https://github.com/ant-design/ant-design/pull/30401) [@vmedar](https://github.com/vmedar)
- TypeScript
- 🤖 Tooltip 导出 `zIndex` 类型定义。[#30432](https://github.com/ant-design/ant-design/pull/30432)
## 4.15.4
`2021-04-30`

View File

@ -69,7 +69,7 @@ The following APIs are shared by DatePicker, RangePicker.
| picker | Set picker type | `date` \| `week` \| `month` \| `quarter` \| `year` | `date` | `quarter`: 4.1.0 |
| placeholder | The placeholder of date input | string \| \[string,string] | - | |
| popupStyle | To customize the style of the popup calendar | CSSProperties | {} | |
| size | The determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | `large` \| `middle` \| `small` | - | |
| size | To determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | `large` \| `middle` \| `small` | - | |
| style | To customize the style of the input box | CSSProperties | {} | |
| suffixIcon | The custom suffix icon | ReactNode | - | |
| onOpenChange | Callback function, can be executed whether the popup calendar is popped up or closed | function(open) | - | |

View File

@ -6,7 +6,7 @@ import { PickerLocale } from '../generatePicker';
const locale: PickerLocale = {
lang: {
placeholder: 'Valitse päivä',
rangePlaceholder: ['Alku päivä', 'Loppu päivä'],
rangePlaceholder: ['Alkamispäivä', 'Päättymispäivä'],
...CalendarLocale,
},
timePickerLocale: {

View File

@ -64,4 +64,15 @@ describe('DropdownButton', () => {
const wrapper = mount(<Dropdown.Button overlay={menu} />);
expect(wrapper.type().__ANT_BUTTON).toBe(true);
});
it('should pass mouseEnterDelay and mouseLeaveDelay to Dropdown', () => {
const menu = (
<Menu>
<Menu.Item>foo</Menu.Item>
</Menu>
);
const wrapper = mount(<Dropdown.Button mouseEnterDelay={1} mouseLeaveDelay={2} overlay={menu} />);
expect(wrapper.find('Dropdown').props().mouseEnterDelay).toBe(1);
expect(wrapper.find('Dropdown').props().mouseLeaveDelay).toBe(2);
});
});

View File

@ -52,6 +52,8 @@ const DropdownButton: DropdownButtonInterface = props => {
icon = <EllipsisOutlined />,
title,
buttonsRender,
mouseEnterDelay,
mouseLeaveDelay,
...restProps
} = props;
@ -63,6 +65,8 @@ const DropdownButton: DropdownButtonInterface = props => {
trigger: disabled ? [] : trigger,
onVisibleChange,
getPopupContainer: getPopupContainer || getContextPopupContainer,
mouseEnterDelay,
mouseLeaveDelay,
} as DropDownProps;
if ('visible' in props) {

View File

@ -11,7 +11,7 @@ title:
## en-US
Import icons from `@ant-design/icons`, component name of icons with different theme is the icon name suffixed by the theme name. Specific the `spin` property to show spinning animation.
Import icons from `@ant-design/icons`, component name of icons with different theme is the icon name suffixed by the theme name. Specify the `spin` property to show spinning animation.
```jsx
import {

View File

@ -74424,7 +74424,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
>
<input
autocomplete="off"
placeholder="Alku päivä"
placeholder="Alkamispäivä"
readonly=""
size="12"
value=""
@ -74463,7 +74463,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
>
<input
autocomplete="off"
placeholder="Loppu päivä"
placeholder="Päättymispäivä"
readonly=""
size="12"
value=""

View File

@ -1,5 +1,4 @@
/* eslint-disable no-template-curly-in-string */
import Pagination from 'rc-pagination/lib/locale/pt_BR';
import DatePicker from '../date-picker/locale/pt_BR';
import TimePicker from '../time-picker/locale/pt_BR';
@ -21,8 +20,11 @@ const localeValues: Locale = {
filterTitle: 'Menu de Filtro',
filterConfirm: 'OK',
filterReset: 'Resetar',
filterEmptyText: 'Sem filtros',
emptyText: 'Sem conteúdo',
selectAll: 'Selecionar página atual',
selectInvert: 'Inverter seleção',
selectNone: 'Apagar todo o conteúdo',
selectionAll: 'Selecionar todo o conteúdo',
sortTitle: 'Ordenar título',
expand: 'Expandir linha',
@ -41,9 +43,16 @@ const localeValues: Locale = {
cancelText: 'Cancelar',
},
Transfer: {
titles: ['', ''],
searchPlaceholder: 'Procurar',
itemUnit: 'item',
itemsUnit: 'items',
remove: 'Remover',
selectCurrent: 'Selecionar página atual',
removeCurrent: 'Remover página atual',
selectAll: 'Selecionar todos',
removeAll: 'Remover todos',
selectInvert: 'Inverter seleção atual',
},
Upload: {
uploading: 'Enviando...',
@ -68,11 +77,12 @@ const localeValues: Locale = {
back: 'Retornar',
},
Form: {
optional: '(opcional)',
defaultValidateMessages: {
default: 'Erro ${label} na validação de campo',
required: 'Por favor, insira ${label}',
enum: '${label} deve ser um dos seguinte: [${enum}]',
whitespace: '${label} não pode ser um caractér vazio',
whitespace: '${label} não pode ser um carácter vazio',
date: {
format: ' O formato de data ${label} é inválido',
parse: '${label} não pode ser convertido para uma data',
@ -116,6 +126,9 @@ const localeValues: Locale = {
},
},
},
Image: {
preview: 'Pré-visualização',
},
};
export default localeValues;

View File

@ -27,21 +27,22 @@
display: inline-block;
color: inherit;
cursor: pointer;
transition: all 0.3s;
&:not(:last-child) {
margin-right: 8px;
}
> div {
&:focus {
outline: 0;
}
transition: all 0.3s;
&:hover,
&:focus {
&:focus-visible {
transform: @rate-star-hover-scale;
}
&:focus:not(:focus-visible) {
outline: 0;
}
}
&-first,

View File

@ -322,12 +322,6 @@ caption {
caption-side: bottom;
}
th {
// Matches default `<td>` alignment by inheriting from the `<body>`, or the
// closest parent with a set `text-align`.
text-align: inherit;
}
//
// Forms
//

View File

@ -1544,6 +1544,7 @@ describe('Table.filter', () => {
expect(wrapper.find('.ant-table-filter-column')).toHaveLength(3);
});
it('should pagination.current be 1 after filtering', () => {
const onChange = jest.fn();
const columns = [
@ -1593,4 +1594,46 @@ describe('Table.filter', () => {
wrapper.find('.ant-btn-primary').first().simulate('click');
expect(onChange.mock.calls[1][0].current).toBe(1);
});
// https://github.com/ant-design/ant-design/issues/30454
it('should not trigger onFilterDropdownVisibleChange when call confirm({ closeDropdown: false })', () => {
const onFilterDropdownVisibleChange = jest.fn();
const wrapper = mount(
createTable({
columns: [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
filteredValue: name,
filterDropdown: ({ confirm }) => (
<>
<button id="confirm-and-close" type="button" onClick={() => confirm()}>
confirm
</button>
<button
id="confirm-only"
type="button"
onClick={() => confirm({ closeDropdown: false })}
>
confirm
</button>
</>
),
onFilterDropdownVisibleChange,
},
],
}),
);
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
expect(onFilterDropdownVisibleChange).toHaveBeenCalledTimes(1);
wrapper.find('#confirm-only').simulate('click');
expect(onFilterDropdownVisibleChange).toHaveBeenCalledTimes(1);
wrapper.find('#confirm-and-close').simulate('click');
expect(onFilterDropdownVisibleChange).toHaveBeenCalledTimes(2);
expect(onFilterDropdownVisibleChange).toHaveBeenLastCalledWith(false);
});
});

View File

@ -64,7 +64,7 @@ class App extends React.Component {
value={selectedKeys[0]}
onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => this.handleSearch(selectedKeys, confirm, dataIndex)}
style={{ width: 188, marginBottom: 8, display: 'block' }}
style={{ marginBottom: 8, display: 'block' }}
/>
<Space>
<Button

View File

@ -8,14 +8,7 @@ import Checkbox from '../../../checkbox';
import Radio from '../../../radio';
import Dropdown from '../../../dropdown';
import Empty from '../../../empty';
import {
ColumnType,
ColumnFilterItem,
Key,
TableLocale,
GetPopupContainer,
FilterConfirmProps,
} from '../../interface';
import { ColumnType, ColumnFilterItem, Key, TableLocale, GetPopupContainer } from '../../interface';
import FilterDropdownMenuWrapper from './FilterWrapper';
import { FilterState } from '.';
import useSyncState from '../../../_util/hooks/useSyncState';
@ -194,8 +187,10 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
internalTriggerFilter([]);
};
const doFilter = (param: FilterConfirmProps = { closeDropdown: true }) => {
triggerVisible(!param.closeDropdown);
const doFilter = ({ closeDropdown } = { closeDropdown: true }) => {
if (closeDropdown) {
triggerVisible(false);
}
internalTriggerFilter(getFilteredKeysSync());
};

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.15.4",
"version": "4.15.5",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -188,7 +188,7 @@
"cheerio": "^1.0.0-rc.3",
"concurrently": "^6.0.0",
"cross-env": "^7.0.0",
"css-minimizer-webpack-plugin": "^2.0.0",
"css-minimizer-webpack-plugin": "^3.0.0",
"css-split-webpack-plugin": "^0.2.6",
"dekko": "^0.2.1",
"docsearch.js": "^2.6.3",
@ -207,7 +207,7 @@
"eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-unicorn": "^31.0.0",
"eslint-plugin-unicorn": "^32.0.1",
"fetch-jsonp": "^1.1.3",
"fs-extra": "^10.0.0",
"full-icu": "^1.3.0",
@ -252,7 +252,7 @@
"react-highlight-words": "^0.17.0",
"react-infinite-scroller": "^1.2.4",
"react-intl": "^5.3.0",
"react-resizable": "^2.0.0",
"react-resizable": "^3.0.1",
"react-router-dom": "^5.0.1",
"react-sortable-hoc": "^2.0.0",
"react-sticky": "^6.0.3",

View File

@ -59,6 +59,10 @@ module.exports = {
javascriptEnabled: true,
},
webpackConfig(config) {
config.cache = {
type: 'filesystem',
};
config.resolve.alias = {
'antd/lib': path.join(process.cwd(), 'components'),
'antd/es': path.join(process.cwd(), 'components'),

View File

@ -79,7 +79,7 @@ export default () => {
const articles = data[isZhCN ? 'cn' : 'en'];
const yearData: Record<number | string, Record<string, Article[]>> = {};
articles.forEach(article => {
articles?.forEach(article => {
const year = moment(article.date).year();
yearData[year] = yearData[year] || {};