chore: auto merge branchs (#34014)

chore: next merge master
This commit is contained in:
github-actions[bot] 2022-02-11 07:32:15 +00:00 committed by GitHub
commit 908a8b54b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
104 changed files with 1547 additions and 1078 deletions

View File

@ -15,6 +15,20 @@ timeline: true
---
## 4.18.6
`2022-02-07`
- 🐞 Fix the empty Popover displayed when `content` and `title` is undefined or null. [#33835](https://github.com/ant-design/ant-design/pull/33835) [@DawnLck](https://github.com/DawnLck)
- 🐞 Fix the problem that Tooltip didn't show on `ellipsis` with rows larger than 1. [#33875](https://github.com/ant-design/ant-design/pull/33875)
- Button
- 🐞 Fix the issue that `block` of Button not work when small size. [#33878](https://github.com/ant-design/ant-design/pull/33878) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 Fix the issue that `loading.delay` of Button cause React memory leak warning [#33858](https://github.com/ant-design/ant-design/pull/33858) [@mrwd2009](https://github.com/mrwd2009)
- 🐞 Fix the problem that Tooltip cannot be displayed when it is used with Switch in `loading` state. [#33860](https://github.com/ant-design/ant-design/pull/33860)
- 🐞 Fix the Upload button sometimes flashes after changed from hidden to display when the Upload component is a `picture-card` type. [#33820](https://github.com/ant-design/ant-design/pull/33820) [@credred](https://github.com/credred)
- TypeScript
- 🤖 Fix DatePicker `ref` TypeScript definition. [#33901](https://github.com/ant-design/ant-design/pull/33901) [@Amour1688](https://github.com/Amour1688)
## 4.18.5
`2022-01-24`

View File

@ -15,6 +15,20 @@ timeline: true
---
## 4.18.6
`2022-02-07`
- 🐞 修复当传入的内容参数和标题参数都为空时Popover 仍旧会渲染空气泡的问题。[#33835](https://github.com/ant-design/ant-design/pull/33835) [@DawnLck](https://github.com/DawnLck)
- 🐞 修复 Typography `ellipsis` 行数大于 1 时 Tooltip 不显示的问题。[#33875](https://github.com/ant-design/ant-design/pull/33875)
- Button
- 🐞 修复小尺寸下 Button 组件 `block` 属性无效的问题[#33878](https://github.com/ant-design/ant-design/pull/33878) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 修复 Button 组件 `loading.delay` 定时器未清除导致的内存泄漏警告[#33858](https://github.com/ant-design/ant-design/pull/33858) [@mrwd2009](https://github.com/mrwd2009)
- 🐞 修复 Tooltip 套在 `loading` 状态的 Switch 上时无法正常显示的问题。[#33860](https://github.com/ant-design/ant-design/pull/33860)
- 🐞 修复 Upload 组件为 `picture-card` 类型时,由隐藏上传按钮改为显示后,上传按钮有时会闪烁的问题。[#33820](https://github.com/ant-design/ant-design/pull/33820) [@credred](https://github.com/credred)
- Typescript
- 🤖 修复 DatePicker `ref` TypeScript 定义。[#33901](https://github.com/ant-design/ant-design/pull/33901) [@Amour1688](https://github.com/Amour1688)
## 4.18.5
`2022-01-24`

View File

@ -71,7 +71,7 @@ exports[`renders ./components/affix/demo/on-change.md extend context correctly 1
class=""
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -71,7 +71,7 @@ exports[`renders ./components/affix/demo/on-change.md correctly 1`] = `
class=""
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -118,7 +118,7 @@ Array [
class="ant-alert-action"
>
<button
class="ant-btn ant-btn-sm ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-sm ant-btn-dangerous"
type="button"
>
<span>
@ -954,7 +954,7 @@ Array [
exports[`renders ./components/alert/demo/error-boundary.md extend context correctly 1`] = `
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>

View File

@ -118,7 +118,7 @@ Array [
class="ant-alert-action"
>
<button
class="ant-btn ant-btn-sm ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-sm ant-btn-dangerous"
type="button"
>
<span>
@ -954,7 +954,7 @@ Array [
exports[`renders ./components/alert/demo/error-boundary.md correctly 1`] = `
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>

View File

@ -129,7 +129,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md extend cont
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-lg ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-lg ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -1395,7 +1395,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md extend context co
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -1618,7 +1618,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md extend context co
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span

View File

@ -101,7 +101,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-lg ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-lg ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -751,7 +751,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -900,7 +900,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span

View File

@ -294,7 +294,7 @@ Array [
</span>
</span>,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="margin:0 16px;vertical-align:middle"
type="button"
>
@ -303,7 +303,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="vertical-align:middle"
type="button"
>
@ -869,7 +869,7 @@ exports[`renders ./components/avatar/demo/responsive.md extend context correctly
exports[`renders ./components/avatar/demo/toggle-debug.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -877,7 +877,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -885,7 +885,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -294,7 +294,7 @@ Array [
</span>
</span>,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="margin:0 16px;vertical-align:middle"
type="button"
>
@ -303,7 +303,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="vertical-align:middle"
type="button"
>
@ -548,7 +548,7 @@ exports[`renders ./components/avatar/demo/responsive.md correctly 1`] = `
exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -556,7 +556,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -564,7 +564,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -121,7 +121,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -145,7 +145,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -173,7 +173,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span

View File

@ -121,7 +121,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -145,7 +145,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -173,7 +173,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span

View File

@ -11,7 +11,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -57,7 +57,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-block"
class="ant-btn ant-btn-default ant-btn-block"
type="button"
>
<span>
@ -94,7 +94,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>
@ -149,7 +149,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -157,7 +157,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
type="button"
>
@ -221,7 +221,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>
@ -229,7 +229,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
disabled=""
type="button"
>
@ -277,7 +277,7 @@ Array [
class="site-button-ghost-wrapper"
>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
type="button"
>
<span>
@ -285,7 +285,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
disabled=""
type="button"
>
@ -310,7 +310,7 @@ exports[`renders ./components/button/demo/ghost.md extend context correctly 1`]
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
type="button"
>
<span>
@ -339,7 +339,7 @@ exports[`renders ./components/button/demo/ghost.md extend context correctly 1`]
exports[`renders ./components/button/demo/icon.md extend context correctly 1`] = `
Array [
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-icon-only"
type="button"
>
<span
@ -387,7 +387,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-btn-primary ant-btn-circle"
class="ant-btn ant-btn-circle ant-btn-primary"
type="button"
>
<span>
@ -422,7 +422,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -470,7 +470,7 @@ Array [
</div>
</div>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -498,7 +498,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -546,7 +546,7 @@ Array [
</div>
</div>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -573,7 +573,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dashed ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-dashed ant-btn-icon-only"
type="button"
>
<span
@ -648,7 +648,7 @@ Array [
</span>
</button>,
<a
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
href="https://www.google.com"
>
<span
@ -674,7 +674,7 @@ Array [
<br />,
<br />,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -722,7 +722,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg"
type="button"
>
<span>
@ -757,7 +757,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -805,7 +805,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span
@ -833,7 +833,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -881,7 +881,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span
@ -908,7 +908,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dashed ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-dashed ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -983,7 +983,7 @@ Array [
</span>
</button>,
<a
class="ant-btn ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-lg ant-btn-icon-only"
href="https://www.google.com"
>
<span
@ -1594,7 +1594,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1605,7 +1605,7 @@ Array [
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1613,7 +1613,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -1899,7 +1899,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span>
@ -1949,7 +1949,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -1973,7 +1973,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-round ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -1997,7 +1997,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg"
class="ant-btn ant-btn-round ant-btn-primary ant-btn-lg"
type="button"
>
<span

View File

@ -11,7 +11,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -57,7 +57,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-block"
class="ant-btn ant-btn-default ant-btn-block"
type="button"
>
<span>
@ -94,7 +94,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>
@ -149,7 +149,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -157,7 +157,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
type="button"
>
@ -221,7 +221,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
type="button"
>
<span>
@ -229,7 +229,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dangerous"
class="ant-btn ant-btn-default ant-btn-dangerous"
disabled=""
type="button"
>
@ -277,7 +277,7 @@ Array [
class="site-button-ghost-wrapper"
>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
type="button"
>
<span>
@ -285,7 +285,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
disabled=""
type="button"
>
@ -310,7 +310,7 @@ exports[`renders ./components/button/demo/ghost.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
class="ant-btn ant-btn-default ant-btn-background-ghost"
type="button"
>
<span>
@ -339,7 +339,7 @@ exports[`renders ./components/button/demo/ghost.md correctly 1`] = `
exports[`renders ./components/button/demo/icon.md correctly 1`] = `
Array [
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-icon-only"
type="button"
>
<span
@ -363,7 +363,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-circle"
class="ant-btn ant-btn-circle ant-btn-primary"
type="button"
>
<span>
@ -398,7 +398,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -422,7 +422,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -450,7 +450,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -474,7 +474,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -501,7 +501,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dashed ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-dashed ant-btn-icon-only"
type="button"
>
<span
@ -552,7 +552,7 @@ Array [
</span>
</button>,
<a
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
href="https://www.google.com"
>
<span
@ -578,7 +578,7 @@ Array [
<br />,
<br />,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -602,7 +602,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg"
type="button"
>
<span>
@ -637,7 +637,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -661,7 +661,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span
@ -689,7 +689,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-default ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -713,7 +713,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span
@ -740,7 +740,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-dashed ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-dashed ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -791,7 +791,7 @@ Array [
</span>
</button>,
<a
class="ant-btn ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-lg ant-btn-icon-only"
href="https://www.google.com"
>
<span
@ -1258,7 +1258,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1269,7 +1269,7 @@ Array [
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1277,7 +1277,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -1379,7 +1379,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-lg"
class="ant-btn ant-btn-default ant-btn-lg"
type="button"
>
<span>
@ -1429,7 +1429,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-circle ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -1453,7 +1453,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg ant-btn-icon-only"
class="ant-btn ant-btn-round ant-btn-primary ant-btn-lg ant-btn-icon-only"
type="button"
>
<span
@ -1477,7 +1477,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg"
class="ant-btn ant-btn-round ant-btn-primary ant-btn-lg"
type="button"
>
<span

View File

@ -2,7 +2,7 @@
exports[`Button fixbug renders {0} , 0 and {false} 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
0
@ -11,7 +11,7 @@ exports[`Button fixbug renders {0} , 0 and {false} 1`] = `
exports[`Button fixbug renders {0} , 0 and {false} 2`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -22,14 +22,14 @@ exports[`Button fixbug renders {0} , 0 and {false} 2`] = `
exports[`Button fixbug renders {0} , 0 and {false} 3`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
/>
`;
exports[`Button renders Chinese characters correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -40,7 +40,7 @@ exports[`Button renders Chinese characters correctly 1`] = `
exports[`Button renders Chinese characters correctly 2`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -70,7 +70,7 @@ exports[`Button renders Chinese characters correctly 2`] = `
exports[`Button renders Chinese characters correctly 3`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -100,7 +100,7 @@ exports[`Button renders Chinese characters correctly 3`] = `
exports[`Button renders Chinese characters correctly 4`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -130,7 +130,7 @@ exports[`Button renders Chinese characters correctly 4`] = `
exports[`Button renders Chinese characters correctly 5`] = `
<button
class="ant-btn ant-btn-loading"
class="ant-btn ant-btn-default ant-btn-loading"
type="button"
>
<span
@ -164,7 +164,7 @@ exports[`Button renders Chinese characters correctly 5`] = `
exports[`Button renders Chinese characters correctly 6`] = `
<button
class="ant-btn ant-btn-loading"
class="ant-btn ant-btn-default ant-btn-loading"
type="button"
>
<span
@ -199,7 +199,7 @@ exports[`Button renders Chinese characters correctly 6`] = `
exports[`Button renders Chinese characters correctly 7`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -210,7 +210,7 @@ exports[`Button renders Chinese characters correctly 7`] = `
exports[`Button renders correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -221,21 +221,21 @@ exports[`Button renders correctly 1`] = `
exports[`Button rtl render component should be rendered correctly in RTL direction 1`] = `
<button
class="ant-btn ant-btn-rtl"
class="ant-btn ant-btn-default ant-btn-rtl"
type="button"
/>
`;
exports[`Button rtl render component should be rendered correctly in RTL direction 2`] = `
<button
class="ant-btn ant-btn-lg ant-btn-rtl"
class="ant-btn ant-btn-default ant-btn-lg ant-btn-rtl"
type="button"
/>
`;
exports[`Button rtl render component should be rendered correctly in RTL direction 3`] = `
<button
class="ant-btn ant-btn-sm ant-btn-rtl"
class="ant-btn ant-btn-default ant-btn-sm ant-btn-rtl"
type="button"
/>
`;
@ -266,7 +266,7 @@ exports[`Button rtl render component should be rendered correctly in RTL directi
exports[`Button should handle fragment as children 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -277,7 +277,7 @@ exports[`Button should handle fragment as children 1`] = `
exports[`Button should merge text if children using variable 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -299,14 +299,14 @@ exports[`Button should not render as link button when href is undefined 1`] = `
exports[`Button should render empty button without errors 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
/>
`;
exports[`Button should support link button 1`] = `
<a
class="ant-btn"
class="ant-btn ant-btn-default"
href="https://ant.design"
target="_blank"
>

View File

@ -0,0 +1,89 @@
import React, { useState } from 'react';
import { mount } from 'enzyme';
import { act } from 'react-dom/test-utils';
import Button from '../button';
const specialDelay = 9529;
const Content = () => {
const [loading, setLoading] = useState(false);
const toggleLoading = () => {
setLoading(!loading);
};
const [visible, setVisible] = useState(true);
const toggleVisible = () => {
setVisible(!visible);
};
return (
<div>
<button type="button" id="toggle_loading" onClick={toggleLoading}>
Toggle Loading
</button>
<button type="button" id="toggle_visible" onClick={toggleVisible}>
Toggle Visible
</button>
{visible && <Button type="text" loading={loading ? { delay: specialDelay } : false} />}
</div>
);
};
it('Delay loading timer in Button component', () => {
const otherTimer: any = 9528;
jest.spyOn(window, 'setTimeout').mockReturnValue(otherTimer);
jest.restoreAllMocks();
const wrapper = mount(<Content />);
const btnTimer: any = 9527;
jest.spyOn(window, 'setTimeout').mockReturnValue(btnTimer);
jest.spyOn(window, 'clearTimeout');
const setTimeoutMock = window.setTimeout as any as jest.Mock;
const clearTimeoutMock = window.clearTimeout as any as jest.Mock;
// other component may call setTimeout or clearTimeout
const setTimeoutCount = () => {
const items = setTimeoutMock.mock.calls.filter(item => item[1] === specialDelay);
return items.length;
};
const clearTimeoutCount = () => {
const items = clearTimeoutMock.mock.calls.filter(item => item[0] === btnTimer);
return items.length;
};
// switch loading state to true
wrapper.find('#toggle_loading').at(0).simulate('click');
expect(setTimeoutCount()).toBe(1);
expect(clearTimeoutCount()).toBe(0);
// trigger timer handler
act(() => {
setTimeoutMock.mock.calls[0][0]();
});
expect(setTimeoutCount()).toBe(1);
expect(clearTimeoutCount()).toBe(0);
// switch loading state to false
wrapper.find('#toggle_loading').at(0).simulate('click');
expect(setTimeoutCount()).toBe(1);
expect(clearTimeoutCount()).toBe(0);
// switch loading state to true
wrapper.find('#toggle_loading').at(0).simulate('click');
expect(setTimeoutCount()).toBe(2);
expect(clearTimeoutCount()).toBe(0);
// switch loading state to false
wrapper.find('#toggle_loading').at(0).simulate('click');
expect(setTimeoutCount()).toBe(2);
expect(clearTimeoutCount()).toBe(1);
// switch loading state to true
wrapper.find('#toggle_loading').at(0).simulate('click');
// remove Button component
wrapper.find('#toggle_visible').at(0).simulate('click');
expect(setTimeoutCount()).toBe(3);
expect(clearTimeoutCount()).toBe(2);
jest.restoreAllMocks();
});

View File

@ -136,7 +136,7 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
const {
loading = false,
prefixCls: customizePrefixCls,
type,
type = 'default',
danger,
shape = 'default',
size: customizeSize,
@ -156,7 +156,6 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
const [hasTwoCNChar, setHasTwoCNChar] = React.useState(false);
const { getPrefixCls, autoInsertSpaceInButton, direction } = React.useContext(ConfigContext);
const buttonRef = (ref as any) || React.createRef<HTMLElement>();
const delayTimeoutRef = React.useRef<number>();
const isNeedInserted = () =>
React.Children.count(children) === 1 && !icon && !isUnborderedButtonType(type);
@ -181,14 +180,25 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
typeof loading === 'object' && loading.delay ? loading.delay || true : !!loading;
React.useEffect(() => {
clearTimeout(delayTimeoutRef.current);
let delayTimer: number | null = null;
if (typeof loadingOrDelay === 'number') {
delayTimeoutRef.current = window.setTimeout(() => {
delayTimer = window.setTimeout(() => {
delayTimer = null;
setLoading(loadingOrDelay);
}, loadingOrDelay);
} else {
setLoading(loadingOrDelay);
}
return () => {
if (delayTimer) {
// in order to not perform a React state update on an unmounted component
// and clear timer after 'loadingOrDelay' updated.
window.clearTimeout(delayTimer);
delayTimer = null;
}
};
}, [loadingOrDelay]);
React.useEffect(fixTwoCNChar, [buttonRef]);
@ -227,8 +237,8 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
const classes = classNames(
prefixCls,
{
[`${prefixCls}-${shape}`]: shape !== 'default' && shape, // Note: Shape also has `default`
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape !== 'default' && shape,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
[`${prefixCls}-background-ghost`]: ghost && !isUnborderedButtonType(type),

View File

@ -256,7 +256,7 @@
letter-spacing: 0.34em;
}
&-block {
&&-block {
width: 100%;
}

View File

@ -152,7 +152,7 @@ exports[`Card title should be vertically aligned 1`] = `
class="ant-card-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1173,7 +1173,7 @@ exports[`ConfigProvider components Breadcrumb prefixCls 1`] = `
exports[`ConfigProvider components Button configProvider 1`] = `
<div>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1184,7 +1184,7 @@ exports[`ConfigProvider components Button configProvider 1`] = `
class="config-btn-group"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1192,7 +1192,7 @@ exports[`ConfigProvider components Button configProvider 1`] = `
</span>
</button>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1206,7 +1206,7 @@ exports[`ConfigProvider components Button configProvider 1`] = `
exports[`ConfigProvider components Button configProvider componentSize large 1`] = `
<div>
<button
class="config-btn config-btn-lg"
class="config-btn config-btn-default config-btn-lg"
type="button"
>
<span>
@ -1217,7 +1217,7 @@ exports[`ConfigProvider components Button configProvider componentSize large 1`]
class="config-btn-group"
>
<button
class="config-btn config-btn-lg"
class="config-btn config-btn-default config-btn-lg"
type="button"
>
<span>
@ -1225,7 +1225,7 @@ exports[`ConfigProvider components Button configProvider componentSize large 1`]
</span>
</button>
<button
class="config-btn config-btn-lg"
class="config-btn config-btn-default config-btn-lg"
type="button"
>
<span>
@ -1239,7 +1239,7 @@ exports[`ConfigProvider components Button configProvider componentSize large 1`]
exports[`ConfigProvider components Button configProvider componentSize middle 1`] = `
<div>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1250,7 +1250,7 @@ exports[`ConfigProvider components Button configProvider componentSize middle 1`
class="config-btn-group"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1258,7 +1258,7 @@ exports[`ConfigProvider components Button configProvider componentSize middle 1`
</span>
</button>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -1272,7 +1272,7 @@ exports[`ConfigProvider components Button configProvider componentSize middle 1`
exports[`ConfigProvider components Button configProvider virtual and dropdownMatchSelectWidth 1`] = `
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1283,7 +1283,7 @@ exports[`ConfigProvider components Button configProvider virtual and dropdownMat
class="ant-btn-group"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1291,7 +1291,7 @@ exports[`ConfigProvider components Button configProvider virtual and dropdownMat
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1305,7 +1305,7 @@ exports[`ConfigProvider components Button configProvider virtual and dropdownMat
exports[`ConfigProvider components Button normal 1`] = `
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1316,7 +1316,7 @@ exports[`ConfigProvider components Button normal 1`] = `
class="ant-btn-group"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1324,7 +1324,7 @@ exports[`ConfigProvider components Button normal 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1338,7 +1338,7 @@ exports[`ConfigProvider components Button normal 1`] = `
exports[`ConfigProvider components Button prefixCls 1`] = `
<div>
<button
class="prefix-Button"
class="prefix-Button prefix-Button-default"
type="button"
>
<span>
@ -1349,7 +1349,7 @@ exports[`ConfigProvider components Button prefixCls 1`] = `
class="prefix-Button"
>
<button
class="prefix-Button"
class="prefix-Button prefix-Button-default"
type="button"
>
<span>
@ -1357,7 +1357,7 @@ exports[`ConfigProvider components Button prefixCls 1`] = `
</span>
</button>
<button
class="prefix-Button"
class="prefix-Button prefix-Button-default"
type="button"
>
<span>
@ -12671,7 +12671,7 @@ exports[`ConfigProvider components Dropdown configProvider 1`] = `
class="config-btn-group config-dropdown-button"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -12679,7 +12679,7 @@ exports[`ConfigProvider components Dropdown configProvider 1`] = `
</span>
</button>
<button
class="config-btn config-btn-icon-only config-dropdown-trigger"
class="config-btn config-btn-default config-btn-icon-only config-dropdown-trigger"
type="button"
>
<span
@ -12710,7 +12710,7 @@ exports[`ConfigProvider components Dropdown configProvider componentSize large 1
class="config-btn-group config-dropdown-button"
>
<button
class="config-btn config-btn-lg"
class="config-btn config-btn-default config-btn-lg"
type="button"
>
<span>
@ -12718,7 +12718,7 @@ exports[`ConfigProvider components Dropdown configProvider componentSize large 1
</span>
</button>
<button
class="config-btn config-btn-lg config-btn-icon-only config-dropdown-trigger"
class="config-btn config-btn-default config-btn-lg config-btn-icon-only config-dropdown-trigger"
type="button"
>
<span
@ -12749,7 +12749,7 @@ exports[`ConfigProvider components Dropdown configProvider componentSize middle
class="config-btn-group config-dropdown-button"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -12757,7 +12757,7 @@ exports[`ConfigProvider components Dropdown configProvider componentSize middle
</span>
</button>
<button
class="config-btn config-btn-icon-only config-dropdown-trigger"
class="config-btn config-btn-default config-btn-icon-only config-dropdown-trigger"
type="button"
>
<span
@ -12788,7 +12788,7 @@ exports[`ConfigProvider components Dropdown configProvider virtual and dropdownM
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -12796,7 +12796,7 @@ exports[`ConfigProvider components Dropdown configProvider virtual and dropdownM
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -12827,7 +12827,7 @@ exports[`ConfigProvider components Dropdown normal 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -12835,7 +12835,7 @@ exports[`ConfigProvider components Dropdown normal 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -12866,7 +12866,7 @@ exports[`ConfigProvider components Dropdown prefixCls 1`] = `
class="ant-btn-group prefix-Dropdown"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -12874,7 +12874,7 @@ exports[`ConfigProvider components Dropdown prefixCls 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -13663,7 +13663,7 @@ exports[`ConfigProvider components Input configProvider 1`] = `
class="config-input-group-addon"
>
<button
class="config-btn config-btn-icon-only config-input-search-button"
class="config-btn config-btn-default config-btn-icon-only config-input-search-button"
type="button"
>
<span
@ -13758,7 +13758,7 @@ exports[`ConfigProvider components Input configProvider componentSize large 1`]
class="config-input-group-addon"
>
<button
class="config-btn config-btn-lg config-btn-icon-only config-input-search-button"
class="config-btn config-btn-default config-btn-lg config-btn-icon-only config-input-search-button"
type="button"
>
<span
@ -13853,7 +13853,7 @@ exports[`ConfigProvider components Input configProvider componentSize middle 1`]
class="config-input-group-addon"
>
<button
class="config-btn config-btn-icon-only config-input-search-button"
class="config-btn config-btn-default config-btn-icon-only config-input-search-button"
type="button"
>
<span
@ -13948,7 +13948,7 @@ exports[`ConfigProvider components Input configProvider virtual and dropdownMatc
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -14043,7 +14043,7 @@ exports[`ConfigProvider components Input normal 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -14138,7 +14138,7 @@ exports[`ConfigProvider components Input prefixCls 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only prefix-Input-button"
class="ant-btn ant-btn-default ant-btn-icon-only prefix-Input-button"
type="button"
>
<span
@ -15624,7 +15624,7 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
class="config-modal-footer"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -15716,7 +15716,7 @@ exports[`ConfigProvider components Modal configProvider componentSize large 1`]
class="config-modal-footer"
>
<button
class="config-btn config-btn-lg"
class="config-btn config-btn-default config-btn-lg"
type="button"
>
<span>
@ -15808,7 +15808,7 @@ exports[`ConfigProvider components Modal configProvider componentSize middle 1`]
class="config-modal-footer"
>
<button
class="config-btn"
class="config-btn config-btn-default"
type="button"
>
<span>
@ -15900,7 +15900,7 @@ exports[`ConfigProvider components Modal configProvider virtual and dropdownMatc
class="ant-modal-footer"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -15992,7 +15992,7 @@ exports[`ConfigProvider components Modal normal 1`] = `
class="ant-modal-footer"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -16084,7 +16084,7 @@ exports[`ConfigProvider components Modal prefixCls 1`] = `
class="prefix-Modal-footer"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -18091,7 +18091,7 @@ exports[`ConfigProvider components Popconfirm configProvider 1`] = `
class="config-popover-buttons"
>
<button
class="config-btn config-btn-sm"
class="config-btn config-btn-default config-btn-sm"
type="button"
>
<span>
@ -18174,7 +18174,7 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize large
class="config-popover-buttons"
>
<button
class="config-btn config-btn-sm"
class="config-btn config-btn-default config-btn-sm"
type="button"
>
<span>
@ -18257,7 +18257,7 @@ exports[`ConfigProvider components Popconfirm configProvider componentSize middl
class="config-popover-buttons"
>
<button
class="config-btn config-btn-sm"
class="config-btn config-btn-default config-btn-sm"
type="button"
>
<span>
@ -18340,7 +18340,7 @@ exports[`ConfigProvider components Popconfirm configProvider virtual and dropdow
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -18423,7 +18423,7 @@ exports[`ConfigProvider components Popconfirm normal 1`] = `
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -18506,7 +18506,7 @@ exports[`ConfigProvider components Popconfirm prefixCls 1`] = `
class="prefix-Popconfirm-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -18555,11 +18555,7 @@ exports[`ConfigProvider components Popover configProvider 1`] = `
<div
class="config-popover-inner"
role="tooltip"
>
<div
class="config-popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -18591,11 +18587,7 @@ exports[`ConfigProvider components Popover configProvider componentSize large 1`
<div
class="config-popover-inner"
role="tooltip"
>
<div
class="config-popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -18627,11 +18619,7 @@ exports[`ConfigProvider components Popover configProvider componentSize middle 1
<div
class="config-popover-inner"
role="tooltip"
>
<div
class="config-popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -18663,11 +18651,7 @@ exports[`ConfigProvider components Popover configProvider virtual and dropdownMa
<div
class="ant-popover-inner"
role="tooltip"
>
<div
class="ant-popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -18699,11 +18683,7 @@ exports[`ConfigProvider components Popover normal 1`] = `
<div
class="ant-popover-inner"
role="tooltip"
>
<div
class="ant-popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -18735,11 +18715,7 @@ exports[`ConfigProvider components Popover prefixCls 1`] = `
<div
class="prefix-Popover-inner"
role="tooltip"
>
<div
class="prefix-Popover-inner-content"
/>
</div>
/>
</div>
</div>
</div>
@ -22943,7 +22919,7 @@ exports[`ConfigProvider components Table configProvider 1`] = `
</div>
</span>
<span
class="config-dropdown-trigger config-table-filter-trigger"
class="config-dropdown-trigger config-table-filter-trigger config-dropdown-open"
role="button"
tabindex="-1"
>
@ -23223,7 +23199,7 @@ exports[`ConfigProvider components Table configProvider componentSize large 1`]
</div>
</span>
<span
class="config-dropdown-trigger config-table-filter-trigger"
class="config-dropdown-trigger config-table-filter-trigger config-dropdown-open"
role="button"
tabindex="-1"
>
@ -23503,7 +23479,7 @@ exports[`ConfigProvider components Table configProvider componentSize middle 1`]
</div>
</span>
<span
class="config-dropdown-trigger config-table-filter-trigger"
class="config-dropdown-trigger config-table-filter-trigger config-dropdown-open"
role="button"
tabindex="-1"
>
@ -23783,7 +23759,7 @@ exports[`ConfigProvider components Table configProvider virtual and dropdownMatc
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
class="ant-dropdown-trigger ant-table-filter-trigger ant-dropdown-open"
role="button"
tabindex="-1"
>
@ -24063,7 +24039,7 @@ exports[`ConfigProvider components Table normal 1`] = `
</div>
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
class="ant-dropdown-trigger ant-table-filter-trigger ant-dropdown-open"
role="button"
tabindex="-1"
>
@ -24343,7 +24319,7 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
</div>
</span>
<span
class="ant-dropdown-trigger prefix-Table-filter-trigger"
class="ant-dropdown-trigger prefix-Table-filter-trigger ant-dropdown-open"
role="button"
tabindex="-1"
>

View File

@ -54,7 +54,7 @@ describe('ConfigProvider', () => {
</ConfigProvider>,
);
expect(wrapper.find('button').props().className).toEqual('bamboo-btn');
expect(wrapper.exists('button.bamboo-btn')).toBeTruthy();
});
it('dynamic prefixCls', () => {
@ -76,9 +76,9 @@ describe('ConfigProvider', () => {
const wrapper = mount(<DynamicPrefixCls />);
expect(wrapper.find('button').last().props().className).toEqual('bamboo-btn');
expect(wrapper.exists('button.bamboo-btn')).toBeTruthy();
wrapper.find('.toggle-button').first().simulate('click');
expect(wrapper.find('button').last().props().className).toEqual('light-btn');
expect(wrapper.exists('button.light-btn')).toBeTruthy();
});
it('iconPrefixCls', () => {

View File

@ -1,5 +1,7 @@
import * as React from 'react';
import { Moment } from 'moment';
import DatePicker from '..';
import { DatePickRef, RangePickerRef } from '../generatePicker/interface';
describe('DatePicker.typescript', () => {
it('DatePicker ref methods', () => {
@ -13,6 +15,23 @@ describe('DatePicker.typescript', () => {
);
expect(datePicker).toBeTruthy();
});
// https://github.com/ant-design/ant-design/issues/33417
it('DatePicker ref methods with forwardRef', () => {
const MyDatePicker = React.forwardRef((props, ref: DatePickRef<Moment>) => (
<DatePicker {...props} ref={ref} />
));
const datePicker = (
<MyDatePicker
ref={picker => {
picker?.focus();
picker?.blur();
}}
/>
);
expect(datePicker).toBeTruthy();
});
it('RangePicker ref methods', () => {
const rangePicker = (
<DatePicker.RangePicker
@ -24,4 +43,19 @@ describe('DatePicker.typescript', () => {
);
expect(rangePicker).toBeTruthy();
});
it('RangePicker ref methods with forwardRef', () => {
const MyRangePicker = React.forwardRef((props, ref: RangePickerRef<Moment>) => (
<DatePicker.RangePicker {...props} ref={ref} />
));
const datePicker = (
<MyRangePicker
ref={picker => {
picker?.focus();
picker?.blur();
}}
/>
);
expect(datePicker).toBeTruthy();
});
});

View File

@ -1,4 +1,5 @@
import { ComponentClass } from 'react';
import type { ComponentClass, ForwardedRef, Component } from 'react';
import { PickerProps, RangePickerProps } from '.';
export interface CommonPickerMethods {
focus: () => void;
@ -9,3 +10,9 @@ export interface PickerComponentClass<P = {}, S = unknown> extends ComponentClas
new (...args: ConstructorParameters<ComponentClass<P, S>>): InstanceType<ComponentClass<P, S>> &
CommonPickerMethods;
}
export type PickerRef<P> = ForwardedRef<Component<P> & CommonPickerMethods>;
export type DatePickRef<DateType> = PickerRef<PickerProps<DateType>>;
export type RangePickerRef<DateType> = PickerRef<RangePickerProps<DateType>>;

View File

@ -3,7 +3,7 @@
exports[`Drawer render correctly 1`] = `
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -3,7 +3,7 @@
exports[`renders ./components/dropdown/demo/arrow.md extend context correctly 1`] = `
Array [
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -216,7 +216,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -429,7 +429,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -643,7 +643,7 @@ Array [
</div>,
<br />,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -856,7 +856,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -1069,7 +1069,7 @@ Array [
</div>
</div>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -1797,7 +1797,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1805,7 +1805,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -2079,7 +2079,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -2087,7 +2087,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -2361,7 +2361,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
type="button"
>
@ -2370,7 +2370,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
disabled=""
type="button"
>
@ -2645,7 +2645,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -2677,7 +2677,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
</div>
</div>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-dropdown-trigger"
type="button"
>
<span
@ -2952,7 +2952,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md extend context co
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -4066,7 +4066,7 @@ exports[`renders ./components/dropdown/demo/loading.md extend context correctly
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -4074,7 +4074,7 @@ exports[`renders ./components/dropdown/demo/loading.md extend context correctly
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -5535,7 +5535,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -5750,7 +5750,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -5965,7 +5965,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -6189,7 +6189,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -6404,7 +6404,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -6619,7 +6619,7 @@ exports[`renders ./components/dropdown/demo/placement.md extend context correctl
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>

View File

@ -3,7 +3,7 @@
exports[`renders ./components/dropdown/demo/arrow.md correctly 1`] = `
Array [
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -11,7 +11,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -19,7 +19,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -28,7 +28,7 @@ Array [
</button>,
<br />,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -36,7 +36,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -44,7 +44,7 @@ Array [
</span>
</button>,
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -103,7 +103,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -111,7 +111,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -144,7 +144,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -152,7 +152,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -185,7 +185,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
type="button"
>
@ -194,7 +194,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
disabled=""
type="button"
>
@ -228,7 +228,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -236,7 +236,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-dropdown-trigger"
type="button"
>
<span
@ -270,7 +270,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -534,7 +534,7 @@ exports[`renders ./components/dropdown/demo/loading.md correctly 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -542,7 +542,7 @@ exports[`renders ./components/dropdown/demo/loading.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span
@ -641,7 +641,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -654,7 +654,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -667,7 +667,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -689,7 +689,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -702,7 +702,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>
@ -715,7 +715,7 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
style="padding-bottom:8px"
>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
type="button"
>
<span>

View File

@ -5,11 +5,11 @@ exports[`DropdownButton rtl render component should be rendered correctly in RTL
class="ant-btn-group ant-btn-group-rtl ant-dropdown-button"
>
<button
class="ant-btn ant-btn-rtl"
class="ant-btn ant-btn-default ant-btn-rtl"
type="button"
/>
<button
class="ant-btn ant-btn-icon-only ant-btn-rtl ant-dropdown-trigger ant-dropdown-rtl"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-rtl ant-dropdown-trigger ant-dropdown-rtl"
type="button"
>
<span
@ -40,11 +40,11 @@ exports[`DropdownButton should support href like Button 1`] = `
class="ant-btn-group ant-dropdown-button"
>
<a
class="ant-btn"
class="ant-btn ant-btn-default"
href="https://ant.design"
/>
<button
class="ant-btn ant-btn-icon-only ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-btn-icon-only ant-dropdown-trigger"
type="button"
>
<span

View File

@ -3,7 +3,7 @@
exports[`Dropdown overlay is function and has custom transitionName 1`] = `
Array [
<button
class="ant-dropdown-trigger"
class="ant-dropdown-trigger ant-dropdown-open"
type="button"
>
button
@ -24,7 +24,7 @@ Array [
exports[`Dropdown overlay is string 1`] = `
Array [
<button
class="ant-dropdown-trigger"
class="ant-dropdown-trigger ant-dropdown-open"
type="button"
>
button

View File

@ -261,7 +261,7 @@ exports[`renders ./components/form/demo/advanced-search.md extend context correc
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin:0 8px"
type="button"
>
@ -846,7 +846,7 @@ exports[`renders ./components/form/demo/control-hooks.md extend context correctl
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1112,7 +1112,7 @@ exports[`renders ./components/form/demo/control-ref.md extend context correctly
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -2747,7 +2747,7 @@ exports[`renders ./components/form/demo/form-context.md extend context correctly
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin:0 8px"
type="button"
>
@ -2985,7 +2985,7 @@ exports[`renders ./components/form/demo/label-debug.md extend context correctly
longtextlongtextlongtextlongtextlongtextlongtextlongtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -3039,7 +3039,7 @@ exports[`renders ./components/form/demo/label-debug.md extend context correctly
longtext longtext longtext longtext longtext longtext longtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -3920,7 +3920,7 @@ exports[`renders ./components/form/demo/ref-item.md extend context correctly 1`]
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5157,7 +5157,7 @@ exports[`renders ./components/form/demo/register.md extend context correctly 1`]
style="padding-left:4px;padding-right:4px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -6890,7 +6890,7 @@ exports[`renders ./components/form/demo/size.md extend context correctly 1`] = `
class="ant-form-item-control-input-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -15825,7 +15825,7 @@ exports[`renders ./components/form/demo/validate-other.md extend context correct
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -20547,7 +20547,7 @@ exports[`renders ./components/form/demo/warning-only.md extend context correctly
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -261,7 +261,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin:0 8px"
type="button"
>
@ -747,7 +747,7 @@ exports[`renders ./components/form/demo/control-hooks.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -914,7 +914,7 @@ exports[`renders ./components/form/demo/control-ref.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -2385,7 +2385,7 @@ exports[`renders ./components/form/demo/form-context.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin:0 8px"
type="button"
>
@ -2623,7 +2623,7 @@ exports[`renders ./components/form/demo/label-debug.md correctly 1`] = `
longtextlongtextlongtextlongtextlongtextlongtextlongtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -2677,7 +2677,7 @@ exports[`renders ./components/form/demo/label-debug.md correctly 1`] = `
longtext longtext longtext longtext longtext longtext longtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -3558,7 +3558,7 @@ exports[`renders ./components/form/demo/ref-item.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -4404,7 +4404,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = `
style="padding-left:4px;padding-right:4px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5327,7 +5327,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = `
class="ant-form-item-control-input-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -7050,7 +7050,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -8615,7 +8615,7 @@ exports[`renders ./components/form/demo/warning-only.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -2,8 +2,11 @@
@import '../../style/mixins/index';
@import './mixin';
@row-prefix-cls: ~'@{ant-prefix}-row';
@col-prefix-cls: ~'@{ant-prefix}-col';
// Grid system
.@{ant-prefix}-row {
.@{row-prefix-cls} {
display: flex;
flex-flow: row wrap;
@ -19,46 +22,46 @@
}
// x轴原点
.@{ant-prefix}-row-start {
.@{row-prefix-cls}-start {
justify-content: flex-start;
}
// x轴居中
.@{ant-prefix}-row-center {
.@{row-prefix-cls}-center {
justify-content: center;
}
// x轴反方向
.@{ant-prefix}-row-end {
.@{row-prefix-cls}-end {
justify-content: flex-end;
}
// x轴平分
.@{ant-prefix}-row-space-between {
.@{row-prefix-cls}-space-between {
justify-content: space-between;
}
// x轴有间隔地平分
.@{ant-prefix}-row-space-around {
.@{row-prefix-cls}-space-around {
justify-content: space-around;
}
// 顶部对齐
.@{ant-prefix}-row-top {
.@{row-prefix-cls}-top {
align-items: flex-start;
}
// 居中对齐
.@{ant-prefix}-row-middle {
.@{row-prefix-cls}-middle {
align-items: center;
}
// 底部对齐
.@{ant-prefix}-row-bottom {
.@{row-prefix-cls}-bottom {
align-items: flex-end;
}
.@{ant-prefix}-col {
.@{col-prefix-cls} {
position: relative;
max-width: 100%;
// Prevent columns from collapsing when empty

View File

@ -16,7 +16,7 @@ exports[`Input.Search rtl render component should be rendered correctly in RTL d
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-btn-rtl ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-rtl ant-input-search-button"
type="button"
>
<span
@ -71,7 +71,7 @@ exports[`Input.Search should support ReactNode suffix without error 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -115,7 +115,7 @@ exports[`Input.Search should support addonAfter 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -218,7 +218,7 @@ exports[`Input.Search should support addonAfter and suffix for loading 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-input-search-button"
type="button"
>
<span
@ -325,7 +325,7 @@ exports[`Input.Search should support custom Button 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-input-search-button"
class="ant-btn ant-btn-default ant-input-search-button"
type="button"
>
<span>
@ -429,7 +429,7 @@ exports[`Input.Search should support invalid suffix 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -473,7 +473,7 @@ exports[`Input.Search should support loading 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-input-search-button"
type="button"
>
<span

View File

@ -5094,7 +5094,7 @@ exports[`renders ./components/input/demo/focus.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5107,7 +5107,7 @@ exports[`renders ./components/input/demo/focus.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5120,7 +5120,7 @@ exports[`renders ./components/input/demo/focus.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5133,7 +5133,7 @@ exports[`renders ./components/input/demo/focus.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -5262,7 +5262,7 @@ exports[`renders ./components/input/demo/group.md extend context correctly 1`] =
value="git@github.com:ant-design/ant-design.git"
/>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -5510,7 +5510,7 @@ exports[`renders ./components/input/demo/group.md extend context correctly 1`] =
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -5580,7 +5580,7 @@ exports[`renders ./components/input/demo/group.md extend context correctly 1`] =
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -8886,7 +8886,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -8962,7 +8962,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -9043,7 +9043,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -9255,7 +9255,7 @@ Array [
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-input-search-button"
type="button"
>
<span
@ -9539,7 +9539,7 @@ exports[`renders ./components/input/demo/textarea.md extend context correctly 1`
exports[`renders ./components/input/demo/textarea-resize.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin-bottom:16px"
type="button"
>

View File

@ -1311,7 +1311,7 @@ exports[`renders ./components/input/demo/focus.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1324,7 +1324,7 @@ exports[`renders ./components/input/demo/focus.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1337,7 +1337,7 @@ exports[`renders ./components/input/demo/focus.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1350,7 +1350,7 @@ exports[`renders ./components/input/demo/focus.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1479,7 +1479,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
value="git@github.com:ant-design/ant-design.git"
/>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -1621,7 +1621,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -1691,7 +1691,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -2660,7 +2660,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -2736,7 +2736,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -2817,7 +2817,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
@ -3029,7 +3029,7 @@ Array [
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-btn-loading ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-btn-loading ant-input-search-button"
type="button"
>
<span
@ -3313,7 +3313,7 @@ exports[`renders ./components/input/demo/textarea.md correctly 1`] = `
exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
style="margin-bottom:16px"
type="button"
>

View File

@ -137,7 +137,7 @@ exports[`renders ./components/mentions/demo/form.md extend context correctly 1`]
</button>
   
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -137,7 +137,7 @@ exports[`renders ./components/mentions/demo/form.md correctly 1`] = `
</button>
   
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1,4 +1,19 @@
.accessibility-focus-dark() {
box-shadow: 0 0 0 2px @primary-7;
}
.@{menu-prefix-cls} {
&&-root:focus-visible {
.accessibility-focus-dark();
}
&-dark &-item,
&-dark &-submenu-title {
&:focus-visible {
.accessibility-focus-dark();
}
}
// dark theme
&&-dark,
&-dark &-sub,

View File

@ -6,7 +6,7 @@
@menu-animation-duration-normal: 0.15s;
.accessibility-focus() {
box-shadow: 0 0 0 2px @primary-1;
box-shadow: 0 0 0 2px @primary-2;
}
// TODO: Should remove icon style compatible in v5

View File

@ -2,7 +2,7 @@
exports[`renders ./components/message/demo/custom-style.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -13,7 +13,7 @@ exports[`renders ./components/message/demo/custom-style.md extend context correc
exports[`renders ./components/message/demo/duration.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -46,7 +46,7 @@ exports[`renders ./components/message/demo/info.md extend context correctly 1`]
exports[`renders ./components/message/demo/loading.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -64,7 +64,7 @@ exports[`renders ./components/message/demo/other.md extend context correctly 1`]
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -77,7 +77,7 @@ exports[`renders ./components/message/demo/other.md extend context correctly 1`]
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -89,7 +89,7 @@ exports[`renders ./components/message/demo/other.md extend context correctly 1`]
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -102,7 +102,7 @@ exports[`renders ./components/message/demo/other.md extend context correctly 1`]
exports[`renders ./components/message/demo/thenable.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -2,7 +2,7 @@
exports[`renders ./components/message/demo/custom-style.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -13,7 +13,7 @@ exports[`renders ./components/message/demo/custom-style.md correctly 1`] = `
exports[`renders ./components/message/demo/duration.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -46,7 +46,7 @@ exports[`renders ./components/message/demo/info.md correctly 1`] = `
exports[`renders ./components/message/demo/loading.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -64,7 +64,7 @@ exports[`renders ./components/message/demo/other.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -77,7 +77,7 @@ exports[`renders ./components/message/demo/other.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -89,7 +89,7 @@ exports[`renders ./components/message/demo/other.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -102,7 +102,7 @@ exports[`renders ./components/message/demo/other.md correctly 1`] = `
exports[`renders ./components/message/demo/thenable.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -69,7 +69,7 @@ exports[`Modal render correctly 1`] = `
class="ant-modal-footer"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -225,7 +225,7 @@ exports[`Modal support closeIcon 1`] = `
class="ant-modal-footer"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -43,7 +43,7 @@ exports[`renders ./components/modal/demo/confirm.md extend context correctly 1`]
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -56,7 +56,7 @@ exports[`renders ./components/modal/demo/confirm.md extend context correctly 1`]
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -95,7 +95,7 @@ exports[`renders ./components/modal/demo/confirm.md extend context correctly 1`]
exports[`renders ./components/modal/demo/confirm-router.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -135,7 +135,7 @@ exports[`renders ./components/modal/demo/hooks.md extend context correctly 1`] =
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -148,7 +148,7 @@ exports[`renders ./components/modal/demo/hooks.md extend context correctly 1`] =
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -161,7 +161,7 @@ exports[`renders ./components/modal/demo/hooks.md extend context correctly 1`] =
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -173,7 +173,7 @@ exports[`renders ./components/modal/demo/hooks.md extend context correctly 1`] =
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -194,7 +194,7 @@ exports[`renders ./components/modal/demo/info.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -207,7 +207,7 @@ exports[`renders ./components/modal/demo/info.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -220,7 +220,7 @@ exports[`renders ./components/modal/demo/info.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -233,7 +233,7 @@ exports[`renders ./components/modal/demo/info.md extend context correctly 1`] =
style="padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -265,7 +265,7 @@ exports[`renders ./components/modal/demo/locale.md extend context correctly 1`]
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -278,7 +278,7 @@ exports[`renders ./components/modal/demo/locale.md extend context correctly 1`]
exports[`renders ./components/modal/demo/manual.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -289,7 +289,7 @@ exports[`renders ./components/modal/demo/manual.md extend context correctly 1`]
exports[`renders ./components/modal/demo/modal-render.md extend context correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -43,7 +43,7 @@ exports[`renders ./components/modal/demo/confirm.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -56,7 +56,7 @@ exports[`renders ./components/modal/demo/confirm.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -95,7 +95,7 @@ exports[`renders ./components/modal/demo/confirm.md correctly 1`] = `
exports[`renders ./components/modal/demo/confirm-router.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -135,7 +135,7 @@ exports[`renders ./components/modal/demo/hooks.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -148,7 +148,7 @@ exports[`renders ./components/modal/demo/hooks.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -161,7 +161,7 @@ exports[`renders ./components/modal/demo/hooks.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -173,7 +173,7 @@ exports[`renders ./components/modal/demo/hooks.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -194,7 +194,7 @@ exports[`renders ./components/modal/demo/info.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -207,7 +207,7 @@ exports[`renders ./components/modal/demo/info.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -220,7 +220,7 @@ exports[`renders ./components/modal/demo/info.md correctly 1`] = `
style="margin-right:8px;padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -233,7 +233,7 @@ exports[`renders ./components/modal/demo/info.md correctly 1`] = `
style="padding-bottom:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -265,7 +265,7 @@ exports[`renders ./components/modal/demo/locale.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -278,7 +278,7 @@ exports[`renders ./components/modal/demo/locale.md correctly 1`] = `
exports[`renders ./components/modal/demo/manual.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -289,7 +289,7 @@ exports[`renders ./components/modal/demo/manual.md correctly 1`] = `
exports[`renders ./components/modal/demo/modal-render.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -361,7 +361,7 @@ exports[`renders ./components/notification/demo/with-icon.md extend context corr
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -374,7 +374,7 @@ exports[`renders ./components/notification/demo/with-icon.md extend context corr
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -387,7 +387,7 @@ exports[`renders ./components/notification/demo/with-icon.md extend context corr
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -399,7 +399,7 @@ exports[`renders ./components/notification/demo/with-icon.md extend context corr
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -361,7 +361,7 @@ exports[`renders ./components/notification/demo/with-icon.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -374,7 +374,7 @@ exports[`renders ./components/notification/demo/with-icon.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -387,7 +387,7 @@ exports[`renders ./components/notification/demo/with-icon.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -399,7 +399,7 @@ exports[`renders ./components/notification/demo/with-icon.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -59,7 +59,7 @@ Array [
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -67,7 +67,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -273,7 +273,7 @@ Array [
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -281,7 +281,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -621,7 +621,7 @@ exports[`renders ./components/page-header/demo/content.md extend context correct
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -629,7 +629,7 @@ exports[`renders ./components/page-header/demo/content.md extend context correct
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -645,7 +645,7 @@ exports[`renders ./components/page-header/demo/content.md extend context correct
</span>
</button>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
style="border:none;padding:0"
type="button"
>
@ -1001,7 +1001,7 @@ exports[`renders ./components/page-header/demo/ghost.md extend context correctly
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1009,7 +1009,7 @@ exports[`renders ./components/page-header/demo/ghost.md extend context correctly
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1209,7 +1209,7 @@ exports[`renders ./components/page-header/demo/responsive.md extend context corr
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1217,7 +1217,7 @@ exports[`renders ./components/page-header/demo/responsive.md extend context corr
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -59,7 +59,7 @@ Array [
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -67,7 +67,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -273,7 +273,7 @@ Array [
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -281,7 +281,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -621,7 +621,7 @@ exports[`renders ./components/page-header/demo/content.md correctly 1`] = `
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -629,7 +629,7 @@ exports[`renders ./components/page-header/demo/content.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -645,7 +645,7 @@ exports[`renders ./components/page-header/demo/content.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-dropdown-trigger"
class="ant-btn ant-btn-default ant-dropdown-trigger"
style="border:none;padding:0"
type="button"
>
@ -799,7 +799,7 @@ exports[`renders ./components/page-header/demo/ghost.md correctly 1`] = `
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -807,7 +807,7 @@ exports[`renders ./components/page-header/demo/ghost.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1007,7 +1007,7 @@ exports[`renders ./components/page-header/demo/responsive.md correctly 1`] = `
class="ant-page-header-heading-extra"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1015,7 +1015,7 @@ exports[`renders ./components/page-header/demo/responsive.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -59,7 +59,6 @@
}
}
&:focus-visible,
&:hover {
border-color: @primary-color;
transition: all 0.3s;
@ -69,6 +68,17 @@
}
}
// cannot merge with `&:hover`
// see https://github.com/ant-design/ant-design/pull/34002
&:focus-visible {
border-color: @primary-color;
transition: all 0.3s;
a {
color: @primary-color;
}
}
&-active {
font-weight: @pagination-font-weight-active;
background: @pagination-item-bg-active;
@ -78,15 +88,21 @@
color: @primary-color;
}
&:focus-visible,
&:hover {
border-color: @primary-5;
}
&:focus-visible a,
&:focus-visible {
border-color: @primary-5;
}
&:hover a {
color: @primary-5;
}
&:focus-visible a {
color: @primary-5;
}
}
}
@ -130,7 +146,6 @@
}
}
&:focus-visible,
&:hover {
.@{pagination-prefix-cls}-item-link-icon {
opacity: 1;
@ -139,6 +154,15 @@
opacity: 0;
}
}
&:focus-visible {
.@{pagination-prefix-cls}-item-link-icon {
opacity: 1;
}
.@{pagination-prefix-cls}-item-ellipsis {
opacity: 0;
}
}
}
&-prev,
@ -194,7 +218,11 @@
transition: all 0.3s;
}
&:focus-visible .@{pagination-prefix-cls}-item-link,
&:focus-visible .@{pagination-prefix-cls}-item-link {
color: @primary-color;
border-color: @primary-color;
}
&:hover .@{pagination-prefix-cls}-item-link {
color: @primary-color;
border-color: @primary-color;
@ -203,7 +231,15 @@
&-disabled {
&,
&:hover,
&:hover {
cursor: not-allowed;
.@{pagination-prefix-cls}-item-link {
color: @disabled-color;
border-color: @border-color-base;
cursor: not-allowed;
}
}
&:focus-visible {
cursor: not-allowed;
.@{pagination-prefix-cls}-item-link {

View File

@ -64,7 +64,7 @@ Array [
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -149,7 +149,7 @@ Array [
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -234,7 +234,7 @@ exports[`renders ./components/popconfirm/demo/dynamic-trigger.md extend context
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -339,7 +339,7 @@ Array [
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -424,7 +424,7 @@ Array [
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -456,7 +456,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -517,7 +517,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -539,7 +539,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -600,7 +600,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -622,7 +622,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -683,7 +683,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -709,7 +709,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -770,7 +770,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -792,7 +792,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -853,7 +853,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -875,7 +875,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -936,7 +936,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -962,7 +962,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1023,7 +1023,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1045,7 +1045,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1106,7 +1106,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1128,7 +1128,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1189,7 +1189,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1215,7 +1215,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1276,7 +1276,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1298,7 +1298,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1359,7 +1359,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1381,7 +1381,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1442,7 +1442,7 @@ exports[`renders ./components/popconfirm/demo/placement.md extend context correc
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -1531,7 +1531,7 @@ Array [
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>

View File

@ -69,7 +69,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -77,7 +77,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -85,7 +85,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -97,7 +97,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -105,7 +105,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -113,7 +113,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -125,7 +125,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -133,7 +133,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -141,7 +141,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -153,7 +153,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -161,7 +161,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -169,7 +169,7 @@ exports[`renders ./components/popconfirm/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -2,8 +2,8 @@
exports[`Popconfirm rtl render component should be rendered correctly in RTL direction 1`] = `<span />`;
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-default ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;
exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;
exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-default ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;
exports[`Popconfirm shows content for render functions 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">some-title</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;
exports[`Popconfirm shows content for render functions 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><span role=\\"img\\" aria-label=\\"exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\\"></path></svg></span><div class=\\"ant-popover-message-title\\">some-title</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-default ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div>"`;

View File

@ -3,7 +3,7 @@
exports[`renders ./components/popover/demo/arrow-point-at-center.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -49,7 +49,7 @@ Array [
</div>
</div>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -201,7 +201,7 @@ Array [
exports[`renders ./components/popover/demo/hover-with-click.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -294,7 +294,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -344,7 +344,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -394,7 +394,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -448,7 +448,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -498,7 +498,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -548,7 +548,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -602,7 +602,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -652,7 +652,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -702,7 +702,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -756,7 +756,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -806,7 +806,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -856,7 +856,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -912,7 +912,7 @@ exports[`renders ./components/popover/demo/placement.md extend context correctly
exports[`renders ./components/popover/demo/triggerType.md extend context correctly 1`] = `
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -960,7 +960,7 @@ exports[`renders ./components/popover/demo/triggerType.md extend context correct
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1008,7 +1008,7 @@ exports[`renders ./components/popover/demo/triggerType.md extend context correct
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -3,7 +3,7 @@
exports[`renders ./components/popover/demo/arrow-point-at-center.md correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -11,7 +11,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -45,7 +45,7 @@ exports[`renders ./components/popover/demo/control.md correctly 1`] = `
exports[`renders ./components/popover/demo/hover-with-click.md correctly 1`] = `
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -62,7 +62,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -70,7 +70,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -78,7 +78,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -90,7 +90,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -98,7 +98,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -106,7 +106,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -118,7 +118,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -126,7 +126,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -134,7 +134,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -146,7 +146,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -154,7 +154,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -162,7 +162,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -176,7 +176,7 @@ exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
exports[`renders ./components/popover/demo/triggerType.md correctly 1`] = `
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -184,7 +184,7 @@ exports[`renders ./components/popover/demo/triggerType.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -192,7 +192,7 @@ exports[`renders ./components/popover/demo/triggerType.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1,7 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Popover handles empty title/content props safely 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"><span class=\\"ant-popover-arrow-content\\"></span></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div class=\\"ant-popover-inner-content\\"></div></div></div>"`;
exports[`Popover should be rendered correctly in RTL direction 1`] = `
Array [
<span

View File

@ -54,8 +54,22 @@ describe('Popover', () => {
popover.find('span').simulate('click');
const popup = ref.current.getPopupDomNode();
expect(popup).not.toBe(null);
expect(popup.innerHTML).toMatchSnapshot();
expect(popup).toBe(null);
});
it('should not render popover when the title & content props is empty', () => {
const ref = React.createRef();
const popover = mount(
<Popover trigger="click" ref={ref} content="">
<span>show me your code</span>
</Popover>,
);
popover.find('span').simulate('click');
const popup = ref.current.getPopupDomNode();
expect(popup).toBe(null);
});
it('props#overlay do not warn anymore', () => {

View File

@ -13,12 +13,15 @@ const Popover = React.forwardRef<unknown, PopoverProps>(
({ prefixCls: customizePrefixCls, title, content, ...otherProps }, ref) => {
const { getPrefixCls } = React.useContext(ConfigContext);
const getOverlay = (prefixCls: string) => (
<>
{title && <div className={`${prefixCls}-title`}>{getRenderPropValue(title)}</div>}
<div className={`${prefixCls}-inner-content`}>{getRenderPropValue(content)}</div>
</>
);
const getOverlay = (prefixCls: string) => {
if (!title && !content) return undefined;
return (
<>
{title && <div className={`${prefixCls}-title`}>{getRenderPropValue(title)}</div>}
<div className={`${prefixCls}-inner-content`}>{getRenderPropValue(content)}</div>
</>
);
};
const prefixCls = getPrefixCls('popover', customizePrefixCls);
const rootPrefixCls = getPrefixCls();

View File

@ -261,7 +261,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -285,7 +285,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -658,7 +658,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -682,7 +682,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span

View File

@ -261,7 +261,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -285,7 +285,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -658,7 +658,7 @@ Array [
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span
@ -682,7 +682,7 @@ Array [
</span>
</button>
<button
class="ant-btn ant-btn-icon-only"
class="ant-btn ant-btn-default ant-btn-icon-only"
type="button"
>
<span

View File

@ -36,8 +36,7 @@
> div {
transition: all 0.3s, outline 0s;
&:hover,
&:focus-visible {
&:hover {
transform: @rate-star-hover-scale;
}
@ -47,6 +46,7 @@
&:focus-visible {
outline: 1px dashed @rate-star-color;
transform: @rate-star-hover-scale;
}
}

View File

@ -1118,7 +1118,7 @@ exports[`renders ./components/result/demo/error.md extend context correctly 1`]
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1305,7 +1305,7 @@ exports[`renders ./components/result/demo/success.md extend context correctly 1`
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1118,7 +1118,7 @@ exports[`renders ./components/result/demo/error.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1305,7 +1305,7 @@ exports[`renders ./components/result/demo/success.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1533,7 +1533,7 @@ Array [
exports[`renders ./components/select/demo/custom-dropdown-menu.md extend context correctly 1`] = `
<div
class="ant-select ant-select-single ant-select-show-arrow"
style="width:240px"
style="width:300px"
>
<div
class="ant-select-selector"
@ -1569,96 +1569,105 @@ exports[`renders ./components/select/demo/custom-dropdown-menu.md extend context
style="opacity:0;pointer-events:none"
>
<div>
<div>
<div
id="undefined_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
>
<div
id="undefined_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
aria-label="jack"
aria-selected="false"
id="undefined_list_0"
role="option"
>
<div
aria-label="jack"
aria-selected="false"
id="undefined_list_0"
role="option"
>
jack
</div>
<div
aria-label="lucy"
aria-selected="false"
id="undefined_list_1"
role="option"
>
lucy
</div>
jack
</div>
<div
class="rc-virtual-list"
style="position:relative"
aria-label="lucy"
aria-selected="false"
id="undefined_list_1"
role="option"
>
<div
class="rc-virtual-list-holder"
style="max-height:256px;overflow-y:auto;overflow-anchor:none"
>
<div>
lucy
</div>
</div>
<div
class="rc-virtual-list"
style="position:relative"
>
<div
class="rc-virtual-list-holder"
style="max-height:256px;overflow-y:auto;overflow-anchor:none"
>
<div>
<div
class="rc-virtual-list-holder-inner"
style="display:flex;flex-direction:column"
>
<div
class="rc-virtual-list-holder-inner"
style="display:flex;flex-direction:column"
aria-selected="false"
class="ant-select-item ant-select-item-option ant-select-item-option-active"
title="jack"
>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option ant-select-item-option-active"
title="jack"
class="ant-select-item-option-content"
>
<div
class="ant-select-item-option-content"
>
jack
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
jack
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="lucy"
>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="lucy"
class="ant-select-item-option-content"
>
<div
class="ant-select-item-option-content"
>
lucy
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
lucy
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-divider ant-divider-horizontal"
role="separator"
style="margin:8px 0"
/>
<div
class="ant-space ant-space-horizontal ant-space-align-center"
style="padding:0 8px 4px"
>
<div
class="ant-divider ant-divider-horizontal"
role="separator"
style="margin:4px 0"
/>
<div
style="display:flex;flex-wrap:nowrap;padding:8px"
class="ant-space-item"
style="margin-right:8px"
>
<input
class="ant-input"
style="flex:auto"
placeholder="Please enter item"
type="text"
value=""
/>
</div>
<div
class="ant-space-item"
>
<a
style="flex:none;padding:8px;display:block;cursor:pointer"
class="ant-typography"
style="white-space:nowrap"
>
<span
aria-label="plus"
@ -2419,7 +2428,7 @@ exports[`renders ./components/select/demo/debug.md extend context correctly 1`]
AntDesign
</span>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -704,7 +704,7 @@ Array [
exports[`renders ./components/select/demo/custom-dropdown-menu.md correctly 1`] = `
<div
class="ant-select ant-select-single ant-select-show-arrow"
style="width:240px"
style="width:300px"
>
<div
class="ant-select-selector"
@ -1059,7 +1059,7 @@ exports[`renders ./components/select/demo/debug.md correctly 1`] = `
AntDesign
</span>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -14,63 +14,51 @@ title:
Customize the dropdown menu via `dropdownRender`.
```jsx
import { Select, Divider, Input } from 'antd';
import React, { useState } from 'react';
import { Select, Divider, Input, Typography, Space } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
const { Option } = Select;
let index = 0;
class App extends React.Component {
state = {
items: ['jack', 'lucy'],
name: '',
const App = () => {
const [items, setItems] = useState(['jack', 'lucy']);
const [name, setName] = useState('');
const onNameChange = event => {
setName(event.target.value);
};
onNameChange = event => {
this.setState({
name: event.target.value,
});
const addItem = e => {
e.preventDefault();
setItems([...items, name || `New item ${index++}`]);
setName('');
};
addItem = () => {
console.log('addItem');
const { items, name } = this.state;
this.setState({
items: [...items, name || `New item ${index++}`],
name: '',
});
};
render() {
const { items, name } = this.state;
return (
<Select
style={{ width: 240 }}
placeholder="custom dropdown render"
dropdownRender={menu => (
<div>
{menu}
<Divider style={{ margin: '4px 0' }} />
<div style={{ display: 'flex', flexWrap: 'nowrap', padding: 8 }}>
<Input style={{ flex: 'auto' }} value={name} onChange={this.onNameChange} />
<a
style={{ flex: 'none', padding: '8px', display: 'block', cursor: 'pointer' }}
onClick={this.addItem}
>
<PlusOutlined /> Add item
</a>
</div>
</div>
)}
>
{items.map(item => (
<Option key={item}>{item}</Option>
))}
</Select>
);
}
}
return (
<Select
style={{ width: 300 }}
placeholder="custom dropdown render"
dropdownRender={menu => (
<>
{menu}
<Divider style={{ margin: '8px 0' }} />
<Space align="center" style={{ padding: '0 8px 4px' }}>
<Input placeholder="Please enter item" value={name} onChange={onNameChange} />
<Typography.Link onClick={addItem} style={{ whiteSpace: 'nowrap' }}>
<PlusOutlined /> Add item
</Typography.Link>
</Space>
</>
)}
>
{items.map(item => (
<Option key={item}>{item}</Option>
))}
</Select>
);
};
ReactDOM.render(<App />, mountNode);
```

View File

@ -61,7 +61,7 @@ exports[`renders ./components/skeleton/demo/children.md extend context correctly
</p>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -61,7 +61,7 @@ exports[`renders ./components/skeleton/demo/children.md correctly 1`] = `
</p>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -195,7 +195,7 @@ exports[`renders ./components/space/demo/base.md extend context correctly 1`] =
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -232,7 +232,7 @@ exports[`renders ./components/space/demo/base.md extend context correctly 1`] =
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -293,7 +293,7 @@ exports[`renders ./components/space/demo/base.md extend context correctly 1`] =
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -394,7 +394,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -446,7 +446,7 @@ exports[`renders ./components/space/demo/debug.md extend context correctly 1`] =
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -465,7 +465,7 @@ exports[`renders ./components/space/demo/debug.md extend context correctly 1`] =
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -526,7 +526,7 @@ exports[`renders ./components/space/demo/debug.md extend context correctly 1`] =
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -557,7 +557,7 @@ exports[`renders ./components/space/demo/debug.md extend context correctly 1`] =
style="display:inline-block;cursor:not-allowed"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
style="pointer-events:none"
type="button"
@ -621,7 +621,7 @@ exports[`renders ./components/space/demo/debug.md extend context correctly 1`] =
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -803,7 +803,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -976,7 +976,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -989,7 +989,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1002,7 +1002,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1015,7 +1015,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1028,7 +1028,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1041,7 +1041,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1054,7 +1054,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1067,7 +1067,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1080,7 +1080,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1093,7 +1093,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1106,7 +1106,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1119,7 +1119,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1132,7 +1132,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1145,7 +1145,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1158,7 +1158,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1171,7 +1171,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1184,7 +1184,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1197,7 +1197,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1210,7 +1210,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1223,7 +1223,7 @@ exports[`renders ./components/space/demo/wrap.md extend context correctly 1`] =
style="padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -195,7 +195,7 @@ exports[`renders ./components/space/demo/base.md correctly 1`] = `
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -232,7 +232,7 @@ exports[`renders ./components/space/demo/base.md correctly 1`] = `
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -295,7 +295,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -347,7 +347,7 @@ exports[`renders ./components/space/demo/debug.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -366,7 +366,7 @@ exports[`renders ./components/space/demo/debug.md correctly 1`] = `
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -383,7 +383,7 @@ exports[`renders ./components/space/demo/debug.md correctly 1`] = `
style="display:inline-block;cursor:not-allowed"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
style="pointer-events:none"
type="button"
@ -554,7 +554,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -727,7 +727,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -740,7 +740,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -753,7 +753,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -766,7 +766,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -779,7 +779,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -792,7 +792,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -805,7 +805,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -818,7 +818,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -831,7 +831,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -844,7 +844,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -857,7 +857,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -870,7 +870,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -883,7 +883,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -896,7 +896,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -909,7 +909,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -922,7 +922,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -935,7 +935,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -948,7 +948,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -961,7 +961,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="margin-right:8px;padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -974,7 +974,7 @@ exports[`renders ./components/space/demo/wrap.md correctly 1`] = `
style="padding-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1496,7 +1496,7 @@ exports[`renders ./components/steps/demo/progress.md extend context correctly 1`
exports[`renders ./components/steps/demo/progress-debug.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1504,7 +1504,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1512,7 +1512,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1520,7 +1520,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1528,7 +1528,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1536,7 +1536,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1544,7 +1544,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -1376,7 +1376,7 @@ exports[`renders ./components/steps/demo/progress.md correctly 1`] = `
exports[`renders ./components/steps/demo/progress-debug.md correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1384,7 +1384,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1392,7 +1392,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1400,7 +1400,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1408,7 +1408,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1416,7 +1416,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1424,7 +1424,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -549,7 +549,7 @@ exports[`Table.filter should support getPopupContainer 1`] = `
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
class="ant-dropdown-trigger ant-table-filter-trigger ant-dropdown-open"
role="button"
tabindex="-1"
>
@ -801,7 +801,7 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
Name
</span>
<span
class="ant-dropdown-trigger ant-table-filter-trigger"
class="ant-dropdown-trigger ant-table-filter-trigger ant-dropdown-open"
role="button"
tabindex="-1"
>

View File

@ -1363,7 +1363,7 @@ exports[`renders ./components/table/demo/custom-filter-panel.md extend context c
style="margin-right:8px"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="width:90px"
type="button"
>
@ -1486,7 +1486,7 @@ exports[`renders ./components/table/demo/custom-filter-panel.md extend context c
style="margin-right:8px"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="width:90px"
type="button"
>
@ -1687,7 +1687,7 @@ exports[`renders ./components/table/demo/custom-filter-panel.md extend context c
style="margin-right:8px"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="width:90px"
type="button"
>
@ -4766,7 +4766,7 @@ exports[`renders ./components/table/demo/edit-cell.md extend context correctly 1
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -4873,7 +4873,7 @@ exports[`renders ./components/table/demo/edit-cell.md extend context correctly 1
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>
@ -16424,7 +16424,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -16437,7 +16437,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -16449,7 +16449,7 @@ Array [
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -13144,7 +13144,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -13157,7 +13157,7 @@ Array [
style="margin-right:8px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -13169,7 +13169,7 @@ Array [
class="ant-space-item"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -594,7 +594,7 @@ exports[`renders ./components/tabs/demo/custom-add-trigger.md extend context cor
style="margin-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -945,39 +945,54 @@ exports[`renders ./components/tabs/demo/custom-tab-bar-node.md extend context co
style="transform:translate(0px, 0px)"
>
<div
class="ant-tabs-tab ant-tabs-tab-active"
class=""
style="margin-right:24px"
>
<div
aria-selected="true"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab ant-tabs-tab-active"
>
tab 1
<div
aria-selected="true"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 1
</div>
</div>
</div>
<div
class="ant-tabs-tab"
class=""
style="margin-right:24px"
>
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab"
>
tab 2
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 2
</div>
</div>
</div>
<div
class="ant-tabs-tab"
class=""
style="margin-right:24px"
>
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab"
>
tab 3
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 3
</div>
</div>
</div>
<div
@ -1586,7 +1601,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1693,7 +1708,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn tabs-extra-demo-button"
class="ant-btn ant-btn-default tabs-extra-demo-button"
type="button"
>
<span>
@ -1807,7 +1822,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -518,7 +518,7 @@ exports[`renders ./components/tabs/demo/custom-add-trigger.md correctly 1`] = `
style="margin-bottom:16px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -831,39 +831,54 @@ exports[`renders ./components/tabs/demo/custom-tab-bar-node.md correctly 1`] = `
style="transform:translate(0px, 0px)"
>
<div
class="ant-tabs-tab ant-tabs-tab-active"
class=""
style="margin-right:24px"
>
<div
aria-selected="true"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab ant-tabs-tab-active"
>
tab 1
<div
aria-selected="true"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 1
</div>
</div>
</div>
<div
class="ant-tabs-tab"
class=""
style="margin-right:24px"
>
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab"
>
tab 2
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 2
</div>
</div>
</div>
<div
class="ant-tabs-tab"
class=""
style="margin-right:24px"
>
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
class="ant-tabs-tab"
>
tab 3
<div
aria-selected="false"
class="ant-tabs-tab-btn"
role="tab"
tabindex="0"
>
tab 3
</div>
</div>
</div>
<div
@ -1396,7 +1411,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1503,7 +1518,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn tabs-extra-demo-button"
class="ant-btn ant-btn-default tabs-extra-demo-button"
type="button"
>
<span>
@ -1598,7 +1613,7 @@ Array [
class="ant-tabs-extra-content"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -7,60 +7,55 @@ title:
## zh-CN
使用 `react-dnd` 实现标签可拖拽。
使用 `react-dnd@15+` 实现标签可拖拽。
## en-US
Use `react-dnd` to make tabs draggable.
Use `react-dnd@15+` to make tabs draggable.
```jsx
import React, { useRef, cloneElement } from 'react';
import { Tabs } from 'antd';
import { DndProvider, DragSource, DropTarget } from 'react-dnd';
import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
const { TabPane } = Tabs;
// Drag & Drop node
class TabNode extends React.Component {
render() {
const { connectDragSource, connectDropTarget, children } = this.props;
const type = 'DraggableTabNode';
return connectDragSource(connectDropTarget(children));
}
}
const cardTarget = {
drop(props, monitor) {
const dragKey = monitor.getItem().index;
const hoverKey = props.index;
if (dragKey === hoverKey) {
return;
}
props.moveTabNode(dragKey, hoverKey);
monitor.getItem().index = hoverKey;
},
const DraggableTabNode = ({ index, children, moveNode }) => {
const ref = useRef();
const [{ isOver, dropClassName }, drop] = useDrop({
accept: type,
collect: monitor => {
const { index: dragIndex } = monitor.getItem() || {};
if (dragIndex === index) {
return {};
}
return {
isOver: monitor.isOver(),
dropClassName: 'dropping',
};
},
drop: item => {
moveNode(item.index, index);
},
});
const [, drag] = useDrag({
type,
item: { index },
collect: monitor => ({
isDragging: monitor.isDragging(),
}),
});
drop(drag(ref));
return (
<div ref={ref} style={{ marginRight: 24 }} className={isOver ? dropClassName : ''}>
{children}
</div>
);
};
const cardSource = {
beginDrag(props) {
return {
id: props.id,
index: props.index,
};
},
};
const WrapTabNode = DropTarget('DND_NODE', cardTarget, connect => ({
connectDropTarget: connect.dropTarget(),
}))(
DragSource('DND_NODE', cardSource, (connect, monitor) => ({
connectDragSource: connect.dragSource(),
isDragging: monitor.isDragging(),
}))(TabNode),
);
class DraggableTabs extends React.Component {
state = {
order: [],
@ -90,9 +85,9 @@ class DraggableTabs extends React.Component {
renderTabBar = (props, DefaultTabBar) => (
<DefaultTabBar {...props}>
{node => (
<WrapTabNode key={node.key} index={node.key} moveTabNode={this.moveTabNode}>
<DraggableTabNode key={node.key} index={node.key} moveNode={this.moveTabNode}>
{node}
</WrapTabNode>
</DraggableTabNode>
)}
</DefaultTabBar>
);
@ -151,3 +146,10 @@ ReactDOM.render(
mountNode,
);
```
```css
.dropping {
background: #fefefe;
transition: all 0.3s;
}
```

View File

@ -528,7 +528,7 @@ Array [
</span>,
<br />,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>

View File

@ -528,7 +528,7 @@ Array [
</span>,
<br />,
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
type="button"
>
<span>

View File

@ -47,14 +47,13 @@ const TimelineItem: React.FC<TimelineItemProps> = ({
[`${prefixCls}-item-head-${color}`]: true,
});
const customColor = /blue|red|green|gray/.test(color || '') ? undefined : color;
return (
<li {...restProps} className={itemClassName}>
{label && <div className={`${prefixCls}-item-label`}>{label}</div>}
<div className={`${prefixCls}-item-tail`} />
<div
className={dotClassName}
style={{ borderColor: /blue|red|green|gray/.test(color || '') ? undefined : color }}
>
<div className={dotClassName} style={{ borderColor: customColor, color: customColor }}>
{dot}
</div>
<div className={`${prefixCls}-item-content`}>{children}</div>

View File

@ -316,7 +316,7 @@ exports[`renders ./components/timeline/demo/color.md extend context correctly 1`
</div>
</li>
<li
class="ant-timeline-item ant-timeline-item-last"
class="ant-timeline-item"
>
<div
class="ant-timeline-item-tail"
@ -338,6 +338,44 @@ exports[`renders ./components/timeline/demo/color.md extend context correctly 1`
</p>
</div>
</li>
<li
class="ant-timeline-item ant-timeline-item-last"
>
<div
class="ant-timeline-item-tail"
/>
<div
class="ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-#00CCFF"
style="border-color:#00CCFF;color:#00CCFF"
>
<span
aria-label="smile"
class="anticon anticon-smile"
role="img"
>
<svg
aria-hidden="true"
data-icon="smile"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"
/>
</svg>
</span>
</div>
<div
class="ant-timeline-item-content"
>
<p>
Custom color testing
</p>
</div>
</li>
</ul>
`;

View File

@ -316,7 +316,7 @@ exports[`renders ./components/timeline/demo/color.md correctly 1`] = `
</div>
</li>
<li
class="ant-timeline-item ant-timeline-item-last"
class="ant-timeline-item"
>
<div
class="ant-timeline-item-tail"
@ -338,6 +338,44 @@ exports[`renders ./components/timeline/demo/color.md correctly 1`] = `
</p>
</div>
</li>
<li
class="ant-timeline-item ant-timeline-item-last"
>
<div
class="ant-timeline-item-tail"
/>
<div
class="ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-#00CCFF"
style="border-color:#00CCFF;color:#00CCFF"
>
<span
aria-label="smile"
class="anticon anticon-smile"
role="img"
>
<svg
aria-hidden="true"
data-icon="smile"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"
/>
</svg>
</span>
</div>
<div
class="ant-timeline-item-content"
>
<p>
Custom color testing
</p>
</div>
</li>
</ul>
`;

View File

@ -15,6 +15,7 @@ Set the color of circles. `green` means completed or success status, `red` means
```jsx
import { Timeline } from 'antd';
import { SmileOutlined } from '@ant-design/icons';
ReactDOM.render(
<Timeline>
@ -40,6 +41,9 @@ ReactDOM.render(
<p>Technical testing 2</p>
<p>Technical testing 3 2015-09-01</p>
</Timeline.Item>
<Timeline.Item color="#00CCFF" dot={<SmileOutlined />}>
<p>Custom color testing</p>
</Timeline.Item>
</Timeline>,
mountNode,
);

View File

@ -3,7 +3,7 @@
exports[`renders ./components/tooltip/demo/arrow-point-at-center.md extend context correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -35,7 +35,7 @@ Array [
</div>
</div>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -74,7 +74,7 @@ exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md extend contex
style="overflow:hidden;position:relative;padding:24px;border:1px solid #e9e9e9"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -107,7 +107,7 @@ exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md extend contex
</div>
<br />
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -187,7 +187,7 @@ Array [
</div>,
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -219,7 +219,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -251,7 +251,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -283,7 +283,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -315,7 +315,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -347,7 +347,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -379,7 +379,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -411,7 +411,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -443,7 +443,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -475,7 +475,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -507,7 +507,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -539,7 +539,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -571,7 +571,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -615,7 +615,7 @@ Array [
</div>,
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -649,7 +649,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -683,7 +683,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -717,7 +717,7 @@ Array [
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -794,7 +794,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -828,7 +828,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -862,7 +862,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -900,7 +900,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -934,7 +934,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -968,7 +968,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1006,7 +1006,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1040,7 +1040,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1074,7 +1074,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1112,7 +1112,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1146,7 +1146,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -1180,7 +1180,7 @@ exports[`renders ./components/tooltip/demo/placement.md extend context correctly
</div>
</div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -3,7 +3,7 @@
exports[`renders ./components/tooltip/demo/arrow-point-at-center.md correctly 1`] = `
Array [
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -11,7 +11,7 @@ Array [
</span>
</button>,
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -26,7 +26,7 @@ exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md correctly 1`]
style="overflow:hidden;position:relative;padding:24px;border:1px solid #e9e9e9"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -35,7 +35,7 @@ exports[`renders ./components/tooltip/demo/auto-adjust-overflow.md correctly 1`]
</button>
<br />
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -65,7 +65,7 @@ Array [
</div>,
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -73,7 +73,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -81,7 +81,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -89,7 +89,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -97,7 +97,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -105,7 +105,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -113,7 +113,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -121,7 +121,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -129,7 +129,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -137,7 +137,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -145,7 +145,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -153,7 +153,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -161,7 +161,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -181,7 +181,7 @@ Array [
</div>,
<div>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -189,7 +189,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -197,7 +197,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -205,7 +205,7 @@ Array [
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -230,7 +230,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
style="margin-left:70px;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -238,7 +238,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -246,7 +246,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -258,7 +258,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
style="width:70px;float:left"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -266,7 +266,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -274,7 +274,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -286,7 +286,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
style="width:70px;margin-left:304px"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -294,7 +294,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -302,7 +302,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -314,7 +314,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
style="margin-left:70px;clear:both;white-space:nowrap"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -322,7 +322,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>
@ -330,7 +330,7 @@ exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span>

View File

@ -8,7 +8,7 @@ exports[`Tooltip should hide when mouse leave antd disabled component Button 1`]
style="display: inline-block; cursor: not-allowed;"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
disabled=""
style="pointer-events: none;"
type="button"

View File

@ -346,4 +346,22 @@ describe('Tooltip', () => {
);
expect(wrapper.find('.ant-tooltip-inner').getDOMNode().style.color).toBe('red');
});
it('should work with loading switch', () => {
const onVisibleChange = jest.fn();
const wrapper = mount(
<Tooltip
title="loading tips"
mouseEnterDelay={0}
mouseLeaveDelay={0}
onVisibleChange={onVisibleChange}
>
<Switch loading defaultChecked />
</Tooltip>,
);
const wrapperEl = wrapper.find('.ant-tooltip-disabled-compatible-wrapper');
expect(wrapperEl).toHaveLength(1);
wrapper.find('span').first().simulate('mouseenter');
expect(onVisibleChange).toHaveBeenLastCalledWith(true);
});
});

View File

@ -85,10 +85,8 @@ const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?
function getDisabledCompatibleChildren(element: React.ReactElement<any>, prefixCls: string) {
const elementType = element.type as any;
if (
(elementType.__ANT_BUTTON === true ||
elementType.__ANT_SWITCH === true ||
element.type === 'button') &&
element.props.disabled
((elementType.__ANT_BUTTON === true || element.type === 'button') && element.props.disabled) ||
(elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading))
) {
// Pick some layout related style properties up to span
// Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254

View File

@ -302,7 +302,7 @@ exports[`renders ./components/transfer/demo/advanced.md extend context correctly
class="ant-transfer-list-footer"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="float:left;margin:5px"
type="button"
>
@ -670,7 +670,7 @@ exports[`renders ./components/transfer/demo/advanced.md extend context correctly
class="ant-transfer-list-footer"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="float:right;margin:5px"
type="button"
>

View File

@ -173,7 +173,7 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
class="ant-transfer-list-footer"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="float:left;margin:5px"
type="button"
>
@ -412,7 +412,7 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
class="ant-transfer-list-footer"
>
<button
class="ant-btn ant-btn-sm"
class="ant-btn ant-btn-default ant-btn-sm"
style="float:right;margin:5px"
type="button"
>

View File

@ -3627,7 +3627,7 @@ exports[`renders ./components/tree/demo/search.md extend context correctly 1`] =
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span

View File

@ -3627,7 +3627,7 @@ exports[`renders ./components/tree/demo/search.md correctly 1`] = `
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
class="ant-btn ant-btn-default ant-btn-icon-only ant-input-search-button"
type="button"
>
<span

View File

@ -193,7 +193,7 @@ const Ellipsis = ({ enabledMeasure, children, text, width, rows, onEllipsis }: E
walkingState !== DONE_WITHOUT_ELLIPSIS && (
<>
{/* `l` for top & `g` for bottom measure */}
{renderMeasure('lg', singleRowRef, { width: 9999 })}
{renderMeasure('lg', singleRowRef, { wordBreak: 'keep-all', whiteSpace: 'nowrap' })}
{/* {renderMeasureSlice(midLen, midRowRef)} */}
{walkingState === PREPARE
? renderMeasure(children(nodeList, false), midRowRef, measureStyle)

View File

@ -168,8 +168,8 @@ const Base = React.forwardRef((props: InternalBlockProps, ref: any) => {
}
}, [editing]);
const onEditClick = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault();
const onEditClick = (e?: React.MouseEvent<HTMLDivElement>) => {
e?.preventDefault();
triggerEdit(true);
};
@ -192,8 +192,9 @@ const Base = React.forwardRef((props: InternalBlockProps, ref: any) => {
clearTimeout(copyIdRef.current!);
};
const onCopyClick = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault();
const onCopyClick = (e?: React.MouseEvent<HTMLDivElement>) => {
e?.preventDefault();
e?.stopPropagation();
if (copyConfig.text === undefined) {
copyConfig.text = String(children);
@ -293,12 +294,14 @@ const Base = React.forwardRef((props: InternalBlockProps, ref: any) => {
const textEle = typographyRef.current;
if (enableEllipsis && cssEllipsis && textEle) {
const currentEllipsis = textEle.offsetWidth < textEle.scrollWidth;
const currentEllipsis = cssLineClamp
? textEle.offsetHeight < textEle.scrollHeight
: textEle.offsetWidth < textEle.scrollWidth;
if (isNativeEllipsis !== currentEllipsis) {
setIsNativeEllipsis(currentEllipsis);
}
}
}, [enableEllipsis, cssEllipsis, children]);
}, [enableEllipsis, cssEllipsis, children, cssLineClamp]);
// ========================== Tooltip ===========================
const tooltipTitle = ellipsisConfig.tooltip === true ? children : ellipsisConfig.tooltip;

View File

@ -237,7 +237,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -259,7 +259,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -288,7 +288,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -455,7 +455,7 @@ Array [
case. Bnt Design, a design language for background applications, is refined by Ant UED Team. Cnt Design, a design language for background applications, is refined by Ant UED Team. Dnt Design, a design language for background applications, is refined by Ant UED Team. Ent Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -529,7 +529,7 @@ Array [
</div>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -604,7 +604,7 @@ Array [
not ellipsis
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -633,7 +633,7 @@ exports[`renders ./components/typography/demo/ellipsis-middle.md extend context
In the process of internal desktop applications development, many different design specs and implementations would be involved, which might cause designers and developers difficulties and duplication and reduce the efficiency ofdevelopment.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -1593,7 +1593,7 @@ Array [
To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life--William Shakespeare
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>

View File

@ -237,7 +237,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -259,7 +259,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -288,7 +288,7 @@ Array [
Ant Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -407,7 +407,7 @@ Array [
case. Bnt Design, a design language for background applications, is refined by Ant UED Team. Cnt Design, a design language for background applications, is refined by Ant UED Team. Dnt Design, a design language for background applications, is refined by Ant UED Team. Ent Design, a design language for background applications, is refined by Ant UED Team.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -457,7 +457,7 @@ Array [
</div>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -508,7 +508,7 @@ Array [
not ellipsis
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -537,7 +537,7 @@ exports[`renders ./components/typography/demo/ellipsis-middle.md correctly 1`] =
In the process of internal desktop applications development, many different design specs and implementations would be involved, which might cause designers and developers difficulties and duplication and reduce the efficiency ofdevelopment.
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>
@ -1213,7 +1213,7 @@ Array [
To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life--William Shakespeare
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;word-break:keep-all;white-space:nowrap"
>
lg
</span>

View File

@ -193,5 +193,18 @@ describe('Typography copy', () => {
tooltipLength: 0,
});
});
it('copy click event stopPropagation', () => {
const onDivClick = jest.fn();
const wrapper = mount(
<div onClick={onDivClick}>
<Base component="p" copyable>
test copy
</Base>
</div>,
);
wrapper.find('.ant-typography-copy').first().simulate('click');
expect(onDivClick).not.toBeCalled();
});
});
});

View File

@ -277,4 +277,34 @@ describe('Typography.Ellipsis', () => {
const tooltipWrapper = mount(<Base ellipsis={{ expandable: true, tooltip: 'little' }} />);
expect(tooltipWrapper.find('.ant-typography').prop('aria-label')).toEqual('little');
});
it('should display tooltip if line clamp', () => {
mockRectSpy = spyElementPrototypes(HTMLElement, {
scrollHeight: {
get() {
let html = this.innerHTML;
html = html.replace(/<[^>]*>/g, '');
const lines = Math.ceil(html.length / LINE_STR_COUNT);
return lines * 16;
},
},
offsetHeight: {
get: () => 32,
},
offsetWidth: {
get: () => 100,
},
scrollWidth: {
get: () => 100,
},
});
const wrapper = mount(
<Base ellipsis={{ tooltip: 'This is tooltip', rows: 2 }}>
Ant Design, a design language for background applications, is refined by Ant UED Team.
</Base>,
);
expect(wrapper.find('EllipsisTooltip').prop('isEllipsis')).toBeTruthy();
mockRectSpy.mockRestore();
});
});

View File

@ -0,0 +1,32 @@
import React from 'react';
import { mount } from 'enzyme';
import KeyCode from 'rc-util/lib/KeyCode';
import Paragraph from '../Paragraph';
test('Callback on enter key is triggered', () => {
const onEditStart = jest.fn();
const onCopy = jest.fn();
const wrapper = mount(
<Paragraph
copyable={{
onCopy,
}}
editable={{
onStart: onEditStart,
}}
>
test
</Paragraph>,
);
const timer: any = 9527;
jest.spyOn(window, 'setTimeout').mockReturnValue(timer);
jest.spyOn(window, 'clearTimeout');
// must copy first, because editing button will hide copy button
wrapper.find('.ant-typography-copy').at(0).simulate('keyup', { keyCode: KeyCode.ENTER });
wrapper.find('.anticon-edit').at(0).simulate('keyup', { keyCode: KeyCode.ENTER });
expect(onEditStart.mock.calls.length).toBe(1);
expect(onCopy.mock.calls.length).toBe(1);
jest.restoreAllMocks();
});

View File

@ -70,7 +70,7 @@ exports[`renders ./components/upload/demo/basic.md extend context correctly 1`]
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -242,7 +242,7 @@ exports[`renders ./components/upload/demo/customize-progress-bar.md extend conte
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -294,7 +294,7 @@ exports[`renders ./components/upload/demo/defaultFileList.md extend context corr
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -607,7 +607,7 @@ exports[`renders ./components/upload/demo/directory.md extend context correctly
webkitdirectory="webkitdirectory"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -720,7 +720,7 @@ exports[`renders ./components/upload/demo/drag-sorting.md extend context correct
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -1924,7 +1924,7 @@ exports[`renders ./components/upload/demo/fileList.md extend context correctly 1
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -2063,7 +2063,7 @@ exports[`renders ./components/upload/demo/max-count.md extend context correctly
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -2117,7 +2117,7 @@ exports[`renders ./components/upload/demo/max-count.md extend context correctly
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -2772,7 +2772,7 @@ Array [
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3007,7 +3007,7 @@ Array [
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3244,7 +3244,7 @@ exports[`renders ./components/upload/demo/preview-file.md extend context correct
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3296,7 +3296,7 @@ exports[`renders ./components/upload/demo/transform-file.md extend context corre
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3348,7 +3348,7 @@ exports[`renders ./components/upload/demo/upload-custom-action-icon.md extend co
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3678,7 +3678,7 @@ Array [
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3741,7 +3741,7 @@ exports[`renders ./components/upload/demo/upload-png-only.md extend context corr
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span
@ -3819,7 +3819,7 @@ exports[`renders ./components/upload/demo/upload-with-aliyun-oss.md extend conte
type="file"
/>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
type="button"
>
<span

Some files were not shown because too many files have changed in this diff Show More