UNPKG

rmwc

Version:

A thin React wrapper for Material Design (Web) Components

38 lines (35 loc) 14.9 kB
/* React v16.0.0 react-dom-server.browser.production.min.js Copyright (c) 2013-present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ 'use strict';function D(r){function S(a){return a[1].toUpperCase()}function u(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=T.exec(a);if(b){var e="",c,n=0;for(c=b.index;c<a.length;c++){switch(a.charCodeAt(c)){case 34:b="\x26quot;";break;case 38:b="\x26amp;";break;case 39:b="\x26#x27;";break;case 60:b="\x26lt;";break;case 62:b="\x26gt;";break;default:continue}n!==c&&(e+=a.substring(n,c));n=c+1;e+=b}a=n!==c?e+a.substring(n,c):e}return a}function p(a){for(var b=arguments.length- 1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}function I(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} function y(a,b){return(a&b)===b}function U(a){if(J.hasOwnProperty(a))return!0;if(K.hasOwnProperty(a))return!1;if(V.test(a))return J[a]=!0;K[a]=!0;return!1}function E(a){return"string"===typeof a?a:"function"===typeof a?a.displayName||a.name:null}function W(a){var b="";r.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a)});return b}function X(a,b){if(a=a.contextTypes){var e={},c;for(c in a)e[c]=b[c];b=e}else b=L;return b}function M(a,b){void 0===a&&p("152",E(b)|| "Component")}function Y(a,b){for(;r.isValidElement(a);){var e=a.type;if("function"!==typeof e)break;var c=X(e,b),n=[],g=!1,f={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===n)return null},enqueueReplaceState:function(a,b){g=!0;n=[b]},enqueueSetState:function(a,b){if(null===n)return null;n.push(b)}};if(e.prototype&&e.prototype.isReactComponent)var d=new e(a.props,c,f);else if(d=e(a.props,c,f),null==d||null==d.render){a=d;M(a,e);continue}d.props=a.props;d.context=c;d.updater= f;f=d.state;void 0===f&&(d.state=f=null);if(d.componentWillMount)if(d.componentWillMount(),n.length){f=n;var h=g;n=null;g=!1;if(h&&1===f.length)d.state=f[0];else{var k=h?f[0]:d.state,l=!0;for(h=h?1:0;h<f.length;h++){var q=f[h];if(q="function"===typeof q?q.call(d,k,a.props,c):q)l?(l=!1,k=x({},k,q)):x(k,q)}d.state=k}}else n=null;a=d.render();M(a,e);if("function"===typeof d.getChildContext){c=e.childContextTypes;"object"!==typeof c?p("107",E(e)||"Unknown"):void 0;var m=d.getChildContext();for(var u in m)u in c?void 0:p("108",E(e)||"Unknown",u)}m&&(b=x({},b,m))}return{child:a,context:b}}var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,Z={children:!0,dangerouslySetInnerHTML:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,style:!0},N={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,HAS_STRING_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(a){var b=N,e=a.Properties|| {},c=a.DOMAttributeNamespaces||{},h=a.DOMAttributeNames||{};a=a.DOMMutationMethods||{};for(var g in e){m.properties.hasOwnProperty(g)?p("48",g):void 0;var f=g.toLowerCase(),d=e[g];f={attributeName:f,attributeNamespace:null,propertyName:g,mutationMethod:null,mustUseProperty:y(d,b.MUST_USE_PROPERTY),hasBooleanValue:y(d,b.HAS_BOOLEAN_VALUE),hasNumericValue:y(d,b.HAS_NUMERIC_VALUE),hasPositiveNumericValue:y(d,b.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:y(d,b.HAS_OVERLOADED_BOOLEAN_VALUE), hasStringBooleanValue:y(d,b.HAS_STRING_BOOLEAN_VALUE)};1>=f.hasBooleanValue+f.hasNumericValue+f.hasOverloadedBooleanValue?void 0:p("50",g);h.hasOwnProperty(g)&&(f.attributeName=h[g]);c.hasOwnProperty(g)&&(f.attributeNamespace=c[g]);a.hasOwnProperty(g)&&(f.mutationMethod=a[g]);m.properties[g]=f}}},m={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", ATTRIBUTE_NAME_CHAR:":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},shouldSetAttribute:function(a,b){if(m.isReservedProp(a)||!("o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]))return!1;if(null===b)return!0;switch(typeof b){case "boolean":return m.shouldAttributeAcceptBooleanValue(a);case "undefined":case "number":case "string":case "object":return!0; default:return!1}},getPropertyInfo:function(a){return m.properties.hasOwnProperty(a)?m.properties[a]:null},shouldAttributeAcceptBooleanValue:function(a){if(m.isReservedProp(a))return!0;var b=m.getPropertyInfo(a);if(b)return b.hasBooleanValue||b.hasStringBooleanValue||b.hasOverloadedBooleanValue;a=a.toLowerCase().slice(0,5);return"data-"===a||"aria-"===a},isReservedProp:function(a){return Z.hasOwnProperty(a)},injection:N},k=m,T=/["'&<>]/,V=new RegExp("^["+k.ATTRIBUTE_NAME_START_CHAR+"]["+k.ATTRIBUTE_NAME_CHAR+ "]*$"),K={},J={},F={createMarkupForID:function(a){return k.ID_ATTRIBUTE_NAME+"\x3d"+('"'+u(a)+'"')},createMarkupForRoot:function(){return k.ROOT_ATTRIBUTE_NAME+'\x3d""'},createMarkupForProperty:function(a,b){var e=k.getPropertyInfo(a);if(e){if(null==b||e.hasBooleanValue&&!b||e.hasNumericValue&&isNaN(b)||e.hasPositiveNumericValue&&1>b||e.hasOverloadedBooleanValue&&!1===b)return"";var c=e.attributeName;if(e.hasBooleanValue||e.hasOverloadedBooleanValue&&!0===b)return c+'\x3d""';if("boolean"!==typeof b|| k.shouldAttributeAcceptBooleanValue(a))return c+"\x3d"+('"'+u(b)+'"')}else if(k.shouldSetAttribute(a,b))return null==b?"":a+"\x3d"+('"'+u(b)+'"');return null},createMarkupForCustomAttribute:function(a,b){return U(a)&&null!=b?a+"\x3d"+('"'+u(b)+'"'):""}},O={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},aa=x({menuitem:!0},O),A={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0, boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0}, ba=["Webkit","ms","Moz","O"];Object.keys(A).forEach(function(a){ba.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);A[b]=A[a]})});var L={},ca=/([A-Z])/g,da=/^ms-/,G=r.Children.toArray,ea={listing:!0,pre:!0,textarea:!0},fa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P={},ha=function(a){var b={};return function(e){b.hasOwnProperty(e)||(b[e]=a.call(this,e));return b[e]}}(function(a){return a.replace(ca,"-$1").toLowerCase().replace(da,"-ms-")}),ia={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null}, Q=function(){function a(b,e){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.stack=[{domNamespace:"http://www.w3.org/1999/xhtml",children:r.isValidElement(b)?[b]:G(b),childIndex:0,context:L,footer:""}];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup=e}a.prototype.read=function(a){if(this.exhausted)return null;for(var b="";b.length<a;){if(0===this.stack.length){this.exhausted=!0;break}var c=this.stack[this.stack.length- 1];if(c.childIndex>=c.children.length)b+=c.footer,this.previousWasTextNode=!1,this.stack.pop(),"select"===c.tag&&(this.currentSelectValue=null);else{var h=c.children[c.childIndex++];b+=this.render(h,c.context,c.domNamespace)}}return b};a.prototype.render=function(a,e,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return u(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+u(c);this.previousWasTextNode=!0;return u(c)}e=Y(a,e);a=e.child;e=e.context; if(null===a||!1===a)return"";if(r.isValidElement(a))return this.renderDOM(a,e,c);a=G(a);this.stack.push({domNamespace:c,children:a,childIndex:0,context:e,footer:""});return""};a.prototype.renderDOM=function(a,e,c){var b=a.type.toLowerCase();"http://www.w3.org/1999/xhtml"===c&&I(b);P.hasOwnProperty(b)||(fa.test(b)?void 0:p("65",b),P[b]=!0);var g=a.props;if("input"===b)g=x({type:void 0},g,{defaultChecked:void 0,defaultValue:void 0,value:null!=g.value?g.value:g.defaultValue,checked:null!=g.checked?g.checked: g.defaultChecked});else if("textarea"===b){var f=g.value;if(null==f){f=g.defaultValue;var d=g.children;null!=d&&(null!=f?p("92"):void 0,Array.isArray(d)&&(1>=d.length?void 0:p("93"),d=d[0]),f=""+d);null==f&&(f="")}g=x({},g,{value:void 0,children:""+f})}else if("select"===b)this.currentSelectValue=null!=g.value?g.value:g.defaultValue,g=x({},g,{value:void 0});else if("option"===b){d=this.currentSelectValue;var h=W(g.children);if(null!=d){var k=null!=g.value?g.value+"":h;f=!1;if(Array.isArray(d))for(var l= 0;l<d.length;l++){if(""+d[l]===k){f=!0;break}}else f=""+d===k;g=x({selected:void 0,children:void 0},g,{selected:f,children:h})}}if(f=g)aa[b]&&(null!=f.children||null!=f.dangerouslySetInnerHTML?p("137",b,""):void 0),null!=f.dangerouslySetInnerHTML&&(null!=f.children?p("60"):void 0,"object"===typeof f.dangerouslySetInnerHTML&&"__html"in f.dangerouslySetInnerHTML?void 0:p("61")),null!=f.style&&"object"!==typeof f.style?p("62",""):void 0;f=g;d=this.makeStaticMarkup;h=1===this.stack.length;k="\x3c"+a.type; for(t in f)if(f.hasOwnProperty(t)){var q=f[t];if(null!=q){if("style"===t){l=void 0;var m="",r="";for(l in q)if(q.hasOwnProperty(l)){var v=0===l.indexOf("--"),w=q[l];null!=w&&(m+=r+ha(l)+":",r=l,v=null==w||"boolean"===typeof w||""===w?"":v||"number"!==typeof w||0===w||A.hasOwnProperty(r)&&A[r]?(""+w).trim():w+"px",m+=v,r=";")}q=m||null}l=null;b:if(v=b,w=f,-1===v.indexOf("-"))v="string"===typeof w.is;else switch(v){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":v= !1;break b;default:v=!0}v?ia.hasOwnProperty(t)||(l=F.createMarkupForCustomAttribute(t,q)):l=F.createMarkupForProperty(t,q);l&&(k+=" "+l)}}d||h&&(k+=" "+F.createMarkupForRoot());var t=k;f="";O.hasOwnProperty(b)?t+="/\x3e":(t+="\x3e",f="\x3c/"+a.type+"\x3e");a:{d=g.dangerouslySetInnerHTML;if(null!=d){if(null!=d.__html){d=d.__html;break a}}else if(d=g.children,"string"===typeof d||"number"===typeof d){d=u(d);break a}d=null}null!=d?(g=[],ea[b]&&"\n"===d.charAt(0)&&(t+="\n"),t+=d):g=G(g.children);a=a.type; e={domNamespace:null==c||"http://www.w3.org/1999/xhtml"===c?I(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c,tag:b,children:g,childIndex:0,context:e,footer:f};this.stack.push(e);return t};return a}(),z=k.injection.MUST_USE_PROPERTY,h=k.injection.HAS_BOOLEAN_VALUE,R=k.injection.HAS_NUMERIC_VALUE,C=k.injection.HAS_POSITIVE_NUMERIC_VALUE,B=k.injection.HAS_STRING_BOOLEAN_VALUE;z={Properties:{allowFullScreen:h,allowTransparency:B,async:h,autoPlay:h,capture:h, checked:z|h,cols:C,contentEditable:B,controls:h,"default":h,defer:h,disabled:h,download:k.injection.HAS_OVERLOADED_BOOLEAN_VALUE,draggable:B,formNoValidate:h,hidden:h,loop:h,multiple:z|h,muted:z|h,noValidate:h,open:h,playsInline:h,readOnly:h,required:h,reversed:h,rows:C,rowSpan:R,scoped:h,seamless:h,selected:z|h,size:C,start:R,span:C,spellCheck:B,style:0,itemScope:h,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:B},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for", httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(a,b){if(null==b)return a.removeAttribute("value");"number"!==a.type||!1===a.hasAttribute("value")?a.setAttribute("value",""+b):a.validity&&!a.validity.badInput&&a.ownerDocument.activeElement!==a&&a.setAttribute("value",""+b)}}};h=k.injection.HAS_STRING_BOOLEAN_VALUE;var H={Properties:{autoReverse:h,externalResourcesRequired:h,preserveAlpha:h},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired", preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:"http://www.w3.org/1999/xlink",xlinkArcrole:"http://www.w3.org/1999/xlink",xlinkHref:"http://www.w3.org/1999/xlink",xlinkRole:"http://www.w3.org/1999/xlink",xlinkShow:"http://www.w3.org/1999/xlink",xlinkTitle:"http://www.w3.org/1999/xlink",xlinkType:"http://www.w3.org/1999/xlink",xmlBase:"http://www.w3.org/XML/1998/namespace",xmlLang:"http://www.w3.org/XML/1998/namespace",xmlSpace:"http://www.w3.org/XML/1998/namespace"}},ja=/[\-\:]([a-z])/g; "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(a){var b= a.replace(ja,S);H.Properties[b]=0;H.DOMAttributeNames[b]=a});k.injection.injectDOMPropertyConfig(z);k.injection.injectDOMPropertyConfig(H);return{renderToString:function(a){return(new Q(a,!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new Q(a,!0)).read(Infinity)},renderToNodeStream:function(){p("207")},renderToStaticNodeStream:function(){p("208")},version:"16.0.0"}} "object"===typeof exports&&"undefined"!==typeof module?module.exports=D(require("react")):"function"===typeof define&&define.amd?define(["react"],D):this.ReactDOMServer=D(this.React);