da4cc1ece089ca1a3d64b2e07e2c838f.json
8.9 KB
{"ast":null,"code":"import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport canUseDOM from \"rc-util/es/Dom/canUseDom\"; // ================= Transition =================\n// Event wrapper. Copy from react source code\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes[\"Webkit\".concat(styleProp)] = \"webkit\".concat(eventName);\n prefixes[\"Moz\".concat(styleProp)] = \"moz\".concat(eventName);\n prefixes[\"ms\".concat(styleProp)] = \"MS\".concat(eventName);\n prefixes[\"O\".concat(styleProp)] = \"o\".concat(eventName.toLowerCase());\n return prefixes;\n}\n\nexport function getVendorPrefixes(domSupport, win) {\n var prefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n };\n\n if (domSupport) {\n if (!('AnimationEvent' in win)) {\n delete prefixes.animationend.animation;\n }\n\n if (!('TransitionEvent' in win)) {\n delete prefixes.transitionend.transition;\n }\n }\n\n return prefixes;\n}\nvar vendorPrefixes = getVendorPrefixes(canUseDOM(), typeof window !== 'undefined' ? window : {});\nvar style = {};\n\nif (canUseDOM()) {\n var _document$createEleme = document.createElement('div');\n\n style = _document$createEleme.style;\n}\n\nvar prefixedEventNames = {};\nexport function getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n if (prefixMap) {\n var stylePropList = Object.keys(prefixMap);\n var len = stylePropList.length;\n\n for (var i = 0; i < len; i += 1) {\n var styleProp = stylePropList[i];\n\n if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {\n prefixedEventNames[eventName] = prefixMap[styleProp];\n return prefixedEventNames[eventName];\n }\n }\n }\n\n return '';\n}\nvar internalAnimationEndName = getVendorPrefixedEventName('animationend');\nvar internalTransitionEndName = getVendorPrefixedEventName('transitionend');\nexport var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);\nexport var animationEndName = internalAnimationEndName || 'animationend';\nexport var transitionEndName = internalTransitionEndName || 'transitionend';\nexport function getTransitionName(transitionName, transitionType) {\n if (!transitionName) return null;\n\n if (_typeof(transitionName) === 'object') {\n var type = transitionType.replace(/-\\w/g, function (match) {\n return match[1].toUpperCase();\n });\n return transitionName[type];\n }\n\n return \"\".concat(transitionName, \"-\").concat(transitionType);\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-motion/es/util/motion.js"],"names":["_typeof","canUseDOM","makePrefixMap","styleProp","eventName","prefixes","toLowerCase","concat","getVendorPrefixes","domSupport","win","animationend","transitionend","animation","transition","vendorPrefixes","window","style","_document$createEleme","document","createElement","prefixedEventNames","getVendorPrefixedEventName","prefixMap","stylePropList","Object","keys","len","length","i","prototype","hasOwnProperty","call","internalAnimationEndName","internalTransitionEndName","supportTransition","animationEndName","transitionEndName","getTransitionName","transitionName","transitionType","type","replace","match","toUpperCase"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,mCAApB;AACA,OAAOC,SAAP,MAAsB,0BAAtB,C,CAAkD;AAClD;;AAEA,SAASC,aAAT,CAAuBC,SAAvB,EAAkCC,SAAlC,EAA6C;AAC3C,MAAIC,QAAQ,GAAG,EAAf;AACAA,EAAAA,QAAQ,CAACF,SAAS,CAACG,WAAV,EAAD,CAAR,GAAoCF,SAAS,CAACE,WAAV,EAApC;AACAD,EAAAA,QAAQ,CAAC,SAASE,MAAT,CAAgBJ,SAAhB,CAAD,CAAR,GAAuC,SAASI,MAAT,CAAgBH,SAAhB,CAAvC;AACAC,EAAAA,QAAQ,CAAC,MAAME,MAAN,CAAaJ,SAAb,CAAD,CAAR,GAAoC,MAAMI,MAAN,CAAaH,SAAb,CAApC;AACAC,EAAAA,QAAQ,CAAC,KAAKE,MAAL,CAAYJ,SAAZ,CAAD,CAAR,GAAmC,KAAKI,MAAL,CA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C,MAAH,CAAUgC,cAAV,EAA0B,GAA1B,EAA+BhC,MAA/B,CAAsCiC,cAAtC,CAAP;AACD","sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport canUseDOM from \"rc-util/es/Dom/canUseDom\"; // ================= Transition =================\n// Event wrapper. Copy from react source code\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes[\"Webkit\".concat(styleProp)] = \"webkit\".concat(eventName);\n prefixes[\"Moz\".concat(styleProp)] = \"moz\".concat(eventName);\n prefixes[\"ms\".concat(styleProp)] = \"MS\".concat(eventName);\n prefixes[\"O\".concat(styleProp)] = \"o\".concat(eventName.toLowerCase());\n return prefixes;\n}\n\nexport function getVendorPrefixes(domSupport, win) {\n var prefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n };\n\n if (domSupport) {\n if (!('AnimationEvent' in win)) {\n delete prefixes.animationend.animation;\n }\n\n if (!('TransitionEvent' in win)) {\n delete prefixes.transitionend.transition;\n }\n }\n\n return prefixes;\n}\nvar vendorPrefixes = getVendorPrefixes(canUseDOM(), typeof window !== 'undefined' ? window : {});\nvar style = {};\n\nif (canUseDOM()) {\n var _document$createEleme = document.createElement('div');\n\n style = _document$createEleme.style;\n}\n\nvar prefixedEventNames = {};\nexport function getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n if (prefixMap) {\n var stylePropList = Object.keys(prefixMap);\n var len = stylePropList.length;\n\n for (var i = 0; i < len; i += 1) {\n var styleProp = stylePropList[i];\n\n if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {\n prefixedEventNames[eventName] = prefixMap[styleProp];\n return prefixedEventNames[eventName];\n }\n }\n }\n\n return '';\n}\nvar internalAnimationEndName = getVendorPrefixedEventName('animationend');\nvar internalTransitionEndName = getVendorPrefixedEventName('transitionend');\nexport var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);\nexport var animationEndName = internalAnimationEndName || 'animationend';\nexport var transitionEndName = internalTransitionEndName || 'transitionend';\nexport function getTransitionName(transitionName, transitionType) {\n if (!transitionName) return null;\n\n if (_typeof(transitionName) === 'object') {\n var type = transitionType.replace(/-\\w/g, function (match) {\n return match[1].toUpperCase();\n });\n return transitionName[type];\n }\n\n return \"\".concat(transitionName, \"-\").concat(transitionType);\n}"]},"metadata":{},"sourceType":"module"}