diff --git a/antdv-demo b/antdv-demo index 7932f81db..e63484050 160000 --- a/antdv-demo +++ b/antdv-demo @@ -1 +1 @@ -Subproject commit 7932f81dbe8517a0492f92dfcd4a3beef879a32d +Subproject commit e63484050915cdc29d9e196aca892f1859615d4e diff --git a/components/_util/classNames.js b/components/_util/classNames.js index 984024502..55875ffb7 100644 --- a/components/_util/classNames.js +++ b/components/_util/classNames.js @@ -1,20 +1,27 @@ import { isArray, isString, isObject } from './util'; -function classNames(value) { - let res = ''; - if (isString(value)) { - res = value; - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - res += classNames(value[i]) + ' '; - } - } else if (isObject(value)) { - for (const name in value) { - if (value[name]) { - res += name + ' '; +function classNames() { + let classes = []; + for (let i = 0; i < arguments.length; i++) { + const value = arguments[i]; + if (!value) continue; + if (isString(value)) { + classes.push(value); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const inner = classNames(value[i]); + if (inner) { + classes.push(inner); + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + classes.push(name); + } } } } - return res.trim(); + return classes.join(' '); } export default classNames; diff --git a/components/affix/__tests__/__snapshots__/demo.test.js.snap b/components/affix/__tests__/__snapshots__/demo.test.js.snap index d6c6954a5..62bfb421b 100644 --- a/components/affix/__tests__/__snapshots__/demo.test.js.snap +++ b/components/affix/__tests__/__snapshots__/demo.test.js.snap @@ -3,18 +3,21 @@ exports[`renders ./antdv-demo/docs/affix/demo/basic.md correctly 1`] = `
+ Affix top +

+ Affix bottom +
`; exports[`renders ./antdv-demo/docs/affix/demo/on-change.md correctly 1`] = `
+ 120px to affix top +
`; @@ -23,7 +26,8 @@ exports[`renders ./antdv-demo/docs/affix/demo/target.md correctly 1`] = `
+ Fixed at the top of container +
diff --git a/components/alert/__tests__/__snapshots__/demo.test.js.snap b/components/alert/__tests__/__snapshots__/demo.test.js.snap index 76acf0c82..0ddccef29 100644 --- a/components/alert/__tests__/__snapshots__/demo.test.js.snap +++ b/components/alert/__tests__/__snapshots__/demo.test.js.snap @@ -23,14 +23,17 @@ exports[`renders ./antdv-demo/docs/alert/demo/basic.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/alert/demo/closable.md correctly 1`] = `
- Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text
+ Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text +
- Error TextError Description Error Description Error Description Error Description Error Description Error Description
+ Error TextError Description Error Description Error Description Error Description Error Description Error Description + `; exports[`renders ./antdv-demo/docs/alert/demo/close-text.md correctly 1`] = `
- Info TextClose Now
+ Info TextClose Now + `; exports[`renders ./antdv-demo/docs/alert/demo/custom-icon.md correctly 1`] = ` @@ -96,7 +99,7 @@ exports[`renders ./antdv-demo/docs/alert/demo/icon.md correctly 1`] = `
Error
-
Success TipsDetailed description and advices about successful copywriting. +
Success TipsDetailed description and advices about successful copywriting.
Informational NotesAdditional description and informations about copywriting. @@ -112,7 +115,8 @@ exports[`renders ./antdv-demo/docs/alert/demo/icon.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/alert/demo/smooth-closed.md correctly 1`] = `
- Alert Message Text
+ Alert Message Text +
`; exports[`renders ./antdv-demo/docs/alert/demo/style.md correctly 1`] = ` diff --git a/components/avatar/__tests__/__snapshots__/demo.test.js.snap b/components/avatar/__tests__/__snapshots__/demo.test.js.snap index 8bcb8b973..5d0fdd55e 100644 --- a/components/avatar/__tests__/__snapshots__/demo.test.js.snap +++ b/components/avatar/__tests__/__snapshots__/demo.test.js.snap @@ -3,7 +3,8 @@ exports[`renders ./antdv-demo/docs/avatar/demo/badge.md correctly 1`] = `

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

-
+ +
`; exports[`renders ./antdv-demo/docs/avatar/demo/basic.md correctly 1`] = ` @@ -15,7 +16,8 @@ exports[`renders ./antdv-demo/docs/avatar/demo/basic.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/avatar/demo/dynamic.md correctly 1`] = `
U
+ 改 变 + `; exports[`renders ./antdv-demo/docs/avatar/demo/type.md correctly 1`] = `
UUSERU
`; diff --git a/components/back-top/__tests__/__snapshots__/demo.test.js.snap b/components/back-top/__tests__/__snapshots__/demo.test.js.snap index 30d58d134..31d2c6d54 100644 --- a/components/back-top/__tests__/__snapshots__/demo.test.js.snap +++ b/components/back-top/__tests__/__snapshots__/demo.test.js.snap @@ -2,10 +2,12 @@ exports[`renders ./antdv-demo/docs/back-top/demo/basic.md correctly 1`] = `
- Scroll down to see the bottom-right gray button.
+ Scroll down to see the bottom-right gray button. + `; exports[`renders ./antdv-demo/docs/back-top/demo/custom.md correctly 1`] = `
- Scroll down to see the bottom-right blue button.
+ Scroll down to see the bottom-right blue button. + `; diff --git a/components/badge/__tests__/__snapshots__/demo.test.js.snap b/components/badge/__tests__/__snapshots__/demo.test.js.snap index 19b0c9609..4aa8b83f1 100644 --- a/components/badge/__tests__/__snapshots__/demo.test.js.snap +++ b/components/badge/__tests__/__snapshots__/demo.test.js.snap @@ -11,11 +11,14 @@ exports[`renders ./antdv-demo/docs/badge/demo/change.md correctly 1`] = `

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

+ +
+ + `; exports[`renders ./antdv-demo/docs/badge/demo/colors.md correctly 1`] = ` @@ -43,12 +46,14 @@ exports[`renders ./antdv-demo/docs/badge/demo/dot.md correctly 1`] = `
- Link something
+ Link something + `; exports[`renders ./antdv-demo/docs/badge/demo/link.md correctly 1`] = `

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

-
+ + `; exports[`renders ./antdv-demo/docs/badge/demo/no-wrapper.md correctly 1`] = ` @@ -66,5 +71,6 @@ exports[`renders ./antdv-demo/docs/badge/demo/status.md correctly 1`] = `

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

-
+
+ `; diff --git a/components/badge/__tests__/__snapshots__/index.test.js.snap b/components/badge/__tests__/__snapshots__/index.test.js.snap index 4afa84dc8..0274af1fb 100644 --- a/components/badge/__tests__/__snapshots__/index.test.js.snap +++ b/components/badge/__tests__/__snapshots__/index.test.js.snap @@ -7,7 +7,8 @@ exports[`Badge badge should support float number 2`] = `-

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

-

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

-
+ + `; exports[`Badge should be compatible with borderColor style 1`] = ` diff --git a/components/button/__tests__/__snapshots__/demo.test.js.snap b/components/button/__tests__/__snapshots__/demo.test.js.snap index 59393b406..80f161eff 100644 --- a/components/button/__tests__/__snapshots__/demo.test.js.snap +++ b/components/button/__tests__/__snapshots__/demo.test.js.snap @@ -2,97 +2,147 @@ exports[`renders ./antdv-demo/docs/button/demo/basic.md correctly 1`] = ` + Primary + `; exports[`renders ./antdv-demo/docs/button/demo/block.md correctly 1`] = ` + Primary + `; exports[`renders ./antdv-demo/docs/button/demo/button-group.md correctly 1`] = `

Basic

+ Cancel +
+ L +
+ L +

With Icon

+ Go back +
`; exports[`renders ./antdv-demo/docs/button/demo/disabled.md correctly 1`] = `


+ Primary +


+ Ghost + `; exports[`renders ./antdv-demo/docs/button/demo/ghost.md correctly 1`] = `
+ Primary + `; exports[`renders ./antdv-demo/docs/button/demo/icon.md correctly 1`] = ` + A + `; exports[`renders ./antdv-demo/docs/button/demo/loading.md correctly 1`] = `

+ mouseenter me! +
`; exports[`renders ./antdv-demo/docs/button/demo/multiple.md correctly 1`] = ` + Primary + + Actions + `; exports[`renders ./antdv-demo/docs/button/demo/size.md correctly 1`] = `




+ Primary +

+ Backward + `; diff --git a/components/button/__tests__/__snapshots__/index.test.js.snap b/components/button/__tests__/__snapshots__/index.test.js.snap index 5dcebaebd..b45ab8461 100644 --- a/components/button/__tests__/__snapshots__/index.test.js.snap +++ b/components/button/__tests__/__snapshots__/index.test.js.snap @@ -2,32 +2,38 @@ exports[`Button fixbug renders {0} , 0 and {false} 1`] = ` + 0 + `; exports[`Button fixbug renders {0} , 0 and {false} 2`] = ` + 0 + `; exports[`Button fixbug renders {0} , 0 and {false} 3`] = ` + + `; exports[`Button renders Chinese characters correctly 1`] = ` + 按 钮 + `; exports[`Button renders Chinese characters correctly 2`] = ` + 按钮 + `; exports[`Button renders Chinese characters correctly 3`] = ` + 按 钮 + `; exports[`Button renders Chinese characters correctly 4`] = ``; @@ -36,20 +42,24 @@ exports[`Button renders Chinese characters correctly 5`] = ` + 按钮 + `; exports[`Button renders correctly 1`] = ` + Follow + `; exports[`Button should not render as link button when href is undefined 1`] = ` + button + `; exports[`Button should support link button 1`] = ` - link button + link button + `; diff --git a/components/calendar/__tests__/__snapshots__/demo.test.js.snap b/components/calendar/__tests__/__snapshots__/demo.test.js.snap index 90ce54e9f..3e1a066d4 100644 --- a/components/calendar/__tests__/__snapshots__/demo.test.js.snap +++ b/components/calendar/__tests__/__snapshots__/demo.test.js.snap @@ -1647,7 +1647,7 @@ exports[`renders ./antdv-demo/docs/calendar/demo/notice-calendar.md correctly 1` `; exports[`renders ./antdv-demo/docs/calendar/demo/select.md correctly 1`] = ` -
+
You selected date: 2017-01-25
diff --git a/components/card/__tests__/__snapshots__/demo.test.js.snap b/components/card/__tests__/__snapshots__/demo.test.js.snap index 091e50dc8..5f421cae1 100644 --- a/components/card/__tests__/__snapshots__/demo.test.js.snap +++ b/components/card/__tests__/__snapshots__/demo.test.js.snap @@ -249,7 +249,8 @@ exports[`renders ./antdv-demo/docs/card/demo/loading.md correctly 1`] = `
+ Toggle loading + `; exports[`renders ./antdv-demo/docs/card/demo/meta.md correctly 1`] = ` diff --git a/components/card/__tests__/__snapshots__/index.test.js.snap b/components/card/__tests__/__snapshots__/index.test.js.snap index 96f5f3dd0..bf48381bf 100644 --- a/components/card/__tests__/__snapshots__/index.test.js.snap +++ b/components/card/__tests__/__snapshots__/index.test.js.snap @@ -58,7 +58,8 @@ exports[`Card title should be vertically aligned 1`] = `
Card title
+ Button +
diff --git a/components/checkbox/__tests__/__snapshots__/demo.test.js.snap b/components/checkbox/__tests__/__snapshots__/demo.test.js.snap index 5d27cb23f..0426fa31a 100644 --- a/components/checkbox/__tests__/__snapshots__/demo.test.js.snap +++ b/components/checkbox/__tests__/__snapshots__/demo.test.js.snap @@ -10,14 +10,18 @@ exports[`renders ./antdv-demo/docs/checkbox/demo/check-all.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/checkbox/demo/controller.md correctly 1`] = `

+ Uncheck +

`; exports[`renders ./antdv-demo/docs/checkbox/demo/disabled.md correctly 1`] = `
+ +
`; exports[`renders ./antdv-demo/docs/checkbox/demo/group.md correctly 1`] = ` diff --git a/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap b/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap index 0811b3f43..18512402c 100644 --- a/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap @@ -198,7 +198,8 @@ exports[`RangePicker show month panel according to value 1`] = `
- 2月2000
+ 2月2000 +
@@ -370,7 +371,8 @@ exports[`RangePicker show month panel according to value 1`] = ` @@ -578,7 +580,8 @@ exports[`RangePicker switch to corresponding month panel when click presetted ra
- 2月2000
+ 2月2000 +
diff --git a/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap b/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap index f95f6585b..b378e63b2 100644 --- a/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap @@ -8,7 +8,8 @@ exports[`Drawer class is test_drawer 1`] = `
-
+ +
Here is content of Drawer
@@ -79,7 +80,8 @@ exports[`Drawer render correctly 1`] = `
-
+ +
Here is content of Drawer
@@ -97,7 +99,8 @@ exports[`Drawer render top drawer 1`] = `
-
+ +
Here is content of Drawer
diff --git a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap index 98b9f7c03..684bf6b56 100644 --- a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap @@ -2,7 +2,8 @@ exports[`Drawer render correctly 1`] = `
+ open +
@@ -10,7 +11,8 @@ exports[`Drawer render correctly 1`] = `
-
+ +
Here is content of Drawer
diff --git a/components/drawer/__tests__/__snapshots__/demo.test.js.snap b/components/drawer/__tests__/__snapshots__/demo.test.js.snap index 3d2a80e10..172893f8c 100644 --- a/components/drawer/__tests__/__snapshots__/demo.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/demo.test.js.snap @@ -2,31 +2,36 @@ exports[`renders ./antdv-demo/docs/drawer/demo/basic-right.md correctly 1`] = ` + Open + `; exports[`renders ./antdv-demo/docs/drawer/demo/form-in-drawer.md correctly 1`] = ` + New account + `; exports[`renders ./antdv-demo/docs/drawer/demo/multi-level-drawer.md correctly 1`] = ` + Open + `; exports[`renders ./antdv-demo/docs/drawer/demo/placement.md correctly 1`] = `
+ Open + `; exports[`renders ./antdv-demo/docs/drawer/demo/render-in-current.md correctly 1`] = `
Render in this
+ Open +
diff --git a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap index 80740a861..ba658324f 100644 --- a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap +++ b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap @@ -9,19 +9,29 @@ exports[`renders ./antdv-demo/docs/dropdown/demo/context-menu.md correctly 1`] = exports[`renders ./antdv-demo/docs/dropdown/demo/dropdown-button.md correctly 1`] = `
+ Dropdown +
+ + +
+ Dropdown +
+ + +
+ Dropdown +
+ + +
+ Button + `; exports[`renders ./antdv-demo/docs/dropdown/demo/event.md correctly 1`] = ` Hover me, Click menu item `; @@ -33,21 +43,27 @@ exports[`renders ./antdv-demo/docs/dropdown/demo/overlay-visible.md correctly 1` exports[`renders ./antdv-demo/docs/dropdown/demo/placement.md correctly 1`] = `
+ bottomLeft + + bottomCenter +
+ bottomRight +
+ topLeft + + topCenter + + topRight +
`; diff --git a/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap b/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap index 72bef44de..0e137c47b 100644 --- a/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap +++ b/components/dropdown/__tests__/__snapshots__/dropdown-button.test.js.snap @@ -2,7 +2,10 @@ exports[`DropdownButton should support href like Button 1`] = `
- + +
+ + +
`; diff --git a/components/empty/__tests__/__snapshots__/demo.test.js.snap b/components/empty/__tests__/__snapshots__/demo.test.js.snap index 354dd1c7b..8a01c712a 100644 --- a/components/empty/__tests__/__snapshots__/demo.test.js.snap +++ b/components/empty/__tests__/__snapshots__/demo.test.js.snap @@ -25,7 +25,8 @@ exports[`renders ./antdv-demo/docs/empty/demo/basic.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/empty/demo/config-provider.md correctly 1`] = ` + default + @@ -52,7 +53,8 @@ exports[`renders ./antdv-demo/docs/empty/demo/config-provider.md correctly 1`] =
0 item
+ + 0 item
@@ -76,7 +78,8 @@ exports[`renders ./antdv-demo/docs/empty/demo/config-provider.md correctly 1`] =
0 item
+ + 0 item
@@ -186,7 +189,8 @@ exports[`renders ./antdv-demo/docs/empty/demo/customize.md correctly 1`] = `
empty

Customize Description

+ Create Now +
`; diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 13a173f28..845ffd75d 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -74,7 +74,8 @@ exports[`renders ./antdv-demo/docs/form/demo/basic.md correctly 1`] = `
+ Cancel + @@ -119,7 +120,8 @@ exports[`renders ./antdv-demo/docs/form/demo/custom-validation.md correctly 1`]
+ Reset + @@ -143,7 +145,8 @@ exports[`renders ./antdv-demo/docs/form/demo/dynamic-form-item.md correctly 1`]
+ Reset + @@ -303,7 +306,8 @@ exports[`renders ./antdv-demo/docs/form/demo/validation.md correctly 1`] = `
+ Reset + diff --git a/components/input-number/__tests__/__snapshots__/demo.test.js.snap b/components/input-number/__tests__/__snapshots__/demo.test.js.snap index 8cd96351a..ed2c673a2 100644 --- a/components/input-number/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input-number/__tests__/__snapshots__/demo.test.js.snap @@ -23,7 +23,8 @@ exports[`renders ./antdv-demo/docs/input-number/demo/disabled.md correctly 1`] =
+ Toggle disabled +
`; diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index cc931299a..1ab6fe444 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -64,7 +64,8 @@ exports[`renders ./antdv-demo/docs/input/demo/search-input.md correctly 1`] = `< exports[`renders ./antdv-demo/docs/input/demo/search-input-loading.md correctly 1`] = `


-
+ +
`; exports[`renders ./antdv-demo/docs/input/demo/size.md correctly 1`] = `
`; @@ -73,7 +74,8 @@ exports[`renders ./antdv-demo/docs/input/demo/textarea.md correctly 1`] = `
+ Auto Resize: false +
`; exports[`renders ./antdv-demo/docs/input/demo/tooltip.md correctly 1`] = ``; diff --git a/components/list/__tests__/__snapshots__/demo.test.js.snap b/components/list/__tests__/__snapshots__/demo.test.js.snap index 46aa3d79b..8c18e8bcd 100644 --- a/components/list/__tests__/__snapshots__/demo.test.js.snap +++ b/components/list/__tests__/__snapshots__/demo.test.js.snap @@ -199,7 +199,8 @@ exports[`renders ./antdv-demo/docs/list/demo/loadmore.md correctly 1`] = `
+ loading more +
`; diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap index d7dd39d91..e56804d25 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap @@ -52,15 +52,20 @@ exports[`renders ./antdv-demo/docs/locale-provider/demo/all.md correctly 1`] = `
- Click to confirm
+ Show Modal + + Click to confirm +
0 item
+ + 0 item