@material/snackbar
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -78,3 +78,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 80); | ||
/******/ return __webpack_require__(__webpack_require__.s = 82); | ||
/******/ }) | ||
@@ -359,3 +359,3 @@ /************************************************************************/ | ||
/***/ 2: | ||
/***/ 4: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -367,6 +367,4 @@ | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(1); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__selection_control__ = __webpack_require__(3); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; }); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionControlState", function() { return __WEBPACK_IMPORTED_MODULE_2__selection_control__["a"]; }); | ||
/** | ||
@@ -393,12 +391,14 @@ * Copyright 2016 Google Inc. | ||
/***/ }), | ||
/***/ 3: | ||
/***/ 8: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectionControlState; }); | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformStyleProperties", function() { return transformStyleProperties; }); | ||
/* harmony export (immutable) */ __webpack_exports__["getCorrectEventName"] = getCorrectEventName; | ||
/* harmony export (immutable) */ __webpack_exports__["getCorrectPropertyName"] = getCorrectPropertyName; | ||
/** | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* Copyright 2016 Google Inc. All Rights Reserved. | ||
* | ||
@@ -419,17 +419,129 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
/** | ||
* @typedef {!{ | ||
* checked: boolean, | ||
* indeterminate: boolean, | ||
* disabled: boolean, | ||
* value: ?string | ||
* @typedef {{ | ||
* noPrefix: string, | ||
* webkitPrefix: string | ||
* }} | ||
*/ | ||
var SelectionControlState = void 0; | ||
var VendorPropertyMapType = void 0; | ||
/** @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' | ||
} | ||
}; | ||
/** | ||
* @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; | ||
} | ||
var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap; | ||
var el = windowObj['document']['createElement']('div'); | ||
var 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. | ||
var 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); | ||
} | ||
/***/ }), | ||
/***/ 80: | ||
/***/ 82: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(81); | ||
module.exports = __webpack_require__(83); | ||
@@ -439,3 +551,3 @@ | ||
/***/ 81: | ||
/***/ 83: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -446,5 +558,5 @@ | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(2); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(82); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation__ = __webpack_require__(9); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(4); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(84); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation__ = __webpack_require__(8); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; }); | ||
@@ -595,8 +707,8 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
/***/ 82: | ||
/***/ 84: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(2); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(83); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(4); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(85); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -757,2 +869,15 @@ | ||
if (!data) { | ||
throw new Error('Please provide a data object with at least a message to display.'); | ||
} | ||
if (!data.message) { | ||
throw new Error('Please provide a message to be displayed.'); | ||
} | ||
if (data.actionHandler && !data.actionText) { | ||
throw new Error('Please provide action text with the handler.'); | ||
} | ||
if (this.active) { | ||
this.queue_.push(data); | ||
return; | ||
} | ||
clearTimeout(this.timeoutId_); | ||
@@ -767,15 +892,2 @@ this.snackbarData_ = data; | ||
if (!this.snackbarData_) { | ||
throw new Error('Please provide a data object with at least a message to display.'); | ||
} | ||
if (!this.snackbarData_.message) { | ||
throw new Error('Please provide a message to be displayed.'); | ||
} | ||
if (this.snackbarData_.actionHandler && !this.snackbarData_.actionText) { | ||
throw new Error('Please provide action text with the handler.'); | ||
} | ||
if (this.active) { | ||
this.queue_.push(this.snackbarData_); | ||
} | ||
var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE, | ||
@@ -900,3 +1012,3 @@ MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE, | ||
/***/ 83: | ||
/***/ 85: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -943,150 +1055,2 @@ | ||
/***/ }), | ||
/***/ 9: | ||
/***/ (function(module, __webpack_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 (immutable) */ __webpack_exports__["getCorrectEventName"] = getCorrectEventName; | ||
/* harmony export (immutable) */ __webpack_exports__["getCorrectPropertyName"] = getCorrectPropertyName; | ||
/** | ||
* Copyright 2016 Google Inc. 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 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* @typedef {{ | ||
* noPrefix: string, | ||
* webkitPrefix: string | ||
* }} | ||
*/ | ||
var VendorPropertyMapType = void 0; | ||
/** @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' | ||
} | ||
}; | ||
/** | ||
* @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; | ||
} | ||
var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap; | ||
var el = windowObj['document']['createElement']('div'); | ||
var 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. | ||
var 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); | ||
} | ||
/***/ }) | ||
@@ -1093,0 +1057,0 @@ |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.snackbar=e():(t.mdc=t.mdc||{},t.mdc.snackbar=e())}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/assets/",e(e.s=80)}({0:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this.adapter_=e}return r(t,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),r(t,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}();e.a=a},1:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,t),this.root_=e;for(var r=arguments.length,a=Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];this.initialize.apply(this,a),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return a(t,null,[{key:"attachTo",value:function(e){return new t(e,new r.a)}}]),a(t,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(t,e){this.root_.addEventListener(t,e)}},{key:"unlisten",value:function(t,e){this.root_.removeEventListener(t,e)}},{key:"emit",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(t,{detail:e,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)}}]),t}();e.a=o},2:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=n(1),a=n(3);n.d(e,"MDCFoundation",function(){return i.a}),n.d(e,"MDCComponent",function(){return r.a}),n.d(e,"SelectionControlState",function(){return a.a})},3:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var i=void 0},80:function(t,e,n){t.exports=n(81)},81:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"MDCSnackbar",function(){return d});var o=n(2),s=n(82),u=n(9);n.d(e,"MDCSnackbarFoundation",function(){return s.a});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t){function e(){return i(this,e),r(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a(e,t),c(e,[{key:"show",value:function(t){this.foundation_.show(t)}},{key:"getDefaultFoundation",value:function(){var t=this,e=s.a.strings,n=e.TEXT_SELECTOR,i=e.ACTION_BUTTON_SELECTOR,r=function(){return t.root_.querySelector(n)},a=function(){return t.root_.querySelector(i)};return new s.a({addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},setAriaHidden:function(){return t.root_.setAttribute("aria-hidden","true")},unsetAriaHidden:function(){return t.root_.removeAttribute("aria-hidden")},setActionAriaHidden:function(){return a().setAttribute("aria-hidden","true")},unsetActionAriaHidden:function(){return a().removeAttribute("aria-hidden")},setActionText:function(t){a().textContent=t},setMessageText:function(t){r().textContent=t},setFocus:function(){return a().focus()},visibilityIsHidden:function(){return document.hidden},registerCapturedBlurHandler:function(t){return a().addEventListener("blur",t,!0)},deregisterCapturedBlurHandler:function(t){return a().removeEventListener("blur",t,!0)},registerVisibilityChangeHandler:function(t){return document.addEventListener("visibilitychange",t)},deregisterVisibilityChangeHandler:function(t){return document.removeEventListener("visibilitychange",t)},registerCapturedInteractionHandler:function(t,e){return document.body.addEventListener(t,e,!0)},deregisterCapturedInteractionHandler:function(t,e){return document.body.removeEventListener(t,e,!0)},registerActionClickHandler:function(t){return a().addEventListener("click",t)},deregisterActionClickHandler:function(t){return a().removeEventListener("click",t)},registerTransitionEndHandler:function(e){return t.root_.addEventListener(Object(u.getCorrectEventName)(window,"transitionend"),e)},deregisterTransitionEndHandler:function(e){return t.root_.removeEventListener(Object(u.getCorrectEventName)(window,"transitionend"),e)}})}},{key:"dismissesOnAction",get:function(){return this.foundation_.dismissesOnAction()},set:function(t){this.foundation_.setDismissOnAction(t)}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(o.MDCComponent)},82:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=n(2),s=n(83),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.active_=!1,n.actionWasClicked_=!1,n.dismissOnAction_=!0,n.firstFocus_=!0,n.pointerDownRecognized_=!1,n.snackbarHasFocus_=!1,n.snackbarData_=null,n.queue_=[],n.actionClickHandler_=function(){n.actionWasClicked_=!0,n.invokeAction_()},n.visibilitychangeHandler_=function(){clearTimeout(n.timeoutId_),n.snackbarHasFocus_=!0,n.adapter_.visibilityIsHidden()||setTimeout(n.cleanup_.bind(n),n.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)},n.interactionHandler_=function(t){"touchstart"!=t.type&&"mousedown"!=t.type||(n.pointerDownRecognized_=!0),n.handlePossibleTabKeyboardFocus_(t),"focus"==t.type&&(n.pointerDownRecognized_=!1)},n.blurHandler_=function(){clearTimeout(n.timeoutId_),n.snackbarHasFocus_=!1,n.timeoutId_=setTimeout(n.cleanup_.bind(n),n.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)},n}return a(e,t),c(e,[{key:"active",get:function(){return this.active_}}],[{key:"cssClasses",get:function(){return s.a}},{key:"strings",get:function(){return s.c}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},setAriaHidden:function(){},unsetAriaHidden:function(){},setActionAriaHidden:function(){},unsetActionAriaHidden:function(){},setActionText:function(){},setMessageText:function(){},setFocus:function(){},visibilityIsHidden:function(){return!1},registerCapturedBlurHandler:function(){},deregisterCapturedBlurHandler:function(){},registerVisibilityChangeHandler:function(){},deregisterVisibilityChangeHandler:function(){},registerCapturedInteractionHandler:function(){},deregisterCapturedInteractionHandler:function(){},registerActionClickHandler:function(){},deregisterActionClickHandler:function(){},registerTransitionEndHandler:function(){},deregisterTransitionEndHandler:function(){}}}}]),c(e,[{key:"init",value:function(){this.adapter_.registerActionClickHandler(this.actionClickHandler_),this.adapter_.setAriaHidden(),this.adapter_.setActionAriaHidden()}},{key:"destroy",value:function(){var t=this;this.adapter_.deregisterActionClickHandler(this.actionClickHandler_),this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_),this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_),["touchstart","mousedown","focus"].forEach(function(e){t.adapter_.deregisterCapturedInteractionHandler(e,t.interactionHandler_)})}},{key:"dismissesOnAction",value:function(){return this.dismissOnAction_}},{key:"setDismissOnAction",value:function(t){this.dismissOnAction_=!!t}},{key:"show",value:function(t){var e=this;if(clearTimeout(this.timeoutId_),this.snackbarData_=t,this.firstFocus_=!0,this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_),this.adapter_.registerCapturedBlurHandler(this.blurHandler_),["touchstart","mousedown","focus"].forEach(function(t){e.adapter_.registerCapturedInteractionHandler(t,e.interactionHandler_)}),!this.snackbarData_)throw new Error("Please provide a data object with at least a message to display.");if(!this.snackbarData_.message)throw new Error("Please provide a message to be displayed.");if(this.snackbarData_.actionHandler&&!this.snackbarData_.actionText)throw new Error("Please provide action text with the handler.");this.active&&this.queue_.push(this.snackbarData_);var n=s.a.ACTIVE,i=s.a.MULTILINE,r=s.a.ACTION_ON_BOTTOM;this.adapter_.setMessageText(this.snackbarData_.message),this.snackbarData_.multiline&&(this.adapter_.addClass(i),this.snackbarData_.actionOnBottom&&this.adapter_.addClass(r)),this.snackbarData_.actionHandler?(this.adapter_.setActionText(this.snackbarData_.actionText),this.actionHandler_=this.snackbarData_.actionHandler,this.setActionHidden_(!1)):(this.setActionHidden_(!0),this.actionHandler_=null,this.adapter_.setActionText(null)),this.active_=!0,this.adapter_.addClass(n),this.adapter_.unsetAriaHidden(),this.timeoutId_=setTimeout(this.cleanup_.bind(this),this.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)}},{key:"handlePossibleTabKeyboardFocus_",value:function(){this.firstFocus_&&!this.pointerDownRecognized_&&this.setFocusOnAction_(),this.firstFocus_=!1}},{key:"setFocusOnAction_",value:function(){this.adapter_.setFocus(),this.snackbarHasFocus_=!0,this.firstFocus_=!1}},{key:"invokeAction_",value:function(){try{if(!this.actionHandler_)return;this.actionHandler_()}finally{this.dismissOnAction_&&this.cleanup_()}}},{key:"cleanup_",value:function(){var t=this;if(!this.snackbarHasFocus_||this.actionWasClicked_){var e=s.a.ACTIVE,n=s.a.MULTILINE,i=s.a.ACTION_ON_BOTTOM;this.adapter_.removeClass(e);var r=function e(){clearTimeout(t.timeoutId_),t.adapter_.deregisterTransitionEndHandler(e),t.adapter_.removeClass(n),t.adapter_.removeClass(i),t.setActionHidden_(!0),t.adapter_.setAriaHidden(),t.active_=!1,t.snackbarHasFocus_=!1,t.showNext_()};this.adapter_.registerTransitionEndHandler(r)}}},{key:"showNext_",value:function(){this.queue_.length&&this.show(this.queue_.shift())}},{key:"setActionHidden_",value:function(t){t?this.adapter_.setActionAriaHidden():this.adapter_.unsetActionAriaHidden()}}]),e}(o.MDCFoundation);e.a=d},83:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"c",function(){return r}),n.d(e,"b",function(){return a});var i={ROOT:"mdc-snackbar",TEXT:"mdc-snackbar__text",ACTION_WRAPPER:"mdc-snackbar__action-wrapper",ACTION_BUTTON:"mdc-snackbar__action-button",ACTIVE:"mdc-snackbar--active",MULTILINE:"mdc-snackbar--multiline",ACTION_ON_BOTTOM:"mdc-snackbar--action-on-bottom"},r={TEXT_SELECTOR:".mdc-snackbar__text",ACTION_WRAPPER_SELECTOR:".mdc-snackbar__action-wrapper",ACTION_BUTTON_SELECTOR:".mdc-snackbar__action-button"},a={MESSAGE_TIMEOUT:2750}},9:function(t,e,n){"use strict";function i(t){return void 0!==t.document&&"function"==typeof t.document.createElement}function r(t){return t in c||t in d}function a(t,e,n){return e[t].styleProperty in n.style?e[t].noPrefix:e[t].webkitPrefix}function o(t,e){if(!i(t)||!r(e))return e;var n=e in c?c:d,o=t.document.createElement("div");return n===c?a(e,n,o):n[e].noPrefix in o.style?n[e].noPrefix:n[e].webkitPrefix}function s(t,e){return o(t,e)}function u(t,e){return o(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"transformStyleProperties",function(){return f}),e.getCorrectEventName=s,e.getCorrectPropertyName=u;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"}},d={animation:{noPrefix:"animation",webkitPrefix:"-webkit-animation"},transform:{noPrefix:"transform",webkitPrefix:"-webkit-transform"},transition:{noPrefix:"transition",webkitPrefix:"-webkit-transition"}},f=["transform","WebkitTransform","MozTransform","OTransform","MSTransform"]}})}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.snackbar=e():(t.mdc=t.mdc||{},t.mdc.snackbar=e())}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/assets/",e(e.s=82)}({0:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this.adapter_=e}return r(t,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),r(t,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}();e.a=o},1:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=n(0),o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,t),this.root_=e;for(var r=arguments.length,o=Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];this.initialize.apply(this,o),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return o(t,null,[{key:"attachTo",value:function(e){return new t(e,new r.a)}}]),o(t,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(t,e){this.root_.addEventListener(t,e)}},{key:"unlisten",value:function(t,e){this.root_.removeEventListener(t,e)}},{key:"emit",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(t,{detail:e,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)}}]),t}();e.a=a},4:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=n(1);n.d(e,"MDCFoundation",function(){return i.a}),n.d(e,"MDCComponent",function(){return r.a})},8:function(t,e,n){"use strict";function i(t){return void 0!==t.document&&"function"==typeof t.document.createElement}function r(t){return t in c||t in d}function o(t,e,n){return e[t].styleProperty in n.style?e[t].noPrefix:e[t].webkitPrefix}function a(t,e){if(!i(t)||!r(e))return e;var n=e in c?c:d,a=t.document.createElement("div");return n===c?o(e,n,a):n[e].noPrefix in a.style?n[e].noPrefix:n[e].webkitPrefix}function s(t,e){return a(t,e)}function u(t,e){return a(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"transformStyleProperties",function(){return f}),e.getCorrectEventName=s,e.getCorrectPropertyName=u;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"}},d={animation:{noPrefix:"animation",webkitPrefix:"-webkit-animation"},transform:{noPrefix:"transform",webkitPrefix:"-webkit-transform"},transition:{noPrefix:"transition",webkitPrefix:"-webkit-transition"}},f=["transform","WebkitTransform","MozTransform","OTransform","MSTransform"]},82:function(t,e,n){t.exports=n(83)},83:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"MDCSnackbar",function(){return d});var a=n(4),s=n(84),u=n(8);n.d(e,"MDCSnackbarFoundation",function(){return s.a});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t){function e(){return i(this,e),r(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),c(e,[{key:"show",value:function(t){this.foundation_.show(t)}},{key:"getDefaultFoundation",value:function(){var t=this,e=s.a.strings,n=e.TEXT_SELECTOR,i=e.ACTION_BUTTON_SELECTOR,r=function(){return t.root_.querySelector(n)},o=function(){return t.root_.querySelector(i)};return new s.a({addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},setAriaHidden:function(){return t.root_.setAttribute("aria-hidden","true")},unsetAriaHidden:function(){return t.root_.removeAttribute("aria-hidden")},setActionAriaHidden:function(){return o().setAttribute("aria-hidden","true")},unsetActionAriaHidden:function(){return o().removeAttribute("aria-hidden")},setActionText:function(t){o().textContent=t},setMessageText:function(t){r().textContent=t},setFocus:function(){return o().focus()},visibilityIsHidden:function(){return document.hidden},registerCapturedBlurHandler:function(t){return o().addEventListener("blur",t,!0)},deregisterCapturedBlurHandler:function(t){return o().removeEventListener("blur",t,!0)},registerVisibilityChangeHandler:function(t){return document.addEventListener("visibilitychange",t)},deregisterVisibilityChangeHandler:function(t){return document.removeEventListener("visibilitychange",t)},registerCapturedInteractionHandler:function(t,e){return document.body.addEventListener(t,e,!0)},deregisterCapturedInteractionHandler:function(t,e){return document.body.removeEventListener(t,e,!0)},registerActionClickHandler:function(t){return o().addEventListener("click",t)},deregisterActionClickHandler:function(t){return o().removeEventListener("click",t)},registerTransitionEndHandler:function(e){return t.root_.addEventListener(Object(u.getCorrectEventName)(window,"transitionend"),e)},deregisterTransitionEndHandler:function(e){return t.root_.removeEventListener(Object(u.getCorrectEventName)(window,"transitionend"),e)}})}},{key:"dismissesOnAction",get:function(){return this.foundation_.dismissesOnAction()},set:function(t){this.foundation_.setDismissOnAction(t)}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(a.MDCComponent)},84:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(4),s=n(85),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.active_=!1,n.actionWasClicked_=!1,n.dismissOnAction_=!0,n.firstFocus_=!0,n.pointerDownRecognized_=!1,n.snackbarHasFocus_=!1,n.snackbarData_=null,n.queue_=[],n.actionClickHandler_=function(){n.actionWasClicked_=!0,n.invokeAction_()},n.visibilitychangeHandler_=function(){clearTimeout(n.timeoutId_),n.snackbarHasFocus_=!0,n.adapter_.visibilityIsHidden()||setTimeout(n.cleanup_.bind(n),n.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)},n.interactionHandler_=function(t){"touchstart"!=t.type&&"mousedown"!=t.type||(n.pointerDownRecognized_=!0),n.handlePossibleTabKeyboardFocus_(t),"focus"==t.type&&(n.pointerDownRecognized_=!1)},n.blurHandler_=function(){clearTimeout(n.timeoutId_),n.snackbarHasFocus_=!1,n.timeoutId_=setTimeout(n.cleanup_.bind(n),n.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)},n}return o(e,t),c(e,[{key:"active",get:function(){return this.active_}}],[{key:"cssClasses",get:function(){return s.a}},{key:"strings",get:function(){return s.c}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},setAriaHidden:function(){},unsetAriaHidden:function(){},setActionAriaHidden:function(){},unsetActionAriaHidden:function(){},setActionText:function(){},setMessageText:function(){},setFocus:function(){},visibilityIsHidden:function(){return!1},registerCapturedBlurHandler:function(){},deregisterCapturedBlurHandler:function(){},registerVisibilityChangeHandler:function(){},deregisterVisibilityChangeHandler:function(){},registerCapturedInteractionHandler:function(){},deregisterCapturedInteractionHandler:function(){},registerActionClickHandler:function(){},deregisterActionClickHandler:function(){},registerTransitionEndHandler:function(){},deregisterTransitionEndHandler:function(){}}}}]),c(e,[{key:"init",value:function(){this.adapter_.registerActionClickHandler(this.actionClickHandler_),this.adapter_.setAriaHidden(),this.adapter_.setActionAriaHidden()}},{key:"destroy",value:function(){var t=this;this.adapter_.deregisterActionClickHandler(this.actionClickHandler_),this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_),this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_),["touchstart","mousedown","focus"].forEach(function(e){t.adapter_.deregisterCapturedInteractionHandler(e,t.interactionHandler_)})}},{key:"dismissesOnAction",value:function(){return this.dismissOnAction_}},{key:"setDismissOnAction",value:function(t){this.dismissOnAction_=!!t}},{key:"show",value:function(t){var e=this;if(!t)throw new Error("Please provide a data object with at least a message to display.");if(!t.message)throw new Error("Please provide a message to be displayed.");if(t.actionHandler&&!t.actionText)throw new Error("Please provide action text with the handler.");if(this.active)return void this.queue_.push(t);clearTimeout(this.timeoutId_),this.snackbarData_=t,this.firstFocus_=!0,this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_),this.adapter_.registerCapturedBlurHandler(this.blurHandler_),["touchstart","mousedown","focus"].forEach(function(t){e.adapter_.registerCapturedInteractionHandler(t,e.interactionHandler_)});var n=s.a.ACTIVE,i=s.a.MULTILINE,r=s.a.ACTION_ON_BOTTOM;this.adapter_.setMessageText(this.snackbarData_.message),this.snackbarData_.multiline&&(this.adapter_.addClass(i),this.snackbarData_.actionOnBottom&&this.adapter_.addClass(r)),this.snackbarData_.actionHandler?(this.adapter_.setActionText(this.snackbarData_.actionText),this.actionHandler_=this.snackbarData_.actionHandler,this.setActionHidden_(!1)):(this.setActionHidden_(!0),this.actionHandler_=null,this.adapter_.setActionText(null)),this.active_=!0,this.adapter_.addClass(n),this.adapter_.unsetAriaHidden(),this.timeoutId_=setTimeout(this.cleanup_.bind(this),this.snackbarData_.timeout||s.b.MESSAGE_TIMEOUT)}},{key:"handlePossibleTabKeyboardFocus_",value:function(){this.firstFocus_&&!this.pointerDownRecognized_&&this.setFocusOnAction_(),this.firstFocus_=!1}},{key:"setFocusOnAction_",value:function(){this.adapter_.setFocus(),this.snackbarHasFocus_=!0,this.firstFocus_=!1}},{key:"invokeAction_",value:function(){try{if(!this.actionHandler_)return;this.actionHandler_()}finally{this.dismissOnAction_&&this.cleanup_()}}},{key:"cleanup_",value:function(){var t=this;if(!this.snackbarHasFocus_||this.actionWasClicked_){var e=s.a.ACTIVE,n=s.a.MULTILINE,i=s.a.ACTION_ON_BOTTOM;this.adapter_.removeClass(e);var r=function e(){clearTimeout(t.timeoutId_),t.adapter_.deregisterTransitionEndHandler(e),t.adapter_.removeClass(n),t.adapter_.removeClass(i),t.setActionHidden_(!0),t.adapter_.setAriaHidden(),t.active_=!1,t.snackbarHasFocus_=!1,t.showNext_()};this.adapter_.registerTransitionEndHandler(r)}}},{key:"showNext_",value:function(){this.queue_.length&&this.show(this.queue_.shift())}},{key:"setActionHidden_",value:function(t){t?this.adapter_.setActionAriaHidden():this.adapter_.unsetActionAriaHidden()}}]),e}(a.MDCFoundation);e.a=d},85:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"c",function(){return r}),n.d(e,"b",function(){return o});var i={ROOT:"mdc-snackbar",TEXT:"mdc-snackbar__text",ACTION_WRAPPER:"mdc-snackbar__action-wrapper",ACTION_BUTTON:"mdc-snackbar__action-button",ACTIVE:"mdc-snackbar--active",MULTILINE:"mdc-snackbar--multiline",ACTION_ON_BOTTOM:"mdc-snackbar--action-on-bottom"},r={TEXT_SELECTOR:".mdc-snackbar__text",ACTION_WRAPPER_SELECTOR:".mdc-snackbar__action-wrapper",ACTION_BUTTON_SELECTOR:".mdc-snackbar__action-button"},o={MESSAGE_TIMEOUT:2750}}})}); |
@@ -122,24 +122,24 @@ /** | ||
show(data) { | ||
clearTimeout(this.timeoutId_); | ||
this.snackbarData_ = data; | ||
this.firstFocus_ = true; | ||
this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_); | ||
this.adapter_.registerCapturedBlurHandler(this.blurHandler_); | ||
['touchstart', 'mousedown', 'focus'].forEach((evtType) => { | ||
this.adapter_.registerCapturedInteractionHandler(evtType, this.interactionHandler_); | ||
}); | ||
if (!this.snackbarData_) { | ||
if (!data) { | ||
throw new Error( | ||
'Please provide a data object with at least a message to display.'); | ||
} | ||
if (!this.snackbarData_.message) { | ||
if (!data.message) { | ||
throw new Error('Please provide a message to be displayed.'); | ||
} | ||
if (this.snackbarData_.actionHandler && !this.snackbarData_.actionText) { | ||
if (data.actionHandler && !data.actionText) { | ||
throw new Error('Please provide action text with the handler.'); | ||
} | ||
if (this.active) { | ||
this.queue_.push(this.snackbarData_); | ||
this.queue_.push(data); | ||
return; | ||
} | ||
clearTimeout(this.timeoutId_); | ||
this.snackbarData_ = data; | ||
this.firstFocus_ = true; | ||
this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_); | ||
this.adapter_.registerCapturedBlurHandler(this.blurHandler_); | ||
['touchstart', 'mousedown', 'focus'].forEach((evtType) => { | ||
this.adapter_.registerCapturedInteractionHandler(evtType, this.interactionHandler_); | ||
}); | ||
@@ -146,0 +146,0 @@ const {ACTIVE, MULTILINE, ACTION_ON_BOTTOM} = cssClasses; |
{ | ||
"name": "@material/snackbar", | ||
"description": "The Material Components for the web snackbar component", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"license": "Apache-2.0", | ||
@@ -18,8 +18,8 @@ "keywords": [ | ||
"@material/animation": "^0.3.1", | ||
"@material/base": "^0.2.3", | ||
"@material/button": "^0.3.11", | ||
"@material/base": "^0.2.4", | ||
"@material/button": "^0.4.0", | ||
"@material/rtl": "^0.1.7", | ||
"@material/theme": "^0.1.7", | ||
"@material/theme": "^0.2.0", | ||
"@material/typography": "^0.3.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
96202
1547
+ Added@material/button@0.4.1(transitive)
+ Added@material/theme@0.2.0(transitive)
- Removed@material/button@0.3.11(transitive)
- Removed@material/theme@0.1.7(transitive)
Updated@material/base@^0.2.4
Updated@material/button@^0.4.0
Updated@material/theme@^0.2.0