chore: auto merge branchs (#30798)

chore: merge master into feature
This commit is contained in:
github-actions[bot] 2021-06-01 02:50:09 +00:00 committed by GitHub
commit 6fa59e718c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 3061 additions and 1993 deletions

View File

@ -7,7 +7,7 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
if: github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master'
if: (github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master') && github.event.pull_request.head.user.login == 'ant-design'
steps:
- uses: actions-cool/issues-helper@v2.2.1
with:

View File

@ -14,6 +14,7 @@ function getTestRegex(libDir) {
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
setupFiles: ['./tests/setup.js'],
setupFilesAfterEnv: ['./tests/setupAfterEnv.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'md'],

View File

@ -15,6 +15,25 @@ timeline: true
---
## 4.16.1
`2021-05-30`
- Menu
- 🐞 Fix overflow not work as expect. [#30672](https://github.com/ant-design/ant-design/pull/30672)
- 🐞 Fix warning of `Can't perform a React state update on an unmounted component` when unmounted. [#30678](https://github.com/ant-design/ant-design/pull/30678)
- 🐞 Fix `inline` mode not correct handle ellipsis when `icon` not provided. [#30682](https://github.com/ant-design/ant-design/pull/30682)
- Typography
- 🐞 Fix Typography.Text trigger ResizeObserver when css ellipsis is validate. [#30664](https://github.com/ant-design/ant-design/pull/30664)
- 🐞 Fix `ellipsis` not work when HMR take effect in dev env. [#30754](https://github.com/ant-design/ant-design/pull/30754)
- Table
- 🐞 Fix Table.Summary missing border style when `sticky` and `bordered` enabled. [#30666](https://github.com/ant-design/ant-design/pull/30666)
- 🐞 Fix column align with sorter and filter. [#30744](https://github.com/ant-design/ant-design/pull/30744)
- 🐞 Fix Collapse expandIconPosition="right" not working. [#30680](https://github.com/ant-design/ant-design/pull/30680) [@hongdeyuan](https://github.com/hongdeyuan)
- TypeScript
- 🤖 Export TableColumnsType type.[#30747](https://github.com/ant-design/ant-design/pull/30747) [@alwaysloseall](https://github.com/alwaysloseall)
- 🤖 Export TreeDataNode type. [#30745](https://github.com/ant-design/ant-design/pull/30745) [@alwaysloseall](https://github.com/alwaysloseall)
## 4.16.0
`2021-05-24`

View File

@ -15,6 +15,25 @@ timeline: true
---
## 4.16.1
`2021-05-30`
- Menu
- 🐞 修复超长省略不能按照预期工作的问题。[#30672](https://github.com/ant-design/ant-design/pull/30672)
- 🐞 修复在卸载时报 `Can't perform a React state update on an unmounted component` 的警告信息。[#30678](https://github.com/ant-design/ant-design/pull/30678)
- 🐞 修复 `inline` 模式下,没有 `icon` 的条目不能正确处理省略样式的问题。[#30682](https://github.com/ant-design/ant-design/pull/30682)
- Typography
- 🐞 修复 Typography.Text 在 css 省略可用时监听 ResizeObserver 的无用操作。[#30664](https://github.com/ant-design/ant-design/pull/30664)
- 🐞 修复 `ellipsis` 在开发环境 HMR 生效后不再工作的问题。[#30754](https://github.com/ant-design/ant-design/pull/30754)
- Table
- 🐞 修复筛选/排序列的 `align` 属性。[#30744](https://github.com/ant-design/ant-design/pull/30744)
- 🐞 修复 Table.Summary `sticky` 模式下,配置 `bordered` 边框样式丢失的问题。[#30666](https://github.com/ant-design/ant-design/pull/30666)
- 🐞 修复 Collapse `expandIconPosition="right"` 未生效的问题。[#30680](https://github.com/ant-design/ant-design/pull/30680) [@hongdeyuan](https://github.com/hongdeyuan)
- TypeScript
- 🤖 导出 TableColumnsType 类型。[#30747](https://github.com/ant-design/ant-design/pull/30747) [@alwaysloseall](https://github.com/alwaysloseall)
- 🤖 导出 TreeDataNode 类型。[#30745](https://github.com/ant-design/ant-design/pull/30745) [@alwaysloseall](https://github.com/alwaysloseall)
## 4.16.0
`2021-05-24`

View File

@ -47,7 +47,7 @@ Uma solução empresarial de design e biblioteca UI para React.
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](https://ant.design)
[English](./README.md) | Português | [简体中文](./README-zh_CN.md)
[English](./README.md) | Português | [简体中文](./README-zh_CN.md) | [Українською](./README-uk_UA.md)
## ✨ Funcionalidades

161
README-uk_UA.md Normal file
View File

@ -0,0 +1,161 @@
<p align="center">
<a href="https://ant.design">
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
</a>
</p>
<h1 align="center">Ant Design</h1>
<div align="center">
Мова інтерфейсу корпоративного класу та React UI бібліотека.
[![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![][bundlesize-js-image]][unpkg-js-url] [![][bundlesize-css-image]][unpkg-css-url]
[![Follow Twitter][twitter-image]][twitter-url] [![FOSSA Status][fossa-image]][fossa-url] [![Discussions][discussions-image]][discussions-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
[npm-url]: http://npmjs.org/package/antd
[github-action-image]: https://github.com/ant-design/ant-design/workflows/%E2%9C%85%20test/badge.svg
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3A%22%E2%9C%85+test%22
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
[david-url]: https://david-dm.org/ant-design/ant-design
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
[download-url]: https://npmjs.org/package/antd
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
[twitter-url]: https://twitter.com/AntDesignUI
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
[discussions-url]: https://github.com/ant-design/ant-design/discussions
[bundlesize-js-image]: https://img.badgesize.io/https:/unpkg.com/antd/dist/antd.min.js?label=antd.min.js&compression=gzip&style=flat-square
[bundlesize-css-image]: https://img.badgesize.io/https:/unpkg.com/antd/dist/antd.min.css?label=antd.min.css&compression=gzip&style=flat-square
[unpkg-js-url]: https://unpkg.com/browse/antd/dist/antd.min.js
[unpkg-css-url]: https://unpkg.com/browse/antd/dist/antd.min.css
</div>
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](https://ant.design)
[English](./README.md) | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md) | Українською
## ✨ Особливості
- 🌈 UI корпоративного класу, призначений для веб-додатків.
- 📦 Набір високоякісних компонентів React з коробки.
- 🛡 Написано на TypeScript із вбудованими статичними типами.
- ⚙️ Весь пакет дизайнерських ресурсів та засобів розробки.
- 🌍 Підтримка інтернаціоналізації для десятків мов.
- 🎨 Потужне налаштування теми в кожній деталі.
## 🖥 Підтримка навколишнього середовища
- Сучасні браузери та Internet Explorer 11 (з [поліфілами](https://stackoverflow.com/questions/57020976/polyfills-in-2019-for-ie11))
- Рендеринг на стороні сервера (SSR)
- [Electron](https://www.electronjs.org/)
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
| --- | --- | --- | --- | --- |
| IE11, Edge | 2 останні версії | 2 останні версії | 2 останні версії | 2 останні версії |
## 📦 Встановлення
```bash
npm install antd
```
```bash
yarn add antd
```
## 🔨 Використання
```jsx
import { Button, DatePicker } from 'antd';
const App = () => (
<>
<Button type="primary">PRESS ME</Button>
<DatePicker placeholder="select date" />
</>
);
```
Та імпортуй стиль вручну:
```jsx
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```
### TypeScript
`antd` написано на TypeScript із повною типізацією, вибери [Використання у TypeScript](https://ant.design/docs/react/use-in-typescript) щоб розпочати.
## 🌍 Інтернаціоналізація
Десятки мов підтримуються в `antd`, дивись [i18n](https://ant.design/docs/react/i18n).
## 🔗 Посилання
- [Домашня сторінка](https://ant.design/)
- [Компоненти](https://ant.design/components/overview)
- [Ant Design Pro](http://pro.ant.design/)
- [Change Log](CHANGELOG.en-US.md)
- [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design)
- [Ant Design Pro Components](https://procomponents.ant.design)
- [Ant Design Charts](https://charts.ant.design)
- [Ant Design Icons](https://github.com/ant-design/ant-design-icons)
- [Ant Design Colors](https://github.com/ant-design/ant-design-colors)
- [Лендінги](https://landing.ant.design)
- [Motion](https://motion.ant.design)
- [Scaffold Market](http://scaffold.ant.design)
- [Інструкція розробника](https://github.com/ant-design/ant-design/wiki/Development)
- [Примітка до випуску версій](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [FAQ](https://ant.design/docs/react/faq)
- [CodeSandbox темплейт](https://u.ant.design/codesandbox-repro) для звітів про помилки
- [Кастомізація теми](https://ant.design/docs/react/customize-theme)
- [Як подати заявку на участь у програмі Співавторства](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
## ⌨️ Розробка
Використовуй Gitpod, безкоштовне середовище розробки для GitHub.
[![Відкрити у Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design)
Або клонуй локально:
```bash
$ git clone git@github.com:ant-design/ant-design.git
$ cd ant-design
$ npm install
$ npm start
```
Відкрий у браузері http://127.0.0.1:8001, докладніше дивись [Розробка](https://github.com/ant-design/ant-design/wiki/Development).
## 🤝 Контрибьютинг [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
Прочитай наш [посібник контриб'ютора](https://ant.design/docs/react/contributing) і давай будувати кращий antd разом.
Ми вітаємо всі внески. Будь ласка, прочитай наш [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) спочатку. Ти можеш пропонувати будь-які ідеї як [Pull Request](https://github.com/ant-design/ant-design/pulls) або як [GitHub issues](https://github.com/ant-design/ant-design/issues). Якщо ти хочеш вдосконалити код, переглянь [Інструкції з розробки](https://github.com/ant-design/ant-design/wiki/Development) та добре проведи час! :)
Якщо ти співавтор, дотримуйся нашого [Pull Request принципу](https://github.com/ant-design/ant-design/wiki/PR-principle) щоб створити Pull Request за [темплейтом співавтора](https://github.com/ant-design/ant-design/compare?expand=1&template=collaborator.md).
[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/34526884)
## ❤️ Спонсори та Меценати [![](https://opencollective.com/ant-design/tiers/sponsors/badge.svg?label=Sponsors&color=brightgreen)](https://opencollective.com/ant-design#support) [![](https://opencollective.com/ant-design/tiers/backers/badge.svg?label=Backers&color=brightgreen)](https://opencollective.com/ant-design#support)
[![](https://opencollective.com/ant-design/tiers/sponsors.svg?avatarHeight=36)](https://opencollective.com/ant-design#support)
[![](https://opencollective.com/ant-design/tiers/backers.svg?avatarHeight=36)](https://opencollective.com/ant-design#support)

View File

@ -47,7 +47,7 @@
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Ey3wTo-5__QAAAAAAAAAAABkARQnAQ)](https://ant.design/index-cn)
[English](./README.md) | [Português](./README-pt_BR.md) | 简体中文
[English](./README.md) | [Português](./README-pt_BR.md) | 简体中文 | [Українською](./README-uk_UA.md)
## ✨ 特性

View File

@ -47,7 +47,7 @@ An enterprise-class UI design language and React UI library.
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](https://ant.design)
English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md)
English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md) | [Українською](./README-uk_UA.md)
## ✨ Features

View File

@ -35,3 +35,9 @@ Please note that Affix should not cover other content on the page, especially wh
We don't listen window scroll for performance consideration. You can add listener if you still want: <https://codesandbox.io/s/2xyj5zr85p>
Related issues[#3938](https://github.com/ant-design/ant-design/issues/3938) [#5642](https://github.com/ant-design/ant-design/issues/5642) [#16120](https://github.com/ant-design/ant-design/issues/16120)
### When Affix is used in a horizontal scroll container, the position of the element `left` is incorrect.
Affix is generally only applicable to areas with one-way scrolling, and only supports use in vertical scrolling containers. If you want to use it in a horizontal container, you can consider using the native `position: sticky` implementation.
Related issues[#29108](https://github.com/ant-design/ant-design/issues/29108)

View File

@ -36,3 +36,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tX6-md4H6/Affix.svg
从性能角度考虑,我们只监听容器滚动事件。如果希望任意滚动,你可以在窗体添加滚动监听:<https://codesandbox.io/s/2xyj5zr85p>
相关 issue[#3938](https://github.com/ant-design/ant-design/issues/3938) [#5642](https://github.com/ant-design/ant-design/issues/5642) [#16120](https://github.com/ant-design/ant-design/issues/16120)
### Affix 在水平滚动容器中使用时, 元素 `left` 位置不正确。
Affix 一般只适用于单向滚动的区域,只支持在垂直滚动容器中使用。如果希望在水平容器中使用,你可以考虑使用 原生 `position: sticky` 实现。
相关 issue: [#29108](https://github.com/ant-design/ant-design/issues/29108)

View File

@ -202,11 +202,70 @@ exports[`Badge should render when count is changed 1`] = `
</span>
<span
class="ant-scroll-number-only"
style="transition: none;"
style="transform: translateY(-100%);"
>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -900%; left: 0px;"
>
0
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -800%; left: 0px;"
>
1
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -700%; left: 0px;"
>
2
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -600%; left: 0px;"
>
3
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -500%; left: 0px;"
>
4
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -400%; left: 0px;"
>
5
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -300%; left: 0px;"
>
6
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -200%; left: 0px;"
>
7
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -100%; left: 0px;"
>
8
</p>
<p
class="ant-scroll-number-only-unit current"
style=""
>
9
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 100%; left: 0px;"
>
0
</p>
@ -236,11 +295,70 @@ exports[`Badge should render when count is changed 2`] = `
</span>
<span
class="ant-scroll-number-only"
style="transition: none;"
style="transform: translateY(-100%);"
>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -900%; left: 0px;"
>
1
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -800%; left: 0px;"
>
2
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -700%; left: 0px;"
>
3
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -600%; left: 0px;"
>
4
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -500%; left: 0px;"
>
5
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -400%; left: 0px;"
>
6
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -300%; left: 0px;"
>
7
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -200%; left: 0px;"
>
8
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -100%; left: 0px;"
>
9
</p>
<p
class="ant-scroll-number-only-unit current"
style=""
>
0
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 100%; left: 0px;"
>
1
</p>
@ -341,11 +459,70 @@ exports[`Badge should render when count is changed 6`] = `
>
<span
class="ant-scroll-number-only"
style="transition: none;"
style="transform: translateY(100%);"
>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: -100%; left: 0px;"
>
9
</p>
<p
class="ant-scroll-number-only-unit current"
style=""
>
0
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 100%; left: 0px;"
>
1
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 200%; left: 0px;"
>
2
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 300%; left: 0px;"
>
3
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 400%; left: 0px;"
>
4
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 500%; left: 0px;"
>
5
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 600%; left: 0px;"
>
6
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 700%; left: 0px;"
>
7
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 800%; left: 0px;"
>
8
</p>
<p
class="ant-scroll-number-only-unit"
style="position: absolute; top: 900%; left: 0px;"
>
9
</p>

View File

@ -72,8 +72,12 @@
padding-right: @collapse-header-padding-extra;
.@{collapse-prefix-cls}-arrow {
position: absolute;
top: 50%;
right: @padding-md;
left: auto;
margin: 0;
transform: translateY(-50%);
}
}
}

View File

@ -6,6 +6,14 @@ import zhCN from '../../locale/zh_CN';
import Form from '../../form';
describe('ConfigProvider.Form', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
describe('form validateMessages', () => {
const wrapperComponent = ({ validateMessages }) => {
const formRef = React.createRef();
@ -26,14 +34,6 @@ describe('ConfigProvider.Form', () => {
return [wrapper, formRef];
};
beforeEach(() => {
jest.useFakeTimers();
});
afterEach(() => {
jest.useRealTimers();
});
it('set locale zhCN', async () => {
const [wrapper, formRef] = wrapperComponent({});

View File

@ -160,7 +160,7 @@ Added in `4.1.0`.
| format | To set the date format, refer to [moment.js](http://momentjs.com/). When an array is provided, all values are used for parsing and first value is used for formatting | string \| string\[] | `YYYY-MM-DD HH:mm:ss` | |
| ranges | The preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - | |
| renderExtraFooter | Render extra footer in panel | () => React.ReactNode | - | |
| separator | Set separator between inputs | string | `~` | |
| separator | Set separator between inputs | React.ReactNode | `<SwapRightOutlined />` | |
| showTime | To provide an additional time selection | object \| boolean | [TimePicker Options](/components/time-picker/#API) | |
| showTime.defaultValue | To set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
| value | To set date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |

View File

@ -161,7 +161,7 @@ import locale from 'antd/lib/locale/zh_CN';
| format | 展示的日期格式 | string | `YYYY-MM-DD HH:mm:ss` | |
| ranges | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - | |
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - | |
| separator | 设置分隔符 | string | `~` | |
| separator | 设置分隔符 | React.ReactNode | `<SwapRightOutlined />` | |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
| value | 日期 | [moment](http://momentjs.com/)\[] | - | |

View File

@ -438,3 +438,7 @@ React 中异步更新会导致受控组件交互行为异常。当用户交互
### `setFieldsValue` 不会触发 `onFieldsChange``onValuesChange`
是的change 事件仅当用户交互才会触发。该设计是为了防止在 change 事件中调用 `setFieldsValue` 导致的循环问题。
### 有更多参考文档吗?
- 你可以阅读[《antd v4 Form 使用心得》](https://zhuanlan.zhihu.com/p/375753910)获得一些使用帮助以及建议。

View File

@ -178,13 +178,18 @@ export type {
ColumnGroupType as TableColumnGroupType,
ColumnType as TableColumnType,
ColumnProps as TableColumnProps,
ColumnsType as TableColumnsType,
} from './table';
export { default as Table } from './table';
export type { TransferProps } from './transfer';
export { default as Transfer } from './transfer';
export type { TreeProps, AntTreeNodeProps as TreeNodeProps } from './tree';
export type {
TreeProps,
AntTreeNodeProps as TreeNodeProps,
DataNode as TreeDataNode,
} from './tree';
export { default as Tree } from './tree';
export type { TreeSelectProps } from './tree-select';

View File

@ -237,6 +237,10 @@ exports[`renders ./components/layout/demo/custom-trigger.md correctly 1`] = `
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
</aside>
<section
@ -368,6 +372,10 @@ exports[`renders ./components/layout/demo/fixed.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</header>
<main
class="ant-layout-content site-layout"
@ -699,6 +707,10 @@ exports[`renders ./components/layout/demo/fixed-sider.md correctly 1`] = `
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
</aside>
<section
@ -969,6 +981,10 @@ exports[`renders ./components/layout/demo/responsive.md correctly 1`] = `
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
</aside>
<section
@ -1196,6 +1212,10 @@ exports[`renders ./components/layout/demo/side.md correctly 1`] = `
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
<div
class="ant-layout-sider-trigger"
@ -1369,6 +1389,10 @@ exports[`renders ./components/layout/demo/top.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</header>
<main
class="ant-layout-content"
@ -1520,6 +1544,10 @@ exports[`renders ./components/layout/demo/top-side.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</header>
<main
class="ant-layout-content"
@ -1761,6 +1789,10 @@ exports[`renders ./components/layout/demo/top-side.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
</aside>
<main
@ -1870,6 +1902,10 @@ exports[`renders ./components/layout/demo/top-side-2.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</header>
<section
class="ant-layout"
@ -2065,6 +2101,10 @@ exports[`renders ./components/layout/demo/top-side-2.md correctly 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display:none"
/>
</div>
</aside>
<section

View File

@ -6673,7 +6673,11 @@ exports[`Locale Provider should display the text as ar 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -11687,7 +11691,11 @@ exports[`Locale Provider should display the text as az 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -16701,7 +16709,11 @@ exports[`Locale Provider should display the text as bg 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -21715,7 +21727,11 @@ exports[`Locale Provider should display the text as by 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -26729,7 +26745,11 @@ exports[`Locale Provider should display the text as ca 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -31743,7 +31763,11 @@ exports[`Locale Provider should display the text as cs 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -36757,7 +36781,11 @@ exports[`Locale Provider should display the text as da 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -41771,7 +41799,11 @@ exports[`Locale Provider should display the text as de 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -46785,7 +46817,11 @@ exports[`Locale Provider should display the text as el 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -51799,7 +51835,11 @@ exports[`Locale Provider should display the text as en 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -56813,7 +56853,11 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -61827,7 +61871,11 @@ exports[`Locale Provider should display the text as es 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -66841,7 +66889,11 @@ exports[`Locale Provider should display the text as et 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -71855,7 +71907,11 @@ exports[`Locale Provider should display the text as fa 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -76869,7 +76925,11 @@ exports[`Locale Provider should display the text as fi 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -81883,7 +81943,11 @@ exports[`Locale Provider should display the text as fr 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -86897,7 +86961,11 @@ exports[`Locale Provider should display the text as fr 2`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -91911,7 +91979,11 @@ exports[`Locale Provider should display the text as fr 3`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -96925,7 +96997,11 @@ exports[`Locale Provider should display the text as ga 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -101939,7 +102015,11 @@ exports[`Locale Provider should display the text as gl 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -106953,7 +107033,11 @@ exports[`Locale Provider should display the text as he 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -111967,7 +112051,11 @@ exports[`Locale Provider should display the text as hi 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -116981,7 +117069,11 @@ exports[`Locale Provider should display the text as hr 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -121995,7 +122087,11 @@ exports[`Locale Provider should display the text as hu 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -127009,7 +127105,11 @@ exports[`Locale Provider should display the text as hy-am 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -132023,7 +132123,11 @@ exports[`Locale Provider should display the text as id 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -137037,7 +137141,11 @@ exports[`Locale Provider should display the text as is 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -142051,7 +142159,11 @@ exports[`Locale Provider should display the text as it 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -147065,7 +147177,11 @@ exports[`Locale Provider should display the text as ja 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -152079,7 +152195,11 @@ exports[`Locale Provider should display the text as kk 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -157093,7 +157213,11 @@ exports[`Locale Provider should display the text as kn 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -162107,7 +162231,11 @@ exports[`Locale Provider should display the text as ko 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -167121,7 +167249,11 @@ exports[`Locale Provider should display the text as ku 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -172135,7 +172267,11 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -177149,7 +177285,11 @@ exports[`Locale Provider should display the text as lt 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -182163,7 +182303,11 @@ exports[`Locale Provider should display the text as lv 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -187177,7 +187321,11 @@ exports[`Locale Provider should display the text as mk 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -192191,7 +192339,11 @@ exports[`Locale Provider should display the text as mn-mn 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -197205,7 +197357,11 @@ exports[`Locale Provider should display the text as ms-my 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -202219,7 +202375,11 @@ exports[`Locale Provider should display the text as nb 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -207233,7 +207393,11 @@ exports[`Locale Provider should display the text as ne-np 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -212247,7 +212411,11 @@ exports[`Locale Provider should display the text as nl 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -217261,7 +217429,11 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -222275,7 +222447,11 @@ exports[`Locale Provider should display the text as pl 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -227289,7 +227465,11 @@ exports[`Locale Provider should display the text as pt 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -232303,7 +232483,11 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -237317,7 +237501,11 @@ exports[`Locale Provider should display the text as ro 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -242331,7 +242519,11 @@ exports[`Locale Provider should display the text as ru 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -247345,7 +247537,11 @@ exports[`Locale Provider should display the text as sk 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -252359,7 +252555,11 @@ exports[`Locale Provider should display the text as sl 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -257373,7 +257573,11 @@ exports[`Locale Provider should display the text as sr 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -262387,7 +262591,11 @@ exports[`Locale Provider should display the text as sv 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -267401,7 +267609,11 @@ exports[`Locale Provider should display the text as ta 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -272415,7 +272627,11 @@ exports[`Locale Provider should display the text as th 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -277429,7 +277645,11 @@ exports[`Locale Provider should display the text as tr 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -282443,7 +282663,11 @@ exports[`Locale Provider should display the text as uk 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -287457,7 +287681,11 @@ exports[`Locale Provider should display the text as vi 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -292471,7 +292699,11 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -297485,7 +297717,11 @@ exports[`Locale Provider should display the text as zh-hk 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -302499,7 +302735,11 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"

View File

@ -158,7 +158,7 @@ Mentions.getMentions = (value: string = '', config?: MentionsConfig): MentionsEn
if (hitPrefix !== null) {
return {
prefix: hitPrefix,
value: str.slice(hitPrefix!.length),
value: str.slice((hitPrefix as string).length),
};
}
return null;

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Menu Menu.Item with icon children auto wrap span 1`] = `
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light"
data-menu-list="true"
role="menu"
tabindex="0"
>
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
tabindex="-1"
Array [
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light"
data-menu-list="true"
role="menu"
tabindex="0"
>
<span
aria-label="mail"
class="anticon anticon-mail ant-menu-item-icon"
role="img"
>
<svg
aria-hidden="true"
data-icon="mail"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Navigation One
</span>
</li>
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-2"
role="menuitem"
tabindex="-1"
>
<span
aria-label="mail"
class="anticon anticon-mail ant-menu-item-icon"
role="img"
>
<svg
aria-hidden="true"
data-icon="mail"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
<span>
Navigation One
</span>
</span>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-controls="rc-menu-uuid-test-3-popup"
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
data-menu-id="rc-menu-uuid-test-3"
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
tabindex="-1"
>
@ -108,21 +38,10 @@ exports[`Menu Menu.Item with icon children auto wrap span 1`] = `
>
Navigation One
</span>
<i
class="ant-menu-submenu-arrow"
/>
</div>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-controls="rc-menu-uuid-test-4-popup"
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
data-menu-id="rc-menu-uuid-test-4"
</li>
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-2"
role="menuitem"
tabindex="-1"
>
@ -145,146 +64,251 @@ exports[`Menu Menu.Item with icon children auto wrap span 1`] = `
/>
</svg>
</span>
<span>
Navigation One
<span
class="ant-menu-title-content"
>
<span>
Navigation One
</span>
</span>
<i
class="ant-menu-submenu-arrow"
/>
</div>
</li>
</ul>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-controls="rc-menu-uuid-test-3-popup"
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
data-menu-id="rc-menu-uuid-test-3"
role="menuitem"
tabindex="-1"
>
<span
aria-label="mail"
class="anticon anticon-mail ant-menu-item-icon"
role="img"
>
<svg
aria-hidden="true"
data-icon="mail"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Navigation One
</span>
<i
class="ant-menu-submenu-arrow"
/>
</div>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-controls="rc-menu-uuid-test-4-popup"
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
data-menu-id="rc-menu-uuid-test-4"
role="menuitem"
tabindex="-1"
>
<span
aria-label="mail"
class="anticon anticon-mail ant-menu-item-icon"
role="img"
>
<svg
aria-hidden="true"
data-icon="mail"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"
/>
</svg>
</span>
<span>
Navigation One
</span>
<i
class="ant-menu-submenu-arrow"
/>
</div>
</li>
</ul>,
<div
aria-hidden="true"
style="display: none;"
/>,
]
`;
exports[`Menu rtl render component should be rendered correctly in RTL direction 1`] = `
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-menu-rtl"
data-menu-list="true"
dir="rtl"
role="menu"
tabindex="0"
>
<li
class="ant-menu-item"
role="menuitem"
tabindex="-1"
Array [
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-menu-rtl"
data-menu-list="true"
dir="rtl"
role="menu"
tabindex="0"
>
<span
class="ant-menu-title-content"
/>
</li>
<li
class="ant-menu-item-group"
>
<div
class="ant-menu-item-group-title"
/>
<ul
class="ant-menu-item-group-list"
/>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
<li
class="ant-menu-item"
role="menuitem"
tabindex="-1"
>
<span
class="ant-menu-title-content"
/>
<i
class="ant-menu-submenu-arrow"
</li>
<li
class="ant-menu-item-group"
>
<div
class="ant-menu-item-group-title"
/>
</div>
</li>
</ul>
<ul
class="ant-menu-item-group-list"
/>
</li>
<li
class="ant-menu-submenu ant-menu-submenu-vertical"
role="none"
>
<div
aria-expanded="false"
aria-haspopup="true"
class="ant-menu-submenu-title"
role="menuitem"
tabindex="-1"
>
<span
class="ant-menu-title-content"
/>
<i
class="ant-menu-submenu-arrow"
/>
</div>
</li>
</ul>,
<div
aria-hidden="true"
style="display:none"
/>,
]
`;
exports[`Menu should controlled collapse work 1`] = `
<ul
class="ant-menu ant-menu-root ant-menu-inline ant-menu-light"
data-menu-list="true"
role="menu"
tabindex="0"
>
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
style="padding-left: 24px;"
tabindex="-1"
Array [
<ul
class="ant-menu ant-menu-root ant-menu-inline ant-menu-light"
data-menu-list="true"
role="menu"
tabindex="0"
>
<span
aria-label="pie-chart"
class="anticon anticon-pie-chart ant-menu-item-icon"
role="img"
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
style="padding-left: 24px;"
tabindex="-1"
>
<svg
aria-hidden="true"
data-icon="pie-chart"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<span
aria-label="pie-chart"
class="anticon anticon-pie-chart ant-menu-item-icon"
role="img"
>
<path
d="M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 00-282.8 117.1 398.19 398.19 0 00-85.7 127.1A397.61 397.61 0 0072 552a398.46 398.46 0 00117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 00472 952a398.46 398.46 0 00282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 00872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 01470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 00589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 01166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Option 1
</span>
</li>
</ul>
<svg
aria-hidden="true"
data-icon="pie-chart"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 00-282.8 117.1 398.19 398.19 0 00-85.7 127.1A397.61 397.61 0 0072 552a398.46 398.46 0 00117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 00472 952a398.46 398.46 0 00282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 00872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 01470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 00589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 01166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Option 1
</span>
</li>
</ul>,
<div
aria-hidden="true"
style="display: none;"
/>,
]
`;
exports[`Menu should controlled collapse work 2`] = `
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-menu-inline-collapsed"
data-menu-list="true"
role="menu"
tabindex="0"
>
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
style="padding-left: 24px;"
tabindex="-1"
Array [
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-menu-inline-collapsed"
data-menu-list="true"
role="menu"
tabindex="0"
>
<span
aria-label="pie-chart"
class="anticon anticon-pie-chart ant-menu-item-icon"
role="img"
<li
class="ant-menu-item"
data-menu-id="rc-menu-uuid-test-1"
role="menuitem"
style="padding-left: 24px;"
tabindex="-1"
>
<svg
aria-hidden="true"
data-icon="pie-chart"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<span
aria-label="pie-chart"
class="anticon anticon-pie-chart ant-menu-item-icon"
role="img"
>
<path
d="M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 00-282.8 117.1 398.19 398.19 0 00-85.7 127.1A397.61 397.61 0 0072 552a398.46 398.46 0 00117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 00472 952a398.46 398.46 0 00282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 00872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 01470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 00589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 01166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Option 1
</span>
</li>
</ul>
<svg
aria-hidden="true"
data-icon="pie-chart"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 00-282.8 117.1 398.19 398.19 0 00-85.7 127.1A397.61 397.61 0 0072 552a398.46 398.46 0 00117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 00472 952a398.46 398.46 0 00282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 00872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 01470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 00589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 01166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"
/>
</svg>
</span>
<span
class="ant-menu-title-content"
>
Option 1
</span>
</li>
</ul>,
<div
aria-hidden="true"
style="display: none;"
/>,
]
`;

View File

@ -66,6 +66,14 @@ describe('Menu', () => {
window.requestAnimationFrame = callback => window.setTimeout(callback, 16);
window.cancelAnimationFrame = window.clearTimeout;
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
mountTest(() => (
<Menu>
<Menu.Item />
@ -107,12 +115,10 @@ describe('Menu', () => {
beforeEach(() => {
div = document.createElement('div');
document.body.appendChild(div);
jest.useFakeTimers();
});
afterEach(() => {
document.body.removeChild(div);
jest.useRealTimers();
});
it('If has select nested submenu item ,the menu items on the grandfather level should be highlight', () => {
@ -416,14 +422,6 @@ describe('Menu', () => {
});
describe('open submenu when click submenu title', () => {
beforeEach(() => {
jest.useFakeTimers();
});
afterEach(() => {
jest.useRealTimers();
});
const toggleMenu = (wrapper, index, event) => {
wrapper.find('.ant-menu-submenu-title').at(index).simulate(event);
jest.runAllTimers();

View File

@ -18,8 +18,8 @@ describe('Select', () => {
act(() => {
wrapper.find('.ant-select-selector').simulate('mousedown');
jest.runAllTimers();
wrapper.update();
});
wrapper.update();
}
beforeEach(() => {

View File

@ -126,8 +126,8 @@ describe('Statistic', () => {
};
const wrapper = mount(<Statistic.Countdown value={deadline} onChange={onChange} />);
wrapper.update();
await sleep(100)
expect(remainingTime).toBeGreaterThan(0)
await sleep(100);
expect(remainingTime).toBeGreaterThan(0);
});
});
@ -145,17 +145,13 @@ describe('Statistic', () => {
});
it('called if finished', async () => {
jest.useFakeTimers();
const now = Date.now() + 10;
const onFinish = jest.fn();
const wrapper = mount(<Statistic.Countdown value={now} onFinish={onFinish} />);
wrapper.update();
MockDate.set(moment('2019-11-28 00:00:00').valueOf());
jest.runAllTimers();
await sleep(100);
expect(onFinish).toHaveBeenCalled();
jest.useFakeTimers();
});
});
});

View File

@ -7,11 +7,4 @@
input::-ms-reveal {
display: none;
}
&,
*,
*::before,
*::after {
box-sizing: border-box; // 1
}
}

View File

@ -67,7 +67,11 @@ exports[`Table.filter renders custom filter icon as ReactNode 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -167,7 +171,11 @@ exports[`Table.filter renders custom filter icon as string correctly 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -281,7 +289,11 @@ exports[`Table.filter renders custom filter icon with right Tooltip title 1`] =
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -407,7 +419,11 @@ exports[`Table.filter renders filter correctly 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -527,7 +543,11 @@ exports[`Table.filter should support getPopupContainer 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -651,6 +671,10 @@ exports[`Table.filter should support getPopupContainer 1`] = `
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display: none;"
/>
<div
class="ant-table-filter-dropdown-btns"
>
@ -771,7 +795,11 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -895,6 +923,10 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
</div>
</li>
</ul>
<div
aria-hidden="true"
style="display: none;"
/>
<div
class="ant-table-filter-dropdown-btns"
>

View File

@ -1093,6 +1093,10 @@ exports[`Table.rowSelection should support getPopupContainer 1`] = `
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display: none;"
/>
</div>
</div>
</div>
@ -1445,6 +1449,10 @@ exports[`Table.rowSelection should support getPopupContainer from ConfigProvider
</span>
</li>
</ul>
<div
aria-hidden="true"
style="display: none;"
/>
</div>
</div>
<div

View File

@ -11,7 +11,9 @@ exports[`Table.sorter renders sorter icon correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Name
</span>
<span
@ -99,7 +101,9 @@ exports[`Table.sorter should support defaultOrder in Column 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Age
</span>
<span

View File

@ -24,10 +24,10 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = `
>
<colgroup>
<col
style="width:20%;min-width:20%"
style="width:20%"
/>
<col
style="width:20%;min-width:20%"
style="width:20%"
/>
</colgroup>
<thead
@ -40,7 +40,9 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Name
</span>
<span
@ -97,7 +99,11 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = `
<div
class="ant-table-filter-column"
>
Gender
<span
class="ant-table-column-title"
>
Gender
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -1040,10 +1046,10 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
>
<colgroup>
<col
style="width:30%;min-width:30%"
style="width:30%"
/>
<col
style="width:20%;min-width:20%"
style="width:20%"
/>
</colgroup>
<thead
@ -1056,7 +1062,11 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -1090,7 +1100,11 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
<div
class="ant-table-filter-column"
>
Age
<span
class="ant-table-column-title"
>
Age
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -1124,59 +1138,65 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
<div
class="ant-table-filter-column"
>
<div
class="ant-table-column-sorters"
<span
class="ant-table-column-title"
>
<span>
Address
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
<div
class="ant-table-column-sorters"
>
<span
class="ant-table-column-sorter-inner"
class="ant-table-column-title"
>
Address
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
>
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
class="ant-table-column-sorter-inner"
>
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
</span>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -1603,7 +1623,7 @@ exports[`renders ./components/table/demo/drag-sorting-handler.md correctly 1`] =
>
<colgroup>
<col
style="width:30px;min-width:30px"
style="width:30px"
/>
</colgroup>
<thead
@ -2698,7 +2718,9 @@ Array [
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Age
</span>
<span
@ -2755,7 +2777,11 @@ Array [
<div
class="ant-table-filter-column"
>
Address
<span
class="ant-table-column-title"
>
Address
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -2789,7 +2815,9 @@ Array [
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Action
</span>
<span
@ -3895,7 +3923,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
>
<colgroup>
<col
style="width:30%;min-width:30%"
style="width:30%"
/>
</colgroup>
<thead
@ -4106,13 +4134,13 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<colgroup>
<col
style="width:25%;min-width:25%"
style="width:25%"
/>
<col
style="width:15%;min-width:15%"
style="width:15%"
/>
<col
style="width:40%;min-width:40%"
style="width:40%"
/>
</colgroup>
<thead
@ -4704,10 +4732,10 @@ exports[`renders ./components/table/demo/ellipsis.md correctly 1`] = `
>
<colgroup>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:80px;min-width:80px"
style="width:80px"
/>
</colgroup>
<thead
@ -4990,10 +5018,10 @@ exports[`renders ./components/table/demo/ellipsis-custom-tooltip.md correctly 1`
>
<colgroup>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:80px;min-width:80px"
style="width:80px"
/>
</colgroup>
<thead
@ -5582,10 +5610,10 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col />
<col />
@ -5596,7 +5624,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<col />
<col />
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<thead
@ -6090,35 +6118,35 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col />
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<tbody
@ -7181,10 +7209,10 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
>
<colgroup>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
</colgroup>
<tbody
@ -8423,7 +8451,11 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
<div
class="ant-table-filter-column"
>
Name
<span
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -8479,7 +8511,9 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Age
</span>
<span
@ -8587,26 +8621,26 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:200px;min-width:200px"
style="width:200px"
/>
<col />
<col
style="width:80px;min-width:80px"
style="width:80px"
/>
</colgroup>
<tbody
@ -9439,40 +9473,46 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
<div
class="ant-table-filter-column"
>
<div
class="ant-table-column-sorters"
<span
class="ant-table-column-title"
>
<span>
Name
</span>
<span
class="ant-table-column-sorter"
<div
class="ant-table-column-sorters"
>
<span
class="ant-table-column-sorter-inner"
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-table-column-sorter"
>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
class="ant-table-column-sorter-inner"
>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
</span>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -9506,7 +9546,9 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Age
</span>
<span
@ -9563,7 +9605,11 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
<div
class="ant-table-filter-column"
>
Address
<span
class="ant-table-column-title"
>
Address
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -10149,7 +10195,9 @@ exports[`renders ./components/table/demo/multiple-sorter.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Chinese Score
</span>
<span
@ -10206,7 +10254,9 @@ exports[`renders ./components/table/demo/multiple-sorter.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Math Score
</span>
<span
@ -10263,7 +10313,9 @@ exports[`renders ./components/table/demo/multiple-sorter.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
English Score
</span>
<span
@ -12434,59 +12486,65 @@ Array [
<div
class="ant-table-filter-column"
>
<div
class="ant-table-column-sorters"
<span
class="ant-table-column-title"
>
<span>
Name
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
<div
class="ant-table-column-sorters"
>
<span
class="ant-table-column-sorter-inner"
class="ant-table-column-title"
>
Name
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
>
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
class="ant-table-column-sorter-inner"
>
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
</span>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -12520,7 +12578,9 @@ Array [
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Age
</span>
<span
@ -12577,59 +12637,65 @@ Array [
<div
class="ant-table-filter-column"
>
<div
class="ant-table-column-sorters"
<span
class="ant-table-column-title"
>
<span>
Address
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
<div
class="ant-table-column-sorters"
>
<span
class="ant-table-column-sorter-inner"
class="ant-table-column-title"
>
Address
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
>
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
class="ant-table-column-sorter-inner"
>
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
<svg
aria-hidden="true"
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
<svg
aria-hidden="true"
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
</span>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
role="button"
@ -12869,16 +12935,16 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
>
<colgroup>
<col
style="width:200px;min-width:200px"
style="width:200px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<thead
@ -12899,7 +12965,9 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
<div
class="ant-table-column-sorters"
>
<span>
<span
class="ant-table-column-title"
>
Amount
</span>
<span
@ -15828,35 +15896,35 @@ exports[`renders ./components/table/demo/sticky.md correctly 1`] = `
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col />
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<tbody
@ -17146,7 +17214,7 @@ Array [
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<tbody
@ -17591,10 +17659,10 @@ Array [
/>
<col />
<col
style="width:12%;min-width:12%"
style="width:12%"
/>
<col
style="width:30%;min-width:30%"
style="width:30%"
/>
</colgroup>
<thead
@ -17856,22 +17924,22 @@ exports[`renders ./components/table/demo/virtual-list.md correctly 1`] = `
>
<colgroup>
<col
style="width:150px;min-width:150px"
style="width:150px"
/>
<col
style="width:0;min-width:0"
style="width:0"
/>
<col
style="width:0;min-width:0"
style="width:0"
/>
<col
style="width:0;min-width:0"
style="width:0"
/>
<col
style="width:200px;min-width:200px"
style="width:200px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<thead

View File

@ -254,10 +254,10 @@ exports[`Table renders empty table with fixed columns 1`] = `
>
<colgroup>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
<col />
<col />
@ -268,7 +268,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
<col />
<col />
<col
style="width:100px;min-width:100px"
style="width:100px"
/>
</colgroup>
<thead

View File

@ -87,6 +87,7 @@ function renderFilterItems({
}
export interface FilterDropdownProps<RecordType> {
tablePrefixCls: string;
prefixCls: string;
dropdownPrefixCls: string;
column: ColumnType<RecordType>;
@ -101,6 +102,7 @@ export interface FilterDropdownProps<RecordType> {
function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
const {
tablePrefixCls,
prefixCls,
column,
dropdownPrefixCls,
@ -281,8 +283,8 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
const { direction } = React.useContext(ConfigContext);
return (
<div className={classNames(`${prefixCls}-column`)}>
{children}
<div className={`${prefixCls}-column`}>
<span className={`${tablePrefixCls}-column-title`}>{children}</span>
<Dropdown
overlay={menu}
trigger={['click']}

View File

@ -87,6 +87,7 @@ function injectFilter<RecordType>(
...newColumn,
title: (renderProps: ColumnTitleProps<RecordType>) => (
<FilterDropdown
tablePrefixCls={prefixCls}
prefixCls={`${prefixCls}-filter`}
dropdownPrefixCls={dropdownPrefixCls}
column={newColumn}
@ -214,9 +215,10 @@ function useFilter<RecordType>({
return collectedStates;
}, [mergedColumns, filterStates]);
const getFilters = React.useCallback(() => generateFilterInfo(mergedFilterStates), [
mergedFilterStates,
]);
const getFilters = React.useCallback(
() => generateFilterInfo(mergedFilterStates),
[mergedFilterStates],
);
const triggerFilter = (filterState: FilterState<RecordType>) => {
const newFilterStates = mergedFilterStates.filter(({ key }) => key !== filterState.key);

View File

@ -154,7 +154,9 @@ function injectSorter<RecordType>(
title: (renderProps: ColumnTitleProps<RecordType>) => {
const renderSortTitle = (
<div className={`${prefixCls}-column-sorters`}>
<span>{renderColumnTitle(column.title, renderProps)}</span>
<span className={`${prefixCls}-column-title`}>
{renderColumnTitle(column.title, renderProps)}
</span>
<span
className={classNames(`${prefixCls}-column-sorter`, {
[`${prefixCls}-column-sorter-full`]: !!(upNode && downNode),

View File

@ -231,6 +231,10 @@
background: @table-body-sort-bg;
}
&-column-title {
flex: 1;
}
&-column-sorters {
display: flex;
flex: auto;

View File

@ -165,11 +165,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
};
getTitles(transferLocale: TransferLocale): React.ReactNode[] {
const { titles } = this.props;
if (titles) {
return titles;
}
return transferLocale.titles;
return this.props.titles ?? transferLocale.titles;
}
getLocale = (transferLocale: TransferLocale, renderEmpty: RenderEmptyHandler) => ({

View File

@ -1145,7 +1145,104 @@ exports[`Directory Tree expand click 2`] = `
<div
class="ant-tree-treenode-motion ant-motion-collapse-leave ant-motion-collapse-leave-start ant-motion-collapse"
style="height: 0px;"
/>
>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="---"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
---
</span>
</span>
</div>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="---"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
---
</span>
</span>
</div>
</div>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
@ -1596,7 +1693,104 @@ exports[`Directory Tree expand double click 2`] = `
<div
class="ant-tree-treenode-motion ant-motion-collapse-leave ant-motion-collapse-leave-start ant-motion-collapse"
style="height: 0px;"
/>
>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="---"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
---
</span>
</span>
</div>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="---"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
---
</span>
</span>
</div>
</div>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
@ -1771,57 +1965,52 @@ exports[`Directory Tree expand with state control click 1`] = `
</span>
</div>
<div
class="ant-tree-treenode-motion ant-motion-collapse-appear ant-motion-collapse-appear-start ant-motion-collapse"
style="height: 0px; opacity: 0;"
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="children"
>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="children"
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
children
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
</div>
<span
class="ant-tree-title"
>
children
</span>
</span>
</div>
</div>
</div>
@ -1933,57 +2122,52 @@ exports[`Directory Tree expand with state control doubleClick 1`] = `
</span>
</div>
<div
class="ant-tree-treenode-motion ant-motion-collapse-appear ant-motion-collapse-appear-start ant-motion-collapse"
style="height: 0px; opacity: 0;"
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
>
<div
class="ant-tree-treenode ant-tree-treenode-switcher-close ant-tree-treenode-leaf-last"
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
aria-hidden="true"
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
class="ant-tree-switcher ant-tree-switcher-noop"
/>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="children"
>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="children"
class="ant-tree-iconEle ant-tree-icon__customize"
>
<span
class="ant-tree-iconEle ant-tree-icon__customize"
aria-label="folder"
class="anticon anticon-folder"
role="img"
>
<span
aria-label="folder"
class="anticon anticon-folder"
role="img"
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="folder"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
<span
class="ant-tree-title"
>
children
<path
d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"
/>
</svg>
</span>
</span>
</div>
<span
class="ant-tree-title"
>
children
</span>
</span>
</div>
</div>
</div>

View File

@ -30,8 +30,10 @@ describe('Typography', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
// Mock offsetHeight
const originOffsetHeight = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetHeight')
.get;
const originOffsetHeight = Object.getOwnPropertyDescriptor(
HTMLElement.prototype,
'offsetHeight',
).get;
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {
get() {
let html = this.innerHTML;
@ -333,6 +335,7 @@ describe('Typography', () => {
}
jest.useFakeTimers();
wrapper.find('.ant-typography-copy').first().simulate('click');
jest.runAllTimers();
wrapper.update();

View File

@ -65,6 +65,10 @@ export default (
if (!ellipsisContainer) {
ellipsisContainer = document.createElement('div');
ellipsisContainer.setAttribute('aria-hidden', 'true');
}
// HMR will remove this from body which should patch back
if (!ellipsisContainer.parentNode) {
document.body.appendChild(ellipsisContainer);
}

View File

@ -433,7 +433,7 @@ describe('Upload', () => {
wrapper.find('div.ant-upload-list-item .anticon-delete').simulate('click');
setImmediate(() => {
setTimeout(() => {
wrapper.update();
expect(mockRemove).toHaveBeenCalled();
@ -499,7 +499,7 @@ describe('Upload', () => {
wrapper.find('div.ant-upload-list-item .anticon-download').simulate('click');
setImmediate(() => {
setTimeout(() => {
wrapper.update();
expect(props.fileList).toHaveLength(1);

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.16.0",
"version": "4.16.1",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -126,9 +126,9 @@
"rc-image": "~5.2.4",
"rc-input-number": "~7.1.0",
"rc-mentions": "~1.6.1",
"rc-menu": "~9.0.1",
"rc-menu": "~9.0.9",
"rc-motion": "^2.4.0",
"rc-notification": "~4.5.2",
"rc-notification": "~4.5.7",
"rc-pagination": "~3.1.6",
"rc-picker": "~2.5.10",
"rc-progress": "~3.1.0",
@ -153,12 +153,12 @@
"devDependencies": {
"@ant-design/bisheng-plugin": "^2.3.0",
"@ant-design/hitu": "^0.0.0-alpha.13",
"@ant-design/tools": "^13.4.0",
"@ant-design/tools": "^13.4.1-beta.0",
"@qixian.cs/github-contributors-list": "^1.0.3",
"@stackblitz/sdk": "^1.3.0",
"@types/classnames": "^2.2.8",
"@types/enzyme": "^3.10.5",
"@types/gtag.js": "^0.0.4",
"@types/gtag.js": "^0.0.5",
"@types/jest": "^26.0.0",
"@types/jest-environment-puppeteer": "^4.4.0",
"@types/jest-image-snapshot": "^4.1.0",
@ -179,7 +179,7 @@
"argos-cli": "^0.3.0",
"array-move": "^3.0.0",
"babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "^3.1.0-beta.4",
"bisheng": "^3.0.0",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^1.1.2",
"bisheng-plugin-toc": "^0.4.4",
@ -188,14 +188,12 @@
"cheerio": "^1.0.0-rc.3",
"concurrently": "^6.0.0",
"cross-env": "^7.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",
"enquire-js": "^0.2.1",
"enzyme": "^3.10.0",
"enzyme-to-json": "^3.6.0",
"esbuild-loader": "^2.7.0",
"esbuild-loader": "^2.13.1",
"eslint": "^7.9.0",
"eslint-config-airbnb": "^18.0.0",
"eslint-config-prettier": "^8.0.0",
@ -220,7 +218,7 @@
"immutability-helper": "^3.0.0",
"inquirer": "^8.0.0",
"intersection-observer": "^0.12.0",
"jest": "^26.0.0",
"jest": "^27.0.3",
"jest-image-snapshot": "^4.0.0",
"jest-puppeteer": "^5.0.1",
"jquery": "^3.4.1",
@ -276,7 +274,7 @@
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^4.0.0",
"theme-switcher": "^1.0.2",
"typescript": "~4.2.2",
"typescript": "~4.3.2",
"webpack-bundle-analyzer": "^4.1.0",
"xhr-mock": "^2.4.1",
"xhr2": "^0.2.0",

View File

@ -1,7 +1,6 @@
const path = require('path');
const replaceLib = require('@ant-design/tools/lib/replaceLib');
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const { ESBuildMinifyPlugin } = require('esbuild-loader');
const { version } = require('../package.json');
const themeConfig = require('./themeConfig');
@ -86,8 +85,8 @@ module.exports = {
config.optimization.minimizer = [
new ESBuildMinifyPlugin({
target: 'es2015',
css: true,
}),
new CssMinimizerPlugin(),
];
}

View File

@ -52,15 +52,16 @@ const MoreCard = ({ title, description, date, img, source, href, icons, loading
export default function MorePage() {
const { locale } = useIntl();
const isZhCN = locale === 'zh-CN';
const list = useSiteData<MoreProps[]>('extras', isZhCN ? 'cn' : 'en');
const icons = useSiteData<Icons>('icons');
const loadingProps = { loading: true } as MoreProps;
const [{ extras, icons }, loading] = useSiteData<any>();
const list = extras?.[locale === 'zh-CN' ? 'cn' : 'en'] || [];
const loadingProps = { loading: loading || list.length === 0 } as MoreProps;
return (
<Row gutter={[24, 32]}>
{(list || [loadingProps, loadingProps, loadingProps, loadingProps]).map((more, i) => (
<MoreCard key={more.title || i} {...more} icons={icons} />
))}
{(list || [loadingProps, loadingProps, loadingProps, loadingProps]).map(
(more: any, i: number) => (
<MoreCard key={more.title || i} {...more} icons={icons} />
),
)}
</Row>
);
}

View File

@ -59,9 +59,9 @@ const RecommendBlock = ({
export default function RecommendPage() {
const { locale } = useIntl();
const isZhCN = locale === 'zh-CN';
const list = useSiteData<Recommend[]>('recommendations', isZhCN ? 'cn' : 'en');
const isLoading = !list;
const [{ recommendations }, loading] = useSiteData<any>();
const list = recommendations?.[locale === 'zh-CN' ? 'cn' : 'en'];
const isLoading = loading || !list || list.length === 0;
return (
<Row gutter={[24, 24]} style={{ marginBottom: -36 }}>
<Col xs={24} sm={14}>

View File

@ -15,26 +15,21 @@ export function preLoad(list: string[]) {
}
}
const siteData: Record<string, any> = {};
export function useSiteData<T>(endpoint: string, language?: 'cn' | 'en'): T {
const getData = () => {
const endpointData = siteData[endpoint];
if (!endpointData) return null;
return language ? endpointData[language] : endpointData;
};
const [data, setData] = React.useState<any>(getData());
export function useSiteData<T>(): [T, boolean] {
const [data, setData] = React.useState<T>({} as any);
const [loading, setLoading] = React.useState<boolean>(false);
React.useEffect(() => {
if (!data && typeof fetch !== 'undefined') {
fetch(`https://my-json-server.typicode.com/ant-design/website-data/${endpoint}`)
if (Object.keys(data).length === 0 && typeof fetch !== 'undefined') {
setLoading(true);
fetch(`https://raw.githubusercontent.com/ant-design/website-data/main/db.json`)
.then(res => res.json())
.then((res: any) => {
siteData[endpoint] = res;
setData(getData());
.then(result => {
setData(result);
setLoading(false);
});
}
}, [endpoint]);
}, []);
return data;
return [data, loading];
}

View File

@ -2,8 +2,8 @@
#articles {
h4 {
margin: 48px 0 16px 0;
font-weight: normal;
margin: 40px 0 24px 0;
font-weight: 500;
font-size: 20px;
}
@ -24,9 +24,15 @@
.article-list {
li {
margin: 0;
margin: 1em 0;
padding: 0;
font-size: 14px;
list-style: none;
}
.ant-avatar > img {
max-width: unset;
}
}
table {
@ -35,40 +41,7 @@
td {
width: 50%;
}
}
.resource-avatars {
vertical-align: top;
ul {
margin-top: 24px;
margin-right: 60px;
}
ul,
li {
list-style: none;
}
li {
display: inline-block;
margin: 0 20px 20px 0;
img {
width: 60px;
max-width: none;
height: 60px;
object-fit: cover;
background: #d8d8d8;
border-radius: 100%;
cursor: pointer;
transition: box-shadow 0.3s;
&:hover {
box-shadow: @shadow-2;
}
}
vertical-align: top;
}
}
}

View File

@ -1,9 +1,8 @@
/* eslint-disable react/no-array-index-key */
import * as React from 'react';
import moment from 'moment';
import { FormattedMessage, useIntl } from 'react-intl';
import { Tabs, Skeleton } from 'antd';
import { Tabs, Skeleton, Avatar, Divider } from 'antd';
import { useSiteData } from '../../Home/util';
import './index.less';
@ -19,48 +18,42 @@ interface Article {
href: string;
date: string;
type: 'design' | 'develop';
author: Author['name'];
}
interface Articles {
author: Author[];
cn: Article[];
en: Article[];
}
interface Authors {
[name: string]: Author;
}
interface ArticleListProps {
name: React.ReactNode;
data: Article[];
authors: Authors;
}
const ArticleList = ({ name, data }: ArticleListProps) => (
const ArticleList: React.FC<ArticleListProps> = ({ name, data, authors = {} }) => (
<td>
<h4>{name}</h4>
<ul className="article-list">
{data.map((article, index) => (
<li key={index}>
<a href={article.href} target="_blank" rel="noreferrer">
{article.title}
</a>
</li>
))}
</ul>
</td>
);
interface AuthorsProps {
data: Author[];
}
const Authors = ({ data }: AuthorsProps) => (
<td className="resource-avatars">
<ul>
{data.map(author => (
<li key={author.avatar}>
<a href={author.href} target="_blank" rel="noreferrer">
<img alt={author.name} src={author.avatar} />
</a>
</li>
))}
{data.map((article, index) => {
const author = authors[article.author] || {};
return (
<li key={index}>
<a href={author.href} target="_blank" rel="noreferrer">
<Avatar size="small" src={author.avatar} />
</a>
<Divider type="vertical" />
<a href={article.href} target="_blank" rel="noreferrer">
{article.title}
</a>
</li>
);
})}
</ul>
</td>
);
@ -68,79 +61,49 @@ const Authors = ({ data }: AuthorsProps) => (
export default () => {
const { locale } = useIntl();
const isZhCN = locale === 'zh-CN';
const data = useSiteData<Articles>('articles');
const [{ articles = { cn: [], en: [] }, authors = {} }, loading] =
useSiteData<{ articles: Articles; authors: Authors }>();
// ========================== Data ==========================
const mergedData = React.useMemo(() => {
if (!data) {
return data;
}
const articles = data[isZhCN ? 'cn' : 'en'];
const yearData: Record<number | string, Record<string, Article[]>> = {};
articles?.forEach(article => {
articles[isZhCN ? 'cn' : 'en']?.forEach(article => {
const year = moment(article.date).year();
yearData[year] = yearData[year] || {};
yearData[year][article.type] = [...(yearData[year][article.type] || []), article];
});
return yearData;
}, [data]);
const mergedAuthors = React.useMemo(() => {
if (!data) {
return data;
}
const authors: Record<string, Author[]> = {};
(data.author || []).forEach(author => {
authors[author.type] = [...(authors[author.type] || []), author];
});
return authors;
}, [data]);
}, [articles]);
// ========================= Render =========================
let content: React.ReactNode;
if (!data) {
if (loading) {
content = <Skeleton active />;
} else {
const yearList = Object.keys(mergedData).sort((a, b) => Number(b) - Number(a));
content = yearList.length ? (
<Tabs>
{yearList.map(year => {
const showAuthors = String(moment().year()) === year;
return (
<Tabs.TabPane tab={`${year}${isZhCN ? ' 年' : ''}`} key={year}>
<table>
<tbody>
<tr>
<ArticleList
name={<FormattedMessage id="app.docs.resource.design" />}
data={mergedData[year].design}
/>
<ArticleList
name={<FormattedMessage id="app.docs.resource.develop" />}
data={mergedData[year].develop}
/>
</tr>
{showAuthors && (
<tr>
<Authors data={mergedAuthors.design} />
<Authors data={mergedAuthors.develop} />
</tr>
)}
</tbody>
</table>
</Tabs.TabPane>
);
})}
{yearList.map(year => (
<Tabs.TabPane tab={`${year}${isZhCN ? ' 年' : ''}`} key={year}>
<table>
<tbody>
<tr>
<ArticleList
name={<FormattedMessage id="app.docs.resource.design" />}
data={mergedData[year].design}
authors={authors}
/>
<ArticleList
name={<FormattedMessage id="app.docs.resource.develop" />}
data={mergedData[year].develop}
authors={authors}
/>
</tr>
</tbody>
</table>
</Tabs.TabPane>
))}
</Tabs>
) : null;
}

View File

@ -101,6 +101,7 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
if (process.env.ESBUILD || process.env.CSB_REPO) {
config.optimization.minimizer[0] = new ESBuildMinifyPlugin({
target: 'es2015',
css: true,
});
}