From a2c859a57296916798042f1197f30fb2d3baf565 Mon Sep 17 00:00:00 2001 From: M03M Date: Fri, 27 Mar 2015 15:20:17 -0500 Subject: [PATCH] Updated mui to use peer dependency changes. --- docs/package.json | 2 +- docs/src/app/components/app-left-nav.jsx | 6 +++--- docs/src/app/components/master.jsx | 6 +++--- docs/src/app/components/pages/components/tabs.jsx | 6 +++--- docs/src/app/components/pages/home.jsx | 2 +- docs/src/app/components/pages/page-with-nav.jsx | 4 ++-- package.json | 2 +- src/js/input.jsx | 6 +++--- src/js/mixins/classable.js | 8 ++++---- src/js/mixins/dom-idable.js | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/package.json b/docs/package.json index b9adc12f018124..c594811d18e85e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "material-ui-docs", - "version": "0.6.1", + "version": "0.7.2", "description": "Documentation site for material-ui", "repository": { "type": "git", diff --git a/docs/src/app/components/app-left-nav.jsx b/docs/src/app/components/app-left-nav.jsx index 9c186f7e8c4564..03bb7aa828b5fe 100644 --- a/docs/src/app/components/app-left-nav.jsx +++ b/docs/src/app/components/app-left-nav.jsx @@ -46,16 +46,16 @@ var AppLeftNav = React.createClass({ for (var i = menuItems.length - 1; i >= 0; i--) { currentItem = menuItems[i]; - if (currentItem.route && this.isActive(currentItem.route)) return i; + if (currentItem.route && this.context.router.isActive(currentItem.route)) return i; }; }, _onLeftNavChange: function(e, key, payload) { - this.transitionTo(payload.route); + this.context.router.transitionTo(payload.route); }, _onHeaderClick: function() { - this.transitionTo('root'); + this.context.router.transitionTo('root'); this.refs.leftNav.close(); } diff --git a/docs/src/app/components/master.jsx b/docs/src/app/components/master.jsx index e4f6631b2c3097..7c943a85764094 100644 --- a/docs/src/app/components/master.jsx +++ b/docs/src/app/components/master.jsx @@ -15,9 +15,9 @@ var Master = React.createClass({ render: function() { var title = - this.isActive('get-started') ? 'Get Started' : - this.isActive('css-framework') ? 'Css Framework' : - this.isActive('components') ? 'Components' : ''; + this.context.router.isActive('get-started') ? 'Get Started' : + this.context.router.isActive('css-framework') ? 'Css Framework' : + this.context.router.isActive('components') ? 'Components' : ''; var githubButton = ( \n' + '\n' + '_onActive: function(tab){ \n' + - ' this.transitionTo(tab.props.route); \n' + + ' this.context.router.transitionTo(tab.props.route); \n' + '}'; - var desc = 'Refs cannont be set on individual Tab components as cloneWithProps is being ' + + var desc = 'Refs cannot be set on individual Tab components as cloneWithProps is being ' + 'used to extend the individual tab components under the hood. However, ' + 'refs can be passed to the Tabs container and to any element or component within the template. ' + 'If you need to access a tab directly - you can do so with the first argument of onActive or ' + @@ -155,7 +155,7 @@ var TabsPage = React.createClass({ }, _onActive: function(tab){ - this.transitionTo(tab.props.route); + this.context.router.transitionTo(tab.props.route); } }); diff --git a/docs/src/app/components/pages/home.jsx b/docs/src/app/components/pages/home.jsx index 243063ec48621b..cf6f5c4bc31917 100644 --- a/docs/src/app/components/pages/home.jsx +++ b/docs/src/app/components/pages/home.jsx @@ -64,7 +64,7 @@ var HomePage = React.createClass({ }, _onDemoClick: function() { - this.transitionTo('components'); + this.context.router.transitionTo('components'); } }); diff --git a/docs/src/app/components/pages/page-with-nav.jsx b/docs/src/app/components/pages/page-with-nav.jsx index 72af80db073bfd..789f2212da869a 100644 --- a/docs/src/app/components/pages/page-with-nav.jsx +++ b/docs/src/app/components/pages/page-with-nav.jsx @@ -36,12 +36,12 @@ var PageWithNav = React.createClass({ for (var i = menuItems.length - 1; i >= 0; i--) { currentItem = menuItems[i]; - if (currentItem.route && this.isActive(currentItem.route)) return i; + if (currentItem.route && this.context.router.isActive(currentItem.route)) return i; }; }, _onMenuItemClick: function(e, index, item) { - this.transitionTo(item.route); + this.context.router.transitionTo(item.route); } }); diff --git a/package.json b/package.json index 7ae1f7b8b470e0..6491e865d0f727 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "homepage": "http://material-ui.com/", "dependencies": { - "react-classset": "0.0.2", + "classnames": "^1.2.0", "react-draggable2": "^0.5.1" }, "peerDependencies": { diff --git a/src/js/input.jsx b/src/js/input.jsx index cbe90e9302b442..29eaf7293a1254 100644 --- a/src/js/input.jsx +++ b/src/js/input.jsx @@ -1,6 +1,6 @@ var React = require('react'); var Classable = require('./mixins/classable'); -var classSet = require('react-classset'); +var ClassNames = require('classnames'); var Input = React.createClass({ @@ -47,10 +47,10 @@ var Input = React.createClass({ }); var placeholder = this.props.inlinePlaceholder ? this.props.placeholder : ""; var inputIsNotEmpty = !!this.state.value; - var inputClassName = classSet({ + var inputClassName = ClassNames({ 'mui-is-not-empty': inputIsNotEmpty }); - var textareaClassName = classSet({ + var textareaClassName = ClassNames({ 'mui-input-textarea': true, 'mui-is-not-empty': inputIsNotEmpty }); diff --git a/src/js/mixins/classable.js b/src/js/mixins/classable.js index c9e90a1a3b016c..c4c986cff75edb 100644 --- a/src/js/mixins/classable.js +++ b/src/js/mixins/classable.js @@ -1,5 +1,5 @@ var React = require('react'); -var classSet = require('react-classset'); +var classNames = require('classnames'); module.exports = { @@ -15,16 +15,16 @@ module.exports = { //Add in initial classes if (typeof initialClasses === 'object') { - classString += ' ' + classSet(initialClasses); + classString += ' ' + classNames(initialClasses); } else { classString += ' ' + initialClasses; } //Add in additional classes - if (additionalClassObj) classString += ' ' + classSet(additionalClassObj); + if (additionalClassObj) classString += ' ' + classNames(additionalClassObj); //Convert the class string into an object and run it through the class set - return classSet(this.getClassSet(classString)); + return classNames(this.getClassSet(classString)); }, getClassSet: function(classString) { diff --git a/src/js/mixins/dom-idable.js b/src/js/mixins/dom-idable.js index 1bea8595d05bb9..1ecb93fd129153 100644 --- a/src/js/mixins/dom-idable.js +++ b/src/js/mixins/dom-idable.js @@ -1,7 +1,7 @@ module.exports = { getDomId: function() { - return 'dom_id' + this._rootNodeID.replace(/\./g, '_'); + return 'dom_id' + this._reactInternalInstance._rootNodeID.replace(/\./g, '_'); } } \ No newline at end of file