File tree 11 files changed +125
-121
lines changed
dropdown/__tests__/__snapshots__
empty/__tests__/__snapshots__
locale-provider/__tests__/__snapshots__
progress/__tests__/__snapshots__
transfer/__tests__/__snapshots__
11 files changed +125
-121
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -45,13 +45,14 @@ export default {
45
45
const autoInsertSpace = this . configProvider . autoInsertSpaceInButton !== false ;
46
46
47
47
const sizeCls = sizeMap [ size ] || '' ;
48
+ const iconType = sLoading ? 'loading' : icon ;
48
49
const children = filterEmpty ( $slots . default ) ;
49
50
return {
50
51
[ `${ prefixCls } ` ] : true ,
51
52
[ `${ prefixCls } -${ type } ` ] : type ,
52
53
[ `${ prefixCls } -${ shape } ` ] : shape ,
53
54
[ `${ prefixCls } -${ sizeCls } ` ] : sizeCls ,
54
- [ `${ prefixCls } -icon-only` ] : ! children && children !== 0 && icon ,
55
+ [ `${ prefixCls } -icon-only` ] : children . length === 0 && iconType ,
55
56
[ `${ prefixCls } -loading` ] : sLoading ,
56
57
[ `${ prefixCls } -background-ghost` ] : ghost || type === 'ghost' ,
57
58
[ `${ prefixCls } -two-chinese-chars` ] : hasTwoCNChar && autoInsertSpace ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ A loading indicator can be added to a button by setting the `loading` property o
25
25
延迟1s
26
26
</a-button>
27
27
<br />
28
+ <a-button type="primary" loading />
28
29
<a-button shape="circle" loading />
29
30
<a-button type="primary" shape="circle" loading />
30
31
</div>
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ exports[`renders ./components/dropdown/demo/context-menu.md correctly 1`] = `<sp
10
10
11
11
exports [` renders ./components/dropdown/demo/dropdown-button.md correctly 1` ] = `
12
12
<div >
13
- <div class = " ant-btn-group ant-dropdown-button" ><button type = " button" class = " ant-btn ant-btn-default" ><span >Dropdown</span ></button ><button type = " button" class = " ant-btn ant-btn-default ant-dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
13
+ <div class = " ant-btn-group ant-dropdown-button" ><button type = " button" class = " ant-btn ant-btn-default" ><span >Dropdown</span ></button ><button type = " button" class = " ant-btn ant-btn-default ant-btn-icon-only ant- dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
14
14
<path d = " M176 511a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0z" ></path >
15
15
</svg ></i ></button ></div >
16
- <div class = " ant-btn-group ant-dropdown-button" style = " margin-left: 8px;" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-default" ><span >Dropdown</span ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-default ant-dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
16
+ <div class = " ant-btn-group ant-dropdown-button" style = " margin-left: 8px;" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-default" ><span >Dropdown</span ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-default ant-btn-icon-only ant- dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
17
17
<path d = " M176 511a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0z" ></path >
18
18
</svg ></i ></button ></div > <button type = " button" class = " ant-btn ant-dropdown-trigger" style = " margin-left: 8px;" ><span >Button</span ><i aria-label = " icon: down" class = " anticon anticon-down" ><svg viewBox = " 64 64 896 896" data-icon = " down" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
19
19
<path d = " M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" ></path >
Original file line number Diff line number Diff line change 1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` DropdownButton should support href like Button 1` ] = `
4
- <div class = " ant-btn-group ant-dropdown-button" ><a href = " https://ant.design" class = " ant-btn ant-btn-default" ></a ><button type = " button" class = " ant-btn ant-btn-default ant-dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
4
+ <div class = " ant-btn-group ant-dropdown-button" ><a href = " https://ant.design" class = " ant-btn ant-btn-default" ></a ><button type = " button" class = " ant-btn ant-btn-default ant-btn-icon-only ant- dropdown-trigger" ><i aria-label = " icon: ellipsis" class = " anticon anticon-ellipsis" ><svg viewBox = " 64 64 896 896" data-icon = " ellipsis" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
5
5
<path d = " M176 511a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm280 0a56 56 0 1 0 112 0 56 56 0 1 0-112 0z" ></path >
6
6
</svg ></i ></button ></div >
7
7
` ;
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
34
34
</div >
35
35
</div >
36
36
</div >
37
- <div class = " ant-transfer-operation" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm" ><i aria-label = " icon: right" class = " anticon anticon-right" ><svg viewBox = " 64 64 896 896" data-icon = " right" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
37
+ <div class = " ant-transfer-operation" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only " ><i aria-label = " icon: right" class = " anticon anticon-right" ><svg viewBox = " 64 64 896 896" data-icon = " right" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
38
38
<path d = " M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z" ></path >
39
- </svg ></i ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm" ><i aria-label = " icon: left" class = " anticon anticon-left" ><svg viewBox = " 64 64 896 896" data-icon = " left" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
39
+ </svg ></i ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only " ><i aria-label = " icon: left" class = " anticon anticon-left" ><svg viewBox = " 64 64 896 896" data-icon = " left" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
40
40
<path d = " M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" ></path >
41
41
</svg ></i ></button ></div >
42
42
<div class = " ant-transfer-list" >
Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
60
60
</div >
61
61
</div >
62
62
</div >
63
- <div class = " ant-transfer-operation" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm" ><i aria-label = " icon: right" class = " anticon anticon-right" ><svg viewBox = " 64 64 896 896" data-icon = " right" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
63
+ <div class = " ant-transfer-operation" ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only " ><i aria-label = " icon: right" class = " anticon anticon-right" ><svg viewBox = " 64 64 896 896" data-icon = " right" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
64
64
<path d = " M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z" ></path >
65
- </svg ></i ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm" ><i aria-label = " icon: left" class = " anticon anticon-left" ><svg viewBox = " 64 64 896 896" data-icon = " left" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
65
+ </svg ></i ></button ><button disabled = " disabled" type = " button" class = " ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only " ><i aria-label = " icon: left" class = " anticon anticon-left" ><svg viewBox = " 64 64 896 896" data-icon = " left" width = " 1em" height = " 1em" fill = " currentColor" aria-hidden = " true" class = " " >
66
66
<path d = " M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" ></path >
67
67
</svg ></i ></button ></div >
68
68
<div class = " ant-transfer-list" >
You can’t perform that action at this time.
0 commit comments