Skip to content

Commit 9b6a1f2

Browse files
authored
feat: placement (#228)
* refactor: rename topCenter/bottomCenter with top/bottom * docs: update readme
1 parent ee7be6d commit 9b6a1f2

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@
22

33
react dropdown component
44

5-
[![NPM version][npm-image]][npm-url]
6-
[![build status][travis-image]][travis-url]
7-
[![Test coverage][coveralls-image]][coveralls-url]
8-
[![Dependencies][david-image]][david-url]
9-
[![DevDependencies][david-dev-image]][david-dev-url]
10-
[![npm download][download-image]][download-url]
11-
[![bundle size][bundlephobia-image]][bundlephobia-url]
12-
[![dumi][dumi-image]][dumi-url]
5+
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependencies][david-image]][david-url] [![DevDependencies][david-dev-image]][david-dev-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url]
136

147
[npm-image]: http://img.shields.io/npm/v/rc-dropdown.svg?style=flat-square
158
[npm-url]: http://npmjs.org/package/rc-dropdown
@@ -95,7 +88,7 @@ var Dropdown = require('rc-dropdown');
9588
<td>placement</td>
9689
<td>String</td>
9790
<td>bottomLeft</td>
98-
<td>Position of menu item. There are: topLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight </td>
91+
<td>Position of menu item. There are: top, topCenter, topRight, bottomLeft, bottom, bottomRight </td>
9992
</tr>
10093
<tr>
10194
<td>onVisibleChange</td>
@@ -166,7 +159,6 @@ npm run coverage
166159

167160
open coverage/ dir
168161

169-
170162
## License
171163

172164
rc-dropdown is released under the MIT license.

src/placements.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const autoAdjustOverflow = {
22
adjustX: 1,
33
adjustY: 1,
4-
}
4+
};
55

6-
const targetOffset = [0, 0]
6+
const targetOffset = [0, 0];
77

88
const placements = {
99
topLeft: {
@@ -12,7 +12,7 @@ const placements = {
1212
offset: [0, -4],
1313
targetOffset,
1414
},
15-
topCenter: {
15+
top: {
1616
points: ['bc', 'tc'],
1717
overflow: autoAdjustOverflow,
1818
offset: [0, -4],
@@ -30,7 +30,7 @@ const placements = {
3030
offset: [0, 4],
3131
targetOffset,
3232
},
33-
bottomCenter: {
33+
bottom: {
3434
points: ['tc', 'bc'],
3535
overflow: autoAdjustOverflow,
3636
offset: [0, 4],
@@ -42,6 +42,6 @@ const placements = {
4242
offset: [0, 4],
4343
targetOffset,
4444
},
45-
}
45+
};
4646

47-
export default placements
47+
export default placements;

0 commit comments

Comments
 (0)