reagent/bower_components/react/react-with-addons.min.js

21 lines
97 KiB
JavaScript
Raw Normal View History

2013-12-16 22:19:36 +00:00
/**
2013-12-19 18:40:58 +00:00
* React (with addons) v0.5.2
2013-12-16 22:19:36 +00:00
*
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2013-12-19 18:40:58 +00:00
!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.React=t():"undefined"!=typeof global?global.React=t():"undefined"!=typeof self&&(self.React=t())}(function(){return function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e){function n(t){var e=r(t);if(!e)throw new Error(o('Tried to get element with id of "%s" but it is not present on the page.',t));return e}var r=t("./ge"),o=t("./ex");e.exports=n},{"./ex":93,"./ge":97}],2:[function(t,e){function n(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}var r=t("./invariant"),o={addClass:function(t,e){return r(!/\s/.test(e)),e&&(t.classList?t.classList.add(e):n(t,e)||(t.className=t.className+" "+e)),t},removeClass:function(t,e){return r(!/\s/.test(e)),e&&(t.classList?t.classList.remove(e):n(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),t},conditionClass:function(t,e,n){return(n?o.addClass:o.removeClass)(t,e)}};e.exports=o},{"./invariant":105}],3:[function(t,e){"use strict";var n={fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,zIndex:!0,zoom:!0},r={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},o={isUnitlessNumber:n,shorthandPropertyExpansions:r};e.exports=o},{}],4:[function(t,e){"use strict";var n=t("./CSSProperty"),r=t("./dangerousStyleValue"),o=t("./escapeTextForBrowser"),i=t("./hyphenate"),a=t("./memoizeStringOnly"),s=a(function(t){return o(i(t))}),u={createMarkupForStyles:function(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];null!=o&&(e+=s(n)+":",e+=r(n,o)+";")}return e||null},setValueForStyles:function(t,e){var o=t.style;for(var i in e)if(e.hasOwnProperty(i)){var a=r(i,e[i]);if(a)o[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)o[u]="";else o[i]=""}}}};e.exports=u},{"./CSSProperty":3,"./dangerousStyleValue":90,"./escapeTextForBrowser":92,"./hyphenate":104,"./memoizeStringOnly":113}],5:[function(t,e){"use strict";var n={},r={putListener:function(t,e,r){var o=n[e]||(n[e]={});o[t]=r},getListener:function(t,e){var r=n[e];return r&&r[t]},deleteListener:function(t,e){var r=n[e];r&&delete r[t]},deleteAllListeners:function(t){for(var e in n)delete n[e][t]},__purge:function(){n={}}};e.exports=r},{}],6:[function(t,e){"use strict";function n(t){return"SELECT"===t.nodeName||"INPUT"===t.nodeName&&"file"===t.type}function r(t){var e=E.getPooled(T.change,N,t);C.accumulateTwoPhaseDispatches(e),g.enqueueEvents(e),g.processEventQueue()}function o(t,e){x=t,N=e,x.attachEvent("onchange",r)}function i(){x&&(x.detachEvent("onchange",r),x=null,N=null)}function a(t,e,n){return t===b.topChange?n:void 0}function s(t,e,n){t===b.topFocus?(i(),o(e,n)):t===b.topBlur&&i()}function u(t,e){x=t,N=e,S=t.value,_=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value"),Object.defineProperty(x,"value",O),x.attachEvent("onpropertychange",l)}function c(){x&&(delete x.value,x.detachEvent("onpropertychange",l),x=null,N=null,S=null,_=null)}function l(t){if("value"===t.propertyName){var e=t.srcElement.value;e!==S&&(S=e,r(t))}}function p(t,e,n){return t===b.topInput?n:void 0}function d(t,e,n){t===b.topFocus?(c(
2013-12-16 22:19:36 +00:00
var r=this._renderedComponent.mountComponent(t,e,n+1);return this.componentDidMount&&e.getReactMountReady().enqueue(this,this.componentDidMount),r}),unmountComponent:function(){this._compositeLifeCycleState=R.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._defaultProps=null,u.Mixin.unmountComponent.call(this),this._renderedComponent.unmountComponent(),this._renderedComponent=null,this.refs&&(this.refs=null)},setState:function(t,e){this.replaceState(v(this._pendingState||this.state,t),e)},replaceState:function(t,e){r(this),this._pendingState=t,h.enqueueUpdate(this,e)},_processProps:function(t){var e,n=this._defaultProps;for(e in n)e in t||(t[e]=n[e]);var r=this.constructor.propTypes;if(r){var o=this.constructor.displayName;for(e in r){var i=r[e];i&&i(t,e,o)}}},performUpdateIfNecessary:function(){var t=this._compositeLifeCycleState;t!==R.MOUNTING&&t!==R.RECEIVING_PROPS&&u.Mixin.performUpdateIfNecessary.call(this)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps||null!=this._pendingState||this._pendingForceUpdate){var e=this.props;null!=this._pendingProps&&(e=this._pendingProps,this._processProps(e),this._pendingProps=null,this._compositeLifeCycleState=R.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(e,t)),this._compositeLifeCycleState=R.RECEIVING_STATE;var n=this._pendingState||this.state;this._pendingState=null,this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(e,n)?(this._pendingForceUpdate=!1,this._performComponentUpdate(e,n,t)):(this.props=e,this.state=n),this._compositeLifeCycleState=null}},_performComponentUpdate:function(t,e,n){var r=this.props,o=this.state;this.componentWillUpdate&&this.componentWillUpdate(t,e,n),this.props=t,this.state=e,this.updateComponent(n,r,o),this.componentDidUpdate&&n.getReactMountReady().enqueue(this,this.componentDidUpdate.bind(this,r,o))},updateComponent:p.measure("ReactCompositeComponent","updateComponent",function(t,e){u.Mixin.updateComponent.call(this,t,e);var n=this._renderedComponent,r=this._renderValidatedComponent();if(n.constructor===r.constructor)n.receiveProps(r.props,t);else{var o=this._rootNodeID,i=n._rootNodeID;n.unmountComponent(),this._renderedComponent=r;var a=r.mountComponent(o,t,this._mountDepth+1);u.DOMIDOperations.dangerouslyReplaceNodeWithMarkupByID(i,a)}}),forceUpdate:function(t){var e=this._compositeLifeCycleState;f(this.isMounted()||e===R.MOUNTING),f(e!==R.RECEIVING_STATE&&e!==R.UNMOUNTING),this._pendingForceUpdate=!0,h.enqueueUpdate(this,t)},_renderValidatedComponent:function(){var t;c.current=this;try{t=this.render()}catch(e){throw e}finally{c.current=null}return f(u.isValidComponent(t)),t},_bindAutoBindMethods:function(){for(var t in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(t)){var e=this.__reactAutoBindMap[t];this[t]=this._bindAutoBindMethod(e)}},_bindAutoBindMethod:function(t){var e=this,n=function(){return t.apply(e,arguments)};return n}},b=function(){};g(b,u.Mixin),g(b,l.Mixin),g(b,d.Mixin),g(b,D);var T={LifeCycle:R,Base:b,createClass:function(t){var e=function(){};e.prototype=new b,e.prototype.constructor=e,o(e,t),f(e.prototype.render);for(var n in E)e.prototype[n]||(e.prototype[n]=null);var r=function(){var t=new e;return t.construct.apply(t,arguments),t};return r.componentConstructor=e,r.originalSpec=t,r},isValidClass:function(t){return t instanceof Function&&"componentConstructor"in t&&t.componentConstructor instanceof Function}};e.exports=T},{"./ReactComponent":28,"./ReactCurrentOwner":32,"./ReactOwner":56,"./ReactPerf":57,"./ReactPropTransferer":58,"./ReactUpdates":68,"./invariant":105,"./keyMirror":111,"./merge":114,"./mixInto":117,"./objMap":120}],32:[function(t,e){"use strict";var n={current:null};e.exports=n},{}],33:[function(t,e){"use strict";function n(t,e){var n=function(){};n.prototype=new r(t,e),n.prototype.constructor=n,n.displayName=t;var o=function(){var t=new n;return t.construct.apply(t,arguments),t};return o.componentConstructor=n,o}var r=t("./ReactDOMComponent"),o=t("./mer
2013-12-19 18:40:58 +00:00
}this._renderedChildren=null},moveChild:function(t,e,n){t._mountIndex<n&&o(this._rootNodeID,t._mountIndex,e)},createChild:function(t){r(this._rootNodeID,t._mountImage,t._mountIndex)},removeChild:function(t){i(this._rootNodeID,t._mountIndex)},setTextContent:function(t){a(this._rootNodeID,t)},_mountChildByNameAtIndex:function(t,e,n,r){var o=this._rootNodeID+"."+e,i=t.mountComponent(o,r,this._mountDepth+1);t._mountImage=i,t._mountIndex=n,this.createChild(t),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[e]=t},_unmountChildByName:function(t,e){c.isValidComponent(t)&&(this.removeChild(t),t._mountImage=null,t._mountIndex=null,t.unmountComponent(),delete this._renderedChildren[e])}}};e.exports=m},{"./ReactComponent":28,"./ReactMultiChildUpdateTypes":55,"./flattenChildren":95}],55:[function(t,e){var n=t("./keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=r},{"./keyMirror":111}],56:[function(t,e){"use strict";var n=t("./invariant"),r={isValidOwner:function(t){return!(!t||"function"!=typeof t.attachRef||"function"!=typeof t.detachRef)},addComponentAsRefTo:function(t,e,o){n(r.isValidOwner(o)),o.attachRef(e,t)},removeComponentAsRefFrom:function(t,e,o){n(r.isValidOwner(o)),o.refs[e]===t&&o.detachRef(e)},Mixin:{attachRef:function(t,e){n(e.isOwnedBy(this));var r=this.refs||(this.refs={});r[t]=e},detachRef:function(t){delete this.refs[t]}}};e.exports=r},{"./invariant":105}],57:[function(t,e){"use strict";function n(t,e,n){return n}var r={enableMeasure:!1,storedMeasure:n,measure:function(t,e,n){return n},injection:{injectMeasure:function(t){r.storedMeasure=t}}};e.exports=r},{}],58:[function(t,e){"use strict";function n(t){return function(e,n,r){e[n]=e.hasOwnProperty(n)?t(e[n],r):r}}var r=t("./emptyFunction"),o=t("./invariant"),i=t("./joinClasses"),a=t("./merge"),s={children:r,className:n(i),ref:r,style:n(a)},u={TransferStrategies:s,Mixin:{transferPropsTo:function(t){o(t.props.__owner__===this);var e={};for(var n in t.props)t.props.hasOwnProperty(n)&&(e[n]=t.props[n]);for(var r in this.props)if(this.props.hasOwnProperty(r)){var i=s[r];i?i(e,r,this.props[r]):e.hasOwnProperty(r)||(e[r]=this.props[r])}return t.props=e,t}}};e.exports=u},{"./emptyFunction":91,"./invariant":105,"./joinClasses":110,"./merge":114}],59:[function(t,e){"use strict";function n(t){function e(e){var n=typeof e;"object"===n&&Array.isArray(e)&&(n="array"),s(n===t)}return i(e)}function r(t){function e(t){s(n[t])}var n=a(t);return i(e)}function o(t){function e(e){s(e instanceof t)}return i(e)}function i(t){function e(n){function r(e,r,o){var i=e[r];null!=i?t(i,r,o||c):s(!n)}return n||(r.isRequired=e(!0)),r}return e(!1)}var a=t("./createObjectFrom"),s=t("./invariant"),u={array:n("array"),bool:n("boolean"),func:n("function"),number:n("number"),object:n("object"),string:n("string"),oneOf:r,instanceOf:o},c="<<anonymous>>";e.exports=u},{"./createObjectFrom":88,"./invariant":105}],60:[function(t,e){"use strict";function n(){this.reinitializeTransaction(),this.reactMountReady=s.getPooled(null)}var r=t("./ExecutionEnvironment"),o=t("./PooledClass"),i=t("./ReactEventEmitter"),a=t("./ReactInputSelection"),s=t("./ReactMountReady"),u=t("./Transaction"),c=t("./mixInto"),l={initialize:a.getSelectionInformation,close:a.restoreSelection},p={initialize:function(){var t=i.isEnabled();return i.setEnabled(!1),t},close:function(t){i.setEnabled(t)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[l,p,d],f={getTransactionWrappers:function(){return r.canUseDOM?h:[]},getReactMountReady:function(){return this.reactMountReady},destructor:function(){s.release(this.reactMountReady),this.reactMountReady=null}};c(n,u.Mixin),c(n,f),o.addPoolingTo(n),e.exports=n},{"./ExecutionEnvironment":21,"./PooledClass":25,"./ReactEventEmitter":45,"./ReactInputSelection":48,"./ReactMountReady":53,"./Transaction":81,"./mixInto":117}],61:[function(t,e){"use strict";function n(t,e){var n=i.createReactRootID(),a=o.getPooled();a.reinitializeTransaction();try{a.perform(function(){var
2013-12-16 22:19:36 +00:00
function n(t,e){if(o(t),null!=e){o(e);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}var r=t("./mergeHelpers"),o=r.checkMergeObjectArg;e.exports=n},{"./mergeHelpers":115}],117:[function(t,e){"use strict";var n=function(t,e){var n;for(n in e)e.hasOwnProperty(n)&&(t.prototype[n]=e[n])};e.exports=n},{}],118:[function(t,e){"use strict";function n(t,e){i("html"===t.tagName.toLowerCase()),e=e.trim(),i(0===e.toLowerCase().indexOf("<html"));var n=e.indexOf(">")+1,a=e.lastIndexOf("<"),s=e.substring(0,n),u=e.substring(n,a),c=s.indexOf(" ")>-1,l=null;if(c){l=r(s.replace("html ","span ")+"</span>")[0];var p=o(l,function(e){return t.getAttributeNS(e.namespaceURI,e.name)!==e.value});p.forEach(function(e){t.setAttributeNS(e.namespaceURI,e.name,e.value)})}var d=o(t,function(t){return!(l&&l.hasAttributeNS(t.namespaceURI,t.name))});d.forEach(function(e){t.removeAttributeNS(e.namespaceURI,e.name)}),t.innerHTML=u}var r=t("./createNodesFromMarkup"),o=t("./filterAttributes"),i=t("./invariant");e.exports=n},{"./createNodesFromMarkup":87,"./filterAttributes":94,"./invariant":105}],119:[function(t,e){function n(t,e){return t&&e?t===e?!0:r(t)?!1:r(e)?n(t,e.parentNode):t.contains?t.contains(e):t.compareDocumentPosition?!!(16&t.compareDocumentPosition(e)):!1:!1}var r=t("./isTextNode");e.exports=n},{"./isTextNode":109}],120:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,t[i],i,r++));return o}e.exports=n},{}],121:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,i,t[i],r++));return o}e.exports=n},{}],122:[function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}e.exports=n},{}],123:[function(t,e){"use strict";function n(t,e,n){null!==t&&void 0!==t&&a(t,"",0,e,n)}var r=t("./ReactComponent"),o=t("./ReactTextComponent"),i=t("./invariant"),a=function(t,e,n,s,u){var c=0;if(Array.isArray(t))for(var l=0;l<t.length;l++){var p=t[l],d=e+r.getKey(p,l),h=n+c;c+=a(p,d,h,s,u)}else{var f=typeof t,m=""===e,v=m?r.getKey(t,0):e;if(null===t||void 0===t||"boolean"===f)s(u,null,v,n),c=1;else if(t.mountComponentIntoNode)s(u,t,v,n),c=1;else if("object"===f){i(!t||1!==t.nodeType);for(var g in t)t.hasOwnProperty(g)&&(c+=a(t[g],e+"{"+g+"}",n+c,s,u))}else if("string"===f){var C=new o(t);s(u,C,v,n),c+=1}else if("number"===f){var y=new o(""+t);s(u,y,v,n),c+=1}}return c};e.exports=n},{"./ReactComponent":28,"./ReactTextComponent":63,"./invariant":105}]},{},[69])(69)});