2013-12-16 22:19:36 +00:00
|
|
|
/**
|
2014-02-21 07:04:16 +00:00
|
|
|
* React v0.9.0
|
2013-12-16 22:19:36 +00:00
|
|
|
*
|
2014-02-21 07:04:16 +00:00
|
|
|
* Copyright 2013-2014 Facebook, Inc.
|
2013-12-16 22:19:36 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2014-02-21 07:04:16 +00:00
|
|
|
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.React=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[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:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return r(n?n:e)},c,c.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t){"use strict";var n={componentDidMount:function(){this.props.autoFocus&&this.getDOMNode().focus()}};t.exports=n},{}],2:[function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={columnCount:!0,fillOpacity:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},r=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){r.forEach(function(t){o[n(t,e)]=o[e]})});var i={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}},a={isUnitlessNumber:o,shorthandPropertyExpansions:i};t.exports=a},{}],3:[function(e,t){"use strict";var n=e("./CSSProperty"),o=e("./dangerousStyleValue"),r=e("./escapeTextForBrowser"),i=e("./hyphenate"),a=e("./memoizeStringOnly"),s=a(function(e){return r(i(e))}),u={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=s(n)+":",t+=o(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var i in t)if(t.hasOwnProperty(i)){var a=o(i,t[i]);if(a)r[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)r[u]="";else r[i]=""}}}};t.exports=u},{"./CSSProperty":2,"./dangerousStyleValue":92,"./escapeTextForBrowser":94,"./hyphenate":105,"./memoizeStringOnly":114}],4:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function o(e){var t=R.getPooled(I.change,T,e);C.accumulateTwoPhaseDispatches(t),M.batchedUpdates(r,t)}function r(e){y.enqueueEvents(e),y.processEventQueue()}function i(e,t){O=e,T=t,O.attachEvent("onchange",o)}function a(){O&&(O.detachEvent("onchange",o),O=null,T=null)}function s(e,t,n){return e===P.topChange?n:void 0}function u(e,t,n){e===P.topFocus?(a(),i(t,n)):e===P.topBlur&&a()}function c(e,t){O=e,T=t,N=e.value,S=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(O,"value",A),O.attachEvent("onpropertychange",p)}function l(){O&&(delete O.value,O.detachEvent("onpropertychange",p),O=null,T=null,N=null,S=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==N&&(N=t,o(e))}}function d(e,t,n){return e===P.topInput?n:void 0}function f(e,t,n){e===P.topFocus?(l(),c(t,n)):e===P.topBlur&&l()}function h(e){return e!==P.topSelectionChange&&e!==P.topKeyUp&&e!==P.topKeyDown||!O||O.value===N?void 0:(N=O.value,T)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===P.topClick?n:void 0}var g=e("./EventConstants"),y=e("./EventPluginHub"),C=e("./EventPropagators"),E=e("./ExecutionEnvironment"),M=e("./ReactUpdates"),R=e("./SyntheticEvent"),D=e("./isEventSupported"),x=e("./isTextInputElement"),b=e("./keyOf"),P=g.topLevelTypes,I={change:{phasedRegistrationNames:{bubbled:b({onChange:null}),captured:b({onChangeCapture:null})},dependencies:[P.topBlur,P.topChange,P.topClick,P.topFocus,P.topInput,P.topKeyDown,P.top
|
|
|
|
}function o(e,t){var n=I[t];N.hasOwnProperty(t)&&E(n===P.OVERRIDE_BASE),e.hasOwnProperty(t)&&E(n===P.DEFINE_MANY||n===P.DEFINE_MANY_MERGED)}function r(e){var t=e._compositeLifeCycleState;E(e.isMounted()||t===T.MOUNTING),E(t!==T.RECEIVING_STATE),E(t!==T.UNMOUNTING)}function i(e,t){E(!l(t)),E(!p.isValidComponent(t));var n=e.componentConstructor,r=n.prototype;for(var i in t){var a=t[i];if(t.hasOwnProperty(i))if(o(r,i),O.hasOwnProperty(i))O[i](e,a);else{var s=i in I,d=i in r,f=a&&a.__reactDontBind,h="function"==typeof a,m=h&&!s&&!d&&!f;m?(r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[i]=a,r[i]=a):r[i]=d?I[i]===P.DEFINE_MANY_MERGED?u(r[i],a):c(r[i],a):a}}}function a(e,t){if(t)for(var n in t){var o=t[n];if(!t.hasOwnProperty(n)||!o)return;var r=n in e,i=o;if(r){var a=e[n],s=typeof a,u=typeof o;E("function"===s&&"function"===u),i=c(a,o)}e[n]=i,e.componentConstructor[n]=i}}function s(e,t){return E(e&&t&&"object"==typeof e&&"object"==typeof t),x(t,function(t,n){E(void 0===e[n]),e[n]=t}),e}function u(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);return null==n?o:null==o?n:s(n,o)}}function c(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e){return e instanceof Function&&"componentConstructor"in e&&e.componentConstructor instanceof Function}var p=e("./ReactComponent"),d=e("./ReactContext"),f=e("./ReactCurrentOwner"),h=e("./ReactErrorUtils"),m=e("./ReactOwner"),v=e("./ReactPerf"),g=e("./ReactPropTransferer"),y=e("./ReactPropTypeLocations"),C=(e("./ReactPropTypeLocationNames"),e("./ReactUpdates")),E=e("./invariant"),M=e("./keyMirror"),R=e("./merge"),D=e("./mixInto"),x=e("./objMap"),b=e("./shouldUpdateReactComponent"),P=M({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),I={mixins:P.DEFINE_MANY,statics:P.DEFINE_MANY,propTypes:P.DEFINE_MANY,contextTypes:P.DEFINE_MANY,childContextTypes:P.DEFINE_MANY,getDefaultProps:P.DEFINE_MANY_MERGED,getInitialState:P.DEFINE_MANY_MERGED,getChildContext:P.DEFINE_MANY_MERGED,render:P.DEFINE_ONCE,componentWillMount:P.DEFINE_MANY,componentDidMount:P.DEFINE_MANY,componentWillReceiveProps:P.DEFINE_MANY,shouldComponentUpdate:P.DEFINE_ONCE,componentWillUpdate:P.DEFINE_MANY,componentDidUpdate:P.DEFINE_MANY,componentWillUnmount:P.DEFINE_MANY,updateComponent:P.OVERRIDE_BASE},O={displayName:function(e,t){e.componentConstructor.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)i(e,t[n])},childContextTypes:function(e,t){var o=e.componentConstructor;n(o,t,y.childContext),o.childContextTypes=R(o.childContextTypes,t)},contextTypes:function(e,t){var o=e.componentConstructor;n(o,t,y.context),o.contextTypes=R(o.contextTypes,t)},propTypes:function(e,t){var o=e.componentConstructor;n(o,t,y.prop),o.propTypes=R(o.propTypes,t)},statics:function(e,t){a(e,t)}},T=M({MOUNTING:null,UNMOUNTING:null,RECEIVING_PROPS:null,RECEIVING_STATE:null}),N={construct:function(){p.Mixin.construct.apply(this,arguments),this.state=null,this._pendingState=null,this.context=this._processContext(d.current),this._currentContext=d.current,this._pendingContext=null,this._compositeLifeCycleState=null},isMounted:function(){return p.Mixin.isMounted.call(this)&&this._compositeLifeCycleState!==T.MOUNTING},mountComponent:v.measure("ReactCompositeComponent","mountComponent",function(e,t,n){p.Mixin.mountComponent.call(this,e,t,n),this._compositeLifeCycleState=T.MOUNTING,this._defaultProps=this.getDefaultProps?this.getDefaultProps():null,this.props=this._processProps(this.props),this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.state=this.getInitialState?this.getInitialState():null,E("object"==typeof this.state&&!Array.isArray(this.state)),this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=this._renderValidatedComponent(),this._compositeLifeCycleState=null;var o=this._renderedComponent.mountComponent(e,t,n+1);return this.componentDidMount&&t.getReactMountReady().enqu
|
|
|
|
},{"./DOMProperty":8,"./EventPluginHub":16,"./ReactDOM":32,"./ReactEventEmitter":46,"./ReactPerf":58,"./ReactRootIndex":65,"./ReactUpdates":68}],50:[function(e,t){"use strict";function n(e){return r(document.documentElement,e)}var o=e("./ReactDOMSelection"),r=e("./containsNode"),i=e("./getActiveElement"),a={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=i();return{focusedElem:e,selectionRange:a.hasSelectionCapabilities(e)?a.getSelection(e):null}},restoreSelection:function(e){var t=i(),o=e.focusedElem,r=e.selectionRange;t!==o&&n(o)&&(a.hasSelectionCapabilities(o)&&a.setSelection(o,r),o.focus())},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};t.exports=a},{"./ReactDOMSelection":41,"./containsNode":86,"./getActiveElement":97}],51:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function o(e,t){return e.charAt(t)===d||t===e.length}function r(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function i(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function a(e){return e?e.substr(0,e.lastIndexOf(d)):""}function s(e,t){if(p(r(e)&&r(t)),p(i(e,t)),e===t)return e;for(var n=e.length+f,a=n;a<t.length&&!o(t,a);a++);return t.substr(0,a)}function u(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var i=0,a=0;n>=a;a++)if(o(e,a)&&o(t,a))i=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,i);return p(r(s)),s}function c(e,t,n,o,r,u){e=e||"",t=t||"",p(e!==t);var c=i(t,e);p(c||i(e,t));for(var l=0,d=c?a:s,f=e;;f=d(f,t)){var m;if(r&&f===e||u&&f===t||(m=n(f,c,o)),m===!1||f===t)break;p(l++<h)}}var l=e("./ReactRootIndex"),p=e("./invariant"),d=".",f=d.length,h=100,m={createReactRootID:function(){return n(l.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===d&&e.length>1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,o,r){var i=u(e,t);i!==e&&c(e,i,n,o,!1,!0),i!==t&&c(i,t,n,r,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:i,SEPARATOR:d};t.exports=m},{"./ReactRootIndex":65,"./invariant":106}],52:[function(e,t){"use strict";var n=e("./adler32"),o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+o.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var r=t.getAttribute(o.CHECKSUM_ATTR_NAME);r=r&&parseInt(r,10);var i=n(e);return i===r}};t.exports=o},{"./adler32":85}],53:[function(e,t){"use strict";function n(e){var t=v(e);return t&&O.getID(t)}function o(e){var t=r(e);if(t)if(M.hasOwnProperty(t)){var n=M[t];n!==e&&(g(!s(n,t)),M[t]=e)}else M[t]=e;return t}function r(e){return e&&e.getAttribute&&e.getAttribute(E)||""}function i(e,t){var n=r(e);n!==t&&delete M[n],e.setAttribute(E,t),M[t]=e}function a(e){return M.hasOwnProperty(e)&&s(M[e],e)||(M[e]=O.findReactNodeByID(e)),M[e]}function s(e,t){if(e){g(r(e)===t);var n=O.findReactContainerForID(t);if(n&&m(n,e))return!0}return!1}function u(e){delete M[e]}function c(e){var t=M[e];return t&&s(t,e)?void(I=t):!1}function l(e){I=null,f.traverseAncestors(e,c);var t=I;return I=null,t}var p=e("./DOMProperty"),d=e("./ReactEventEmitter"),f=e("./ReactInstanceH
|
|
|
|
t.exports=n},{"./invariant":106}],85:[function(e,t){"use strict";function n(e){for(var t=1,n=0,r=0;r<e.length;r++)t=(t+e.charCodeAt(r))%o,n=(n+t)%o;return t|n<<16}var o=65521;t.exports=n},{}],86:[function(e,t){function n(e,t){return e&&t?e===t?!0:o(e)?!1:o(t)?n(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var o=e("./isTextNode");t.exports=n},{"./isTextNode":110}],87:[function(e,t){function n(e,t,n,o,r,i){e=e||{};for(var a,s=[t,n,o,r,i],u=0;s[u];){a=s[u++];for(var c in a)e[c]=a[c];a.hasOwnProperty&&a.hasOwnProperty("toString")&&"undefined"!=typeof a.toString&&e.toString!==a.toString&&(e.toString=a.toString)}return e}t.exports=n},{}],88:[function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return n(e)?Array.isArray(e)?e.slice():r(e):[e]}var r=e("./toArray");t.exports=o},{"./toArray":124}],89:[function(e,t){"use strict";function n(e){var t=o.createClass({displayName:"ReactFullPageComponent"+(e.componentConstructor.displayName||""),componentWillUnmount:function(){r(!1)},render:function(){return this.transferPropsTo(e(null,this.props.children))}});return t}var o=e("./ReactCompositeComponent"),r=e("./invariant");t.exports=n},{"./ReactCompositeComponent":29,"./invariant":106}],90:[function(e,t){function n(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var o=u;s(!!u);var r=n(e),c=r&&a(r);if(c){o.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)o=o.lastChild}else o.innerHTML=e;var p=o.getElementsByTagName("script");p.length&&(s(t),i(p).forEach(t));for(var d=i(o.childNodes);o.lastChild;)o.removeChild(o.lastChild);return d}var r=e("./ExecutionEnvironment"),i=e("./createArrayFrom"),a=e("./getMarkupWrap"),s=e("./invariant"),u=r.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=o},{"./ExecutionEnvironment":20,"./createArrayFrom":88,"./getMarkupWrap":100,"./invariant":106}],91:[function(e,t){function n(e,t){var n={},o=Array.isArray(t);"undefined"==typeof t&&(t=!0);for(var r=e.length;r--;)n[e[r]]=o?t[r]:t;return n}t.exports=n},{}],92:[function(e,t){"use strict";function n(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||o.isUnitlessNumber[e]?""+t:t+"px"}var o=e("./CSSProperty");t.exports=n},{"./CSSProperty":2}],93:[function(e,t){function n(e){return function(){return e}}function o(){}var r=e("./copyProperties");r(o,{thatReturns:n,thatReturnsFalse:n(!1),thatReturnsTrue:n(!0),thatReturnsNull:n(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(e){return e}}),t.exports=o},{"./copyProperties":87}],94:[function(e,t){"use strict";function n(e){return r[e]}function o(e){return(""+e).replace(i,n)}var r={"&":"&",">":">","<":"<",'"':""","'":"'","/":"/"},i=/[&><"'\/]/g;t.exports=o},{}],95:[function(e,t){"use strict";function n(e,t,n){var o=e;r(!o.hasOwnProperty(n)),null!=t&&(o[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,n,t),t}var r=e("./invariant"),i=e("./traverseAllChildren");t.exports=o},{"./invariant":106,"./traverseAllChildren":125}],96:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],97:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],98:[function(e,t){"use strict";function n(e){return"key"in e?o[e.key]||e.key:r[e.which||e.keyCode]||"Unidentified"}var o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},r={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117
|