Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed Oct 29, 2015
2 parents f7b6c61 + 8011303 commit 5131770
Showing 21 changed files with 64 additions and 40 deletions.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "amazeui-react",
"title": "Amaze UI React",
"version": "1.0.0-beta1",
"version": "1.0.0-beta2",
"description": "Amaze UI components build with React.",
"main": "lib/AMUIReact.js",
"scripts": {
@@ -73,11 +73,9 @@
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.2.1"
},
"peerDependencies": {
"react": "0.13.x"
},
"browserify-shim": {
"react": "global:React"
"react": "global:React",
"react-dom": "global:ReactDOM"
},
"jest": {
"rootDir": "./src",
5 changes: 3 additions & 2 deletions src/Accordion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var CollapseMixin = require('./mixins/CollapseMixin');
@@ -80,15 +81,15 @@ Accordion.Item = React.createClass({
},

getCollapsibleDimensionValue: function() {
return React.findDOMNode(this.refs.panel).scrollHeight;
return ReactDOM.findDOMNode(this.refs.panel).scrollHeight;
},

getCollapsibleDOMNode: function() {
if (!this.isMounted() || !this.refs || !this.refs.panel) {
return null;
}

return React.findDOMNode(this.refs.panel);
return ReactDOM.findDOMNode(this.refs.panel);
},

render: function() {
5 changes: 3 additions & 2 deletions src/CollapsibleNav.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
* */

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var CollapseMixin = require('./mixins/CollapseMixin');
@@ -32,7 +33,7 @@ var CollapsibleNav = React.createClass({

for (var key in nodes) {
if (nodes.hasOwnProperty(key)) {
var n = React.findDOMNode(nodes[key]);
var n = ReactDOM.findDOMNode(nodes[key]);
var h = n.offsetHeight;
var computedStyles = getComputedStyle(n, null);

@@ -47,7 +48,7 @@ var CollapsibleNav = React.createClass({
},

getCollapsibleDOMNode: function() {
return React.findDOMNode(this);
return ReactDOM.findDOMNode(this);
},

getChildActiveProp: function(child) {
3 changes: 2 additions & 1 deletion src/DateTimeInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var fecha = require('fecha');
var Events = require('./utils/Events');
var isNodeInTree = require('./utils/isNodeInTree');
@@ -28,7 +29,7 @@ var DateTimeInput = React.createClass({
},

handleOuterClick: function(event) {
var picker = React.findDOMNode(this.refs.DateTimePicker.getDOMNode());
var picker = ReactDOM.findDOMNode(this.refs.DateTimePicker.getDOMNode());

if (!isNodeInTree(event.target, picker)) {
this.handleClose();
11 changes: 10 additions & 1 deletion src/Dropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var constants = require('./constants');
@@ -44,6 +45,10 @@ var Dropdown = React.createClass({
this.unbindOuterHandlers();
},

componentWillUnmount: function () {
this.unbindOuterHandlers();
},

setDropdownState: function(state, callback) {
if (state) {
this.bindOuterHandlers();
@@ -68,7 +73,7 @@ var Dropdown = React.createClass({

// close dropdown when click outer dropdown
handleOuterClick: function(e) {
if (isNodeInTree(e.target, React.findDOMNode(this))) {
if (isNodeInTree(e.target, ReactDOM.findDOMNode(this))) {
return false;
}

@@ -94,6 +99,8 @@ var Dropdown = React.createClass({
render: function() {
var classSet = this.getClassSet();
var Component = this.props.navItem ? 'li' : 'div';
var btnClassPrefix = this.props.navItem ? '' : 'btn';
var btnComponentTag = this.props.navItem ? 'a' : null;
var caret = (<Icon
className={this.props.caretClassName}
icon={'caret-' + (this.props.dropup ? 'up' : 'down')} />);
@@ -115,6 +122,8 @@ var Dropdown = React.createClass({
style={this.props.btnInlineStyle}
className={classNames(this.prefixClass('toggle'),
this.props.toggleClassName)}
classPrefix={btnClassPrefix}
componentTag={btnComponentTag}
ref="dropdownToggle">
{this.props.title}
{' '}
3 changes: 2 additions & 1 deletion src/GoTop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var SmoothScrollMixin = require('./mixins/SmoothScrollMixin');
@@ -46,7 +47,7 @@ var GoTop = React.createClass({
checkPosition: function() {
var action = (dom.scrollTop(window) > 50 ? 'add' : 'remove') + 'Class';

CSSCore[action](React.findDOMNode(this), this.setClassNamespace('active'));
CSSCore[action](ReactDOM.findDOMNode(this), this.setClassNamespace('active'));
},

isAutoHide: function() {
3 changes: 2 additions & 1 deletion src/Input.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
*/

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var FormGroup = require('./FormGroup');
@@ -48,7 +49,7 @@ var Input = React.createClass({
},

getFieldDOMNode: function() {
return React.findDOMNode(this.refs.field);
return ReactDOM.findDOMNode(this.refs.field);
},

getValue: function() {
3 changes: 2 additions & 1 deletion src/Modal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var DimmerMixin = require('./mixins/DimmerMixin');
@@ -85,7 +86,7 @@ var Modal = React.createClass({
// Get input data for prompt modal
getPromptData: function() {
var data = [];
var inputs = React.findDOMNode(this).querySelectorAll('input');
var inputs = ReactDOM.findDOMNode(this).querySelectorAll('input');

if (inputs) {
var i = 0;
3 changes: 2 additions & 1 deletion src/NProgress.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
*/

var React = require('react');
var ReactDOM = require('react-dom');
var ClassNameMixin = require('./mixins/ClassNameMixin');

function clamp(n, min, max) {
@@ -82,7 +83,7 @@ var NProgress = React.createClass({
});

if (n === 1) {
var progress = React.findDOMNode(this.refs.progress);
var progress = ReactDOM.findDOMNode(this.refs.progress);

progress.style.opacity = 1;
progress.style.transition = 'none';
3 changes: 2 additions & 1 deletion src/Pagination.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');

@@ -40,7 +41,7 @@ var Pagination = React.createClass({

handleChange: function(e) {
if (this.props.onSelect) {
var select = React.findDOMNode(this.refs.select);
var select = ReactDOM.findDOMNode(this.refs.select);

this.props.onSelect.call(this, select && select.value, e);
}
5 changes: 3 additions & 2 deletions src/Panel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var CollapseMixin = require('./mixins/CollapseMixin');
@@ -44,15 +45,15 @@ var Panel = React.createClass({
},

getCollapsibleDimensionValue: function() {
return React.findDOMNode(this.refs.panel).scrollHeight;
return ReactDOM.findDOMNode(this.refs.panel).scrollHeight;
},

getCollapsibleDOMNode: function() {
if (!this.isMounted() || !this.refs || !this.refs.panel) {
return null;
}

return React.findDOMNode(this.refs.panel);
return ReactDOM.findDOMNode(this.refs.panel);
},

renderHeader: function() {
3 changes: 2 additions & 1 deletion src/PopoverTrigger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var cloneElement = React.cloneElement;
var OverlayMixin = require('./mixins/OverlayMixin');
var assign = require('object-assign');
@@ -166,7 +167,7 @@ var PopoverTrigger = React.createClass({
},

getPosition: function() {
var node = React.findDOMNode(this);
var node = ReactDOM.findDOMNode(this);
var container = this.getContainerDOMNode();

var offset = container.tagName === 'BODY' ?
3 changes: 2 additions & 1 deletion src/ScrollSpy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var cloneElement = React.cloneElement;
var assign = require('object-assign');
var classNames = require('classnames');
@@ -58,7 +59,7 @@ var ScrollSpy = React.createClass({
}

if (this.isMounted) {
var isInView = isInViewport(React.findDOMNode(this));
var isInView = isInViewport(ReactDOM.findDOMNode(this));

if (isInView && !this.state.inViewport) {
if (this._timer) {
5 changes: 3 additions & 2 deletions src/ScrollSpyNav.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var cloneElement = React.cloneElement;
var assign = require('object-assign');
var classNames = require('classnames');
@@ -47,7 +48,7 @@ var ScrollSpyNav = React.createClass({
},

_init: function() {
this._linkNodes = React.findDOMNode(this).querySelectorAll('a[href^="#"]');
this._linkNodes = ReactDOM.findDOMNode(this).querySelectorAll('a[href^="#"]');
this._anchorNodes = [];

Array.prototype.forEach.call(this._linkNodes, function(link) {
@@ -88,7 +89,7 @@ var ScrollSpyNav = React.createClass({
CSSCore.removeClass(link, this.props.activeClass);
}.bind(this));

var targetLink = React.findDOMNode(this).
var targetLink = ReactDOM.findDOMNode(this).
querySelector('a[href="#' + targetNode.id + '"]');

targetLink && CSSCore.addClass(targetLink, this.props.activeClass);
7 changes: 4 additions & 3 deletions src/Selected.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var Dropdown = require('./Dropdown');
@@ -55,7 +56,7 @@ var Selected = React.createClass({

setDropdownWidth: function() {
if (this.isMounted) {
var toggleButton = React.findDOMNode(this.refs.dropdown.
var toggleButton = ReactDOM.findDOMNode(this.refs.dropdown.
refs.dropdownToggle);

toggleButton && this.setState({dropdownWidth: toggleButton.offsetWidth});
@@ -105,7 +106,7 @@ var Selected = React.createClass({
e.preventDefault();

this.setState({
filterText: React.findDOMNode(this.refs.filterInput).value
filterText: ReactDOM.findDOMNode(this.refs.filterInput).value
});
},

@@ -115,7 +116,7 @@ var Selected = React.createClass({
this.setState({
filterText: null
});
React.findDOMNode(this.refs.filterInput).value = null;
ReactDOM.findDOMNode(this.refs.filterInput).value = null;
}
},

5 changes: 3 additions & 2 deletions src/Slider.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var TransitionEvents = require('./utils/TransitionEvents');

React.initializeTouchEvents(true);
//React.initializeTouchEvents(true);

var Slider = React.createClass({
mixins: [ClassNameMixin],
@@ -342,7 +343,7 @@ Slider.Item = React.createClass({

componentDidUpdate: function(prevProps) {
if (!this.props.active && prevProps.active) {
TransitionEvents.on(React.findDOMNode(this), this.handleAnimateOutEnd);
TransitionEvents.on(ReactDOM.findDOMNode(this), this.handleAnimateOutEnd);
}

if (this.props.active !== prevProps.active) {
Loading

0 comments on commit 5131770

Please sign in to comment.