forked from bebeanan/monkey-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
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
banana
committed
Sep 22, 2016
1 parent
f8d25d0
commit 1fbb4d1
Showing
11 changed files
with
138 additions
and
30 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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,24 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
// import MonkeyUi from '../../components/monkeyui.js'; | ||
import MonkeyUi from '../../monkeyui.js'; | ||
var Collapse=MonkeyUi.Collapse; | ||
const Page = React.createClass({ | ||
render() { | ||
return ( | ||
<Collapse defaultActiveKey={['1']} onChange={callback}> | ||
<Panel header="This is panel header 1" key="1"> | ||
<p>{text}</p> | ||
</Panel> | ||
<Panel header="This is panel header 2" key="2"> | ||
<p>{text}</p> | ||
</Panel> | ||
<Panel header="This is panel header 3" key="3"> | ||
<p>{text}</p> | ||
</Panel> | ||
</Collapse> | ||
); | ||
}, | ||
}); | ||
|
||
export default Page; |
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
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
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
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 @@ | ||
"use strict"; |
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 @@ | ||
"use strict"; |
Large diffs are not rendered by default.
Oops, something went wrong.
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,71 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _classnames = require('classnames'); | ||
|
||
var _classnames2 = _interopRequireDefault(_classnames); | ||
|
||
var _ClassNameMixin = require('./_mixins/ClassNameMixin'); | ||
|
||
var _ClassNameMixin2 = _interopRequireDefault(_ClassNameMixin); | ||
|
||
require('./style/index.less'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
|
||
var Icon = _react2.default.createClass({ | ||
displayName: 'Icon', | ||
|
||
//mixins: [ClassNameMixin], | ||
|
||
propTypes: { | ||
classPrefix: _react.PropTypes.string.isRequired, | ||
component: _react.PropTypes.node.isRequired, | ||
name: _react.PropTypes.string.isRequired, | ||
href: _react.PropTypes.string | ||
}, | ||
|
||
getDefaultProps: function getDefaultProps() { | ||
return { | ||
classPrefix: 'icon', | ||
component: 'span' | ||
}; | ||
}, | ||
render: function render() { | ||
var classSet = this.getClassSet(); | ||
var _props = this.props; | ||
var Component = _props.component; | ||
var className = _props.className; | ||
var name = _props.name; | ||
|
||
var props = _objectWithoutProperties(_props, ['component', 'className', 'name']); | ||
|
||
delete props.classPrefix; | ||
|
||
Component = props.href ? 'a' : Component; | ||
|
||
// icon-[iconName] | ||
classSet[this.prefixClass(name)] = true; | ||
|
||
return _react2.default.createElement( | ||
Component, | ||
_extends({}, props, { | ||
className: (0, _classnames2.default)(classSet, className) | ||
}), | ||
this.props.children | ||
); | ||
} | ||
}); | ||
|
||
exports.default = Icon; |
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