@material/animation
Advanced tools
Comparing version 0.41.0 to 1.0.0-0
/*! | ||
Material Components for the Web | ||
Copyright (c) 2018 Google Inc. | ||
Copyright (c) 2019 Google Inc. | ||
License: MIT | ||
@@ -78,3 +78,3 @@ */ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 10); | ||
/******/ return __webpack_require__(__webpack_require__.s = 132); | ||
/******/ }) | ||
@@ -84,13 +84,10 @@ /************************************************************************/ | ||
/***/ 10: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/***/ 132: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformStyleProperties", function() { return transformStyleProperties; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCorrectEventName", function() { return getCorrectEventName; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCorrectPropertyName", function() { return getCorrectPropertyName; }); | ||
/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
* Copyright 2019 Google Inc. | ||
* | ||
@@ -116,127 +113,318 @@ * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
/** | ||
* @typedef {{ | ||
* noPrefix: string, | ||
* webkitPrefix: string, | ||
* styleProperty: string | ||
* }} | ||
*/ | ||
var VendorPropertyMapType = void 0; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = __webpack_require__(133); | ||
var util = __webpack_require__(21); | ||
exports.util = util; | ||
tslib_1.__exportStar(__webpack_require__(21), exports); // Old namespace for backward compatibility | ||
/** @const {Object<string, !VendorPropertyMapType>} */ | ||
var eventTypeMap = { | ||
'animationstart': { | ||
noPrefix: 'animationstart', | ||
webkitPrefix: 'webkitAnimationStart', | ||
styleProperty: 'animation' | ||
}, | ||
'animationend': { | ||
noPrefix: 'animationend', | ||
webkitPrefix: 'webkitAnimationEnd', | ||
styleProperty: 'animation' | ||
}, | ||
'animationiteration': { | ||
noPrefix: 'animationiteration', | ||
webkitPrefix: 'webkitAnimationIteration', | ||
styleProperty: 'animation' | ||
}, | ||
'transitionend': { | ||
noPrefix: 'transitionend', | ||
webkitPrefix: 'webkitTransitionEnd', | ||
styleProperty: 'transition' | ||
} | ||
}; | ||
/***/ }), | ||
/** @const {Object<string, !VendorPropertyMapType>} */ | ||
var cssPropertyMap = { | ||
'animation': { | ||
noPrefix: 'animation', | ||
webkitPrefix: '-webkit-animation' | ||
}, | ||
'transform': { | ||
noPrefix: 'transform', | ||
webkitPrefix: '-webkit-transform' | ||
}, | ||
'transition': { | ||
noPrefix: 'transition', | ||
webkitPrefix: '-webkit-transition' | ||
} | ||
/***/ 133: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony export (immutable) */ __webpack_exports__["__extends"] = __extends; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); | ||
/* harmony export (immutable) */ __webpack_exports__["__rest"] = __rest; | ||
/* harmony export (immutable) */ __webpack_exports__["__decorate"] = __decorate; | ||
/* harmony export (immutable) */ __webpack_exports__["__param"] = __param; | ||
/* harmony export (immutable) */ __webpack_exports__["__metadata"] = __metadata; | ||
/* harmony export (immutable) */ __webpack_exports__["__awaiter"] = __awaiter; | ||
/* harmony export (immutable) */ __webpack_exports__["__generator"] = __generator; | ||
/* harmony export (immutable) */ __webpack_exports__["__exportStar"] = __exportStar; | ||
/* harmony export (immutable) */ __webpack_exports__["__values"] = __values; | ||
/* harmony export (immutable) */ __webpack_exports__["__read"] = __read; | ||
/* harmony export (immutable) */ __webpack_exports__["__spread"] = __spread; | ||
/* harmony export (immutable) */ __webpack_exports__["__await"] = __await; | ||
/* harmony export (immutable) */ __webpack_exports__["__asyncGenerator"] = __asyncGenerator; | ||
/* harmony export (immutable) */ __webpack_exports__["__asyncDelegator"] = __asyncDelegator; | ||
/* harmony export (immutable) */ __webpack_exports__["__asyncValues"] = __asyncValues; | ||
/* harmony export (immutable) */ __webpack_exports__["__makeTemplateObject"] = __makeTemplateObject; | ||
/* harmony export (immutable) */ __webpack_exports__["__importStar"] = __importStar; | ||
/* harmony export (immutable) */ __webpack_exports__["__importDefault"] = __importDefault; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
/** | ||
* @param {!Object} windowObj | ||
* @return {boolean} | ||
*/ | ||
function hasProperShape(windowObj) { | ||
return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function'; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
/** | ||
* @param {string} eventType | ||
* @return {boolean} | ||
*/ | ||
function eventFoundInMaps(eventType) { | ||
return eventType in eventTypeMap || eventType in cssPropertyMap; | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
} | ||
return __assign.apply(this, arguments); | ||
} | ||
/** | ||
* @param {string} eventType | ||
* @param {!Object<string, !VendorPropertyMapType>} map | ||
* @param {!Element} el | ||
* @return {string} | ||
*/ | ||
function getJavaScriptEventName(eventType, map, el) { | ||
return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix; | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
return t; | ||
} | ||
/** | ||
* Helper function to determine browser prefix for CSS3 animation events | ||
* and property names. | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
*/ | ||
function getAnimationName(windowObj, eventType) { | ||
if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) { | ||
return eventType; | ||
} | ||
function __decorate(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
} | ||
var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap; | ||
var el = windowObj['document']['createElement']('div'); | ||
var eventName = ''; | ||
function __param(paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
} | ||
if (map === eventTypeMap) { | ||
eventName = getJavaScriptEventName(eventType, map, el); | ||
} else { | ||
eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix; | ||
} | ||
function __metadata(metadataKey, metadataValue) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); | ||
} | ||
return eventName; | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
// Public functions to access getAnimationName() for JavaScript events or CSS | ||
// property names. | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
} | ||
var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform']; | ||
function __exportStar(m, exports) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
/** | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
*/ | ||
function getCorrectEventName(windowObj, eventType) { | ||
return getAnimationName(windowObj, eventType); | ||
function __values(o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
function __await(v) { | ||
return this instanceof __await ? (this.v = v, this) : new __await(v); | ||
} | ||
function __asyncGenerator(thisArg, _arguments, generator) { | ||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var g = generator.apply(thisArg, _arguments || []), i, q = []; | ||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; | ||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } | ||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } | ||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } | ||
function fulfill(value) { resume("next", value); } | ||
function reject(value) { resume("throw", value); } | ||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } | ||
} | ||
function __asyncDelegator(o) { | ||
var i, p; | ||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; | ||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } | ||
} | ||
function __asyncValues(o) { | ||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var m = o[Symbol.asyncIterator], i; | ||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); | ||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } | ||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } | ||
} | ||
function __makeTemplateObject(cooked, raw) { | ||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } | ||
return cooked; | ||
}; | ||
function __importStar(mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result.default = mod; | ||
return result; | ||
} | ||
function __importDefault(mod) { | ||
return (mod && mod.__esModule) ? mod : { default: mod }; | ||
} | ||
/***/ }), | ||
/***/ 21: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/** | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
function getCorrectPropertyName(windowObj, eventType) { | ||
return getAnimationName(windowObj, eventType); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssPropertyNameMap = { | ||
animation: { | ||
prefixed: '-webkit-animation', | ||
standard: 'animation' | ||
}, | ||
transform: { | ||
prefixed: '-webkit-transform', | ||
standard: 'transform' | ||
}, | ||
transition: { | ||
prefixed: '-webkit-transition', | ||
standard: 'transition' | ||
} | ||
}; | ||
var jsEventTypeMap = { | ||
animationend: { | ||
cssProperty: 'animation', | ||
prefixed: 'webkitAnimationEnd', | ||
standard: 'animationend' | ||
}, | ||
animationiteration: { | ||
cssProperty: 'animation', | ||
prefixed: 'webkitAnimationIteration', | ||
standard: 'animationiteration' | ||
}, | ||
animationstart: { | ||
cssProperty: 'animation', | ||
prefixed: 'webkitAnimationStart', | ||
standard: 'animationstart' | ||
}, | ||
transitionend: { | ||
cssProperty: 'transition', | ||
prefixed: 'webkitTransitionEnd', | ||
standard: 'transitionend' | ||
} | ||
}; | ||
function isWindow(windowObj) { | ||
return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function'; | ||
} | ||
function getCorrectPropertyName(windowObj, cssProperty) { | ||
if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) { | ||
var el = windowObj.document.createElement('div'); | ||
var _a = cssPropertyNameMap[cssProperty], | ||
standard = _a.standard, | ||
prefixed = _a.prefixed; | ||
var isStandard = standard in el.style; | ||
return isStandard ? standard : prefixed; | ||
} | ||
return cssProperty; | ||
} | ||
exports.getCorrectPropertyName = getCorrectPropertyName; | ||
function getCorrectEventName(windowObj, eventType) { | ||
if (isWindow(windowObj) && eventType in jsEventTypeMap) { | ||
var el = windowObj.document.createElement('div'); | ||
var _a = jsEventTypeMap[eventType], | ||
standard = _a.standard, | ||
prefixed = _a.prefixed, | ||
cssProperty = _a.cssProperty; | ||
var isStandard = cssProperty in el.style; | ||
return isStandard ? standard : prefixed; | ||
} | ||
return eventType; | ||
} | ||
exports.getCorrectEventName = getCorrectEventName; | ||
/***/ }) | ||
@@ -243,0 +431,0 @@ |
/*! | ||
Material Components for the Web | ||
Copyright (c) 2018 Google Inc. | ||
Copyright (c) 2019 Google Inc. | ||
License: MIT | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.animation=n():(t.mdc=t.mdc||{},t.mdc.animation=n())}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=10)}({10:function(t,n,e){"use strict";function r(t){return void 0!==t.document&&"function"==typeof t.document.createElement}function i(t){return t in c||t in s}function o(t,n,e){return n[t].styleProperty in e.style?n[t].noPrefix:n[t].webkitPrefix}function a(t,n){if(!r(t)||!i(n))return n;var e=n in c?c:s,a=t.document.createElement("div");return e===c?o(n,e,a):e[n].noPrefix in a.style?e[n].noPrefix:e[n].webkitPrefix}function f(t,n){return a(t,n)}function u(t,n){return a(t,n)}Object.defineProperty(n,"__esModule",{value:!0}),e.d(n,"transformStyleProperties",function(){return m}),e.d(n,"getCorrectEventName",function(){return f}),e.d(n,"getCorrectPropertyName",function(){return u});/** | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.animation=n():(t.mdc=t.mdc||{},t.mdc.animation=n())}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=132)}({132:function(t,n,e){"use strict";/** | ||
* @license | ||
* Copyright 2019 Google Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
Object.defineProperty(n,"__esModule",{value:!0});var r=e(133),o=e(21);n.util=o,r.__exportStar(e(21),n)},133:function(t,n,e){"use strict";function r(t,n){function e(){this.constructor=t}x(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}function o(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&(e[r[o]]=t[r[o]]);return e}function i(t,n,e,r){var o,i=arguments.length,a=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(n,e,a):o(n,e))||a);return i>3&&a&&Object.defineProperty(n,e,a),a}function a(t,n){return function(e,r){n(e,r,t)}}function u(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function c(t,n,e,r){return new(e||(e=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new e(function(n){n(t.value)}).then(a,u)}c((r=r.apply(t,n||[])).next())})}function f(t,n){function e(t){return function(n){return r([t,n])}}function r(e){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,i&&(a=2&e[0]?i.return:e[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,e[1])).done)return a;switch(i=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,i=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(a=c.trys,!(a=a.length>0&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=n.call(t,c)}catch(t){e=[6,t],i=0}finally{o=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var o,i,a,u,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return u={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u}function l(t,n){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}function s(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function p(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function d(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(p(arguments[n]));return t}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function m(t,n,e){function r(t){l[t]&&(f[t]=function(n){return new Promise(function(e,r){s.push([t,n,e,r])>1||o(t,n)})})}function o(t,n){try{i(l[t](n))}catch(t){c(s[0][3],t)}}function i(t){t.value instanceof y?Promise.resolve(t.value.v).then(a,u):c(s[0][2],t)}function a(t){o("next",t)}function u(t){o("throw",t)}function c(t,n){t(n),s.shift(),s.length&&o(s[0][0],s[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var f,l=e.apply(t,n||[]),s=[];return f={},r("next"),r("throw"),r("return"),f[Symbol.asyncIterator]=function(){return this},f}function b(t){function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:y(t[n](e)),done:"return"===n}:o?o(e):e}:o}var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e}function _(t){function n(n){r[n]=t[n]&&function(r){return new Promise(function(o,i){r=t[n](r),e(o,i,r.done,r.value)})}}function e(t,n,e,r){Promise.resolve(r).then(function(n){t({value:n,done:e})},n)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=t[Symbol.asyncIterator];return o?o.call(t):(t="function"==typeof s?s(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r)}function v(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}function h(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function w(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.__extends=r,e.d(n,"__assign",function(){return O}),n.__rest=o,n.__decorate=i,n.__param=a,n.__metadata=u,n.__awaiter=c,n.__generator=f,n.__exportStar=l,n.__values=s,n.__read=p,n.__spread=d,n.__await=y,n.__asyncGenerator=m,n.__asyncDelegator=b,n.__asyncValues=_,n.__makeTemplateObject=v,n.__importStar=h,n.__importDefault=w;/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
var x=function(t,n){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},O=function(){return O=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},O.apply(this,arguments)}},21:function(t,n,e){"use strict";function r(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}function o(t,n){if(r(t)&&n in a){var e=t.document.createElement("div"),o=a[n],i=o.standard,u=o.prefixed;return i in e.style?i:u}return n}function i(t,n){if(r(t)&&n in u){var e=t.document.createElement("div"),o=u[n],i=o.standard,a=o.prefixed;return o.cssProperty in e.style?i:a}return n}/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
@@ -28,3 +64,3 @@ * | ||
*/ | ||
var c={animationstart:{noPrefix:"animationstart",webkitPrefix:"webkitAnimationStart",styleProperty:"animation"},animationend:{noPrefix:"animationend",webkitPrefix:"webkitAnimationEnd",styleProperty:"animation"},animationiteration:{noPrefix:"animationiteration",webkitPrefix:"webkitAnimationIteration",styleProperty:"animation"},transitionend:{noPrefix:"transitionend",webkitPrefix:"webkitTransitionEnd",styleProperty:"transition"}},s={animation:{noPrefix:"animation",webkitPrefix:"-webkit-animation"},transform:{noPrefix:"transform",webkitPrefix:"-webkit-transform"},transition:{noPrefix:"transition",webkitPrefix:"-webkit-transition"}},m=["transform","WebkitTransform","MozTransform","OTransform","MSTransform"]}})}); | ||
Object.defineProperty(n,"__esModule",{value:!0});var a={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},u={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};n.getCorrectPropertyName=o,n.getCorrectEventName=i}})}); | ||
//# sourceMappingURL=mdc.animation.min.js.map |
133
index.js
/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
* Copyright 2019 Google Inc. | ||
* | ||
@@ -23,128 +23,5 @@ * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
*/ | ||
/** | ||
* @typedef {{ | ||
* noPrefix: string, | ||
* webkitPrefix: string, | ||
* styleProperty: string | ||
* }} | ||
*/ | ||
let VendorPropertyMapType; | ||
/** @const {Object<string, !VendorPropertyMapType>} */ | ||
const eventTypeMap = { | ||
'animationstart': { | ||
noPrefix: 'animationstart', | ||
webkitPrefix: 'webkitAnimationStart', | ||
styleProperty: 'animation', | ||
}, | ||
'animationend': { | ||
noPrefix: 'animationend', | ||
webkitPrefix: 'webkitAnimationEnd', | ||
styleProperty: 'animation', | ||
}, | ||
'animationiteration': { | ||
noPrefix: 'animationiteration', | ||
webkitPrefix: 'webkitAnimationIteration', | ||
styleProperty: 'animation', | ||
}, | ||
'transitionend': { | ||
noPrefix: 'transitionend', | ||
webkitPrefix: 'webkitTransitionEnd', | ||
styleProperty: 'transition', | ||
}, | ||
}; | ||
/** @const {Object<string, !VendorPropertyMapType>} */ | ||
const cssPropertyMap = { | ||
'animation': { | ||
noPrefix: 'animation', | ||
webkitPrefix: '-webkit-animation', | ||
}, | ||
'transform': { | ||
noPrefix: 'transform', | ||
webkitPrefix: '-webkit-transform', | ||
}, | ||
'transition': { | ||
noPrefix: 'transition', | ||
webkitPrefix: '-webkit-transition', | ||
}, | ||
}; | ||
/** | ||
* @param {!Object} windowObj | ||
* @return {boolean} | ||
*/ | ||
function hasProperShape(windowObj) { | ||
return (windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function'); | ||
} | ||
/** | ||
* @param {string} eventType | ||
* @return {boolean} | ||
*/ | ||
function eventFoundInMaps(eventType) { | ||
return (eventType in eventTypeMap || eventType in cssPropertyMap); | ||
} | ||
/** | ||
* @param {string} eventType | ||
* @param {!Object<string, !VendorPropertyMapType>} map | ||
* @param {!Element} el | ||
* @return {string} | ||
*/ | ||
function getJavaScriptEventName(eventType, map, el) { | ||
return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix; | ||
} | ||
/** | ||
* Helper function to determine browser prefix for CSS3 animation events | ||
* and property names. | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
*/ | ||
function getAnimationName(windowObj, eventType) { | ||
if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) { | ||
return eventType; | ||
} | ||
const map = /** @type {!Object<string, !VendorPropertyMapType>} */ ( | ||
eventType in eventTypeMap ? eventTypeMap : cssPropertyMap | ||
); | ||
const el = windowObj['document']['createElement']('div'); | ||
let eventName = ''; | ||
if (map === eventTypeMap) { | ||
eventName = getJavaScriptEventName(eventType, map, el); | ||
} else { | ||
eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix; | ||
} | ||
return eventName; | ||
} | ||
// Public functions to access getAnimationName() for JavaScript events or CSS | ||
// property names. | ||
const transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform']; | ||
/** | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
*/ | ||
function getCorrectEventName(windowObj, eventType) { | ||
return getAnimationName(windowObj, eventType); | ||
} | ||
/** | ||
* @param {!Object} windowObj | ||
* @param {string} eventType | ||
* @return {string} | ||
*/ | ||
function getCorrectPropertyName(windowObj, eventType) { | ||
return getAnimationName(windowObj, eventType); | ||
} | ||
export {transformStyleProperties, getCorrectEventName, getCorrectPropertyName}; | ||
import * as util from './util'; | ||
export { util }; // New namespace | ||
export * from './util'; // Old namespace for backward compatibility | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@material/animation", | ||
"description": "Animation Variables and Mixins used by Material Components for the web", | ||
"version": "0.41.0", | ||
"version": "1.0.0-0", | ||
"license": "MIT", | ||
@@ -12,6 +12,12 @@ "keywords": [ | ||
"main": "dist/mdc.animation.js", | ||
"module": "index.js", | ||
"sideEffects": false, | ||
"types": "dist/mdc.animation.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/material-components/material-components-web.git" | ||
}, | ||
"dependencies": { | ||
"tslib": "^1.9.3" | ||
} | ||
} |
@@ -105,3 +105,3 @@ <!--docs: | ||
--- | --- | ||
`getCorrectEventName(windowObj, eventType)` | Returns a JavaScript event name, prefixed if necessary | ||
`getCorrectPropertyName(windowObj, eventType)` | Returns a CSS property name, prefixed if necessary | ||
`getCorrectEventName(windowObj: Window, eventType: StandardJsEventType) => StandardJsEventType \| PrefixedJsEventType` | Returns a JavaScript event name, prefixed if necessary. See [`types.ts`](types.ts) for supported values. | ||
`getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName) => StandardCssPropertyName \| PrefixedCssPropertyName` | Returns a CSS property name, prefixed if necessary. See [`types.ts`](types.ts) for supported values. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
120752
18
798
1
+ Addedtslib@^1.9.3
+ Addedtslib@1.14.1(transitive)