perkeep/third_party/react/react-with-addons.min.js

21 lines
119 KiB
JavaScript
Raw Normal View History

/**
* React (with addons) v0.10.0
*
* Copyright 2013-2014 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.
*/
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.React=t()}}(function(){return function t(e,n,o){function r(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 r(n?n:t)},c,c.exports,t,e,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(t,e){"use strict";var n=t("./focusNode"),o={componentDidMount:function(){this.props.autoFocus&&n(this.getDOMNode())}};e.exports=o},{"./focusNode":110}],2:[function(t,e){var n=t("./invariant"),o={addClass:function(t,e){return n(!/\s/.test(e)),e&&(t.classList?t.classList.add(e):o.hasClass(t,e)||(t.className=t.className+" "+e)),t},removeClass:function(t,e){return n(!/\s/.test(e)),e&&(t.classList?t.classList.remove(e):o.hasClass(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)},hasClass:function(t,e){return n(!/\s/.test(e)),t.classList?!!e&&t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}};e.exports=o},{"./invariant":122}],3:[function(t,e){"use strict";function n(t,e){return t+e.charAt(0).toUpperCase()+e.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(t){r.forEach(function(e){o[n(e,t)]=o[t]})});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};e.exports=a},{}],4:[function(t,e){"use strict";var n=t("./CSSProperty"),o=t("./dangerousStyleValue"),r=t("./escapeTextForBrowser"),i=t("./hyphenate"),a=t("./memoizeStringOnly"),s=a(function(t){return r(i(t))}),u={createMarkupForStyles:function(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];null!=r&&(e+=s(n)+":",e+=o(n,r)+";")}return e||null},setValueForStyles:function(t,e){var r=t.style;for(var i in e)if(e.hasOwnProperty(i)){var a=o(i,e[i]);if(a)r[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)r[u]="";else r[i]=""}}}};e.exports=u},{"./CSSProperty":3,"./dangerousStyleValue":105,"./escapeTextForBrowser":108,"./hyphenate":120,"./memoizeStringOnly":130}],5:[function(t,e){"use strict";function n(t){return"SELECT"===t.nodeName||"INPUT"===t.nodeName&&"file"===t.type}function o(t){var e=M.getPooled(b.change,S,t);C.accumulateTwoPhaseDispatches(e),R.batchedUpdates(r,e)}function r(t){y.enqueueEvents(t),y.processEventQueue()}function i(t,e){O=t,S=e,O.attachEvent("onchange",o)}function a(){O&&(O.detachEvent("onchange",o),O=null,S=null)}function s(t,e,n){return t===T.topChange?n:void 0}function u(t,e,n){t===T.topFocus?(a(),i(e,n)):t===T.topBlur&&a()}function c(t,e){O=t,S=e,N=t.value,I=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value"),Object.defineProperty(O,"value",A),O.attachEvent("onpropertychange",p)}function l(){O&&(delete O.value,O.detachEvent("onpropertychange",p),O=null,S=null,N=null,I=null)}function p(t){if("value"===t.propertyName){var e=t.srcElement.value;e!==N&&(N=e,o(t))}}function d(t,e,n){return t===T.topInput?n:void 0}function h(t,e,n){t===T.topFocus?(l(),c(e,n)):t===T.topB
},construct:function(t,e){this.props=t||{},this._owner=n.current,this._lifeCycleState=u.UNMOUNTED,this._pendingProps=null,this._pendingCallbacks=null,this._pendingOwner=this._owner;var o=arguments.length-1;if(1===o)this.props.children=e;else if(o>1){for(var r=Array(o),i=0;o>i;i++)r[i]=arguments[i+1];this.props.children=r}},mountComponent:function(t,e,n){i(!this.isMounted());var r=this.props;null!=r.ref&&o.addComponentAsRefTo(this,r.ref,this._owner),this._rootNodeID=t,this._lifeCycleState=u.MOUNTED,this._mountDepth=n},unmountComponent:function(){i(this.isMounted());var t=this.props;null!=t.ref&&o.removeComponentAsRefFrom(this,t.ref,this._owner),l(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=u.UNMOUNTED},receiveComponent:function(t,e){i(this.isMounted()),this._pendingOwner=t._owner,this._pendingProps=t.props,this._performUpdateIfNecessary(e)},performUpdateIfNecessary:function(){var t=d.ReactReconcileTransaction.getPooled();t.perform(this._performUpdateIfNecessary,this,t),d.ReactReconcileTransaction.release(t)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps){var e=this.props,n=this._owner;this.props=this._pendingProps,this._owner=this._pendingOwner,this._pendingProps=null,this.updateComponent(t,e,n)}},updateComponent:function(t,e,n){var r=this.props;(this._owner!==n||r.ref!==e.ref)&&(null!=e.ref&&o.removeComponentAsRefFrom(this,e.ref,n),null!=r.ref&&o.addComponentAsRefTo(this,r.ref,this._owner))},mountComponentIntoNode:function(t,e,n){var o=d.ReactReconcileTransaction.getPooled();o.perform(this._mountComponentIntoNode,this,t,e,o,n),d.ReactReconcileTransaction.release(o)},_mountComponentIntoNode:function(t,e,n,o){var r=this.mountComponent(t,n,0);p(r,e,o)},isOwnedBy:function(t){return this._owner===t},getSiblingByRef:function(t){var e=this._owner;return e&&e.refs?e.refs[t]:null}}};e.exports=d},{"./ReactCurrentOwner":35,"./ReactOwner":62,"./ReactUpdates":78,"./invariant":122,"./keyMirror":128,"./merge":131,"./monitorCodeUse":135}],32:[function(t,e){"use strict";var n=t("./ReactDOMIDOperations"),o=t("./ReactMarkupChecksum"),r=t("./ReactMount"),i=t("./ReactPerf"),a=t("./ReactReconcileTransaction"),s=t("./getReactRootElementInContainer"),u=t("./invariant"),c=1,l=9,p={ReactReconcileTransaction:a,BackendIDOperations:n,unmountIDFromEnvironment:function(t){r.purgeID(t)},mountImageIntoNode:i.measure("ReactComponentBrowserEnvironment","mountImageIntoNode",function(t,e,n){if(u(e&&(e.nodeType===c||e.nodeType===l)),n){if(o.canReuseMarkup(t,s(e)))return;u(e.nodeType!==l)}u(e.nodeType!==l),e.innerHTML=t})};e.exports=p},{"./ReactDOMIDOperations":40,"./ReactMarkupChecksum":57,"./ReactMount":58,"./ReactPerf":63,"./ReactReconcileTransaction":69,"./getReactRootElementInContainer":117,"./invariant":122}],33:[function(t,e){"use strict";function n(t,e){for(var n in e)e.hasOwnProperty(n)&&R("function"==typeof e[n])}function o(t,e){var n=S[e];_.hasOwnProperty(e)&&R(n===b.OVERRIDE_BASE),t.hasOwnProperty(e)&&R(n===b.DEFINE_MANY||n===b.DEFINE_MANY_MERGED)}function r(t){var e=t._compositeLifeCycleState;R(t.isMounted()||e===I.MOUNTING),R(e!==I.RECEIVING_STATE),R(e!==I.UNMOUNTING)}function i(t,e){R(!l(e)),R(!p.isValidComponent(e));var n=t.componentConstructor,r=n.prototype;for(var i in e){var a=e[i];if(e.hasOwnProperty(i))if(o(r,i),N.hasOwnProperty(i))N[i](t,a);else{var s=i in S,d=i in r,h=a&&a.__reactDontBind,f="function"==typeof a,m=f&&!s&&!d&&!h;m?(r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[i]=a,r[i]=a):r[i]=d?S[i]===b.DEFINE_MANY_MERGED?u(r[i],a):c(r[i],a):a}}}function a(t,e){if(e)for(var n in e){var o=e[n];if(!e.hasOwnProperty(n))return;var r=n in t,i=o;if(r){var a=t[n],s=typeof a,u=typeof o;R("function"===s&&"function"===u),i=c(a,o)}t[n]=i,t.componentConstructor[n]=i}}function s(t,e){return R(t&&e&&"object"==typeof t&&"object"==typeof e),P(e,function(e,n){R(void 0===t[n]),t[n]=e}),t}function u(t,e){return function(){var n=t.apply(this,arguments),o=e.apply(this,arguments);return null==n?o:null==o?n:s(n,o)}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}fu
}},setEnabled:function(t){d(c.canUseDOM),E.TopLevelCallbackCreator&&E.TopLevelCallbackCreator.setEnabled(t)},isEnabled:function(){return!(!E.TopLevelCallbackCreator||!E.TopLevelCallbackCreator.isEnabled())},listenTo:function(t,e){for(var a=e,s=n(a),c=u.registrationNameDependencies[t],l=i.topLevelTypes,p=0,d=c.length;d>p;p++){var f=c[p];if(!s[f]){var m=l[f];m===l.topWheel?h("wheel")?o(l.topWheel,"wheel",a):h("mousewheel")?o(l.topWheel,"mousewheel",a):o(l.topWheel,"DOMMouseScroll",a):m===l.topScroll?h("scroll",!0)?r(l.topScroll,"scroll",a):o(l.topScroll,"scroll",window):m===l.topFocus||m===l.topBlur?(h("focus",!0)?(r(l.topFocus,"focus",a),r(l.topBlur,"blur",a)):h("focusin")&&(o(l.topFocus,"focusin",a),o(l.topBlur,"focusout",a)),s[l.topBlur]=!0,s[l.topFocus]=!0):y[f]&&o(m,y[f],a),s[f]=!0}}},ensureScrollValueMonitoring:function(){if(!v){var t=p.refreshScrollValues;a.listen(window,"scroll",t),a.listen(window,"resize",t),v=!0}},eventNameDispatchConfigs:s.eventNameDispatchConfigs,registrationNameModules:s.registrationNameModules,putListener:s.putListener,getListener:s.getListener,deleteListener:s.deleteListener,deleteAllListeners:s.deleteAllListeners,trapBubbledEvent:o,trapCapturedEvent:r});e.exports=E},{"./EventConstants":15,"./EventListener":16,"./EventPluginHub":17,"./EventPluginRegistry":18,"./ExecutionEnvironment":21,"./ReactEventEmitterMixin":51,"./ViewportMetrics":94,"./invariant":122,"./isEventSupported":123,"./merge":131}],51:[function(t,e){"use strict";function n(t){o.enqueueEvents(t),o.processEventQueue()}var o=t("./EventPluginHub"),r=t("./ReactUpdates"),i={handleTopLevel:function(t,e,i,a){var s=o.extractEvents(t,e,i,a);r.batchedUpdates(n,s)}};e.exports=i},{"./EventPluginHub":17,"./ReactUpdates":78}],52:[function(t,e){"use strict";function n(t){var e=u.getID(t),n=s.getReactRootIDFromNodeID(e),o=u.findReactContainerForID(n),r=u.getFirstReactDOM(o);return r}function o(t,e,o){for(var r=u.getFirstReactDOM(c(e))||window,i=r;i;)o.ancestors.push(i),i=n(i);for(var s=0,l=o.ancestors.length;l>s;s++){r=o.ancestors[s];var p=u.getID(r)||"";a.handleTopLevel(t,r,p,e)}}function r(){this.ancestors=[]}var i=t("./PooledClass"),a=t("./ReactEventEmitter"),s=t("./ReactInstanceHandles"),u=t("./ReactMount"),c=t("./getEventTarget"),l=t("./mixInto"),p=!0;l(r,{destructor:function(){this.ancestors.length=0}}),i.addPoolingTo(r);var d={setEnabled:function(t){p=!!t},isEnabled:function(){return p},createTopLevelCallback:function(t){return function(e){if(p){var n=r.getPooled();try{o(t,e,n)}finally{r.release(n)}}}}};e.exports=d},{"./PooledClass":25,"./ReactEventEmitter":50,"./ReactInstanceHandles":55,"./ReactMount":58,"./getEventTarget":114,"./mixInto":134}],53:[function(t,e){"use strict";var n=t("./DOMProperty"),o=t("./EventPluginHub"),r=t("./ReactComponent"),i=t("./ReactCompositeComponent"),a=t("./ReactDOM"),s=t("./ReactEventEmitter"),u=t("./ReactPerf"),c=t("./ReactRootIndex"),l=t("./ReactUpdates"),p={Component:r.injection,CompositeComponent:i.injection,DOMProperty:n.injection,EventPluginHub:o.injection,DOM:a.injection,EventEmitter:s.injection,Perf:u.injection,RootIndex:c.injection,Updates:l.injection};e.exports=p},{"./DOMProperty":9,"./EventPluginHub":17,"./ReactComponent":31,"./ReactCompositeComponent":33,"./ReactDOM":36,"./ReactEventEmitter":50,"./ReactPerf":63,"./ReactRootIndex":70,"./ReactUpdates":78}],54:[function(t,e){"use strict";function n(t){return r(document.documentElement,t)}var o=t("./ReactDOMSelection"),r=t("./containsNode"),i=t("./focusNode"),a=t("./getActiveElement"),s={hasSelectionCapabilities:function(t){return t&&("INPUT"===t.nodeName&&"text"===t.type||"TEXTAREA"===t.nodeName||"true"===t.contentEditable)},getSelectionInformation:function(){var t=a();return{focusedElem:t,selectionRange:s.hasSelectionCapabilities(t)?s.getSelection(t):null}},restoreSelection:function(t){var e=a(),o=t.focusedElem,r=t.selectionRange;e!==o&&n(o)&&(s.hasSelectionCapabilities(o)&&s.setSelection(o,r),i(o))},getSelection:function(t){var e;if("selectionStart"in t)e={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&"INPUT"===t.nodeNam
for(var C in y)y[C].dependencies=[C];var E={eventTypes:g,executeDispatch:function(t,e,n){var r=o.executeDispatch(t,e,n);r===!1&&(t.stopPropagation(),t.preventDefault())},extractEvents:function(t,e,n,o){var m=y[t];if(!m)return null;var g;switch(t){case v.topInput:case v.topLoad:case v.topError:case v.topReset:case v.topSubmit:g=a;break;case v.topKeyDown:case v.topKeyPress:case v.topKeyUp:g=u;break;case v.topBlur:case v.topFocus:g=s;break;case v.topClick:if(2===o.button)return null;case v.topContextMenu:case v.topDoubleClick:case v.topMouseDown:case v.topMouseMove:case v.topMouseOut:case v.topMouseOver:case v.topMouseUp:g=c;break;case v.topDrag:case v.topDragEnd:case v.topDragEnter:case v.topDragExit:case v.topDragLeave:case v.topDragOver:case v.topDragStart:case v.topDrop:g=l;break;case v.topTouchCancel:case v.topTouchEnd:case v.topTouchMove:case v.topTouchStart:g=p;break;case v.topScroll:g=d;break;case v.topWheel:g=h;break;case v.topCopy:case v.topCut:case v.topPaste:g=i}f(g);var C=g.getPooled(m,n,o);return r.accumulateTwoPhaseDispatches(C),C}};e.exports=E},{"./EventConstants":15,"./EventPluginUtils":19,"./EventPropagators":20,"./SyntheticClipboardEvent":83,"./SyntheticDragEvent":85,"./SyntheticEvent":86,"./SyntheticFocusEvent":87,"./SyntheticKeyboardEvent":88,"./SyntheticMouseEvent":89,"./SyntheticTouchEvent":90,"./SyntheticUIEvent":91,"./SyntheticWheelEvent":92,"./invariant":122,"./keyOf":129}],83:[function(t,e){"use strict";function n(t,e,n){o.call(this,t,e,n)}var o=t("./SyntheticEvent"),r={clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}};o.augmentClass(n,r),e.exports=n},{"./SyntheticEvent":86}],84:[function(t,e){"use strict";function n(t,e,n){o.call(this,t,e,n)}var o=t("./SyntheticEvent"),r={data:null};o.augmentClass(n,r),e.exports=n},{"./SyntheticEvent":86}],85:[function(t,e){"use strict";function n(t,e,n){o.call(this,t,e,n)}var o=t("./SyntheticMouseEvent"),r={dataTransfer:null};o.augmentClass(n,r),e.exports=n},{"./SyntheticMouseEvent":89}],86:[function(t,e){"use strict";function n(t,e,n){this.dispatchConfig=t,this.dispatchMarker=e,this.nativeEvent=n;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];this[i]=a?a(n):n[i]}var s=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;this.isDefaultPrevented=s?r.thatReturnsTrue:r.thatReturnsFalse,this.isPropagationStopped=r.thatReturnsFalse}var o=t("./PooledClass"),r=t("./emptyFunction"),i=t("./getEventTarget"),a=t("./merge"),s=t("./mergeInto"),u={type:null,target:i,currentTarget:r.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};s(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t.preventDefault?t.preventDefault():t.returnValue=!1,this.isDefaultPrevented=r.thatReturnsTrue},stopPropagation:function(){var t=this.nativeEvent;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this.isPropagationStopped=r.thatReturnsTrue},persist:function(){this.isPersistent=r.thatReturnsTrue},isPersistent:r.thatReturnsFalse,destructor:function(){var t=this.constructor.Interface;for(var e in t)this[e]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=u,n.augmentClass=function(t,e){var n=this,r=Object.create(n.prototype);s(r,t.prototype),t.prototype=r,t.prototype.constructor=t,t.Interface=a(n.Interface,e),t.augmentClass=n.augmentClass,o.addPoolingTo(t,o.threeArgumentPooler)},o.addPoolingTo(n,o.threeArgumentPooler),e.exports=n},{"./PooledClass":25,"./emptyFunction":106,"./getEventTarget":114,"./merge":131,"./mergeInto":133}],87:[function(t,e){"use strict";function n(t,e,n){o.call(this,t,e,n)}var o=t("./SyntheticUIEvent"),r={relatedTarget:null};o.augmentClass(n,r),e.exports=n},{"./SyntheticUIEvent":91}],88:[function(t,e){"use strict";function n(t,e,n){o.call(this,t,e,n)}var o=t("./SyntheticUIEvent"),r=t("./getEventKey"),i={key:r,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,"char":null