Skip to content

Commit

Permalink
'u'
Browse files Browse the repository at this point in the history
  • Loading branch information
banana committed Sep 22, 2016
1 parent f8d25d0 commit 1fbb4d1
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 30 deletions.
Empty file.
1 change: 1 addition & 0 deletions components/accordion/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

24 changes: 24 additions & 0 deletions demo/js/Page.js
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;
4 changes: 1 addition & 3 deletions demo/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ var Input=MonkeyUi.Input
const confirm = Modal.confirm;
const Panel=Collapse.Panel;
const DemoBox = props => <p className={`height-${props.value}`}>{props.children}</p>;


ReactDOM.render(
<div>
<Button type="primary">Primary</Button>
Expand Down Expand Up @@ -189,4 +187,4 @@ ReactDOM.render(


ReactDOM.render(<Input type="textarea" rows={4} />
, document.getElementById('input'));
, document.getElementById('input'));
3 changes: 2 additions & 1 deletion demo/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Cache-Control" content="no-siteapp"/>
</head>
<body>
<body>
<div id="hello"></div>
<div id="world"></div>
<div id="checkboxdemo"></div>
Expand All @@ -22,6 +22,7 @@
<div id="alert"></div>
<div id="collapse"></div>
<div id="input"></div>
<div id="root"></div>
<script src="js/vendors.js?<%= htmlWebpackPlugin.options.version%>"></script>
<script src="js/index.js?<%= htmlWebpackPlugin.options.version%>"></script>
</body>
Expand Down
58 changes: 33 additions & 25 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import babel from 'gulp-babel';
import less from 'gulp-less';
import concat from 'gulp-concat';
import cssmin from 'gulp-minify-css';
import gutil from "gulp-util";
import webpack from 'webpack';
import browserSync from 'browser-sync';
import webpackConfig from './webpack.config.js';
import WebpackDevServer from 'webpack-dev-server';

const dirs={
src : ['./components/**/*.js','./components/**/*.jsx'],
less :[ './components/style/index.less',
'./components/button/style/index.less',
'./components/layout/style/index.less',
'./components/modal/style/index.less',
'./components/tree/style/index.less',
'./components/message/style/index.less',
'./components/alert/style/index.less',
'./components/collapse/style/index.less',
'./components/input/style/index.less'
'./components/**/style/index.less',
// './components/layout/style/index.less',
// './components/modal/style/index.less',
// './components/tree/style/index.less',
// './components/message/style/index.less',
// './components/alert/style/index.less',
// './components/collapse/style/index.less',
// './components/input/style/index.less'
],
lib: 'lib',
dist :'lib/dist'
Expand All @@ -29,22 +30,6 @@ gulp.task('webpack',() =>{

});
});
// gulp.task('dev',() =>{
// var myConfig = Object.create(webpackConfig);
// myConfig.devtool = 'eval';
// myConfig.debug = true;
// new WebpackDevServer(webpack(myConfig), {
// publicPath: "./dist/",
// stats: {
// colors: true
// },
// inline : true,
// hot : true
// }).listen(8080, "localhost", function(err) {
// if(err) throw new gutil.PluginError("webpack-dev-server", err);
// gutil.log("[webpack-dev-server]", "http://localhost:8080/webpack-dev-server/index.html");
// });
// });

gulp.task('less',() =>{
return gulp.src(dirs.less)
Expand All @@ -60,8 +45,31 @@ gulp.task('babel',() => {
.pipe(gulp.dest(dirs.lib))
});



gulp.task('build',()=>{
gulp.start('babel', 'less');
});

// 监控修改自动编译
gulp.task('watch', () => {
gulp.watch('./components/**/style/*.less', ['build']);
gulp.watch('./components/**/*.js', ['build']);
gulp.watch('./components/**/*.jsx', ['build']);
gulp.watch('./demo/**/*.js', ['build']);
gulp.watch('./demo/js/**/*.js', ['build']);
gulp.watch('./demo/**/*.html', ['build']);
});

// 启动预览服务自动刷新浏览器
gulp.task('default', ['build', 'watch'], () => {
/* const bs = browserSync.create();
bs.init({
notify: false,
logPrefix: 'AMT',
server: 'demo/templates/'
});
gulp.watch('components', bs.reload);
gulp.watch('demo', bs.reload);*/
});
1 change: 1 addition & 0 deletions lib/_mixins/ClassNameMixin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";
1 change: 1 addition & 0 deletions lib/accordion/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";
2 changes: 1 addition & 1 deletion lib/dist/monkeyui.css

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions lib/icon/index2.js
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;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
},
"dependencies": {
"array-tree-filter": "~1.0.0",
"browser-sync": "^2.16.0",
"classnames": "~2.2.0",
"css-animation": "^1.2.5",
"gregorian-calendar": "~4.1.0",
"gregorian-calendar-format": "~4.1.0",
"gulp-load-plugins": "^1.3.0",
"gulp-uglify": "^2.0.0",
"object-assign": "~4.1.0",
"object.omit": "^2.0.0",
"rc-animate": "~2.3.0",
Expand Down

0 comments on commit 1fbb4d1

Please sign in to comment.