-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,485 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*.{js,css}] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*.iml | ||
*.log | ||
.idea/ | ||
.ipr | ||
.iws | ||
*~ | ||
~* | ||
*.diff | ||
*.patch | ||
*.bak | ||
.DS_Store | ||
Thumbs.db | ||
.project | ||
.*proj | ||
.svn/ | ||
*.swp | ||
*.swo | ||
*.pyc | ||
*.pyo | ||
.build | ||
node_modules | ||
_site | ||
sea-modules | ||
spm_modules | ||
.cache | ||
dist | ||
assets/**/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], | ||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideObjectBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowSpaceAfterObjectKeys": true, | ||
"requireSpaceBeforeBinaryOperators": ["-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ], | ||
"requireSpacesInConditionalExpression": { | ||
"afterTest": true, | ||
"beforeConsequent": true, | ||
"afterConsequent": true, | ||
"beforeAlternate": true | ||
}, | ||
"requireSpaceAfterBinaryOperators": ["/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], | ||
"disallowKeywords": [ "with" ], | ||
"disallowSpaceAfterPrefixUnaryOperators": [ "!" , "++", "--", "+", "-", "~"], | ||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ","], | ||
"disallowMultipleLineBreaks": true, | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"safeContextKeyword": "self", | ||
"excludeFiles": ["lib/**/parser.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"freeze": true, | ||
"indent": 4, | ||
"latedef": "nofunc", | ||
"quotmark": "false", | ||
"nonew": true, | ||
"newcap": false, | ||
"immed": true, | ||
"noarg": true, | ||
"eqnull": true, | ||
"trailing": true, | ||
"undef": true, | ||
"unused": true, | ||
"browser": true, | ||
"node": true, | ||
"esnext": true, | ||
"globals": { | ||
"describe": false, | ||
"expect": false, | ||
"beforeEach": false, | ||
"afterEach": false, | ||
"modulex": false, | ||
"it": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
bower_components/ | ||
*.cfg | ||
node_modules/ | ||
nohup.out | ||
*.iml | ||
.idea/ | ||
.ipr | ||
.iws | ||
*~ | ||
~* | ||
*.diff | ||
*.log | ||
*.patch | ||
*.bak | ||
.DS_Store | ||
Thumbs.db | ||
.project | ||
.*proj | ||
.svn/ | ||
*.swp | ||
out/ | ||
.build | ||
node_modules | ||
_site | ||
sea-modules | ||
spm_modules | ||
.cache | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
bower_components/ | ||
node_modules/ | ||
nohup.out | ||
*.iml | ||
.idea/ | ||
.ipr | ||
.iws | ||
*~ | ||
~* | ||
*.diff | ||
*.log | ||
*.patch | ||
*.bak | ||
.DS_Store | ||
Thumbs.db | ||
.project | ||
.*proj | ||
.svn/ | ||
*.swp | ||
out/ | ||
.build | ||
_site | ||
sea-modules | ||
spm_modules | ||
.cache | ||
dist | ||
assets/**/*.less | ||
tests/ | ||
examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: node_js | ||
notifications: | ||
email: | ||
- yiminghe@gmail.com | ||
node_js: | ||
- 0.11 | ||
before_script: | ||
- npm start & | ||
- npm install mocha-phantomjs -g | ||
- phantomjs --version | ||
script: | ||
- npm test | ||
- npm run-script browser-test | ||
- npm run-script browser-test-cover |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,81 @@ | ||
menu | ||
==== | ||
# rc-menu | ||
|
||
menu ui component for react | ||
react menu component | ||
|
||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![gemnasium deps][gemnasium-image]][gemnasium-url] | ||
[![node version][node-image]][node-url] | ||
[![npm download][download-image]][download-url] | ||
|
||
[npm-image]: http://img.shields.io/npm/v/rc-menu.svg?style=flat-square | ||
[npm-url]: http://npmjs.org/package/rc-menu | ||
[travis-image]: https://img.shields.io/travis/react-component/menu.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/react-component/menu | ||
[coveralls-image]: https://img.shields.io/coveralls/react-component/menu.svg?style=flat-square | ||
[coveralls-url]: https://coveralls.io/r/react-component/menu?branch=master | ||
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/menu.svg?style=flat-square | ||
[gemnasium-url]: https://gemnasium.com/react-component/menu | ||
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square | ||
[node-url]: http://nodejs.org/download/ | ||
[download-image]: https://img.shields.io/npm/dm/rc-menu.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/rc-menu | ||
|
||
|
||
## examples | ||
- [full](./examples/index.md) | ||
- [pure css menu](./examples/pure-css.html) | ||
|
||
![alt](https://tfsimg.alipay.com/images/T19vReXg0oXXXXXXXX.png) | ||
|
||
|
||
## Usage | ||
- It uses the [bootstrap](http://getbootstrap.com/)'s css and [Font Awesome](http://fortawesome.github.io/Font-Awesome/) | ||
|
||
```js | ||
var topMenu = ( | ||
<Menu className="navbar-nav" activeKey="1"> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<MenuItem eventKey="1" href="###" title="xx" onSelect={handleSelect} >xxx</MenuItem> | ||
<MenuItem eventKey="2">Another action</MenuItem> | ||
|
||
<Dropdown title={titleDown}> | ||
|
||
<MenuItem eventKey="1">Action</MenuItem> | ||
<MenuItem divider /> | ||
<MenuItem eventKey="2">Another action</MenuItem> | ||
|
||
<Dropdown className="dropdown-submenu" title={titleRight}> | ||
<MenuItem eventKey="2">Another action</MenuItem> | ||
<MenuItem eventKey="3">Something else here</MenuItem> | ||
</Dropdown> | ||
|
||
</Dropdown> | ||
</Menu> | ||
); | ||
React.render(topMenu, document.querySelector('#topMenu')); | ||
``` | ||
|
||
|
||
## install | ||
|
||
[![rc-menu](https://nodei.co/npm/rc-menu.png)](https://npmjs.org/package/rc-menu) | ||
|
||
## Development | ||
|
||
``` | ||
npm install | ||
npm start | ||
``` | ||
|
||
## Test Case | ||
|
||
http://localhost:8000/tests/runner.html?coverage | ||
|
||
## Coverage | ||
|
||
http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage | ||
|
||
## License | ||
|
||
rc-menu is released under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* dropdown-submenu | ||
*/ | ||
.dropdown-submenu { | ||
position: relative; | ||
|
||
>.dropdown-menu { | ||
top: 0; | ||
left: 100%; | ||
} | ||
|
||
&.pull-left{ | ||
float: none !important; | ||
>.dropdown-menu { | ||
left: -100%; | ||
} | ||
} | ||
} | ||
|
||
//override | ||
.dropdown-submenu .fa{ | ||
line-height: 20px; | ||
} | ||
.dropdown-menu > li > a{ | ||
white-space: normal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
@import "./dpl/dropdown-submenu"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
This comment has been minimized.
Sorry, something went wrong. |
||
* pure css menu | ||
*/ | ||
|
||
@import "./dpl/dropdown-submenu"; | ||
|
||
// hover显示子菜单 | ||
.dropdown, .dropdown-submenu{ | ||
&:hover{ | ||
>.dropdown-menu, | ||
>.dropdown-submenu { | ||
display: block; | ||
} | ||
} | ||
} | ||
|
||
// hover改变背景色 | ||
.navbar-default, .navbar-inverse{ | ||
.navbar-nav > li > a:hover, .navbar-nav > li > a:focus{ | ||
background-color: #eee; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!doctype html> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<html> | ||
<head> | ||
<title>rc-menu@1.0.0 demo</title> | ||
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css" rel="stylesheet" /> | ||
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet" /> | ||
<link href="/assets/index.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<h1 style="text-align: center">rc-menu@1.0.0 demo</h1> | ||
<div class="container"> | ||
<!-- top --> | ||
<nav class="navbar navbar-default" role="navigation"> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="#">project</a> | ||
</div> | ||
<div id="topMenu" class="collapse navbar-collapse"></div> | ||
</nav> | ||
|
||
<!-- left --> | ||
<div class="col-sm-3 col-md-2"></div> | ||
|
||
<!-- content --> | ||
<div class="col-sm-6 col-md-8"> | ||
<b>this is full version and contains js.</b> <br /> | ||
</div> | ||
|
||
<!-- right --> | ||
<div class="col-sm-3 col-md-2"></div> | ||
|
||
</div> | ||
|
||
<script src="/node_modules/modulex/build/modulex-debug.js?nowrap"></script> | ||
<script> | ||
require('./index'); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.
样式内置到组件,这个组件改成 Nav?
组件尽量不要留原生 dom 操作接口,比如搞成属性: bsStyle={bar:1}