diff --git a/build/rollup.ie.js b/build/rollup.ie.js index 25390c9..baeb200 100644 --- a/build/rollup.ie.js +++ b/build/rollup.ie.js @@ -27,7 +27,7 @@ export default { }), license({ - banner: `IE6+,有问题请加QQ 370262116 by 司徒正美 Copyright ${JSON.stringify( + banner: `Maintained by YMFE Copyright ${JSON.stringify( new Date() ).replace(/T.*|"/g,"")}` }), diff --git a/build/rollup.js b/build/rollup.js index 6cda023..979cb61 100644 --- a/build/rollup.js +++ b/build/rollup.js @@ -27,7 +27,7 @@ export default { }), license({ - banner: `by 司徒正美 Copyright ${JSON.stringify(new Date()).replace(/T.*|"/g,"")} + banner: `Maintained by YMFE Copyright ${JSON.stringify(new Date()).replace(/T.*|"/g,"")} IE9+ ` }), diff --git a/build/rollup.selection.js b/build/rollup.selection.js index aee19d6..18bc882 100644 --- a/build/rollup.selection.js +++ b/build/rollup.selection.js @@ -26,7 +26,7 @@ export default { }), license({ - banner: `此版本带有selection by 司徒正美 Copyright ${JSON.stringify(new Date()).replace(/T.*|"/g,"")} + banner: `Maintained by YMFE Copyright ${JSON.stringify(new Date()).replace(/T.*|"/g,"")} IE9+ ` }), diff --git a/build/rollup.shim.js b/build/rollup.shim.js index e28907d..d2ed421 100644 --- a/build/rollup.shim.js +++ b/build/rollup.shim.js @@ -26,11 +26,9 @@ export default { }), license({ - banner: `此版本要求浏览器没有createClass, createFactory, PropTypes, isValidElement, - unmountComponentAtNode,unstable_renderSubtreeIntoContainer - QQ 370262116 by 司徒正美 Copyright ${JSON.stringify( - new Date() - ).replace(/T.*|"/g, "")}` + banner: `Maintained by YMFE Copyright ${JSON.stringify( + new Date() + ).replace(/T.*|"/g, "")}` }), replace({ diff --git a/build/shim.script.js b/build/shim.script.js index 725c57c..2551c8b 100644 --- a/build/shim.script.js +++ b/build/shim.script.js @@ -13,13 +13,6 @@ var str2 = fs.readFileSync(dir2, "utf-8"); var text2 = str2.replace(/Object\.freeze/g, "extend").replace(/\/\/freeze_start([\s\S]+?)freeze_end/, ""); fs.writeFileSync(dir2, text2, { encoding: "utf8" }); -// fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/qreact/dist/React.js"), text2, { encoding: "utf8" }); -// fs.writeFileSync( path.join(__dirname, "../../react-study/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" }); - -// fs.writeFileSync( path.join(__dirname, "../../antd-test/other/React.js"), text2, { encoding: "utf8" }); - -// fs.writeFileSync( path.join(__dirname, "../../yo-demo/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" }); -// fs.writeFileSync( path.join(__dirname, "../../ani/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" }); console.log("对React瘦身完毕"); // eslint-disable-line @@ -33,9 +26,7 @@ console.log("对ReactIE瘦身完毕"); // eslint-disable-line var dir4 = path.join(__dirname, "../dist/ReactSelection.js"); var str4 = fs.readFileSync(dir4, "utf-8"); var text4 = str4.replace(/Object\.freeze/g, "extend").replace(/\/\/freeze_start([\s\S]+?)freeze_end/, ""); -// fs.writeFileSync(path.join(__dirname, "../../antd-test/node_modules/qreact/dist/ReactSelection.js"), text4, { encoding: "utf8" }); fs.writeFileSync(dir4, text4, { encoding: "utf8" }); -// fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/anujs/dist/ReactSelection.js"), text2, { encoding: "utf8" }); console.log("对ReactSelection瘦身完毕"); // eslint-disable-line diff --git a/dist/React.js b/dist/React.js index b5c2c56..4f91dab 100644 --- a/dist/React.js +++ b/dist/React.js @@ -1,5 +1,5 @@ /** - * by 司徒正美 Copyright 2018-01-23 + * Maintained by YMFE Copyright 2018-01-26 * IE9+ */ @@ -411,7 +411,7 @@ function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); @@ -2749,7 +2749,8 @@ function render(vnode, container, callback) { //[Top API] ReactDOM.unstable_renderSubtreeIntoContainer function unstable_renderSubtreeIntoContainer(lastVnode, nextVnode, container, callback) { deprecatedWarn("unstable_renderSubtreeIntoContainer"); - var parentContext = lastVnode && lastVnode.context || {}; + var updater = lastVnode && lastVnode.updater; + var parentContext = updater ? updater.parentContext : {}; return renderByAnu(nextVnode, container, callback, parentContext); } //[Top API] ReactDOM.unmountComponentAtNode @@ -3080,7 +3081,7 @@ if (win.React && win.React.options) { React = win.React; //解决引入多个 } else { React = win.React = win.ReactDOM = { - version: "2.0.0", + version: "2.0.1", render: render, hydrate: render, options: options, diff --git a/dist/React.min.js b/dist/React.min.js index 4c4cbc6..b9489a2 100644 --- a/dist/React.min.js +++ b/dist/React.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return rt[e]||(rt[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===nt.call(e)}function c(e,t){e+""===e&&(e=e.match(ot)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,u)}function y(e,t){var n=new h(e,0);return n.text=t,n}function _(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=g(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function g(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)lt=null;else{if(r<5){if(lt)return void(lt.text+=e);lt=e=y("#text",e+"")}else lt=null;var o=e.key;o&&!ft[".$"+o]?ft[".$"+o]=e:("."===t&&(t="."+dt),ft[t]=e),e.index=dt,e.return=n,pt&&(pt.sibling=e),pt=e,dt++,ht.push(e)}}function w(e,t){ft={},pt=null,ht=[];var n=t.vnode;if(void 0!==e){lt=null,dt=0,x(e,"",b,n);var r=ht[0];r&&(n.child=r),pt&&delete pt.sibling}return t.children=ft}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=k(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function k(e){if(f(e)>7){var t=vt&&e[vt]||e[mt];if(t&&t.call)return t}}function C(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=ct.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=C(s[u]));ct.currentOwner=o;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=m.apply(null,c);return ct.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=yt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=O(e,o,n,i);r.arr.push(C(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function S(e){return e}function O(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(gt,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return bt[e]}function M(e){this.nodeName=e,this.style={},this.children=[]}function P(e){for(var t;t=e.firstChild;)P(t),e.removeChild(t)}function A(e){e&&(ct.nodeOperate=!0,1===e.nodeType?(Et?e.textContent="":P(e),e.__events=null):3===e.nodeType&&Mt["#text"].length<100&&Mt["#text"].push(e),Rt.appendChild(e),Rt.removeChild(e),ct.nodeOperate=!1)}function V(e,t){var n,r=e.type;switch(r){case"#text":var o=Mt[r].pop();return o?(o.nodeValue=e.text,o):St.createTextNode(e.text);case"#comment":return St.createComment(e.text);case"svg":n=wt.svg;break;case"math":n=wt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,St.createElementNS(n,r)}catch(e){}return St.createElement(r)}function U(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(ct.nodeOperate=!0,n.insertBefore(o,i),ct.nodeOperate=!1)}}function I(e,t,n){if(e&&!e._disposed){if(at.beforeDelete(e),e.isTop){var r=Vt.indexOf(e);-1!==r&&(Vt.splice(r,1),Ut.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&j(e,t,n),t.push({node:e.stateNode,vnode:e,transition:T}))}}function T(){delete this.vnode.stateNode,A(this.node)}function j(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)I(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function W(){if(It.length){var e=s(It).sort(H);e.forEach(function(e){delete e._dirty}),$(e)}}function F(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,It.push(e))}function $(e){at.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=ct.errorHook;if(n){var r,o,i,a=ct.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(u(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function G(e,t){jt[e]||(jt[e]=!0,Y(St,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function Z(e){var t=Ht[e];return t||(t=e.slice(2).replace(Ft,"").toLowerCase(),Ht[e]=t,t)}function J(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function X(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)Gt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){ct.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=tn[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Me(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ae(){return null}function Ve(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Te(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=ct.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Ue(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ie(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Te(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function je(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=je(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=Ut.indexOf(t),i=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==o){if(i=Vt[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else Ut.push(t),o=Ut.length-1;ct.currentOwner=null;var l=m(Sn,{child:e});if(l.isTop=!0,Vt[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,u,c);else{var d=new Ne(a=l.return=_(t));a.child=l,d.children={".0":l},l.child=e,We(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),$(u),e.stateNode}function We(e,t,n,r){for(var o,i=e.return.stateNode,s=ut(i.childNodes||et),u=null,c=0;o=s[c++];)a(o.nodeName)===e.type?u=_(o):i.removeChild(o);u?Qe(u,e,t,n,r):Fe(e,t,n,r)}function Fe(e,t,n,r){if(at.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=V(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);$e(e,w(e.props.children,i),t,n,{}),i.init(n)}U(e,o),e.updater&&e.updater.props()}else new Ve(e,t).init(n,r)}function $e(e,t,n,r,o){for(var i in t)if(Fe(t[i],n,r,o),ct.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(at.beforeUpdate(t),e.vtype<2)if(U(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[Je]?L(s,r):Ge(s,w(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(i.contextTypes?(c=Te(n,i.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&ct.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(I(e,r),Fe(t,n,r,o))}function Ge(e,t,n,r,i,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)$e(n,t,r,i,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):I(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:ct.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(u=t[m],(s=p[m])?Qe(s,u,r,i,a):Fe(u,r,i,a),ct.errorHook)return}}var Ye="function"==typeof Symbol&&Symbol.for,Ze=Ye?Symbol.for("react.element"):60103,Je="dangerouslySetInnerHTML",Xe=Object.prototype.hasOwnProperty,Ke=Ye?Symbol.for("react.fragment"):60107,et=[],tt={},nt=Object.prototype.toString,rt={},ot=/[^, ]+/g,it=/[-_][^-_]/g,at=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),st={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},ut=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){St["__"+e]||(St["__"+e]=!0,G(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Lt[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=J(n);if(!r||r!==e&&!X(e,r)){var o=K(e,r);q(n,t,o)}}))}}),Wt&&(Lt.click=Lt.clickcapture=function(e){e.onclick=e.onclick||o});var qt=ee("change"),zt=ee("doubleclick"),Qt=ee("scroll");Lt.changecapture=Lt.change=function(e){/text|password/.test(e.type)&&Y(St,"input",qt)},Lt.scrollcapture=Lt.scroll=function(e){Y(e,"scroll",Qt)},Lt.doubleclick=Lt.doubleclickcapture=function(){Y(St,"dblclick",zt)};var Gt=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Yt=t({eventPropHooks:Dt,eventHooks:Lt,eventLowerCache:Ht,isEventName:B,isTouch:Wt,dispatchEvent:q,addGlobalEvent:G,addEvent:Y,getBrowserName:Z,createHandle:ee,SyntheticEvent:te}),Zt=function e(){return e};Zt.isRequired=Zt;var Jt={array:Zt,bool:Zt,func:Zt,number:Zt,object:Zt,string:Zt,any:Zt,arrayOf:Zt,element:Zt,instanceOf:Zt,node:Zt,objectOf:Zt,oneOf:Zt,oneOfType:Zt,shape:Zt},Xt={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||Xt).isMounted()},setState:function(e,t){(this.updater||Xt).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||Xt).enqueueSetState(!0,e)},render:function(){}};var Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},tn={getInitialState:1,getDefaultProps:1,getChildContext:1},nn=i(ue,ne);nn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},nn.isPureComponent=!0;var rn={select:1,textarea:1,input:1,option:1},on={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},an=/^-?\d+(\.\d+)?$/,sn=c("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),un=["","-webkit-","-o-","-moz-","-ms-"],cn=c("float","cssFloat"),ln={},dn=/checked|radio/,fn={set:function(e){var t=dn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};ln.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,fn)}catch(e){}};var pn={value:1,checked:1},hn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},vn={},mn={},yn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},_n={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},gn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],bn=/[a-z][A-Z]/,wn=ge("-"),xn=ge(":"),kn={className:1,title:1,name:1,type:1,alt:1,lang:1},Cn=/textarea|input|select/i,Nn={innerHTML:o,defaultValue:Ce,defaultChecked:Ce,children:o,style:function(e,t,n,r){me(e,r.style||tt,n||tt)},autoFocus:function(e){(Ot[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](wt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!pn[t])try{n||0===n?e[t]=n:(kn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var u=Z(t),c=Lt[u];G(u),c&&c(e,u)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),rn[n]&&ce(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,ct.fireRef(e,t)},dispose:function(){var e=this.vnode;ct.fireRef(e,null)}};Ve.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),St.__async)F(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),$([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(c>5&&(s=Ie(r,o)),i=w(u,this)):(this.children=i,delete this.child);ct.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=ct.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete ct.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?at.afterUpdate(t):at.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(ct.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Ue.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Ue.call(this,e)},dispose:function(){var e=this.instance;at.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;ct.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var Sn=function(){ne.call(this)};i(Sn,ne).render=function(){return this.props.child},ct.diffChildren=Ge;return Nt.React&&Nt.React.options?Nt.React:Nt.React=Nt.ReactDOM={version:"2.0.0",render:De,hydrate:De,options:at,Fragment:Ke,PropTypes:Jt,Children:_t,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=_(t),r.vnode=n,new Ne(n));var o=m(Se,{children:e});return r.child=o,o.superReturn=n,o},Component:ne,eventSystem:Yt,findDOMNode:Le,createClass:function(n){if(e("createClass"),!u(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)u(t[o])||console.error(o+" in "+e+" must be a function")}}),u(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createElement:m,cloneElement:C,PureComponent:ue,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=Ut.indexOf(e);if(t>-1){var n=[];I(Vt[t],n),$(n),P(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){return e("unstable_renderSubtreeIntoContainer"),He(n,r,o,t&&t.context||{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}}}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return rt[e]||(rt[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===nt.call(e)}function c(e,t){e+""===e&&(e=e.match(ot)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,u)}function y(e,t){var n=new h(e,0);return n.text=t,n}function _(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=g(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function g(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)lt=null;else{if(r<5){if(lt)return void(lt.text+=e);lt=e=y("#text",e+"")}else lt=null;var o=e.key;o&&!ft[".$"+o]?ft[".$"+o]=e:("."===t&&(t="."+dt),ft[t]=e),e.index=dt,e.return=n,pt&&(pt.sibling=e),pt=e,dt++,ht.push(e)}}function w(e,t){ft={},pt=null,ht=[];var n=t.vnode;if(void 0!==e){lt=null,dt=0,x(e,"",b,n);var r=ht[0];r&&(n.child=r),pt&&delete pt.sibling}return t.children=ft}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=k(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.call&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function k(e){if(f(e)>7){var t=vt&&e[vt]||e[mt];if(t&&t.call)return t}}function C(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=ct.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=C(s[u]));ct.currentOwner=o;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=m.apply(null,c);return ct.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=yt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=O(e,o,n,i);r.arr.push(C(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function S(e){return e}function O(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(gt,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return bt[e]}function M(e){this.nodeName=e,this.style={},this.children=[]}function P(e){for(var t;t=e.firstChild;)P(t),e.removeChild(t)}function A(e){e&&(ct.nodeOperate=!0,1===e.nodeType?(Et?e.textContent="":P(e),e.__events=null):3===e.nodeType&&Mt["#text"].length<100&&Mt["#text"].push(e),Rt.appendChild(e),Rt.removeChild(e),ct.nodeOperate=!1)}function V(e,t){var n,r=e.type;switch(r){case"#text":var o=Mt[r].pop();return o?(o.nodeValue=e.text,o):St.createTextNode(e.text);case"#comment":return St.createComment(e.text);case"svg":n=wt.svg;break;case"math":n=wt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,St.createElementNS(n,r)}catch(e){}return St.createElement(r)}function U(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(ct.nodeOperate=!0,n.insertBefore(o,i),ct.nodeOperate=!1)}}function I(e,t,n){if(e&&!e._disposed){if(at.beforeDelete(e),e.isTop){var r=Vt.indexOf(e);-1!==r&&(Vt.splice(r,1),Ut.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&j(e,t,n),t.push({node:e.stateNode,vnode:e,transition:T}))}}function T(){delete this.vnode.stateNode,A(this.node)}function j(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)I(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function W(){if(It.length){var e=s(It).sort(H);e.forEach(function(e){delete e._dirty}),$(e)}}function F(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,It.push(e))}function $(e){at.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=ct.errorHook;if(n){var r,o,i,a=ct.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(u(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function G(e,t){jt[e]||(jt[e]=!0,Y(St,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function Z(e){var t=Ht[e];return t||(t=e.slice(2).replace(Ft,"").toLowerCase(),Ht[e]=t,t)}function J(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function X(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)Gt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){ct.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=tn[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Me(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ae(){return null}function Ve(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Te(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=ct.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Ue(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ie(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Te(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function je(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=je(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=Ut.indexOf(t),i=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==o){if(i=Vt[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else Ut.push(t),o=Ut.length-1;ct.currentOwner=null;var l=m(Sn,{child:e});if(l.isTop=!0,Vt[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,u,c);else{var d=new Ne(a=l.return=_(t));a.child=l,d.children={".0":l},l.child=e,We(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),$(u),e.stateNode}function We(e,t,n,r){for(var o,i=e.return.stateNode,s=ut(i.childNodes||et),u=null,c=0;o=s[c++];)a(o.nodeName)===e.type?u=_(o):i.removeChild(o);u?Qe(u,e,t,n,r):Fe(e,t,n,r)}function Fe(e,t,n,r){if(at.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=V(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);$e(e,w(e.props.children,i),t,n,{}),i.init(n)}U(e,o),e.updater&&e.updater.props()}else new Ve(e,t).init(n,r)}function $e(e,t,n,r,o){for(var i in t)if(Fe(t[i],n,r,o),ct.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(at.beforeUpdate(t),e.vtype<2)if(U(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[Je]?L(s,r):Ge(s,w(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(i.contextTypes?(c=Te(n,i.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&ct.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(I(e,r),Fe(t,n,r,o))}function Ge(e,t,n,r,i,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)$e(n,t,r,i,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):I(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:ct.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(u=t[m],(s=p[m])?Qe(s,u,r,i,a):Fe(u,r,i,a),ct.errorHook)return}}var Ye="function"==typeof Symbol&&Symbol.for,Ze=Ye?Symbol.for("react.element"):60103,Je="dangerouslySetInnerHTML",Xe=Object.prototype.hasOwnProperty,Ke=Ye?Symbol.for("react.fragment"):60107,et=[],tt={},nt=Object.prototype.toString,rt={},ot=/[^, ]+/g,it=/[-_][^-_]/g,at=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),st={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},ut=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){St["__"+e]||(St["__"+e]=!0,G(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Lt[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=J(n);if(!r||r!==e&&!X(e,r)){var o=K(e,r);q(n,t,o)}}))}}),Wt&&(Lt.click=Lt.clickcapture=function(e){e.onclick=e.onclick||o});var qt=ee("change"),zt=ee("doubleclick"),Qt=ee("scroll");Lt.changecapture=Lt.change=function(e){/text|password/.test(e.type)&&Y(St,"input",qt)},Lt.scrollcapture=Lt.scroll=function(e){Y(e,"scroll",Qt)},Lt.doubleclick=Lt.doubleclickcapture=function(){Y(St,"dblclick",zt)};var Gt=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Yt=t({eventPropHooks:Dt,eventHooks:Lt,eventLowerCache:Ht,isEventName:B,isTouch:Wt,dispatchEvent:q,addGlobalEvent:G,addEvent:Y,getBrowserName:Z,createHandle:ee,SyntheticEvent:te}),Zt=function e(){return e};Zt.isRequired=Zt;var Jt={array:Zt,bool:Zt,func:Zt,number:Zt,object:Zt,string:Zt,any:Zt,arrayOf:Zt,element:Zt,instanceOf:Zt,node:Zt,objectOf:Zt,oneOf:Zt,oneOfType:Zt,shape:Zt},Xt={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||Xt).isMounted()},setState:function(e,t){(this.updater||Xt).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||Xt).enqueueSetState(!0,e)},render:function(){}};var Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},tn={getInitialState:1,getDefaultProps:1,getChildContext:1},nn=i(ue,ne);nn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},nn.isPureComponent=!0;var rn={select:1,textarea:1,input:1,option:1},on={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},an=/^-?\d+(\.\d+)?$/,sn=c("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),un=["","-webkit-","-o-","-moz-","-ms-"],cn=c("float","cssFloat"),ln={},dn=/checked|radio/,fn={set:function(e){var t=dn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};ln.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,fn)}catch(e){}};var pn={value:1,checked:1},hn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},vn={},mn={},yn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},_n={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},gn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],bn=/[a-z][A-Z]/,wn=ge("-"),xn=ge(":"),kn={className:1,title:1,name:1,type:1,alt:1,lang:1},Cn=/textarea|input|select/i,Nn={innerHTML:o,defaultValue:Ce,defaultChecked:Ce,children:o,style:function(e,t,n,r){me(e,r.style||tt,n||tt)},autoFocus:function(e){(Ot[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](wt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!pn[t])try{n||0===n?e[t]=n:(kn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var u=Z(t),c=Lt[u];G(u),c&&c(e,u)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),rn[n]&&ce(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,ct.fireRef(e,t)},dispose:function(){var e=this.vnode;ct.fireRef(e,null)}};Ve.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),St.__async)F(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),$([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(c>5&&(s=Ie(r,o)),i=w(u,this)):(this.children=i,delete this.child);ct.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=ct.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete ct.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?at.afterUpdate(t):at.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(ct.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Ue.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Ue.call(this,e)},dispose:function(){var e=this.instance;at.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;ct.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var Sn=function(){ne.call(this)};i(Sn,ne).render=function(){return this.props.child},ct.diffChildren=Ge;return Nt.React&&Nt.React.options?Nt.React:Nt.React=Nt.ReactDOM={version:"2.0.1",render:De,hydrate:De,options:at,Fragment:Ke,PropTypes:Jt,Children:_t,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=_(t),r.vnode=n,new Ne(n));var o=m(Se,{children:e});return r.child=o,o.superReturn=n,o},Component:ne,eventSystem:Yt,findDOMNode:Le,createClass:function(n){if(e("createClass"),!u(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)u(t[o])||console.error(o+" in "+e+" must be a function")}}),u(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createElement:m,cloneElement:C,PureComponent:ue,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=Ut.indexOf(e);if(t>-1){var n=[];I(Vt[t],n),$(n),P(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){e("unstable_renderSubtreeIntoContainer");var i=t&&t.updater;return He(n,r,o,i?i.parentContext:{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}}}); \ No newline at end of file diff --git a/dist/ReactDOMServer.js b/dist/ReactDOMServer.js index bd03d04..1a97e3a 100644 --- a/dist/ReactDOMServer.js +++ b/dist/ReactDOMServer.js @@ -266,7 +266,7 @@ function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); diff --git a/dist/ReactDOMServer.min.js b/dist/ReactDOMServer.min.js index 4e35c1b..9df0fdf 100644 --- a/dist/ReactDOMServer.min.js +++ b/dist/ReactDOMServer.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("stream")):"function"==typeof define&&define.amd?define(["stream"],t):e.ReactDOMServer=t(e.stream)}(this,function(e){function t(e,t){e+""===e&&(e=e.match(T)||[]);for(var r={},n=void 0!==t?t:1,o=0,a=e.length;o7){var t=W&&e[W]||e[B];if(t&&t.call)return t}}function l(e){this.nodeName=e,this.style={},this.children=[]}function s(e,t){if(e.getChildContext){var r=e.getChildContext();r&&(t=Object.assign({},t,r))}return t}function p(e,t){var r={};if(!t||!e)return r;for(var n in t)t.hasOwnProperty(n)&&(r[n]=e[n]);return r}function d(e){var t=""+e,r=Z.exec(t);if(!r)return t;var n,o="",a=0,i=0;for(a=r.index;a\n";if(p+=">",i)p+=i;else{var d={vnode:e},m=u(a.children,d);for(var b in m)p+=S(m[b],t);e.updater=d}return p+"\n"}if(n>1){var h={context:t};return e=C(e,h),t=h.context,S(e,t)}if(Array.isArray(e)){var y="";return e.forEach(function(e){y+=S(e,t)}),y}throw"数据不合法"}}function w(e,t){var r,n,o,a,i,c,f,l,s,p,d,m,b,h,y,x,w;return regeneratorRuntime.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:n=(r=e).vtype,o=r.type,a=r.props,N.t0=o,N.next="#text"===N.t0?4:"#comment"===N.t0?7:10;break;case 4:return N.next=6,v(e.text);case 6:return N.abrupt("break",40);case 7:return N.next=9,"\x3c!--"+e.text+"--\x3e";case 9:return N.abrupt("break",40);case 10:if(i=a&&a.dangerouslySetInnerHTML,i=i&&i.__html,1!==n){N.next=24;break}if("option"===o){for(c=e.return;c&&"select"!==c.type;c===c.return);c&&c.valuesSet&&(f=k(e),c.valuesSet["&"+f]&&(a=Object.assign({selected:""},a)))}else"select"===o&&null!=(l=e.props.value||e.props.defaultValue)&&(s=[].concat(l),p={},s.forEach(function(e){p["&"+e]=!0}),e.valuesSet=p);if(d="<"+o+g(a,o),!ae[o]){N.next=18;break}return N.next=18,d+"/>\n";case 18:if(d+=">",i)d+=i;else{m={vnode:e},b=u(a.children,m);for(h in b)y=b[h],d+=S(y,t);e.updater=m}return N.next=22,d+"\n";case 22:N.next=40;break;case 24:if(!(n>1)){N.next=32;break}return x={context:t},e=C(e,x),t=x.context,N.next=30,S(e,t);case 30:N.next=40;break;case 32:if(!Array.isArray(e)){N.next=39;break}return w="",e.forEach(function(e){w+=S(e,t)}),N.next=37,w;case 37:N.next=40;break;case 39:throw"数据不合法";case 40:case"end":return N.stop()}},oe,this)}function k(e){if("value"in e.props)return e.props.value;var t=e.props.children;return t+""=="a"?t:t.text}function C(e,t){var r,n,o=t.context,a=e.type;if(e.vtype>1){var i=e.props,u=p(o,a.contextTypes);if(4===e.vtype)(n=a(i,u))&&n.render&&(n=n.render()),r={};else{if(r=new a(i,u),r.props=r.props||i,r.context=r.context||u,r.componentWillMount)try{r.componentWillMount()}catch(e){}n=r.render()}return n=N(n),r.componentWillMount&&r.componentWillMount(),r.getChildContext&&(t.context=s(r,o)),Array.isArray(n)?n.map(function(e){return C(e,t,r)}):C(n,t,r)}return e}function N(e){var t=r(e);return t<3?{vtype:0,text:"",type:"#text"}:t<5?{vtype:0,text:e+"",type:"#text"}:e}function j(e,t){return S(N(e),t||{})}function M(t,r){var n=new e.Readable,o=w(t,r||{});return n._read=function(){var e=o.next();e.done?n.push(null):n.push(e.value.toString())},n}var O="function"==typeof Symbol&&Symbol.for,A=O?Symbol.for("react.element"):60103,E=(O&&Symbol.for("react.fragment"),Object.prototype.toString),T=/[^, ]+/g,_=t(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],function(){}),L={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7};window.pendingRefs=[];var R={mountOrder:1,currentOwner:null,controlledCbs:[],fireRef:function(e,t){(e._disposed||e.stateNode.__isStateless)&&(t=null);var r=e.ref;if("function"==typeof r)return r(t);var o=e._owner;if(r){if(!o)throw"Element ref was specified as a string ("+r+") but no owner was set";t?(t.nodeType&&(t.getDOMNode=n),o.refs[r]=t):delete o.refs[r]}}};o.prototype={getDOMNode:function(){return this.stateNode||null},$$typeof:A};var $,D,F,H,I,W=O&&Symbol.iterator,B="@@iterator",P=l.prototype={contains:Boolean};String("replaceChild,appendChild,removeAttributeNS,setAttributeNS,removeAttribute,setAttribute,getAttribute,insertBefore,removeChild,addEventListener,removeEventListener,attachEvent,detachEvent").replace(/\w+/g,function(e){P[e]=function(){console.log("fire "+e)}});var q=new l;q.createElement=q.createElementNS=q.createDocumentFragment=function(e){return new l(e)},q.createTextNode=q.createComment=Boolean,q.documentElement=new l("html"),q.body=new l("body"),q.nodeName="#document",q.textContent="";try{var U=window;U.alert}catch(e){!1,U={document:q}}var V=U,z=U.document||q,G=(z.createDocumentFragment(),{88:7,80:6,"00":NaN,"08":NaN}),X=z.documentMode||G[r(z.all)+""+r(V.XMLHttpRequest)],Z=(/NaN|undefined/.test(X),/["'&<>]/),J=/^-?\d+(\.\d+)?$/,K=t("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),Q=(t("float","cssFloat"),"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}),Y={ref:1,key:1,children:1,dangerouslySetInnerHTML:1,innerHTML:1},ee={styleFloat:"float",cssFloat:"float"},te=/^xlink:?(.+)/,re={},ne={select:1,input:1,textarea:1},oe=regeneratorRuntime.mark(w),ae=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];return{renderToString:j,renderToStaticMarkup:j,renderToNodeStream:M,renderToStaticNodeStream:M}}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("stream")):"function"==typeof define&&define.amd?define(["stream"],t):e.ReactDOMServer=t(e.stream)}(this,function(e){function t(e,t){e+""===e&&(e=e.match(T)||[]);for(var r={},n=void 0!==t?t:1,o=0,a=e.length;o7){var t=W&&e[W]||e[B];if(t&&t.call)return t}}function l(e){this.nodeName=e,this.style={},this.children=[]}function s(e,t){if(e.getChildContext){var r=e.getChildContext();r&&(t=Object.assign({},t,r))}return t}function p(e,t){var r={};if(!t||!e)return r;for(var n in t)t.hasOwnProperty(n)&&(r[n]=e[n]);return r}function d(e){var t=""+e,r=Z.exec(t);if(!r)return t;var n,o="",a=0,i=0;for(a=r.index;a\n";if(p+=">",i)p+=i;else{var d={vnode:e},m=u(a.children,d);for(var b in m)p+=S(m[b],t);e.updater=d}return p+"\n"}if(n>1){var h={context:t};return e=C(e,h),t=h.context,S(e,t)}if(Array.isArray(e)){var y="";return e.forEach(function(e){y+=S(e,t)}),y}throw"数据不合法"}}function w(e,t){var r,n,o,a,i,c,f,l,s,p,d,m,b,h,y,x,w;return regeneratorRuntime.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:n=(r=e).vtype,o=r.type,a=r.props,N.t0=o,N.next="#text"===N.t0?4:"#comment"===N.t0?7:10;break;case 4:return N.next=6,v(e.text);case 6:return N.abrupt("break",40);case 7:return N.next=9,"\x3c!--"+e.text+"--\x3e";case 9:return N.abrupt("break",40);case 10:if(i=a&&a.dangerouslySetInnerHTML,i=i&&i.__html,1!==n){N.next=24;break}if("option"===o){for(c=e.return;c&&"select"!==c.type;c===c.return);c&&c.valuesSet&&(f=k(e),c.valuesSet["&"+f]&&(a=Object.assign({selected:""},a)))}else"select"===o&&null!=(l=e.props.value||e.props.defaultValue)&&(s=[].concat(l),p={},s.forEach(function(e){p["&"+e]=!0}),e.valuesSet=p);if(d="<"+o+g(a,o),!ae[o]){N.next=18;break}return N.next=18,d+"/>\n";case 18:if(d+=">",i)d+=i;else{m={vnode:e},b=u(a.children,m);for(h in b)y=b[h],d+=S(y,t);e.updater=m}return N.next=22,d+"\n";case 22:N.next=40;break;case 24:if(!(n>1)){N.next=32;break}return x={context:t},e=C(e,x),t=x.context,N.next=30,S(e,t);case 30:N.next=40;break;case 32:if(!Array.isArray(e)){N.next=39;break}return w="",e.forEach(function(e){w+=S(e,t)}),N.next=37,w;case 37:N.next=40;break;case 39:throw"数据不合法";case 40:case"end":return N.stop()}},oe,this)}function k(e){if("value"in e.props)return e.props.value;var t=e.props.children;return t+""=="a"?t:t.text}function C(e,t){var r,n,o=t.context,a=e.type;if(e.vtype>1){var i=e.props,u=p(o,a.contextTypes);if(4===e.vtype)(n=a(i,u))&&n.render&&(n=n.render()),r={};else{if(r=new a(i,u),r.props=r.props||i,r.context=r.context||u,r.componentWillMount)try{r.componentWillMount()}catch(e){}n=r.render()}return n=N(n),r.componentWillMount&&r.componentWillMount(),r.getChildContext&&(t.context=s(r,o)),Array.isArray(n)?n.map(function(e){return C(e,t,r)}):C(n,t,r)}return e}function N(e){var t=r(e);return t<3?{vtype:0,text:"",type:"#text"}:t<5?{vtype:0,text:e+"",type:"#text"}:e}function j(e,t){return S(N(e),t||{})}function M(t,r){var n=new e.Readable,o=w(t,r||{});return n._read=function(){var e=o.next();e.done?n.push(null):n.push(e.value.toString())},n}var O="function"==typeof Symbol&&Symbol.for,A=O?Symbol.for("react.element"):60103,E=(O&&Symbol.for("react.fragment"),Object.prototype.toString),T=/[^, ]+/g,_=t(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],function(){}),L={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7};window.pendingRefs=[];var R={mountOrder:1,currentOwner:null,controlledCbs:[],fireRef:function(e,t){(e._disposed||e.stateNode.__isStateless)&&(t=null);var r=e.ref;if("function"==typeof r)return r(t);var o=e._owner;if(r){if(!o)throw"Element ref was specified as a string ("+r+") but no owner was set";t?(t.nodeType&&(t.getDOMNode=n),o.refs[r]=t):delete o.refs[r]}}};o.prototype={getDOMNode:function(){return this.stateNode||null},$$typeof:A};var $,D,F,H,I,W=O&&Symbol.iterator,B="@@iterator",P=l.prototype={contains:Boolean};String("replaceChild,appendChild,removeAttributeNS,setAttributeNS,removeAttribute,setAttribute,getAttribute,insertBefore,removeChild,addEventListener,removeEventListener,attachEvent,detachEvent").replace(/\w+/g,function(e){P[e]=function(){console.log("fire "+e)}});var q=new l;q.createElement=q.createElementNS=q.createDocumentFragment=function(e){return new l(e)},q.createTextNode=q.createComment=Boolean,q.documentElement=new l("html"),q.body=new l("body"),q.nodeName="#document",q.textContent="";try{var U=window;U.alert}catch(e){!1,U={document:q}}var V=U,z=U.document||q,G=(z.createDocumentFragment(),{88:7,80:6,"00":NaN,"08":NaN}),X=z.documentMode||G[r(z.all)+""+r(V.XMLHttpRequest)],Z=(/NaN|undefined/.test(X),/["'&<>]/),J=/^-?\d+(\.\d+)?$/,K=t("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),Q=(t("float","cssFloat"),"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}),Y={ref:1,key:1,children:1,dangerouslySetInnerHTML:1,innerHTML:1},ee={styleFloat:"float",cssFloat:"float"},te=/^xlink:?(.+)/,re={},ne={select:1,input:1,textarea:1},oe=regeneratorRuntime.mark(w),ae=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];return{renderToString:j,renderToStaticMarkup:j,renderToNodeStream:M,renderToStaticNodeStream:M}}); \ No newline at end of file diff --git a/dist/ReactIE.js b/dist/ReactIE.js index ce6437a..f09a49e 100644 --- a/dist/ReactIE.js +++ b/dist/ReactIE.js @@ -1,5 +1,5 @@ /** - * IE6+,有问题请加QQ 370262116 by 司徒正美 Copyright 2018-01-23 + * Maintained by YMFE Copyright 2018-01-26 */ (function (global, factory) { @@ -410,7 +410,7 @@ function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); @@ -2748,7 +2748,8 @@ function render(vnode, container, callback) { //[Top API] ReactDOM.unstable_renderSubtreeIntoContainer function unstable_renderSubtreeIntoContainer(lastVnode, nextVnode, container, callback) { deprecatedWarn("unstable_renderSubtreeIntoContainer"); - var parentContext = lastVnode && lastVnode.context || {}; + var updater = lastVnode && lastVnode.updater; + var parentContext = updater ? updater.parentContext : {}; return renderByAnu(nextVnode, container, callback, parentContext); } //[Top API] ReactDOM.unmountComponentAtNode @@ -3197,6 +3198,7 @@ if (msie < 9) { function needFix(fn) { return !/native code/.test(fn); } + function keysPolyfill() { //解决IE下Object.keys的性能问题 if (needFix(Object.keys)) { @@ -3220,7 +3222,7 @@ if (win.React && win.React.options) { React = win.React; } else { React = win.React = win.ReactDOM = { - version: "2.0.0", + version: "2.0.1", render: render, hydrate: render, Fragment: REACT_FRAGMENT_TYPE, diff --git a/dist/ReactIE.min.js b/dist/ReactIE.min.js index bbc1eac..b9f642c 100644 --- a/dist/ReactIE.min.js +++ b/dist/ReactIE.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return st[e]||(st[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===at.call(e)}function c(e,t){e+""===e&&(e=e.match(ut)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,u)}function y(e,t){var n=new h(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=_(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function _(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)ht=null;else{if(r<5){if(ht)return void(ht.text+=e);ht=e=y("#text",e+"")}else ht=null;var o=e.key;o&&!mt[".$"+o]?mt[".$"+o]=e:("."===t&&(t="."+vt),mt[t]=e),e.index=vt,e.return=n,yt&&(yt.sibling=e),yt=e,vt++,gt.push(e)}}function w(e,t){mt={},yt=null,gt=[];var n=t.vnode;if(void 0!==e){ht=null,vt=0,x(e,"",b,n);var r=gt[0];r&&(n.child=r),yt&&delete yt.sibling}return t.children=mt}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=k(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function k(e){if(f(e)>7){var t=_t&&e[_t]||e[bt];if(t&&t.call)return t}}function C(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=pt.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=C(s[u]));pt.currentOwner=o;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=m.apply(null,c);return pt.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=wt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=S(e,o,n,i);r.arr.push(C(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function O(e){return e}function S(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(kt,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return Ct[e]}function M(e){this.nodeName=e,this.style={},this.children=[]}function P(e){for(var t;t=e.firstChild;)P(t),e.removeChild(t)}function V(e){e&&(pt.nodeOperate=!0,1===e.nodeType?(Vt?e.textContent="":P(e),e.__events=null):3===e.nodeType&&Tt["#text"].length<100&&Tt["#text"].push(e),At.appendChild(e),At.removeChild(e),pt.nodeOperate=!1)}function A(e,t){var n,r=e.type;switch(r){case"#text":var o=Tt[r].pop();return o?(o.nodeValue=e.text,o):Mt.createTextNode(e.text);case"#comment":return Mt.createComment(e.text);case"svg":n=Nt.svg;break;case"math":n=Nt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,Mt.createElementNS(n,r)}catch(e){}return Mt.createElement(r)}function T(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(pt.nodeOperate=!0,n.insertBefore(o,i),pt.nodeOperate=!1)}}function U(e,t,n){if(e&&!e._disposed){if(lt.beforeDelete(e),e.isTop){var r=It.indexOf(e);-1!==r&&(It.splice(r,1),Dt.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&I(e,t,n),t.push({node:e.stateNode,vnode:e,transition:j}))}}function j(){delete this.vnode.stateNode,V(this.node)}function I(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)U(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function F(){if(Lt.length){var e=s(Lt).sort(H);e.forEach(function(e){delete e._dirty}),$(e)}}function W(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,Lt.push(e))}function $(e){lt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=pt.errorHook;if(n){var r,o,i,a=pt.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(u(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function X(e,t){Ft[e]||(Ft[e]=!0,Y(Mt,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function G(e){var t=Bt[e];return t||(t=e.slice(2).replace(zt,"").toLowerCase(),Bt[e]=t,t)}function Z(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function J(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)Jt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){pt.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=an[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Me(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ve(){return null}function Ae(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=je(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=pt.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Te(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ue(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function je(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function Ie(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=Ie(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=Dt.indexOf(t),i=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==o){if(i=It[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else Dt.push(t),o=Dt.length-1;pt.currentOwner=null;var l=m(Mn,{child:e});if(l.isTop=!0,It[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,u,c);else{var d=new Ne(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,Fe(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),$(u),e.stateNode}function Fe(e,t,n,r){for(var o,i=e.return.stateNode,s=ft(i.childNodes||ot),u=null,c=0;o=s[c++];)a(o.nodeName)===e.type?u=g(o):i.removeChild(o);u?Qe(u,e,t,n,r):We(e,t,n,r)}function We(e,t,n,r){if(lt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=A(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);$e(e,w(e.props.children,i),t,n,{}),i.init(n)}T(e,o),e.updater&&e.updater.props()}else new Ae(e,t).init(n,r)}function $e(e,t,n,r,o){for(var i in t)if(We(t[i],n,r,o),pt.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(lt.beforeUpdate(t),e.vtype<2)if(T(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[tt]?L(s,r):Xe(s,w(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(i.contextTypes?(c=je(n,i.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&pt.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(U(e,r),We(t,n,r,o))}function Xe(e,t,n,r,i,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)$e(n,t,r,i,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):U(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:pt.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(u=t[m],(s=p[m])?Qe(s,u,r,i,a):We(u,r,i,a),pt.errorHook)return}}function Ye(e){"value"!==e.propertyName||Pn||Ge(e.srcElement)}function Ge(e){var t=e.selectedIndex,n=void 0,r=void 0;t>-1&&(r=(n=e.options[t]).attributes.value,e.value=r&&r.specified?n.value:n.text)}function Ze(e){return!/native code/.test(e)}function Je(){Ze(Object.keys)&&(Object.keys=function(e){var t=[];for(var n in e)nt.call(e,n)&&t.push(n);return t})}var Ke="function"==typeof Symbol&&Symbol.for,et=Ke?Symbol.for("react.element"):60103,tt="dangerouslySetInnerHTML",nt=Object.prototype.hasOwnProperty,rt=Ke?Symbol.for("react.fragment"):60107,ot=[],it={},at=Object.prototype.toString,st={},ut=/[^, ]+/g,ct=/[-_][^-_]/g,lt=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),dt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},ft=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){Mt["__"+e]||(Mt["__"+e]=!0,X(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){$t[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=Z(n);if(!r||r!==e&&!J(e,r)){var o=K(e,r);q(n,t,o)}}))}}),qt&&($t.click=$t.clickcapture=function(e){e.onclick=e.onclick||o});var Yt=ee("change"),Gt=ee("doubleclick"),Zt=ee("scroll");$t.changecapture=$t.change=function(e){/text|password/.test(e.type)&&Y(Mt,"input",Yt)},$t.scrollcapture=$t.scroll=function(e){Y(e,"scroll",Zt)},$t.doubleclick=$t.doubleclickcapture=function(){Y(Mt,"dblclick",Gt)};var Jt=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Kt=t({eventPropHooks:Wt,eventHooks:$t,eventLowerCache:Bt,isEventName:B,isTouch:qt,dispatchEvent:q,addGlobalEvent:X,addEvent:Y,getBrowserName:G,createHandle:ee,SyntheticEvent:te}),en=function e(){return e};en.isRequired=en;var tn={array:en,bool:en,func:en,number:en,object:en,string:en,any:en,arrayOf:en,element:en,instanceOf:en,node:en,objectOf:en,oneOf:en,oneOfType:en,shape:en},nn={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||nn).isMounted()},setState:function(e,t){(this.updater||nn).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||nn).enqueueSetState(!0,e)},render:function(){}};var rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},an={getInitialState:1,getDefaultProps:1,getChildContext:1},sn=i(ue,ne);sn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},sn.isPureComponent=!0;var un={select:1,textarea:1,input:1,option:1},cn={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},ln=/^-?\d+(\.\d+)?$/,dn=c("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),fn=["","-webkit-","-o-","-moz-","-ms-"],pn=c("float","cssFloat"),hn={},vn=/checked|radio/,mn={set:function(e){var t=vn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};hn.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,mn)}catch(e){}};var yn={value:1,checked:1},gn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},_n={},bn={},wn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},xn={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},kn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],Cn=/[a-z][A-Z]/,Nn=_e("-"),On=_e(":"),Sn={className:1,title:1,name:1,type:1,alt:1,lang:1},En=/textarea|input|select/i,Rn={innerHTML:o,defaultValue:Ce,defaultChecked:Ce,children:o,style:function(e,t,n,r){me(e,r.style||it,n||it)},autoFocus:function(e){(Pt[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](Nt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!yn[t])try{n||0===n?e[t]=n:(Sn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var u=G(t),c=$t[u];X(u),c&&c(e,u)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),un[n]&&ce(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,pt.fireRef(e,t)},dispose:function(){var e=this.vnode;pt.fireRef(e,null)}};Ae.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),Mt.__async)W(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),$([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(c>5&&(s=Ue(r,o)),i=w(u,this)):(this.children=i,delete this.child);pt.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=pt.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete pt.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?lt.afterUpdate(t):lt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(pt.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Te.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Te.call(this,e)},dispose:function(){var e=this.instance;lt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;pt.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var Mn=function(){ne.call(this)};i(Mn,ne).render=function(){return this.props.child},pt.diffChildren=Xe;var Pn=!1,Vn=ee("change",function(e){var t=e.srcElement;if("select-one"===t.type&&(t.__bindFixValueFn||(Y(t,"propertychange",Ye),t.__bindFixValueFn=!0),Pn=!0,Ge(t),Pn=!1),"propertychange"===e.type)return"value"===e.propertyName}),An=ee("input",function(e){return"value"===e.propertyName}),Tn={input:function(e){Y(e,"propertychange",An)},change:function(e){Y(e,/radio|check/.test(e.type)?"click":/text|password/.test(e.type)?"propertychange":"change",Vn)},submit:function(e){"FORM"===e.nodeName&&Y(e,"submit",q)}};if(jt<9){Rn[tt]=function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;if(i!==o){e.innerHTML=String.fromCharCode(65279)+i;var a=e.firstChild;1===a.data.length?e.removeChild(a):a.deleteData(0,1)}},jt<8&&(hn.observe=o),String("focus,blur").replace(/\w+/g,function(e){$t[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"focus"===t?"focusin":"focusout",function(n){var r=n.srcElement.tagName;if(r){var o=a(r);"#document"!=o&&"body"!=o&&(n.target=e,q(n,t,e.parentNode))}}))}}),Object.assign(Wt,c("mousemove, mouseout,mouseenter, mouseleave, mouseout,mousewheel, mousewheel, wheel, click",function(e){if(!("pageX"in e)){var t=e.target.ownerDocument||Mt,n="BackCompat"===t.compatMode?t.body:t.documentElement;e.pageX=e.clientX+(n.scrollLeft>>0)-(n.clientLeft>>0),e.pageY=e.clientY+(n.scrollTop>>0)-(n.clientTop>>0)}})),Object.assign(Wt,c("keyup, keydown, keypress",function(e){null==e.which&&0===e.type.indexOf("key")&&(e.which=null!=e.charCode?e.charCode:e.keyCode)}));for(var Un in Tn)$t[Un]=$t[Un+"capture"]=Tn[Un]}Je(),setTimeout(Je,0),setTimeout(Je,100);return Rt.React&&Rt.React.options?Rt.React:Rt.React=Rt.ReactDOM={version:"2.0.0",render:De,hydrate:De,Fragment:rt,options:lt,PropTypes:tn,Children:xt,Component:ne,eventSystem:Kt,findDOMNode:Le,createClass:function(n){if(e("createClass"),!u(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)u(t[o])||console.error(o+" in "+e+" must be a function")}}),u(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new Ne(n));var o=m(Oe,{children:e});return r.child=o,o.superReturn=n,o},createElement:m,cloneElement:C,PureComponent:ue,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=Dt.indexOf(e);if(t>-1){var n=[];U(It[t],n),$(n),P(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){return e("unstable_renderSubtreeIntoContainer"),He(n,r,o,t&&t.context||{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}}}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return st[e]||(st[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===at.call(e)}function c(e,t){e+""===e&&(e=e.match(ut)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,u)}function y(e,t){var n=new h(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=_(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function _(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)ht=null;else{if(r<5){if(ht)return void(ht.text+=e);ht=e=y("#text",e+"")}else ht=null;var o=e.key;o&&!mt[".$"+o]?mt[".$"+o]=e:("."===t&&(t="."+vt),mt[t]=e),e.index=vt,e.return=n,yt&&(yt.sibling=e),yt=e,vt++,gt.push(e)}}function w(e,t){mt={},yt=null,gt=[];var n=t.vnode;if(void 0!==e){ht=null,vt=0,x(e,"",b,n);var r=gt[0];r&&(n.child=r),yt&&delete yt.sibling}return t.children=mt}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=k(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.call&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function k(e){if(f(e)>7){var t=_t&&e[_t]||e[bt];if(t&&t.call)return t}}function C(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=pt.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=C(s[u]));pt.currentOwner=o;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=m.apply(null,c);return pt.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=wt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=S(e,o,n,i);r.arr.push(C(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function O(e){return e}function S(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(kt,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return Ct[e]}function M(e){this.nodeName=e,this.style={},this.children=[]}function P(e){for(var t;t=e.firstChild;)P(t),e.removeChild(t)}function V(e){e&&(pt.nodeOperate=!0,1===e.nodeType?(Vt?e.textContent="":P(e),e.__events=null):3===e.nodeType&&Tt["#text"].length<100&&Tt["#text"].push(e),At.appendChild(e),At.removeChild(e),pt.nodeOperate=!1)}function A(e,t){var n,r=e.type;switch(r){case"#text":var o=Tt[r].pop();return o?(o.nodeValue=e.text,o):Mt.createTextNode(e.text);case"#comment":return Mt.createComment(e.text);case"svg":n=Nt.svg;break;case"math":n=Nt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,Mt.createElementNS(n,r)}catch(e){}return Mt.createElement(r)}function T(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(pt.nodeOperate=!0,n.insertBefore(o,i),pt.nodeOperate=!1)}}function U(e,t,n){if(e&&!e._disposed){if(lt.beforeDelete(e),e.isTop){var r=It.indexOf(e);-1!==r&&(It.splice(r,1),Dt.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&I(e,t,n),t.push({node:e.stateNode,vnode:e,transition:j}))}}function j(){delete this.vnode.stateNode,V(this.node)}function I(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)U(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function F(){if(Lt.length){var e=s(Lt).sort(H);e.forEach(function(e){delete e._dirty}),$(e)}}function W(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,Lt.push(e))}function $(e){lt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=pt.errorHook;if(n){var r,o,i,a=pt.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(u(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function X(e,t){Ft[e]||(Ft[e]=!0,Y(Mt,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function G(e){var t=Bt[e];return t||(t=e.slice(2).replace(zt,"").toLowerCase(),Bt[e]=t,t)}function Z(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function J(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)Jt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){pt.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=an[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Me(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ve(){return null}function Ae(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=je(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=pt.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Te(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ue(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function je(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function Ie(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=Ie(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=Dt.indexOf(t),i=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==o){if(i=It[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else Dt.push(t),o=Dt.length-1;pt.currentOwner=null;var l=m(Mn,{child:e});if(l.isTop=!0,It[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,u,c);else{var d=new Ne(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,Fe(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),$(u),e.stateNode}function Fe(e,t,n,r){for(var o,i=e.return.stateNode,s=ft(i.childNodes||ot),u=null,c=0;o=s[c++];)a(o.nodeName)===e.type?u=g(o):i.removeChild(o);u?Qe(u,e,t,n,r):We(e,t,n,r)}function We(e,t,n,r){if(lt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=A(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);$e(e,w(e.props.children,i),t,n,{}),i.init(n)}T(e,o),e.updater&&e.updater.props()}else new Ae(e,t).init(n,r)}function $e(e,t,n,r,o){for(var i in t)if(We(t[i],n,r,o),pt.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(lt.beforeUpdate(t),e.vtype<2)if(T(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[tt]?L(s,r):Xe(s,w(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(i.contextTypes?(c=je(n,i.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&pt.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(U(e,r),We(t,n,r,o))}function Xe(e,t,n,r,i,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)$e(n,t,r,i,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):U(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:pt.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(u=t[m],(s=p[m])?Qe(s,u,r,i,a):We(u,r,i,a),pt.errorHook)return}}function Ye(e){"value"!==e.propertyName||Pn||Ge(e.srcElement)}function Ge(e){var t=e.selectedIndex,n=void 0,r=void 0;t>-1&&(r=(n=e.options[t]).attributes.value,e.value=r&&r.specified?n.value:n.text)}function Ze(e){return!/native code/.test(e)}function Je(){Ze(Object.keys)&&(Object.keys=function(e){var t=[];for(var n in e)nt.call(e,n)&&t.push(n);return t})}var Ke="function"==typeof Symbol&&Symbol.for,et=Ke?Symbol.for("react.element"):60103,tt="dangerouslySetInnerHTML",nt=Object.prototype.hasOwnProperty,rt=Ke?Symbol.for("react.fragment"):60107,ot=[],it={},at=Object.prototype.toString,st={},ut=/[^, ]+/g,ct=/[-_][^-_]/g,lt=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),dt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},ft=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){Mt["__"+e]||(Mt["__"+e]=!0,X(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){$t[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=Z(n);if(!r||r!==e&&!J(e,r)){var o=K(e,r);q(n,t,o)}}))}}),qt&&($t.click=$t.clickcapture=function(e){e.onclick=e.onclick||o});var Yt=ee("change"),Gt=ee("doubleclick"),Zt=ee("scroll");$t.changecapture=$t.change=function(e){/text|password/.test(e.type)&&Y(Mt,"input",Yt)},$t.scrollcapture=$t.scroll=function(e){Y(e,"scroll",Zt)},$t.doubleclick=$t.doubleclickcapture=function(){Y(Mt,"dblclick",Gt)};var Jt=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Kt=t({eventPropHooks:Wt,eventHooks:$t,eventLowerCache:Bt,isEventName:B,isTouch:qt,dispatchEvent:q,addGlobalEvent:X,addEvent:Y,getBrowserName:G,createHandle:ee,SyntheticEvent:te}),en=function e(){return e};en.isRequired=en;var tn={array:en,bool:en,func:en,number:en,object:en,string:en,any:en,arrayOf:en,element:en,instanceOf:en,node:en,objectOf:en,oneOf:en,oneOfType:en,shape:en},nn={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||nn).isMounted()},setState:function(e,t){(this.updater||nn).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||nn).enqueueSetState(!0,e)},render:function(){}};var rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},an={getInitialState:1,getDefaultProps:1,getChildContext:1},sn=i(ue,ne);sn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},sn.isPureComponent=!0;var un={select:1,textarea:1,input:1,option:1},cn={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},ln=/^-?\d+(\.\d+)?$/,dn=c("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),fn=["","-webkit-","-o-","-moz-","-ms-"],pn=c("float","cssFloat"),hn={},vn=/checked|radio/,mn={set:function(e){var t=vn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};hn.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,mn)}catch(e){}};var yn={value:1,checked:1},gn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},_n={},bn={},wn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},xn={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},kn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],Cn=/[a-z][A-Z]/,Nn=_e("-"),On=_e(":"),Sn={className:1,title:1,name:1,type:1,alt:1,lang:1},En=/textarea|input|select/i,Rn={innerHTML:o,defaultValue:Ce,defaultChecked:Ce,children:o,style:function(e,t,n,r){me(e,r.style||it,n||it)},autoFocus:function(e){(Pt[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](Nt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!yn[t])try{n||0===n?e[t]=n:(Sn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var u=G(t),c=$t[u];X(u),c&&c(e,u)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),un[n]&&ce(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,pt.fireRef(e,t)},dispose:function(){var e=this.vnode;pt.fireRef(e,null)}};Ae.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),Mt.__async)W(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),$([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(c>5&&(s=Ue(r,o)),i=w(u,this)):(this.children=i,delete this.child);pt.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=pt.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete pt.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?lt.afterUpdate(t):lt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(pt.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Te.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Te.call(this,e)},dispose:function(){var e=this.instance;lt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;pt.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var Mn=function(){ne.call(this)};i(Mn,ne).render=function(){return this.props.child},pt.diffChildren=Xe;var Pn=!1,Vn=ee("change",function(e){var t=e.srcElement;if("select-one"===t.type&&(t.__bindFixValueFn||(Y(t,"propertychange",Ye),t.__bindFixValueFn=!0),Pn=!0,Ge(t),Pn=!1),"propertychange"===e.type)return"value"===e.propertyName}),An=ee("input",function(e){return"value"===e.propertyName}),Tn={input:function(e){Y(e,"propertychange",An)},change:function(e){Y(e,/radio|check/.test(e.type)?"click":/text|password/.test(e.type)?"propertychange":"change",Vn)},submit:function(e){"FORM"===e.nodeName&&Y(e,"submit",q)}};if(jt<9){Rn[tt]=function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;if(i!==o){e.innerHTML=String.fromCharCode(65279)+i;var a=e.firstChild;1===a.data.length?e.removeChild(a):a.deleteData(0,1)}},jt<8&&(hn.observe=o),String("focus,blur").replace(/\w+/g,function(e){$t[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"focus"===t?"focusin":"focusout",function(n){var r=n.srcElement.tagName;if(r){var o=a(r);"#document"!=o&&"body"!=o&&(n.target=e,q(n,t,e.parentNode))}}))}}),Object.assign(Wt,c("mousemove, mouseout,mouseenter, mouseleave, mouseout,mousewheel, mousewheel, wheel, click",function(e){if(!("pageX"in e)){var t=e.target.ownerDocument||Mt,n="BackCompat"===t.compatMode?t.body:t.documentElement;e.pageX=e.clientX+(n.scrollLeft>>0)-(n.clientLeft>>0),e.pageY=e.clientY+(n.scrollTop>>0)-(n.clientTop>>0)}})),Object.assign(Wt,c("keyup, keydown, keypress",function(e){null==e.which&&0===e.type.indexOf("key")&&(e.which=null!=e.charCode?e.charCode:e.keyCode)}));for(var Un in Tn)$t[Un]=$t[Un+"capture"]=Tn[Un]}Je(),setTimeout(Je,0),setTimeout(Je,100);return Rt.React&&Rt.React.options?Rt.React:Rt.React=Rt.ReactDOM={version:"2.0.1",render:De,hydrate:De,Fragment:rt,options:lt,PropTypes:tn,Children:xt,Component:ne,eventSystem:Kt,findDOMNode:Le,createClass:function(n){if(e("createClass"),!u(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)u(t[o])||console.error(o+" in "+e+" must be a function")}}),u(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new Ne(n));var o=m(Oe,{children:e});return r.child=o,o.superReturn=n,o},createElement:m,cloneElement:C,PureComponent:ue,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=Dt.indexOf(e);if(t>-1){var n=[];U(It[t],n),$(n),P(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){e("unstable_renderSubtreeIntoContainer");var i=t&&t.updater;return He(n,r,o,i?i.parentContext:{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}}}); \ No newline at end of file diff --git a/dist/ReactSelection.js b/dist/ReactSelection.js index d020edc..cb84817 100644 --- a/dist/ReactSelection.js +++ b/dist/ReactSelection.js @@ -1,5 +1,5 @@ /** - * 此版本带有selection by 司徒正美 Copyright 2018-01-23 + * Maintained by YMFE Copyright 2018-01-26 * IE9+ */ @@ -411,7 +411,7 @@ function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); @@ -2749,7 +2749,8 @@ function render(vnode, container, callback) { //[Top API] ReactDOM.unstable_renderSubtreeIntoContainer function unstable_renderSubtreeIntoContainer(lastVnode, nextVnode, container, callback) { deprecatedWarn("unstable_renderSubtreeIntoContainer"); - var parentContext = lastVnode && lastVnode.context || {}; + var updater = lastVnode && lastVnode.updater; + var parentContext = updater ? updater.parentContext : {}; return renderByAnu(nextVnode, container, callback, parentContext); } //[Top API] ReactDOM.unmountComponentAtNode @@ -3076,7 +3077,7 @@ function diffChildren(lastChildren, nextChildren, parentVnode, parentContext, up Refs.diffChildren = diffChildren; var React = { - version: "2.0.0", + version: "2.0.1", render: render, hydrate: render, options: options, diff --git a/dist/ReactSelection.min.js b/dist/ReactSelection.min.js index d457cb7..51d760d 100644 --- a/dist/ReactSelection.min.js +++ b/dist/ReactSelection.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return ft[e]||(ft[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function c(e){return"[object Function]"===dt.call(e)}function u(e,t){e+""===e&&(e=e.match(pt)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,c)}function y(e,t){var n=new h(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=_(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function _(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)_t=null;else{if(r<5){if(_t)return void(_t.text+=e);_t=e=y("#text",e+"")}else _t=null;var o=e.key;o&&!wt[".$"+o]?wt[".$"+o]=e:("."===t&&(t="."+bt),wt[t]=e),e.index=bt,e.return=n,xt&&(xt.sibling=e),xt=e,bt++,Ct.push(e)}}function w(e,t){wt={},xt=null,Ct=[];var n=t.vnode;if(void 0!==e){_t=null,bt=0,x(e,"",b,n);var r=Ct[0];r&&(n.child=r),xt&&delete xt.sibling}return t.children=wt}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=C(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function C(e){if(f(e)>7){var t=St&&e[St]||e[Nt];if(t&&t.call)return t}}function S(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=gt.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var c in s)"children"!==c&&s[c]&&s[c].$$typeof&&(s[c]=S(s[c]));gt.currentOwner=o;var u=[].slice.call(arguments,0),l=u.length;u[0]=e.type,u[1]=s,2===l&&s.children&&(delete s.children._disposed,u.push(s.children));var d=m.apply(null,u);return gt.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=kt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=O(e,o,n,i);r.arr.push(S(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function k(e){return e}function O(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(Et,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return Rt[e]}function P(e){this.nodeName=e,this.style={},this.children=[]}function M(e){for(var t;t=e.firstChild;)M(t),e.removeChild(t)}function A(e){e&&(gt.nodeOperate=!0,1===e.nodeType?(Lt?e.textContent="":M(e),e.__events=null):3===e.nodeType&&Wt["#text"].length<100&&Wt["#text"].push(e),Ht.appendChild(e),Ht.removeChild(e),gt.nodeOperate=!1)}function T(e,t){var n,r=e.type;switch(r){case"#text":var o=Wt[r].pop();return o?(o.nodeValue=e.text,o):jt.createTextNode(e.text);case"#comment":return jt.createComment(e.text);case"svg":n=Pt.svg;break;case"math":n=Pt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,jt.createElementNS(n,r)}catch(e){}return jt.createElement(r)}function V(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(gt.nodeOperate=!0,n.insertBefore(o,i),gt.nodeOperate=!1)}}function U(e,t,n){if(e&&!e._disposed){if(vt.beforeDelete(e),e.isTop){var r=Bt.indexOf(e);-1!==r&&(Bt.splice(r,1),qt.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&j(e,t,n),t.push({node:e.stateNode,vnode:e,transition:I}))}}function I(){delete this.vnode.stateNode,A(this.node)}function j(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)U(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function W(){if(zt.length){var e=s(zt).sort(H);e.forEach(function(e){delete e._dirty}),F(e)}}function $(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,zt.push(e))}function F(e){vt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=gt.errorHook;if(n){var r,o,i,a=gt.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(c(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function G(e,t){Gt[e]||(Gt[e]=!0,Y(jt,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function Z(e){var t=Jt[e];return t||(t=e.slice(2).replace(Kt,"").toLowerCase(),Jt[e]=t,t)}function J(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function X(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)an[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){gt.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=pn[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Pe(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ae(){return null}function Te(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Ie(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=gt.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Ve(e){var t,n=this._nextCallbacks;if(n&&n.length){do{c(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ue(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Ie(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function je(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=je(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=qt.indexOf(t),i=void 0,a=void 0,s=void 0,c=[],u={};if(-1!==o){if(i=Bt[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else qt.push(t),o=qt.length-1;gt.currentOwner=null;var l=m(jn,{child:e});if(l.isTop=!0,Bt[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,c,u);else{var d=new Ne(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,We(l,r,c,u)}return a.updater.init(c),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),F(c),e.stateNode}function We(e,t,n,r){for(var o,i=e.return.stateNode,s=yt(i.childNodes||ut),c=null,u=0;o=s[u++];)a(o.nodeName)===e.type?c=g(o):i.removeChild(o);c?Qe(c,e,t,n,r):$e(e,t,n,r)}function $e(e,t,n,r){if(vt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=T(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);Fe(e,w(e.props.children,i),t,n,{}),i.init(n)}V(e,o),e.updater&&e.updater.props()}else new Te(e,t).init(n,r)}function Fe(e,t,n,r,o){for(var i in t)if($e(t[i],n,r,o),gt.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(vt.beforeUpdate(t),e.vtype<2)if(V(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,c=t.props;c[at]?L(s,r):Ge(s,w(c.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,c=e!==t,u=void 0;if(i.contextTypes?(u=Ie(n,i.contextTypes),c=!0):u=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=u,s.willReceive=c,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,u]),s._hasError)return;delete s._receiving,e.ref!==t.ref&>.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(U(e,r),$e(t,n,r,o))}function Ge(e,t,n,r,i,a){var s=void 0,c=void 0,u=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(u=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(u)Fe(n,t,r,i,a);else{var p={},h=[];for(var v in e)c=t[v],s=e[v],c&&c.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==c.ref&&(s.order=c.index,h.push(s))):U(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:gt.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(c=t[m],(s=p[m])?Qe(s,c,r,i,a):$e(c,r,i,a),gt.errorHook)return}}function Ye(e){return!!Ut&&Ze(jt.documentElement,e)}function Ze(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function Je(e){try{e.focus()}catch(e){}}function Xe(e){return e.nodeName?e.nodeName.toLowerCase():""}function Ke(e){if(void 0===(e=e||(Ut?jt:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function et(e,t,n,r){return e===n&&t===r}function tt(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nt(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function rt(e,t){for(var n=tt(e),r=0,o=0;n;){if(3===n.nodeType){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=tt(nt(n))}}var ot="function"==typeof Symbol&&Symbol.for,it=ot?Symbol.for("react.element"):60103,at="dangerouslySetInnerHTML",st=Object.prototype.hasOwnProperty,ct=ot?Symbol.for("react.fragment"):60107,ut=[],lt={},dt=Object.prototype.toString,ft={},pt=/[^, ]+/g,ht=/[-_][^-_]/g,vt=u(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),mt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},yt=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){jt["__"+e]||(jt["__"+e]=!0,G(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Zt[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=J(n);if(!r||r!==e&&!X(e,r)){var o=K(e,r);q(n,t,o)}}))}}),Xt&&(Zt.click=Zt.clickcapture=function(e){e.onclick=e.onclick||o});var nn=ee("change"),rn=ee("doubleclick"),on=ee("scroll");Zt.changecapture=Zt.change=function(e){/text|password/.test(e.type)&&Y(jt,"input",nn)},Zt.scrollcapture=Zt.scroll=function(e){Y(e,"scroll",on)},Zt.doubleclick=Zt.doubleclickcapture=function(){Y(jt,"dblclick",rn)};var an=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},sn=t({eventPropHooks:Yt,eventHooks:Zt,eventLowerCache:Jt,isEventName:B,isTouch:Xt,dispatchEvent:q,addGlobalEvent:G,addEvent:Y,getBrowserName:Z,createHandle:ee,SyntheticEvent:te}),cn=function e(){return e};cn.isRequired=cn;var un={array:cn,bool:cn,func:cn,number:cn,object:cn,string:cn,any:cn,arrayOf:cn,element:cn,instanceOf:cn,node:cn,objectOf:cn,oneOf:cn,oneOfType:cn,shape:cn},ln={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||ln).isMounted()},setState:function(e,t){(this.updater||ln).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||ln).enqueueSetState(!0,e)},render:function(){}};var dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fn={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},pn={getInitialState:1,getDefaultProps:1,getChildContext:1},hn=i(ce,ne);hn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},hn.isPureComponent=!0;var vn={select:1,textarea:1,input:1,option:1},mn={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},yn=/^-?\d+(\.\d+)?$/,gn=u("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),_n=["","-webkit-","-o-","-moz-","-ms-"],bn=u("float","cssFloat"),wn={},xn=/checked|radio/,Cn={set:function(e){var t=xn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};wn.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,Cn)}catch(e){}};var Sn={value:1,checked:1},Nn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},kn={},On={},En={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},Rn={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},Pn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],Mn=/[a-z][A-Z]/,An=_e("-"),Tn=_e(":"),Vn={className:1,title:1,name:1,type:1,alt:1,lang:1},Un=/textarea|input|select/i,In={innerHTML:o,defaultValue:Se,defaultChecked:Se,children:o,style:function(e,t,n,r){me(e,r.style||lt,n||lt)},autoFocus:function(e){(Dt[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](Pt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!Sn[t])try{n||0===n?e[t]=n:(Vn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var c=Z(t),u=Zt[c];G(c),u&&u(e,c)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),vn[n]&&ue(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,gt.fireRef(e,t)},dispose:function(){var e=this.vnode;gt.fireRef(e,null)}};Te.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(c(t)&&this._pendingCallbacks.push(t),jt.__async)$(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),F([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(u>5&&(s=Ue(r,o)),i=w(c,this)):(this.children=i,delete this.child);gt.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=gt.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete gt.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?vt.afterUpdate(t):vt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(gt.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Ve.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Ve.call(this,e)},dispose:function(){var e=this.instance;vt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;gt.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var jn=function(){ne.call(this)};i(jn,ne).render=function(){return this.props.child},gt.diffChildren=Ge;var Dn={version:"2.0.0",render:De,hydrate:De,options:vt,PropTypes:un,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new Ne(n));var o=m(ke,{children:e});return r.child=o,o.superReturn=n,o},Children:Ot,Component:ne,eventSystem:sn,findDOMNode:Le,createClass:function(n){if(e("createClass"),!c(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)c(t[o])||console.error(o+" in "+e+" must be a function")}}),c(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createElement:m,cloneElement:S,PureComponent:ce,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=qt.indexOf(e);if(t>-1){var n=[];U(Bt[t],n),F(n),M(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){return e("unstable_renderSubtreeIntoContainer"),He(n,r,o,t&&t.context||{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}},Ln={hasSelectionCapabilities:function(e){var t=Xe(e||{});return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=Ke();return{focusedElem:e,selectionRange:Ln.hasSelectionCapabilities(e)?Ln.getSelection(e):null}},restoreSelection:function(e){var t=Ke(),n=e.focusedElem,r=e.selectionRange;t&&Ye(n)&&(Ln.hasSelectionCapabilities(n)&&Ln.setSelection(n,r),Je(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(jt.selection&&"input"===Xe(e)){var n=jt.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=Wn.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(jt.selection&&"input"===Xe(e)){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.select()}else Wn.setOffsets(e,t)}},Hn=Ut&&"selection"in jt&&!("getSelection"in It),Wn={getOffsets:Hn?function(e){var t=jt.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=It.getSelection&&It.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,a=t.getRangeAt(0);try{a.startContainer.nodeType,a.endContainer.nodeType}catch(e){return null}var s=et(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:a.toString().length,c=a.cloneRange();c.selectNodeContents(e),c.setEnd(a.startContainer,a.startOffset);var u=et(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,l=u+s,d=jt.createRange();d.setStart(n,r),d.setEnd(o,i);var f=d.collapsed;return{start:f?l:u,end:f?u:l}},setOffsets:Hn?function(e,t){var n,r,o=jt.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(It.getSelection){var n=It.getSelection(),r=e.textContent.length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=rt(e,o),c=rt(e,i);if(s&&c){var u=jt.createRange();u.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(u),n.extend(c.node,c.offset)):(u.setEnd(c.node,c.offset),n.addRange(u))}}}},$n={},Fn={beforePatch:function(){var e=Ln.getSelectionInformation();$n=e.focusedElem&&e.selectionRange?e:{}},afterPatch:function(){Ln.restoreSelection($n)}};for(var Bn in Fn)!function(e,t,n,r){e[t]=n?function(e){r(e),n(e)}:r}(vt,Bn,vt[Bn],Fn[Bn]);return It.React=It.ReactDOM=Dn,Dn}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function o(){}function i(e,n){function r(){}var o=e.prototype;r.prototype=n.prototype;var i=e.prototype=new r;return t(i,o),i.constructor=e,i}function a(e){return ft[e]||(ft[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function c(e){return"[object Function]"===dt.call(e)}function u(e,t){e+""===e&&(e=e.match(pt)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;o2?n-2:0),o=2;o1&&(i.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===i[p]&&(i[p]=f[p]);return new h(e,a,i,s,c)}function y(e,t){var n=new h(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new h(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=_(e)}else t=y(n,e.nodeValue);return t.stateNode=e,t}function _(e){for(var t,n=e.attributes,r={},o=0;t=n[o++];)if(t.specified){var i=t.name;"class"===i&&(i="className"),r[i]=t.value}return r}function b(e,t,n){var r=f(e);if(r<3)_t=null;else{if(r<5){if(_t)return void(_t.text+=e);_t=e=y("#text",e+"")}else _t=null;var o=e.key;o&&!wt[".$"+o]?wt[".$"+o]=e:("."===t&&(t="."+bt),wt[t]=e),e.index=bt,e.return=n,xt&&(xt.sibling=e),xt=e,bt++,Ct.push(e)}}function w(e,t){wt={},xt=null,Ct=[];var n=t.vnode;if(void 0!==e){_t=null,bt=0,x(e,"",b,n);var r=Ct[0];r&&(n.child=r),xt&&delete xt.sibling}return t.children=wt}function x(e,t,n,r){var o;if(e){if(e.forEach)return void e.forEach(function(e,o){x(e,t?t+":"+o:"."+o,n,r)});if(o=C(e)){for(var i,a=o.call(e),s=0;!(i=a.next()).done;)x(i.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.call&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function C(e){if(f(e)>7){var t=St&&e[St]||e[Nt];if(t&&t.call)return t}}function S(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var o=e._owner,i=gt.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,o=i):e._hasRef&&(s.ref=e.ref)):s=a;for(var c in s)"children"!==c&&s[c]&&s[c].$$typeof&&(s[c]=S(s[c]));gt.currentOwner=o;var u=[].slice.call(arguments,0),l=u.length;u[0]=e.type,u[1]=s,2===l&&s.children&&(delete s.children._disposed,u.push(s.children));var d=m.apply(null,u);return gt.currentOwner=i,d}function N(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=kt[0],o=r.callback.call(r.context,e,r.index),i=r.index;if(r.index++,!r.isEach&&null!=o)if(o.vtype){var a=O(e,o,n,i);r.arr.push(S(o,{key:a}))}else o.type?r.arr.push(t({},o)):r.arr.push(o)}function k(e){return e}function O(e,t,n,r){var o=t&&null!=t.key?E(t.key):null,i=e&&null!=e.key?E(e.key):null,a=void 0;return i&&o?(a=n+"$"+i,i!==o&&(a=o+"/"+a)):a=(a=o||i)?n+"$"+a:"."===n?n+r:n,a.replace(Et,"$")}function E(e){return String(e).replace(/[=:]/g,R)}function R(e){return Rt[e]}function P(e){this.nodeName=e,this.style={},this.children=[]}function M(e){for(var t;t=e.firstChild;)M(t),e.removeChild(t)}function A(e){e&&(gt.nodeOperate=!0,1===e.nodeType?(Lt?e.textContent="":M(e),e.__events=null):3===e.nodeType&&Wt["#text"].length<100&&Wt["#text"].push(e),Ht.appendChild(e),Ht.removeChild(e),gt.nodeOperate=!1)}function T(e,t){var n,r=e.type;switch(r){case"#text":var o=Wt[r].pop();return o?(o.nodeValue=e.text,o):jt.createTextNode(e.text);case"#comment":return jt.createComment(e.text);case"svg":n=Pt.svg;break;case"math":n=Pt.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,jt.createElementNS(n,r)}catch(e){}return jt.createElement(r)}function V(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var o=e.stateNode,i=t?t.nextSibling:n.firstChild;i!==o&&(gt.nodeOperate=!0,n.insertBefore(o,i),gt.nodeOperate=!1)}}function U(e,t,n){if(e&&!e._disposed){if(vt.beforeDelete(e),e.isTop){var r=Bt.indexOf(e);-1!==r&&(Bt.splice(r,1),qt.splice(r,1))}e._disposed=!0,e.superReturn&&delete e.superReturn.stateNode.__events,e.vtype>1?D(e,t,n):(1===e.vtype&&j(e,t,n),t.push({node:e.stateNode,vnode:e,transition:I}))}}function I(){delete this.vnode.stateNode,A(this.node)}function j(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),L(r.children,t,n)}function D(e,t,n){var r=e.stateNode;if(r){var o=r.updater;r.isPortal&&(o.updateQueue=t),n?o.isMounted()&&(1===n&&(o._states.length=0),o.addState("dispose"),t.push(o)):(o.addState("dispose"),t.push(o)),o.insertQueue=o.insertPoint=NaN,L(o.children,t,n)}}function L(e,t,n){for(var r in e)U(e[r],t,n)}function H(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function W(){if(zt.length){var e=s(zt).sort(H);e.forEach(function(e){delete e._dirty}),F(e)}}function $(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,zt.push(e))}function F(e){vt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=gt.errorHook;if(n){var r,o,i,a=gt.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,i=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var o=r.__events,i=o.child||o.vnode;do{if(1===i.vtype){var a=i.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(i=i.return);return n}function Q(e,t,n){for(var r=e.length;r--;){var o=e[r],i=o.events[t];if(c(i)&&(n.currentTarget=o.dom,i.call(void 0,n),n._stopPropagation))break}}function G(e,t){Gt[e]||(Gt[e]=!0,Y(jt,e,q,t))}function Y(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function Z(e){var t=Jt[e];return t||(t=e.slice(2).replace(Kt,"").toLowerCase(),Jt[e]=t,t)}function J(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function X(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function K(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var o=0,i=t;i;i=i.parentNode)o++;for(;n-o>0;)e=e.parentNode,n--;for(;o-n>0;)t=t.parentNode,o--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function ee(e,t){return function(n){t&&!1===t(n)||q(n,e)}}function te(e){if(e.nativeEvent)return e;for(var t in e)an[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function ne(e,t){gt.currentOwner=this,this.context=t,this.props=e,this.refs={},this.state=null}function re(e){for(var t={},n=0;n1?function(){for(var n={},r=void 0,o=pn[e],i=0;i 的value应该对应一个字符串数组')}for(var i=0;i1?(i=o.displayName||o.name,t.push(i),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Pe(r):a||e===n||(a=r))):1===s.vtype&&t.push(o)}while(s=s.return)}function Ae(){return null}function Te(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Ie(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=gt.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Ve(e){var t,n=this._nextCallbacks;if(n&&n.length){do{c(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ue(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Ie(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function je(e){var t=[];for(var n in e){var r=e[n],o=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var i=o.updater;if(r.child){var a=je(i.children);t.push.apply(t,a)}}}return t}function De(e,t,n){return He(e,t,n)}function Le(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Le(t.stateNode):null}}function He(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var o=qt.indexOf(t),i=void 0,a=void 0,s=void 0,c=[],u={};if(-1!==o){if(i=Bt[o],(s=i.stateNode.updater)._hydrating)return s._pendingCallbacks.push(He.bind(null,e,t,n,r)),i.child.stateNode}else qt.push(t),o=qt.length-1;gt.currentOwner=null;var l=m(jn,{child:e});if(l.isTop=!0,Bt[o]=l,i)(a=l.return=i.return).child=l,Qe(i,l,r,c,u);else{var d=new Ne(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,We(l,r,c,u)}return a.updater.init(c),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),F(c),e.stateNode}function We(e,t,n,r){for(var o,i=e.return.stateNode,s=yt(i.childNodes||ut),c=null,u=0;o=s[u++];)a(o.nodeName)===e.type?c=g(o):i.removeChild(o);c?Qe(c,e,t,n,r):$e(e,t,n,r)}function $e(e,t,n,r){if(vt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=T(e,e.return);var o=r.dom;if(r.dom=e.stateNode,1===e.vtype){var i=new Ne(e);Fe(e,w(e.props.children,i),t,n,{}),i.init(n)}V(e,o),e.updater&&e.updater.props()}else new Te(e,t).init(n,r)}function Fe(e,t,n,r,o){for(var i in t)if($e(t[i],n,r,o),gt.errorHook)break}function Be(e,t,n,r,o){var i=t.stateNode=e.stateNode;if(vt.beforeUpdate(t),e.vtype<2)if(V(t,o.dom),o.dom=i,0===e.vtype)t.text!==e.text&&(i.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,c=t.props;c[at]?L(s,r):Ge(s,w(c.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else qe(e,t,n,r,o)}function qe(e,t,n,r,o){var i=e.type,a=e.stateNode,s=a.updater,c=e!==t,u=void 0;if(i.contextTypes?(u=Ie(n,i.contextTypes),c=!0):u=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=o,s.parentContext=n,s.pendingVnode=t,s.context=u,s.willReceive=c,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ee(a,"componentWillReceiveProps",[t.props,u]),s._hasError)return;delete s._receiving,e.ref!==t.ref&>.fireRef(e,null),s.hydrate(r,!0)}}function ze(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Qe(e,t,n,r,o){ze(e,t)?Be(e,t,n,r,o):(U(e,r),$e(t,n,r,o))}function Ge(e,t,n,r,i,a){var s=void 0,c=void 0,u=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(u=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(u)Fe(n,t,r,i,a);else{var p={},h=[];for(var v in e)c=t[v],s=e[v],c&&c.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==c.ref&&(s.order=c.index,h.push(s))):U(s,i);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){i.push({transition:gt.fireRef.bind(null,e,null),isMounted:o})});for(var m in t)if(c=t[m],(s=p[m])?Qe(s,c,r,i,a):$e(c,r,i,a),gt.errorHook)return}}function Ye(e){return!!Ut&&Ze(jt.documentElement,e)}function Ze(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function Je(e){try{e.focus()}catch(e){}}function Xe(e){return e.nodeName?e.nodeName.toLowerCase():""}function Ke(e){if(void 0===(e=e||(Ut?jt:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function et(e,t,n,r){return e===n&&t===r}function tt(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nt(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function rt(e,t){for(var n=tt(e),r=0,o=0;n;){if(3===n.nodeType){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=tt(nt(n))}}var ot="function"==typeof Symbol&&Symbol.for,it=ot?Symbol.for("react.element"):60103,at="dangerouslySetInnerHTML",st=Object.prototype.hasOwnProperty,ct=ot?Symbol.for("react.fragment"):60107,ut=[],lt={},dt=Object.prototype.toString,ft={},pt=/[^, ]+/g,ht=/[-_][^-_]/g,vt=u(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],o),mt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},yt=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new te(t)).type="wheel",t.deltaY=r,q(t)})},"blur,focus".replace(/\w+/g,function(e){jt["__"+e]||(jt["__"+e]=!0,G(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Zt[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,Y(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=J(n);if(!r||r!==e&&!X(e,r)){var o=K(e,r);q(n,t,o)}}))}}),Xt&&(Zt.click=Zt.clickcapture=function(e){e.onclick=e.onclick||o});var nn=ee("change"),rn=ee("doubleclick"),on=ee("scroll");Zt.changecapture=Zt.change=function(e){/text|password/.test(e.type)&&Y(jt,"input",nn)},Zt.scrollcapture=Zt.scroll=function(e){Y(e,"scroll",on)},Zt.doubleclick=Zt.doubleclickcapture=function(){Y(jt,"dblclick",rn)};var an=te.prototype={fixEvent:o,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:o,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:o,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},sn=t({eventPropHooks:Yt,eventHooks:Zt,eventLowerCache:Jt,isEventName:B,isTouch:Xt,dispatchEvent:q,addGlobalEvent:G,addEvent:Y,getBrowserName:Z,createHandle:ee,SyntheticEvent:te}),cn=function e(){return e};cn.isRequired=cn;var un={array:cn,bool:cn,func:cn,number:cn,object:cn,string:cn,any:cn,arrayOf:cn,element:cn,instanceOf:cn,node:cn,objectOf:cn,oneOf:cn,oneOfType:cn,shape:cn},ln={enqueueSetState:n,isMounted:n};ne.prototype={constructor:ne,replaceState:function(){e("replaceState")},isReactComponent:r,isMounted:function(){return e("isMounted"),(this.updater||ln).isMounted()},setState:function(e,t){(this.updater||ln).enqueueSetState(e,t)},forceUpdate:function(e){(this.updater||ln).enqueueSetState(!0,e)},render:function(){}};var dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fn={render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},pn={getInitialState:1,getDefaultProps:1,getChildContext:1},hn=i(ce,ne);hn.shouldComponentUpdate=function(e,t){var n=se(this.props,e),r=se(this.state,t);return!n||!r},hn.isPureComponent=!0;var vn={select:1,textarea:1,input:1,option:1},mn={1:["value",{onChange:1,onInput:1,readOnly:1,disabled:1},function(e){return null==e?null:e+""},function(e,t,n){if(null!=t){if("input"===n.type&&(e.setAttribute("value",t),"number"===e.type)){var r=parseFloat(e.value)||0;if(t==r&&(t!=r||e.value==t))return;t+=""}e._persistValue!==t&&(e._persistValue=e.value=t)}},de,"change","input"],2:["checked",{onChange:1,onClick:1,readOnly:1,disabled:1},function(e){return!!e},function(e,t,n){null!=n.props.value&&(e.value=n.props.value),e._persistValue!==t&&(e._persistValue=e.checked=t)},de,"change","click"],3:["value",{onChange:1,disabled:1},function(e){return e},function(e,t,n,r){r?e.multiple||e.value===e._persistValue||(e._persistValue=e.value,e._setValue=!1):"value"in n.props&&(e._persistValue=t),fe({target:e})},fe,"change"]},yn=/^-?\d+(\.\d+)?$/,gn=u("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),_n=["","-webkit-","-o-","-moz-","-ms-"],bn=u("float","cssFloat"),wn={},xn=/checked|radio/,Cn={set:function(e){var t=xn.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};wn.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,Cn)}catch(e){}};var Sn={value:1,checked:1},Nn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},kn={},On={},En={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},Rn={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},Pn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],Mn=/[a-z][A-Z]/,An=_e("-"),Tn=_e(":"),Vn={className:1,title:1,name:1,type:1,alt:1,lang:1},Un=/textarea|input|select/i,In={innerHTML:o,defaultValue:Se,defaultChecked:Se,children:o,style:function(e,t,n,r){me(e,r.style||lt,n||lt)},autoFocus:function(e){(Dt[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",o=be(t);if(o.ifSpecial){var i=o.name.split(":")[0];e[r+"NS"](Pt[i],o.name,n||"")}else e[r](o,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!Sn[t])try{n||0===n?e[t]=n:(Vn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,o){var i=e.__events||(e.__events={});i.vnode=o;var s=a(t.slice(2));if(!1===n)delete i[s];else{if(!r[t]){var c=Z(t),u=Zt[c];G(c),u&&u(e,c)}i[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var o=r[t]&&r[t].__html,i=n&&n.__html;i!==o&&(e.innerHTML=i)}};Ne.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;we(t,e.lastProps||{},r,e),vn[n]&&ue(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,gt.fireRef(e,t)},dispose:function(){var e=this.vnode;gt.fireRef(e,null)}};Te.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(c(t)&&this._pendingCallbacks.push(t),jt.__async)$(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),F([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,o=e.state;if(0===r)return o;for(var i=t({},o),a=0;a2?(u>5&&(s=Ue(r,o)),i=w(c,this)):(this.children=i,delete this.child);gt.diffChildren(a,i,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,o=this.isMounted();o||(this.isMounted=r);var i=gt.focusNode;if(i){try{i.focus(),i.__inner__=!0}catch(e){}delete gt.focusNode}this._hydrating&&(Ee(t,o?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),o?vt.afterUpdate(t):vt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(gt.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Ve.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Ve.call(this,e)},dispose:function(){var e=this.instance;vt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;gt.fireRef(t,null),Ee(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var jn=function(){ne.call(this)};i(jn,ne).render=function(){return this.props.child},gt.diffChildren=Ge;var Dn={version:"2.0.1",render:De,hydrate:De,options:vt,PropTypes:un,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new Ne(n));var o=m(ke,{children:e});return r.child=o,o.superReturn=n,o},Children:Ot,Component:ne,eventSystem:sn,findDOMNode:Le,createClass:function(n){if(e("createClass"),!c(n.render))throw"请实现render方法";var r=ae(n.displayName||"Component",n),o=i(r,ne);return n.mixins&&ie(n,re(n.mixins)),t(o,n),n.statics&&t(r,n.statics),"propTypes,contextTypes,childContextTypes,displayName".replace(/\w+/g,function(e){if(n[e]){var t=r[e]=n[e];if("displayName"!==e)for(var o in t)c(t[o])||console.error(o+" in "+e+" must be a function")}}),c(n.getDefaultProps)&&(r.defaultProps=n.getDefaultProps()),r},createElement:m,cloneElement:S,PureComponent:ce,isValidElement:function(e){return e&&e.vtype},unmountComponentAtNode:function(e){var t=qt.indexOf(e);if(t>-1){var n=[];U(Bt[t],n),F(n),M(e),e.__component=null}},unstable_renderSubtreeIntoContainer:function(t,n,r,o){e("unstable_renderSubtreeIntoContainer");var i=t&&t.updater;return He(n,r,o,i?i.parentContext:{})},createFactory:function(e){console.warn("createFactory is deprecated");var t=m.bind(null,e);return t.type=e,t}},Ln={hasSelectionCapabilities:function(e){var t=Xe(e||{});return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=Ke();return{focusedElem:e,selectionRange:Ln.hasSelectionCapabilities(e)?Ln.getSelection(e):null}},restoreSelection:function(e){var t=Ke(),n=e.focusedElem,r=e.selectionRange;t&&Ye(n)&&(Ln.hasSelectionCapabilities(n)&&Ln.setSelection(n,r),Je(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(jt.selection&&"input"===Xe(e)){var n=jt.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=Wn.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(jt.selection&&"input"===Xe(e)){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.select()}else Wn.setOffsets(e,t)}},Hn=Ut&&"selection"in jt&&!("getSelection"in It),Wn={getOffsets:Hn?function(e){var t=jt.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=It.getSelection&&It.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,a=t.getRangeAt(0);try{a.startContainer.nodeType,a.endContainer.nodeType}catch(e){return null}var s=et(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:a.toString().length,c=a.cloneRange();c.selectNodeContents(e),c.setEnd(a.startContainer,a.startOffset);var u=et(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,l=u+s,d=jt.createRange();d.setStart(n,r),d.setEnd(o,i);var f=d.collapsed;return{start:f?l:u,end:f?u:l}},setOffsets:Hn?function(e,t){var n,r,o=jt.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(It.getSelection){var n=It.getSelection(),r=e.textContent.length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=rt(e,o),c=rt(e,i);if(s&&c){var u=jt.createRange();u.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(u),n.extend(c.node,c.offset)):(u.setEnd(c.node,c.offset),n.addRange(u))}}}},$n={},Fn={beforePatch:function(){var e=Ln.getSelectionInformation();$n=e.focusedElem&&e.selectionRange?e:{}},afterPatch:function(){Ln.restoreSelection($n)}};for(var Bn in Fn)!function(e,t,n,r){e[t]=n?function(e){r(e),n(e)}:r}(vt,Bn,vt[Bn],Fn[Bn]);return It.React=It.ReactDOM=Dn,Dn}); \ No newline at end of file diff --git a/dist/ReactShim.js b/dist/ReactShim.js index 34123a0..e8a5a11 100644 --- a/dist/ReactShim.js +++ b/dist/ReactShim.js @@ -1,7 +1,5 @@ /** - * 此版本要求浏览器没有createClass, createFactory, PropTypes, isValidElement, - * unmountComponentAtNode,unstable_renderSubtreeIntoContainer - * QQ 370262116 by 司徒正美 Copyright 2018-01-23 + * Maintained by YMFE Copyright 2018-01-26 */ (function (global, factory) { @@ -451,7 +449,7 @@ function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); @@ -2920,7 +2918,7 @@ if (win.React && win.React.options) { React = win.React; } else { React = win.React = win.ReactDOM = { - version: "2.0.0", + version: "2.0.1", render: render, hydrate: render, Fragment: REACT_FRAGMENT_TYPE, diff --git a/dist/ReactShim.min.js b/dist/ReactShim.min.js index f577164..9d6ec17 100644 --- a/dist/ReactShim.min.js +++ b/dist/ReactShim.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function i(){}function o(e,n){function r(){}var i=e.prototype;r.prototype=n.prototype;var o=e.prototype=new r;return t(o,i),o.constructor=e,o}function a(e){return Ke[e]||(Ke[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===Je.call(e)}function c(e,t){e+""===e&&(e=e.match(et)||[]);for(var n={},r=void 0!==t?t:1,i=0,o=e.length;i2?n-2:0),i=2;i1&&(o.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===o[p]&&(o[p]=f[p]);return new v(e,a,o,s,u)}function _(e,t){var n=new v(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new v(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=b(e)}else t=_(n,e.nodeValue);return t.stateNode=e,t}function b(e){for(var t,n=e.attributes,r={},i=0;t=n[i++];)if(t.specified){var o=t.name;"class"===o&&(o="className"),r[o]=t.value}return r}function w(e,t,n){var r=f(e);if(r<3)st=null;else{if(r<5){if(st)return void(st.text+=e);st=e=_("#text",e+"")}else st=null;var i=e.key;i&&!ct[".$"+i]?ct[".$"+i]=e:("."===t&&(t="."+ut),ct[t]=e),e.index=ut,e.return=n,lt&&(lt.sibling=e),lt=e,ut++,dt.push(e)}}function x(e,t){ct={},lt=null,dt=[];var n=t.vnode;if(void 0!==e){st=null,ut=0,k(e,"",w,n);var r=dt[0];r&&(n.child=r),lt&&delete lt.sibling}return t.children=ct}function k(e,t,n,r){var i;if(e){if(e.forEach)return void e.forEach(function(e,i){k(e,t?t+":"+i:"."+i,n,r)});if(i=C(e)){for(var o,a=i.call(e),s=0;!(o=a.next()).done;)k(o.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function C(e){if(f(e)>7){var t=ft&&e[ft]||e[pt];if(t&&t.call)return t}}function N(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var i=e._owner,o=ot.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,i=o):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=N(s[u]));ot.currentOwner=i;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=y.apply(null,c);return ot.currentOwner=o,d}function O(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=ht[0],i=r.callback.call(r.context,e,r.index),o=r.index;if(r.index++,!r.isEach&&null!=i)if(i.vtype){var a=E(e,i,n,o);r.arr.push(N(i,{key:a}))}else i.type?r.arr.push(t({},i)):r.arr.push(i)}function S(e){return e}function E(e,t,n,r){var i=t&&null!=t.key?R(t.key):null,o=e&&null!=e.key?R(e.key):null,a=void 0;return o&&i?(a=n+"$"+o,o!==i&&(a=i+"/"+a)):a=(a=i||o)?n+"$"+a:"."===n?n+r:n,a.replace(mt,"$")}function R(e){return String(e).replace(/[=:]/g,M)}function M(e){return yt[e]}function A(e){this.nodeName=e,this.style={},this.children=[]}function V(e){for(var t;t=e.firstChild;)V(t),e.removeChild(t)}function P(e){e&&(ot.nodeOperate=!0,1===e.nodeType?(Nt?e.textContent="":V(e),e.__events=null):3===e.nodeType&&St["#text"].length<100&&St["#text"].push(e),Ot.appendChild(e),Ot.removeChild(e),ot.nodeOperate=!1)}function U(e,t){var n,r=e.type;switch(r){case"#text":var i=St[r].pop();return i?(i.nodeValue=e.text,i):kt.createTextNode(e.text);case"#comment":return kt.createComment(e.text);case"svg":n=_t.svg;break;case"math":n=_t.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,kt.createElementNS(n,r)}catch(e){}return kt.createElement(r)}function I(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var i=e.stateNode,o=t?t.nextSibling:n.firstChild;o!==i&&(ot.nodeOperate=!0,n.insertBefore(i,o),ot.nodeOperate=!1)}}function T(e,t){if(Object.is(e,t))return!0;if(f(e)<7||f(t)<7)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i 的value应该对应一个字符串数组')}for(var o=0;o1?G(e,t,n):(1===e.vtype&&Z(e,t,n),t.push({node:e.stateNode,vnode:e,transition:Y}))}}function Y(){delete this.vnode.stateNode,P(this.node)}function Z(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),X(r.children,t,n)}function G(e,t,n){var r=e.stateNode;if(r){var i=r.updater;r.isPortal&&(i.updateQueue=t),n?i.isMounted()&&(1===n&&(i._states.length=0),i.addState("dispose"),t.push(i)):(i.addState("dispose"),t.push(i)),i.insertQueue=i.insertPoint=NaN,X(i.children,t,n)}}function X(e,t,n){for(var r in e)Q(e[r],t,n)}function J(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function K(){if(Lt.length){var e=s(Lt).sort(J);e.forEach(function(e){delete e._dirty}),te(e)}}function ee(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,Lt.push(e))}function te(e){nt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=ot.errorHook;if(n){var r,i,o,a=ot.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,o=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var i=r.__events,o=i.child||i.vnode;do{if(1===o.vtype){var a=o.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(o=o.return);return n}function oe(e,t,n){for(var r=e.length;r--;){var i=e[r],o=i.events[t];if(u(o)&&(n.currentTarget=i.dom,o.call(void 0,n),n._stopPropagation))break}}function ae(e,t){Wt[e]||(Wt[e]=!0,se(kt,e,re,t))}function se(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent}function ue(e){var t=Bt[e];return t||(t=e.slice(2).replace(qt,"").toLowerCase(),Bt[e]=t,t)}function ce(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function le(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function de(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var i=0,o=t;o;o=o.parentNode)i++;for(;n-i>0;)e=e.parentNode,n--;for(;i-n>0;)t=t.parentNode,i--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function fe(e,t){return function(n){t&&!1===t(n)||re(n,e)}}function pe(e){if(e.nativeEvent)return e;for(var t in e)Jt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function he(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?(o=i.displayName||i.name,t.push(o),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Oe(r):a||e===n||(a=r))):1===s.vtype&&t.push(i)}while(s=s.return)}function Ee(){return null}function Re(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Ve(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=ot.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Me(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ae(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Ve(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function Pe(e){var t=[];for(var n in e){var r=e[n],i=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var o=i.updater;if(r.child){var a=Pe(o.children);t.push.apply(t,a)}}}return t}function Ue(e,t,n){return Te(e,t,n)}function Ie(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Ie(t.stateNode):null}}function Te(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var i=Dt.indexOf(t),o=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==i){if(o=jt[i],(s=o.stateNode.updater)._hydrating)return s._pendingCallbacks.push(Te.bind(null,e,t,n,r)),o.child.stateNode}else Dt.push(t),i=Dt.length-1;ot.currentOwner=null;var l=y(mn,{child:e});if(l.isTop=!0,jt[i]=l,o)(a=l.return=o.return).child=l,Fe(o,l,r,u,c);else{var d=new we(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,je(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),te(u),e.stateNode}function je(e,t,n,r){for(var i,o=e.return.stateNode,s=it(o.childNodes||Ge),u=null,c=0;i=s[c++];)a(i.nodeName)===e.type?u=g(i):o.removeChild(i);u?Fe(u,e,t,n,r):De(e,t,n,r)}function De(e,t,n,r){if(nt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=U(e,e.return);var i=r.dom;if(r.dom=e.stateNode,1===e.vtype){var o=new we(e);Le(e,x(e.props.children,o),t,n,{}),o.init(n)}I(e,i),e.updater&&e.updater.props()}else new Re(e,t).init(n,r)}function Le(e,t,n,r,i){for(var o in t)if(De(t[o],n,r,i),ot.errorHook)break}function He(e,t,n,r,i){var o=t.stateNode=e.stateNode;if(nt.beforeUpdate(t),e.vtype<2)if(I(t,i.dom),i.dom=o,0===e.vtype)t.text!==e.text&&(o.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[Qe]?X(s,r):Be(s,x(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else We(e,t,n,r,i)}function We(e,t,n,r,i){var o=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(o.contextTypes?(c=Ve(n,o.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=i,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ce(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&ot.fireRef(e,null),s.hydrate(r,!0)}}function $e(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Fe(e,t,n,r,i){$e(e,t)?He(e,t,n,r,i):(Q(e,r),De(t,n,r,i))}function Be(e,t,n,r,o,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)Le(n,t,r,o,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):Q(s,o);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){o.push({transition:ot.fireRef.bind(null,e,null),isMounted:i})});for(var m in t)if(u=t[m],(s=p[m])?Fe(s,u,r,o,a):De(u,r,o,a),ot.errorHook)return}}var ze="function"==typeof Symbol&&Symbol.for,qe=ze?Symbol.for("react.element"):60103,Qe="dangerouslySetInnerHTML",Ye=Object.prototype.hasOwnProperty,Ze=ze?Symbol.for("react.fragment"):60107,Ge=[],Xe={},Je=Object.prototype.toString,Ke={},et=/[^, ]+/g,tt=/[-_][^-_]/g,nt=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],i),rt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},it=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new pe(t)).type="wheel",t.deltaY=r,re(t)})},"blur,focus".replace(/\w+/g,function(e){kt["__"+e]||(kt["__"+e]=!0,ae(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Ft[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,se(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=ce(n);if(!r||r!==e&&!le(e,r)){var i=de(e,r);re(n,t,i)}}))}}),zt&&(Ft.click=Ft.clickcapture=function(e){e.onclick=e.onclick||i});var Zt=fe("change"),Gt=fe("doubleclick"),Xt=fe("scroll");Ft.changecapture=Ft.change=function(e){/text|password/.test(e.type)&&se(kt,"input",Zt)},Ft.scrollcapture=Ft.scroll=function(e){se(e,"scroll",Xt)},Ft.doubleclick=Ft.doubleclickcapture=function(){se(kt,"dblclick",Gt)};var Jt=pe.prototype={fixEvent:i,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:i,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:i,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Kt={},en=/checked|radio/,tn={set:function(e){var t=en.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};Kt.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,tn)}catch(e){}};var nn={value:1,checked:1},rn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},on={},an={},sn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},un={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},cn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],ln=/[a-z][A-Z]/,dn=ve("-"),fn=ve(":"),pn={className:1,title:1,name:1,type:1,alt:1,lang:1},hn=/textarea|input|select/i,vn={innerHTML:i,defaultValue:be,defaultChecked:be,children:i,style:function(e,t,n,r){z(e,r.style||Xe,n||Xe)},autoFocus:function(e){(Ct[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",i=me(t);if(i.ifSpecial){var o=i.name.split(":")[0];e[r+"NS"](_t[o],i.name,n||"")}else e[r](i,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!nn[t])try{n||0===n?e[t]=n:(pn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,i){var o=e.__events||(e.__events={});o.vnode=i;var s=a(t.slice(2));if(!1===n)delete o[s];else{if(!r[t]){var u=ue(t),c=Ft[u];ae(u),c&&c(e,u)}o[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var i=r[t]&&r[t].__html,o=n&&n.__html;o!==i&&(e.innerHTML=o)}};we.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;ye(t,e.lastProps||{},r,e),At[n]&&D(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,ot.fireRef(e,t)},dispose:function(){var e=this.vnode;ot.fireRef(e,null)}};Re.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),kt.__async)ee(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),te([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,i=e.state;if(0===r)return i;for(var o=t({},i),a=0;a2?(c>5&&(s=Ae(r,i)),o=x(u,this)):(this.children=o,delete this.child);ot.diffChildren(a,o,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,i=this.isMounted();i||(this.isMounted=r);var o=ot.focusNode;if(o){try{o.focus(),o.__inner__=!0}catch(e){}delete ot.focusNode}this._hydrating&&(Ce(t,i?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),i?nt.afterUpdate(t):nt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(ot.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Me.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Me.call(this,e)},dispose:function(){var e=this.instance;nt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;ot.fireRef(t,null),Ce(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var mn=function(){h.call(this)};o(mn,h).render=function(){return this.props.child},ot.diffChildren=Be;return xt.React&&xt.React.options?xt.React:xt.React=xt.ReactDOM={version:"2.0.0",render:Ue,hydrate:Ue,Fragment:Ze,options:nt,Children:vt,Component:h,findDOMNode:Ie,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new we(n));var i=y(xe,{children:e});return r.child=i,i.superReturn=n,i},createElement:y,cloneElement:N,PureComponent:j,unmountComponentAtNode:function(e){var t=Dt.indexOf(e);if(t>-1){var n=[];Q(jt[t],n),te(n),V(e),e.__component=null}}}}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){function e(t){e[t]||(console.warn(t+" is deprecated"),e[t]=1)}function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(){return!1}function r(){return!0}function i(){}function o(e,n){function r(){}var i=e.prototype;r.prototype=n.prototype;var o=e.prototype=new r;return t(o,i),o.constructor=e,o}function a(e){return Ke[e]||(Ke[e]=e.toLowerCase())}function s(e){return e.splice(0,e.length)}function u(e){return"[object Function]"===Je.call(e)}function c(e,t){e+""===e&&(e=e.match(et)||[]);for(var n={},r=void 0!==t?t:1,i=0,o=e.length;i2?n-2:0),i=2;i1&&(o.children=r);var f=e.defaultProps;if(f)for(var p in f)void 0===o[p]&&(o[p]=f[p]);return new v(e,a,o,s,u)}function _(e,t){var n=new v(e,0);return n.text=t,n}function g(e){var t,n=e.nodeName;if(1===e.nodeType){t=new v(n,1);var r=e.namespaceURI;!r||r.indexOf("html")>=22?t.type=n.toLowerCase():t.namespaceURI=r,t.props=b(e)}else t=_(n,e.nodeValue);return t.stateNode=e,t}function b(e){for(var t,n=e.attributes,r={},i=0;t=n[i++];)if(t.specified){var o=t.name;"class"===o&&(o="className"),r[o]=t.value}return r}function w(e,t,n){var r=f(e);if(r<3)st=null;else{if(r<5){if(st)return void(st.text+=e);st=e=_("#text",e+"")}else st=null;var i=e.key;i&&!ct[".$"+i]?ct[".$"+i]=e:("."===t&&(t="."+ut),ct[t]=e),e.index=ut,e.return=n,lt&&(lt.sibling=e),lt=e,ut++,dt.push(e)}}function x(e,t){ct={},lt=null,dt=[];var n=t.vnode;if(void 0!==e){st=null,ut=0,k(e,"",w,n);var r=dt[0];r&&(n.child=r),lt&&delete lt.sibling}return t.children=ct}function k(e,t,n,r){var i;if(e){if(e.forEach)return void e.forEach(function(e,i){k(e,t?t+":"+i:"."+i,n,r)});if(i=C(e)){for(var o,a=i.call(e),s=0;!(o=a.next()).done;)k(o.value,t?t+":"+s:"."+s,n,r),s++;return}}if(Object(e)===e&&!e.call&&!e.type)throw"children中存在非法的对象";n(e,t||".",r)}function C(e){if(f(e)>7){var t=ft&&e[ft]||e[pt];if(t&&t.call)return t}}function N(e,n){if(!e.vtype){var r=t({},e);return delete r._disposed,r}var i=e._owner,o=ot.currentOwner,a=e.props,s={};n?(Object.assign(s,a,n),s.key=void 0!==n.key?n.key:e.key,void 0!==n.ref?(s.ref=n.ref,i=o):e._hasRef&&(s.ref=e.ref)):s=a;for(var u in s)"children"!==u&&s[u]&&s[u].$$typeof&&(s[u]=N(s[u]));ot.currentOwner=i;var c=[].slice.call(arguments,0),l=c.length;c[0]=e.type,c[1]=s,2===l&&s.children&&(delete s.children._disposed,c.push(s.children));var d=y.apply(null,c);return ot.currentOwner=o,d}function O(e,n){void 0!==e&&!1!==e&&!0!==e||(e=null);var r=ht[0],i=r.callback.call(r.context,e,r.index),o=r.index;if(r.index++,!r.isEach&&null!=i)if(i.vtype){var a=E(e,i,n,o);r.arr.push(N(i,{key:a}))}else i.type?r.arr.push(t({},i)):r.arr.push(i)}function S(e){return e}function E(e,t,n,r){var i=t&&null!=t.key?R(t.key):null,o=e&&null!=e.key?R(e.key):null,a=void 0;return o&&i?(a=n+"$"+o,o!==i&&(a=i+"/"+a)):a=(a=i||o)?n+"$"+a:"."===n?n+r:n,a.replace(mt,"$")}function R(e){return String(e).replace(/[=:]/g,M)}function M(e){return yt[e]}function A(e){this.nodeName=e,this.style={},this.children=[]}function V(e){for(var t;t=e.firstChild;)V(t),e.removeChild(t)}function P(e){e&&(ot.nodeOperate=!0,1===e.nodeType?(Nt?e.textContent="":V(e),e.__events=null):3===e.nodeType&&St["#text"].length<100&&St["#text"].push(e),Ot.appendChild(e),Ot.removeChild(e),ot.nodeOperate=!1)}function U(e,t){var n,r=e.type;switch(r){case"#text":var i=St[r].pop();return i?(i.nodeValue=e.text,i):kt.createTextNode(e.text);case"#comment":return kt.createComment(e.text);case"svg":n=_t.svg;break;case"math":n=_t.math;break;case"div":case"span":case"p":case"tr":case"td":case"li":n="";break;default:if(!(n=e.namespaceURI))do{if(1===t.vtype){n=t.namespaceURI,"foreignObject"===t.type&&(n="");break}}while(t=t.return)}try{if(n)return e.namespaceURI=n,kt.createElementNS(n,r)}catch(e){}return kt.createElement(r)}function I(e,t){if(!e._disposed){for(var n,r=e.return;r;){if(1===r.vtype){n=r.stateNode;break}r=r.superReturn||r.return}var i=e.stateNode,o=t?t.nextSibling:n.firstChild;o!==i&&(ot.nodeOperate=!0,n.insertBefore(i,o),ot.nodeOperate=!1)}}function T(e,t){if(Object.is(e,t))return!0;if(f(e)<7||f(t)<7)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i 的value应该对应一个字符串数组')}for(var o=0;o1?G(e,t,n):(1===e.vtype&&Z(e,t,n),t.push({node:e.stateNode,vnode:e,transition:Y}))}}function Y(){delete this.vnode.stateNode,P(this.node)}function Z(e,t,n){var r=e.updater;n?r.isMounted()&&(r._states=["dispose"],t.push(r)):(r.addState("dispose"),t.push(r)),X(r.children,t,n)}function G(e,t,n){var r=e.stateNode;if(r){var i=r.updater;r.isPortal&&(i.updateQueue=t),n?i.isMounted()&&(1===n&&(i._states.length=0),i.addState("dispose"),t.push(i)):(i.addState("dispose"),t.push(i)),i.insertQueue=i.insertPoint=NaN,X(i.children,t,n)}}function X(e,t,n){for(var r in e)Q(e[r],t,n)}function J(e,t){return e._dirty=!1,e._mountOrder-t._mountOrder}function K(){if(Lt.length){var e=s(Lt).sort(J);e.forEach(function(e){delete e._dirty}),te(e)}}function ee(e){e._dirty||(e.addState("hydrate"),e._dirty=!0,Lt.push(e))}function te(e){nt.beforePatch();for(var t=void 0;t=e.shift();)if(!t._disposed){var n=ot.errorHook;if(n){var r,i,o,a=ot.doctors,s=a[0];switch(n){case"componentDidMount":case"componentDidUpdate":case"componentWillUnmount":r=0===e.length,o=2;break;case"render":case"constructor":case"componentWillMount":case"componentWillUpdate":case"componentWillReceiveProps":r=!0,e=e.filter(function(e){return e._mountOrder1)return n;var i=r.__events,o=i.child||i.vnode;do{if(1===o.vtype){var a=o.stateNode;if(a===t)break;if(!a)break;a.__events&&n.push({dom:a,events:a.__events})}}while(o=o.return);return n}function oe(e,t,n){for(var r=e.length;r--;){var i=e[r],o=i.events[t];if(u(o)&&(n.currentTarget=i.dom,o.call(void 0,n),n._stopPropagation))break}}function ae(e,t){Wt[e]||(Wt[e]=!0,se(kt,e,re,t))}function se(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent}function ue(e){var t=Bt[e];return t||(t=e.slice(2).replace(qt,"").toLowerCase(),Bt[e]=t,t)}function ce(e){return e.timeStamp||(e.relatedTarget="mouseover"===e.type?e.fromElement:e.toElement),e.relatedTarget}function le(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1}function de(e,t){for(var n=0,r=e;r;r=r.parentNode)n++;for(var i=0,o=t;o;o=o.parentNode)i++;for(;n-i>0;)e=e.parentNode,n--;for(;i-n>0;)t=t.parentNode,i--;for(var a=n;a--;){if(e===t)return e;e=e.parentNode,t=t.parentNode}return null}function fe(e,t){return function(n){t&&!1===t(n)||re(n,e)}}function pe(e){if(e.nativeEvent)return e;for(var t in e)Jt[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement),this.fixEvent(),this.timeStamp=new Date-0,this.nativeEvent=e}function he(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?(o=i.displayName||i.name,t.push(o),(n=s.stateNode).componentDidCatch&&((r=n.updater)._isDoctor?Oe(r):a||e===n||(a=r))):1===s.vtype&&t.push(i)}while(s=s.return)}function Ee(){return null}function Re(e,t){var n=e.type,r=e.props;if(!n)throw e;this.name=n.displayName||n.name,this.props=r,this.vnode=e,this.context=Ve(t,n.contextTypes),this.parentContext=t,this._pendingCallbacks=[],this._pendingStates=[],this._states=["resolve"],this._mountOrder=ot.mountOrder++,e.superReturn&&(this.isPortal=!0)}function Me(e){var t,n=this._nextCallbacks;if(n&&n.length){do{u(t=n.shift())&&this._pendingCallbacks.push(t)}while(n.length);delete this._nextCallbacks,this.addState("hydrate"),e.push(this)}}function Ae(e,t){if(e.getChildContext){var n=e.getChildContext();n&&(t=Object.assign({},t,n))}return t}function Ve(e,t){var n={};if(!t||!e)return n;for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]);return n}function Pe(e){var t=[];for(var n in e){var r=e[n],i=r.stateNode;if(!r._disposed)if(r.vtype<2)t.push(r);else{var o=i.updater;if(r.child){var a=Pe(o.children);t.push.apply(t,a)}}}return t}function Ue(e,t,n){return Te(e,t,n)}function Ie(e){if(null==e)return null;if(e.nodeType)return e;if(e.render){var t=e.updater.vnode.child;return t?Ie(t.stateNode):null}}function Te(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t||!t.appendChild)throw"ReactDOM.render的第二个参数错误";var i=Dt.indexOf(t),o=void 0,a=void 0,s=void 0,u=[],c={};if(-1!==i){if(o=jt[i],(s=o.stateNode.updater)._hydrating)return s._pendingCallbacks.push(Te.bind(null,e,t,n,r)),o.child.stateNode}else Dt.push(t),i=Dt.length-1;ot.currentOwner=null;var l=y(mn,{child:e});if(l.isTop=!0,jt[i]=l,o)(a=l.return=o.return).child=l,Fe(o,l,r,u,c);else{var d=new we(a=l.return=g(t));a.child=l,d.children={".0":l},l.child=e,je(l,r,u,c)}return a.updater.init(u),t.__component=l,s=l.stateNode.updater,n&&s._pendingCallbacks.push(n.bind(e.stateNode)),te(u),e.stateNode}function je(e,t,n,r){for(var i,o=e.return.stateNode,s=it(o.childNodes||Ge),u=null,c=0;i=s[c++];)a(i.nodeName)===e.type?u=g(i):o.removeChild(i);u?Fe(u,e,t,n,r):De(e,t,n,r)}function De(e,t,n,r){if(nt.beforeInsert(e),0===e.vtype||1===e.vtype){e.stateNode=U(e,e.return);var i=r.dom;if(r.dom=e.stateNode,1===e.vtype){var o=new we(e);Le(e,x(e.props.children,o),t,n,{}),o.init(n)}I(e,i),e.updater&&e.updater.props()}else new Re(e,t).init(n,r)}function Le(e,t,n,r,i){for(var o in t)if(De(t[o],n,r,i),ot.errorHook)break}function He(e,t,n,r,i){var o=t.stateNode=e.stateNode;if(nt.beforeUpdate(t),e.vtype<2)if(I(t,i.dom),i.dom=o,0===e.vtype)t.text!==e.text&&(o.nodeValue=t.text);else{e.namespaceURI&&(t.namespaceURI=e.namespaceURI);var a=t.updater=e.updater;a.vnode=t,t.lastProps=e.props;var s=a.children,u=t.props;u[Qe]?X(s,r):Be(s,x(u.children,a),t,n,r,{}),a.props(),a.addState("resolve"),r.push(a)}else We(e,t,n,r,i)}function We(e,t,n,r,i){var o=e.type,a=e.stateNode,s=a.updater,u=e!==t,c=void 0;if(o.contextTypes?(c=Ve(n,o.contextTypes),u=!0):c=a.context,s.props=t.props,s.isPortal?s.insertCarrier={}:s.insertCarrier=i,s.parentContext=n,s.pendingVnode=t,s.context=c,s.willReceive=u,t.stateNode=a,!s._dirty){if(s._receiving=!0,s.updateQueue=r,Ce(a,"componentWillReceiveProps",[t.props,c]),s._hasError)return;delete s._receiving,e.ref!==t.ref&&ot.fireRef(e,null),s.hydrate(r,!0)}}function $e(e,t){if(e.type===t.type&&e.key===t.key)return!0}function Fe(e,t,n,r,i){$e(e,t)?He(e,t,n,r,i):(Q(e,r),De(t,n,r,i))}function Be(e,t,n,r,o,a){var s=void 0,u=void 0,c=!0,l=void 0,d=void 0;1===n.vtype&&(d=n.stateNode.firstChild);for(var f in e){if(c=!1,l=e[f],d)do{if(l.superReturn)break;if(l.vtype<2){l.stateNode=d;break}}while(l=l.child);break}if(c)Le(n,t,r,o,a);else{var p={},h=[];for(var v in e)u=t[v],s=e[v],u&&u.type===s.type?(p[v]=s,s.vtype<2&&s.ref!==u.ref&&(s.order=u.index,h.push(s))):Q(s,o);h.sort(function(e,t){return e.order-t.order}).forEach(function(e){o.push({transition:ot.fireRef.bind(null,e,null),isMounted:i})});for(var m in t)if(u=t[m],(s=p[m])?Fe(s,u,r,o,a):De(u,r,o,a),ot.errorHook)return}}var ze="function"==typeof Symbol&&Symbol.for,qe=ze?Symbol.for("react.element"):60103,Qe="dangerouslySetInnerHTML",Ye=Object.prototype.hasOwnProperty,Ze=ze?Symbol.for("react.fragment"):60107,Ge=[],Xe={},Je=Object.prototype.toString,Ke={},et=/[^, ]+/g,tt=/[-_][^-_]/g,nt=c(["beforeProps","afterCreate","beforeInsert","beforeDelete","beforeUpdate","afterUpdate","beforePatch","afterPatch","beforeUnmount","afterMount"],i),rt={"[object Boolean]":2,"[object Number]":3,"[object String]":4,"[object Function]":5,"[object Symbol]":6,"[object Array]":7},it=Array.from||function(e){for(var t=[],n=0,r=e.length;n0?-120:120,r=~~e.__wheel+n;e.__wheel=r,(t=new pe(t)).type="wheel",t.deltaY=r,re(t)})},"blur,focus".replace(/\w+/g,function(e){kt["__"+e]||(kt["__"+e]=!0,ae(e,!0))}),String("mouseenter,mouseleave").replace(/\w+/g,function(e){Ft[e]=function(e,t){var n="__"+t;e[n]||(e[n]=!0,se(e,"mouseenter"===t?"mouseover":"mouseout",function(n){var r=ce(n);if(!r||r!==e&&!le(e,r)){var i=de(e,r);re(n,t,i)}}))}}),zt&&(Ft.click=Ft.clickcapture=function(e){e.onclick=e.onclick||i});var Zt=fe("change"),Gt=fe("doubleclick"),Xt=fe("scroll");Ft.changecapture=Ft.change=function(e){/text|password/.test(e.type)&&se(kt,"input",Zt)},Ft.scrollcapture=Ft.scroll=function(e){se(e,"scroll",Xt)},Ft.doubleclick=Ft.doubleclickcapture=function(){se(kt,"dblclick",Gt)};var Jt=pe.prototype={fixEvent:i,preventDefault:function(){var e=this.nativeEvent||{};e.returnValue=this.returnValue=!1,e.preventDefault&&e.preventDefault()},fixHooks:i,stopPropagation:function(){var e=this.nativeEvent||{};e.cancelBubble=this._stopPropagation=!0,e.stopPropagation&&e.stopPropagation()},persist:i,stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}},Kt={},en=/checked|radio/,tn={set:function(e){var t=en.test(this.type)?"checked":"value";if("textarea"===this.type&&(this.innerHTML=e),this._observing)this._setValue=null!=e;else if(!this._setValue){var n=this[t]=e;this._persistValue=Array.isArray(e)?e:n,this._setValue=!0}this._defaultValue=e},get:function(){return this._defaultValue},configurable:!0};Kt.observe=function(e,t){try{"_persistValue"in e&&(e._setValue=!0),Object.defineProperty(e,t,tn)}catch(e){}};var nn={value:1,checked:1},rn={style:1,autoFocus:1,defaultValue:1,defaultChecked:1,children:1,innerHTML:1,dangerouslySetInnerHTML:1},on={},an={},sn={w:{r:1,b:1,t:1},e:{n:1,t:1,f:1,p:1,c:1,m:1,a:2,u:1,s:1,v:1},o:{r:1},c:{m:1},p:{p:1},t:{s:2,t:1,u:1,c:1,d:1,o:1,x:1,y:1,l:1},l:{r:1,m:1,u:1,b:-1,l:-1,s:-1},r:{r:1,u:2,h:1,w:1,c:1,e:1},h:{r:1,a:1,l:1,t:1},y:{p:1,s:1,t:1,c:1},g:{c:1},k:{a:-1,h:-1,r:-1,s:-1,t:-1,c:1,u:1},m:{o:1,l:1,a:1},n:{c:1,t:1,u:1},s:{a:3},f:{x:1,y:1},d:{e:1,f:1,m:1,d:1},x:{c:1}},un={"overline-thickness":2,"underline-thickness":2,"overline-position":2,"underline-position":2,"stroke-miterlimit":2,"baseline-shift":2,"clip-path":2,"font-size":2,"font-size-adjust":2,"font-stretch":2,"font-style":2,"text-decoration":2,"vert-origin-x":2,"vert-origin-y":2,"paint-order":2,"fill-rule":2,"color-rendering":2,"marker-end":2,"pointer-events":2,"units-per-em":2,"strikethrough-thickness":2,"lighting-color":2},cn=["et","ep","em","es","pp","ts","td","to","lr","rr","re","ht","gc"],ln=/[a-z][A-Z]/,dn=ve("-"),fn=ve(":"),pn={className:1,title:1,name:1,type:1,alt:1,lang:1},hn=/textarea|input|select/i,vn={innerHTML:i,defaultValue:be,defaultChecked:be,children:i,style:function(e,t,n,r){z(e,r.style||Xe,n||Xe)},autoFocus:function(e){(Ct[e.type]<3||"true"===e.contentEditable)&&e.focus()},svgClass:function(e,t,n){n?e.setAttribute("class",n):e.removeAttribute("class")},svgAttr:function(e,t,n){var r=f(n)<3&&!n?"removeAttribute":"setAttribute",i=me(t);if(i.ifSpecial){var o=i.name.split(":")[0];e[r+"NS"](_t[o],i.name,n||"")}else e[r](i,n||"")},booleanAttr:function(e,t,n){e[t]=!!n,!1===e[t]?e.removeAttribute(t):"false"===e[t]&&(e[t]="")},attribute:function(e,t,n){if(null==n||!1===n)return e.removeAttribute(t);try{e.setAttribute(t,n)}catch(e){console.warn("setAttribute error",t,n)}},property:function(e,t,n){if(!nn[t])try{n||0===n?e[t]=n:(pn[t]&&(e[t]=""),e.removeAttribute(t))}catch(r){e.setAttribute(t,n)}},event:function(e,t,n,r,i){var o=e.__events||(e.__events={});o.vnode=i;var s=a(t.slice(2));if(!1===n)delete o[s];else{if(!r[t]){var u=ue(t),c=Ft[u];ae(u),c&&c(e,u)}o[s]=n}},dangerouslySetInnerHTML:function(e,t,n,r){var i=r[t]&&r[t].__html,o=n&&n.__html;o!==i&&(e.innerHTML=o)}};we.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},init:function(e){e.push(this)},isMounted:n,props:function(){var e=this.vnode,t=e.stateNode,n=e.type,r=e.props;ye(t,e.lastProps||{},r,e),At[n]&&D(e,t,r)},resolve:function(){var e=this.vnode,t=e.stateNode;this.isMounted=r,ot.fireRef(e,t)},dispose:function(){var e=this.vnode;ot.fireRef(e,null)}};Re.prototype={addState:function(e){var t=this._states;t[t.length-1]!==e&&t.push(e)},transition:function(e){var t=this._states.shift();t&&this[t](e)},enqueueSetState:function(e,t){if(!0===e?this._forceUpdate=!0:this._pendingStates.push(e),this._hydrating)this._nextCallbacks?this._nextCallbacks.push(t):this._nextCallbacks=[t];else if(u(t)&&this._pendingCallbacks.push(t),kt.__async)ee(this);else if(this.isMounted===r){if(this._receiving)return;this.addState("hydrate"),te([this])}},mergeStates:function(){var e=this.instance,n=this._pendingStates,r=n.length,i=e.state;if(0===r)return i;for(var o=t({},i),a=0;a2?(c>5&&(s=Ae(r,i)),o=x(u,this)):(this.children=o,delete this.child);ot.diffChildren(a,o,t,s,e,this.insertCarrier)},resolve:function(e){var t=this.instance,n=this.vnode,i=this.isMounted();i||(this.isMounted=r);var o=ot.focusNode;if(o){try{o.focus(),o.__inner__=!0}catch(e){}delete ot.focusNode}this._hydrating&&(Ce(t,i?"componentDidUpdate":"componentDidMount",this._hookArgs||[]),i?nt.afterUpdate(t):nt.afterMount(t),delete this._hookArgs,delete this._hydrating),this._hasError||(n._hasRef&&(ot.fireRef(n,t),n._hasRef=!1),s(this._pendingCallbacks).forEach(function(e){e.call(t)}),Me.call(this,e))},catch:function(e){var t=this.instance;this._states.length=0,this.children={},this._isDoctor=this._hydrating=!0,t.componentDidCatch.apply(t,this.errorInfo),delete this.errorInfo,this._hydrating=!1,Me.call(this,e)},dispose:function(){var e=this.instance;nt.beforeUnmount(e),e.setState=e.forceUpdate=n;var t=this.vnode;ot.fireRef(t,null),Ce(e,"componentWillUnmount",[]),this.isMounted=n,this._disposed=!0}};var mn=function(){h.call(this)};o(mn,h).render=function(){return this.props.child},ot.diffChildren=Be;return xt.React&&xt.React.options?xt.React:xt.React=xt.ReactDOM={version:"2.0.1",render:Ue,hydrate:Ue,Fragment:Ze,options:nt,Children:vt,Component:h,findDOMNode:Ie,createPortal:function(e,t){var n,r=t.__events;r?n=t.__events.vnode:(r=t.__events={},n=g(t),r.vnode=n,new we(n));var i=y(xe,{children:e});return r.child=i,i.superReturn=n,i},createElement:y,cloneElement:N,PureComponent:j,unmountComponentAtNode:function(e){var t=Dt.indexOf(e);if(t>-1){var n=[];Q(jt[t],n),te(n),V(e),e.__component=null}}}}); \ No newline at end of file diff --git a/package.json b/package.json index ec818d1..9ca3203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qreact", - "version": "2.0.0", + "version": "2.0.1", "description": "a mini React-like framework", "main": "dist/React.js", "scripts": { diff --git a/src/React.js b/src/React.js index 6262f53..dbc454b 100644 --- a/src/React.js +++ b/src/React.js @@ -1,15 +1,42 @@ -import { options, REACT_FRAGMENT_TYPE } from "./util"; -import { Children } from "./Children"; +import { + options, + REACT_FRAGMENT_TYPE +} from "./util"; +import { + Children +} from "./Children"; import * as eventSystem from "./event"; -import { PropTypes } from "./PropTypes"; -import { Component } from "./Component"; -import { win as window } from "./browser"; -import { createClass } from "./createClass"; -import { cloneElement } from "./cloneElement"; -import { PureComponent } from "./PureComponent"; -import { createElement } from "./createElement"; -import { createPortal } from "./createPortal"; -import { render, findDOMNode, isValidElement, unmountComponentAtNode, unstable_renderSubtreeIntoContainer } from "./diff"; +import { + PropTypes +} from "./PropTypes"; +import { + Component +} from "./Component"; +import { + win as window +} from "./browser"; +import { + createClass +} from "./createClass"; +import { + cloneElement +} from "./cloneElement"; +import { + PureComponent +} from "./PureComponent"; +import { + createElement +} from "./createElement"; +import { + createPortal +} from "./createPortal"; +import { + render, + findDOMNode, + isValidElement, + unmountComponentAtNode, + unstable_renderSubtreeIntoContainer +} from "./diff"; var React; if (window.React && window.React.options) { @@ -35,11 +62,11 @@ if (window.React && window.React.options) { unmountComponentAtNode, unstable_renderSubtreeIntoContainer, createFactory(type) { - console.warn("createFactory is deprecated"); // eslint-disable-line + console.warn("createFactory is deprecated"); // eslint-disable-line var factory = createElement.bind(null, type); factory.type = type; return factory; } }; } -export default React; +export default React; \ No newline at end of file diff --git a/src/ReactIE.js b/src/ReactIE.js index b3f9eb8..374196e 100644 --- a/src/ReactIE.js +++ b/src/ReactIE.js @@ -1,21 +1,51 @@ -import { options, REACT_FRAGMENT_TYPE, hasOwnProperty } from "./util"; -import { Children } from "./Children"; +import { + options, + REACT_FRAGMENT_TYPE, + hasOwnProperty +} from "./util"; +import { + Children +} from "./Children"; import * as eventSystem from "./event"; -import { PropTypes } from "./PropTypes"; -import { Component } from "./Component"; -import { win as window } from "./browser"; -import { createClass } from "./createClass"; -import { cloneElement } from "./cloneElement"; -import { PureComponent } from "./PureComponent"; -import { createElement } from "./createElement"; -import { createPortal } from "./createPortal"; +import { + PropTypes +} from "./PropTypes"; +import { + Component +} from "./Component"; +import { + win as window +} from "./browser"; +import { + createClass +} from "./createClass"; +import { + cloneElement +} from "./cloneElement"; +import { + PureComponent +} from "./PureComponent"; +import { + createElement +} from "./createElement"; +import { + createPortal +} from "./createPortal"; -import { render, findDOMNode, isValidElement, unmountComponentAtNode, unstable_renderSubtreeIntoContainer } from "./diff"; +import { + render, + findDOMNode, + isValidElement, + unmountComponentAtNode, + unstable_renderSubtreeIntoContainer +} from "./diff"; import "./compat"; + function needFix(fn) { return !/native code/.test(fn); } + function keysPolyfill() { //解决IE下Object.keys的性能问题 if (needFix(Object.keys)) { @@ -59,11 +89,11 @@ if (window.React && window.React.options) { unstable_renderSubtreeIntoContainer, createFactory(type) { - console.warn("createFactory is deprecated"); // eslint-disable-line + console.warn("createFactory is deprecated"); // eslint-disable-line var factory = createElement.bind(null, type); factory.type = type; return factory; } }; } -export default React; +export default React; \ No newline at end of file diff --git a/src/ReactShim.js b/src/ReactShim.js index 7c9119d..a76f459 100644 --- a/src/ReactShim.js +++ b/src/ReactShim.js @@ -1,26 +1,46 @@ -import { Component } from "./Component"; -import { options, REACT_FRAGMENT_TYPE } from "./util"; -import { Children } from "./Children"; -import { win as window } from "./browser"; -import { createElement } from "./createElement"; -import { cloneElement } from "./cloneElement"; -import { PureComponent } from "./PureComponent"; -import { createPortal } from "./createPortal"; - -import { render, findDOMNode, unmountComponentAtNode } from "./diff"; +import { + Component +} from "./Component"; +import { + options, + REACT_FRAGMENT_TYPE +} from "./util"; +import { + Children +} from "./Children"; +import { + win as window +} from "./browser"; +import { + createElement +} from "./createElement"; +import { + cloneElement +} from "./cloneElement"; +import { + PureComponent +} from "./PureComponent"; +import { + createPortal +} from "./createPortal"; +import { + render, + findDOMNode, + unmountComponentAtNode +} from "./diff"; var React; if (window.React && window.React.options) { React = window.React; } else { - React = window.React = window.ReactDOM = { + React = window.React = window.ReactDOM = { version: "VERSION", render, hydrate: render, Fragment: REACT_FRAGMENT_TYPE, options, - Children, + Children, Component, findDOMNode, createPortal, @@ -30,4 +50,4 @@ if (window.React && window.React.options) { unmountComponentAtNode }; } -export default React; +export default React; \ No newline at end of file diff --git a/src/component.js b/src/component.js index fb1e1ab..3e29e52 100644 --- a/src/component.js +++ b/src/component.js @@ -38,4 +38,3 @@ Component.prototype = { }, render() {} }; - diff --git a/src/createElement.js b/src/createElement.js index 9ce4a95..13b3d42 100644 --- a/src/createElement.js +++ b/src/createElement.js @@ -179,7 +179,7 @@ export function operateChildren(children, prefix, callback, parent) { return; } } - if (Object(children) === children && !children.type) { + if (Object(children) === children && !children.call && !children.type) { throw "children中存在非法的对象"; } callback(children, prefix || ".", parent); diff --git a/src/diff.js b/src/diff.js index d60e87a..053710e 100644 --- a/src/diff.js +++ b/src/diff.js @@ -21,7 +21,8 @@ export function render(vnode, container, callback) { //[Top API] ReactDOM.unstable_renderSubtreeIntoContainer export function unstable_renderSubtreeIntoContainer(lastVnode, nextVnode, container, callback) { deprecatedWarn("unstable_renderSubtreeIntoContainer"); - var parentContext = (lastVnode && lastVnode.context) || {}; + var updater = lastVnode && lastVnode.updater; + var parentContext = updater ? updater.parentContext : {}; return renderByAnu(nextVnode, container, callback, parentContext); } //[Top API] ReactDOM.unmountComponentAtNode