mdc.animation.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE
  7. */
  8. (function webpackUniversalModuleDefinition(root, factory) {
  9. if(typeof exports === 'object' && typeof module === 'object')
  10. module.exports = factory();
  11. else if(typeof define === 'function' && define.amd)
  12. define([], factory);
  13. else if(typeof exports === 'object')
  14. exports["animation"] = factory();
  15. else
  16. root["mdc"] = root["mdc"] || {}, root["mdc"]["animation"] = factory();
  17. })(this, function() {
  18. return /******/ (function(modules) { // webpackBootstrap
  19. /******/ // The module cache
  20. /******/ var installedModules = {};
  21. /******/
  22. /******/ // The require function
  23. /******/ function __webpack_require__(moduleId) {
  24. /******/
  25. /******/ // Check if module is in cache
  26. /******/ if(installedModules[moduleId]) {
  27. /******/ return installedModules[moduleId].exports;
  28. /******/ }
  29. /******/ // Create a new module (and put it into the cache)
  30. /******/ var module = installedModules[moduleId] = {
  31. /******/ i: moduleId,
  32. /******/ l: false,
  33. /******/ exports: {}
  34. /******/ };
  35. /******/
  36. /******/ // Execute the module function
  37. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  38. /******/
  39. /******/ // Flag the module as loaded
  40. /******/ module.l = true;
  41. /******/
  42. /******/ // Return the exports of the module
  43. /******/ return module.exports;
  44. /******/ }
  45. /******/
  46. /******/
  47. /******/ // expose the modules object (__webpack_modules__)
  48. /******/ __webpack_require__.m = modules;
  49. /******/
  50. /******/ // expose the module cache
  51. /******/ __webpack_require__.c = installedModules;
  52. /******/
  53. /******/ // define getter function for harmony exports
  54. /******/ __webpack_require__.d = function(exports, name, getter) {
  55. /******/ if(!__webpack_require__.o(exports, name)) {
  56. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  57. /******/ }
  58. /******/ };
  59. /******/
  60. /******/ // define __esModule on exports
  61. /******/ __webpack_require__.r = function(exports) {
  62. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  63. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  64. /******/ }
  65. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  66. /******/ };
  67. /******/
  68. /******/ // create a fake namespace object
  69. /******/ // mode & 1: value is a module id, require it
  70. /******/ // mode & 2: merge all properties of value into the ns
  71. /******/ // mode & 4: return value when already ns object
  72. /******/ // mode & 8|1: behave like require
  73. /******/ __webpack_require__.t = function(value, mode) {
  74. /******/ if(mode & 1) value = __webpack_require__(value);
  75. /******/ if(mode & 8) return value;
  76. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  77. /******/ var ns = Object.create(null);
  78. /******/ __webpack_require__.r(ns);
  79. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  80. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  81. /******/ return ns;
  82. /******/ };
  83. /******/
  84. /******/ // getDefaultExport function for compatibility with non-harmony modules
  85. /******/ __webpack_require__.n = function(module) {
  86. /******/ var getter = module && module.__esModule ?
  87. /******/ function getDefault() { return module['default']; } :
  88. /******/ function getModuleExports() { return module; };
  89. /******/ __webpack_require__.d(getter, 'a', getter);
  90. /******/ return getter;
  91. /******/ };
  92. /******/
  93. /******/ // Object.prototype.hasOwnProperty.call
  94. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  95. /******/
  96. /******/ // __webpack_public_path__
  97. /******/ __webpack_require__.p = "";
  98. /******/
  99. /******/
  100. /******/ // Load entry module and return exports
  101. /******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-animation/index.ts");
  102. /******/ })
  103. /************************************************************************/
  104. /******/ ({
  105. /***/ "./packages/mdc-animation/index.ts":
  106. /*!*****************************************!*\
  107. !*** ./packages/mdc-animation/index.ts ***!
  108. \*****************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. "use strict";
  112. /**
  113. * @license
  114. * Copyright 2019 Google Inc.
  115. *
  116. * Permission is hereby granted, free of charge, to any person obtaining a copy
  117. * of this software and associated documentation files (the "Software"), to deal
  118. * in the Software without restriction, including without limitation the rights
  119. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  120. * copies of the Software, and to permit persons to whom the Software is
  121. * furnished to do so, subject to the following conditions:
  122. *
  123. * The above copyright notice and this permission notice shall be included in
  124. * all copies or substantial portions of the Software.
  125. *
  126. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  127. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  128. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  129. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  130. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  131. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  132. * THE SOFTWARE.
  133. */
  134. function __export(m) {
  135. for (var p in m) {
  136. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  137. }
  138. }
  139. var __importStar = this && this.__importStar || function (mod) {
  140. if (mod && mod.__esModule) return mod;
  141. var result = {};
  142. if (mod != null) for (var k in mod) {
  143. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  144. }result["default"] = mod;
  145. return result;
  146. };
  147. Object.defineProperty(exports, "__esModule", { value: true });
  148. var util = __importStar(__webpack_require__(/*! ./util */ "./packages/mdc-animation/util.ts"));
  149. exports.util = util;
  150. __export(__webpack_require__(/*! ./util */ "./packages/mdc-animation/util.ts")); // Old namespace for backward compatibility
  151. /***/ }),
  152. /***/ "./packages/mdc-animation/util.ts":
  153. /*!****************************************!*\
  154. !*** ./packages/mdc-animation/util.ts ***!
  155. \****************************************/
  156. /*! no static exports found */
  157. /***/ (function(module, exports, __webpack_require__) {
  158. "use strict";
  159. /**
  160. * @license
  161. * Copyright 2016 Google Inc.
  162. *
  163. * Permission is hereby granted, free of charge, to any person obtaining a copy
  164. * of this software and associated documentation files (the "Software"), to deal
  165. * in the Software without restriction, including without limitation the rights
  166. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  167. * copies of the Software, and to permit persons to whom the Software is
  168. * furnished to do so, subject to the following conditions:
  169. *
  170. * The above copyright notice and this permission notice shall be included in
  171. * all copies or substantial portions of the Software.
  172. *
  173. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  174. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  175. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  176. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  177. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  178. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  179. * THE SOFTWARE.
  180. */
  181. Object.defineProperty(exports, "__esModule", { value: true });
  182. var cssPropertyNameMap = {
  183. animation: {
  184. prefixed: '-webkit-animation',
  185. standard: 'animation'
  186. },
  187. transform: {
  188. prefixed: '-webkit-transform',
  189. standard: 'transform'
  190. },
  191. transition: {
  192. prefixed: '-webkit-transition',
  193. standard: 'transition'
  194. }
  195. };
  196. var jsEventTypeMap = {
  197. animationend: {
  198. cssProperty: 'animation',
  199. prefixed: 'webkitAnimationEnd',
  200. standard: 'animationend'
  201. },
  202. animationiteration: {
  203. cssProperty: 'animation',
  204. prefixed: 'webkitAnimationIteration',
  205. standard: 'animationiteration'
  206. },
  207. animationstart: {
  208. cssProperty: 'animation',
  209. prefixed: 'webkitAnimationStart',
  210. standard: 'animationstart'
  211. },
  212. transitionend: {
  213. cssProperty: 'transition',
  214. prefixed: 'webkitTransitionEnd',
  215. standard: 'transitionend'
  216. }
  217. };
  218. function isWindow(windowObj) {
  219. return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
  220. }
  221. function getCorrectPropertyName(windowObj, cssProperty) {
  222. if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
  223. var el = windowObj.document.createElement('div');
  224. var _a = cssPropertyNameMap[cssProperty],
  225. standard = _a.standard,
  226. prefixed = _a.prefixed;
  227. var isStandard = standard in el.style;
  228. return isStandard ? standard : prefixed;
  229. }
  230. return cssProperty;
  231. }
  232. exports.getCorrectPropertyName = getCorrectPropertyName;
  233. function getCorrectEventName(windowObj, eventType) {
  234. if (isWindow(windowObj) && eventType in jsEventTypeMap) {
  235. var el = windowObj.document.createElement('div');
  236. var _a = jsEventTypeMap[eventType],
  237. standard = _a.standard,
  238. prefixed = _a.prefixed,
  239. cssProperty = _a.cssProperty;
  240. var isStandard = cssProperty in el.style;
  241. return isStandard ? standard : prefixed;
  242. }
  243. return eventType;
  244. }
  245. exports.getCorrectEventName = getCorrectEventName;
  246. /***/ })
  247. /******/ });
  248. });
  249. //# sourceMappingURL=mdc.animation.js.map