diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..2205895642 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install pretty-quick --staged \ No newline at end of file diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index df5b709c94..8cfdbc3446 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -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` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 24a553a907..4c10bdda0d 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,17 +15,39 @@ 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` - 🐞 修复 Menu.Item 设置 `collapsedWidth` 时宽度错误的问题。[#30357](https://github.com/ant-design/ant-design/pull/30357) [@Map1en](https://github.com/Map1en) - 🐞 修复 Radio 选中样式有时高度略长的问题。[#30367](https://github.com/ant-design/ant-design/pull/30367) -- 🐞 修复 Typography.Link 在 `editable` 模式下点击编辑会触发链接跳转的问题。[#30354](https://github.com/ant-design/ant-design/pull/30354) [@John60676](https://github.com/John60676) +- 🐞 修复 Typography.Link 在 `editable` 模式下点击编辑会触发链接跳转的问题。[#30354](https://github.com/ant-design/ant-design/pull/30354) [@John60676](https://github.com/John60676) - 🐞 InputNumber 现在清空输入框时会触发 `onChange(null)`。[#30337](https://github.com/ant-design/ant-design/pull/30337) - 🐞 修复 Modal `footer` 里放置 Dropdown.Button 的样式错乱问题。[#30328](https://github.com/ant-design/ant-design/pull/30328) [@Map1en](https://github.com/Map1en) - 💄 替换 Anchor 默认背景颜色从 `#FFFFFF` 改至 `transparent`。[#30336](https://github.com/ant-design/ant-design/pull/30336) -- 🌐 添加 TimePicker.RangePicker `ko_KR` 和 `ja_JP` 的 `placeholder` 国际化。[#30285](https://github.com/ant-design/ant-design/pull/30285) [@ChalkPE](https://github.com/ChalkPE) +- 🌐 添加 TimePicker.RangePicker `ko_KR` 和 `ja_JP` 的 `placeholder` 国际化。[#30285](https://github.com/ant-design/ant-design/pull/30285) [@ChalkPE](https://github.com/ChalkPE) - TypeScript - 🤖 修复 Upload `beforeUpload` 和 `UploadFile` 类型声明。[#30351](https://github.com/ant-design/ant-design/pull/30351) [#30343](https://github.com/ant-design/ant-design/pull/30343) [@kerm1it](https://github.com/kerm1it) diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 4c36123177..e9efe64e36 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -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) | - | | diff --git a/components/date-picker/locale/fi_FI.tsx b/components/date-picker/locale/fi_FI.tsx index a6222f2b36..f6a06451d5 100644 --- a/components/date-picker/locale/fi_FI.tsx +++ b/components/date-picker/locale/fi_FI.tsx @@ -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: { diff --git a/components/dropdown/__tests__/dropdown-button.test.js b/components/dropdown/__tests__/dropdown-button.test.js index 451b07c868..80ed2586f4 100644 --- a/components/dropdown/__tests__/dropdown-button.test.js +++ b/components/dropdown/__tests__/dropdown-button.test.js @@ -64,4 +64,15 @@ describe('DropdownButton', () => { const wrapper = mount(); expect(wrapper.type().__ANT_BUTTON).toBe(true); }); + + it('should pass mouseEnterDelay and mouseLeaveDelay to Dropdown', () => { + const menu = ( + + foo + + ); + const wrapper = mount(); + expect(wrapper.find('Dropdown').props().mouseEnterDelay).toBe(1); + expect(wrapper.find('Dropdown').props().mouseLeaveDelay).toBe(2); + }); }); diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index 4af0a837fe..3d2f902baf 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -52,6 +52,8 @@ const DropdownButton: DropdownButtonInterface = props => { icon = , 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) { diff --git a/components/icon/demo/basic.md b/components/icon/demo/basic.md index af2f66304d..2b3879038c 100644 --- a/components/icon/demo/basic.md +++ b/components/icon/demo/basic.md @@ -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 { diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index f7231bfa4e..458b4330dc 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -74424,7 +74424,7 @@ exports[`Locale Provider should display the text as fi 1`] = ` > div { - &:focus { - outline: 0; - } + transition: all 0.3s; &:hover, - &:focus { + &:focus-visible { transform: @rate-star-hover-scale; } + + &:focus:not(:focus-visible) { + outline: 0; + } } &-first, diff --git a/components/style/core/global.less b/components/style/core/global.less index d4f53103fb..f1bbd8b08c 100644 --- a/components/style/core/global.less +++ b/components/style/core/global.less @@ -322,12 +322,6 @@ caption { caption-side: bottom; } -th { - // Matches default `` alignment by inheriting from the ``, or the - // closest parent with a set `text-align`. - text-align: inherit; -} - // // Forms // diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js index d426312213..962f2d31c4 100644 --- a/components/table/__tests__/Table.filter.test.js +++ b/components/table/__tests__/Table.filter.test.js @@ -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 }) => ( + <> + + + + ), + 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); + }); }); diff --git a/components/table/demo/custom-filter-panel.md b/components/table/demo/custom-filter-panel.md index 9c3a69021d..719af1a561 100644 --- a/components/table/demo/custom-filter-panel.md +++ b/components/table/demo/custom-filter-panel.md @@ -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' }} />