Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@material/snackbar

Package Overview
Dependencies
Maintainers
13
Versions
1684
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/snackbar - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0-alpha.0

18

CHANGELOG.md

@@ -6,4 +6,18 @@ # Change Log

# [3.0.0](https://github.com/material-components/material-components-web/compare/v2.3.1...v3.0.0) (2019-06-25)
# [3.1.0-alpha.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0-alpha.0) (2019-07-16)
**Note:** Version bump only for package @material/snackbar
### Features
* **snackbar:** add feature targeting for styles ([#4876](https://github.com/material-components/material-components-web/issues/4876)) ([1b7aea1](https://github.com/material-components/material-components-web/commit/1b7aea1))
# [3.1.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0) (2019-07-16)
### Features
* **snackbar:** add feature targeting for styles ([#4876](https://github.com/material-components/material-components-web/issues/4876)) ([1b7aea1](https://github.com/material-components/material-components-web/commit/1b7aea1))

4

dist/mdc.snackbar.d.ts
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../../../@material/base/component
// ../../../@material/base/foundation
// ../../@material/base/component
// ../../@material/base/foundation

@@ -6,0 +6,0 @@ declare module '@material/snackbar' {

@@ -9,698 +9,1096 @@ /**

(function webpackUniversalModuleDefinition(root, factory) {
if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["snackbar"] = factory(); else root["mdc"] = root["mdc"] || {},
root["mdc"]["snackbar"] = factory();
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["snackbar"] = factory();
else
root["mdc"] = root["mdc"] || {}, root["mdc"]["snackbar"] = factory();
})(this, function() {
return function(modules) {
var installedModules = {};
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) {
return installedModules[moduleId].exports;
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-snackbar/index.ts");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./packages/mdc-base/component.ts":
/*!****************************************!*\
!*** ./packages/mdc-base/component.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @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.
*/
var __read = this && this.__read || function (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;
};
var __spread = this && this.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-base/foundation.ts");
var MDCComponent = /** @class */function () {
function MDCComponent(root, foundation) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
this.root_ = root;
this.initialize.apply(this, __spread(args));
// Note that we initialize foundation here and not within the constructor's default param so that
// this.root_ is defined and can be used within the foundation class.
this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
this.foundation_.init();
this.initialSyncWithDOM();
}
MDCComponent.attachTo = function (root) {
// Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
// returns an instantiated component with its root set to that element. Also note that in the cases of
// subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
// from getDefaultFoundation().
return new MDCComponent(root, new foundation_1.MDCFoundation({}));
};
/* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */
MDCComponent.prototype.initialize = function () {
var _args = [];
for (var _i = 0; _i < arguments.length; _i++) {
_args[_i] = arguments[_i];
}
// Subclasses can override this to do any additional setup work that would be considered part of a
// "constructor". Essentially, it is a hook into the parent constructor before the foundation is
// initialized. Any additional arguments besides root and foundation will be passed in here.
};
MDCComponent.prototype.getDefaultFoundation = function () {
// Subclasses must override this method to return a properly configured foundation class for the
// component.
throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
};
MDCComponent.prototype.initialSyncWithDOM = function () {
// Subclasses should override this method if they need to perform work to synchronize with a host DOM
// object. An example of this would be a form control wrapper that needs to synchronize its internal state
// to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
// reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
};
MDCComponent.prototype.destroy = function () {
// Subclasses may implement this method to release any resources / deregister any listeners they have
// attached. An example of this might be deregistering a resize event from the window object.
this.foundation_.destroy();
};
MDCComponent.prototype.listen = function (evtType, handler, options) {
this.root_.addEventListener(evtType, handler, options);
};
MDCComponent.prototype.unlisten = function (evtType, handler, options) {
this.root_.removeEventListener(evtType, handler, options);
};
/**
* Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.
*/
MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) {
if (shouldBubble === void 0) {
shouldBubble = false;
}
var evt;
if (typeof CustomEvent === 'function') {
evt = new CustomEvent(evtType, {
bubbles: shouldBubble,
detail: evtData
});
} else {
evt = document.createEvent('CustomEvent');
evt.initCustomEvent(evtType, shouldBubble, false, evtData);
}
this.root_.dispatchEvent(evt);
};
return MDCComponent;
}();
exports.MDCComponent = MDCComponent;
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
exports.default = MDCComponent;
/***/ }),
/***/ "./packages/mdc-base/foundation.ts":
/*!*****************************************!*\
!*** ./packages/mdc-base/foundation.ts ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var MDCFoundation = /** @class */function () {
function MDCFoundation(adapter) {
if (adapter === void 0) {
adapter = {};
}
this.adapter_ = adapter;
}
Object.defineProperty(MDCFoundation, "cssClasses", {
get: function get() {
// Classes extending MDCFoundation should implement this method to return an object which exports every
// CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "strings", {
get: function get() {
// Classes extending MDCFoundation should implement this method to return an object which exports all
// semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "numbers", {
get: function get() {
// Classes extending MDCFoundation should implement this method to return an object which exports all
// of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "defaultAdapter", {
get: function get() {
// Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
// way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
// validation.
return {};
},
enumerable: true,
configurable: true
});
MDCFoundation.prototype.init = function () {
// Subclasses should override this method to perform initialization routines (registering events, etc.)
};
MDCFoundation.prototype.destroy = function () {
// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
};
return MDCFoundation;
}();
exports.MDCFoundation = MDCFoundation;
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
exports.default = MDCFoundation;
/***/ }),
/***/ "./packages/mdc-dom/ponyfill.ts":
/*!**************************************!*\
!*** ./packages/mdc-dom/ponyfill.ts ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @license
* Copyright 2018 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(exports, "__esModule", { value: true });
/**
* @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
* This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
*/
function closest(element, selector) {
if (element.closest) {
return element.closest(selector);
}
var el = element;
while (el) {
if (matches(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
exports.closest = closest;
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
}
exports.matches = matches;
/***/ }),
/***/ "./packages/mdc-snackbar/component.ts":
/*!********************************************!*\
!*** ./packages/mdc-snackbar/component.ts ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @license
* Copyright 2018 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.
*/
var __extends = this && this.__extends || function () {
var _extendStatics = function extendStatics(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];
}
var module = installedModules[moduleId] = {
i: moduleId,
l: false,
exports: {}
};
return _extendStatics(d, b);
};
return function (d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __importStar = this && this.__importStar || function (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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts");
var ponyfill_1 = __webpack_require__(/*! @material/dom/ponyfill */ "./packages/mdc-dom/ponyfill.ts");
var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-snackbar/constants.ts");
var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-snackbar/foundation.ts");
var util = __importStar(__webpack_require__(/*! ./util */ "./packages/mdc-snackbar/util.ts"));
var SURFACE_SELECTOR = constants_1.strings.SURFACE_SELECTOR,
LABEL_SELECTOR = constants_1.strings.LABEL_SELECTOR,
ACTION_SELECTOR = constants_1.strings.ACTION_SELECTOR,
DISMISS_SELECTOR = constants_1.strings.DISMISS_SELECTOR,
OPENING_EVENT = constants_1.strings.OPENING_EVENT,
OPENED_EVENT = constants_1.strings.OPENED_EVENT,
CLOSING_EVENT = constants_1.strings.CLOSING_EVENT,
CLOSED_EVENT = constants_1.strings.CLOSED_EVENT;
var MDCSnackbar = /** @class */function (_super) {
__extends(MDCSnackbar, _super);
function MDCSnackbar() {
return _super !== null && _super.apply(this, arguments) || this;
}
MDCSnackbar.attachTo = function (root) {
return new MDCSnackbar(root);
};
MDCSnackbar.prototype.initialize = function (announcerFactory) {
if (announcerFactory === void 0) {
announcerFactory = function announcerFactory() {
return util.announce;
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l = true;
return module.exports;
}
__webpack_require__.m = modules;
__webpack_require__.c = installedModules;
__webpack_require__.d = function(exports, name, getter) {
if (!__webpack_require__.o(exports, name)) {
Object.defineProperty(exports, name, {
configurable: false,
enumerable: true,
get: getter
});
this.announce_ = announcerFactory();
};
MDCSnackbar.prototype.initialSyncWithDOM = function () {
var _this = this;
this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR);
this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR);
this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR);
this.handleKeyDown_ = function (evt) {
return _this.foundation_.handleKeyDown(evt);
};
this.handleSurfaceClick_ = function (evt) {
var target = evt.target;
if (_this.isActionButton_(target)) {
_this.foundation_.handleActionButtonClick(evt);
} else if (_this.isActionIcon_(target)) {
_this.foundation_.handleActionIconClick(evt);
}
};
__webpack_require__.n = function(module) {
var getter = module && module.__esModule ? function getDefault() {
return module["default"];
} : function getModuleExports() {
return module;
};
__webpack_require__.d(getter, "a", getter);
return getter;
this.registerKeyDownHandler_(this.handleKeyDown_);
this.registerSurfaceClickHandler_(this.handleSurfaceClick_);
};
MDCSnackbar.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this.deregisterKeyDownHandler_(this.handleKeyDown_);
this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);
};
MDCSnackbar.prototype.open = function () {
this.foundation_.open();
};
/**
* @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the
* `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom
* client-specific values may also be used if desired.
*/
MDCSnackbar.prototype.close = function (reason) {
if (reason === void 0) {
reason = '';
}
this.foundation_.close(reason);
};
MDCSnackbar.prototype.getDefaultFoundation = function () {
var _this = this;
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
// To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
var adapter = {
addClass: function addClass(className) {
return _this.root_.classList.add(className);
},
announce: function announce() {
return _this.announce_(_this.labelEl_);
},
notifyClosed: function notifyClosed(reason) {
return _this.emit(CLOSED_EVENT, reason ? { reason: reason } : {});
},
notifyClosing: function notifyClosing(reason) {
return _this.emit(CLOSING_EVENT, reason ? { reason: reason } : {});
},
notifyOpened: function notifyOpened() {
return _this.emit(OPENED_EVENT, {});
},
notifyOpening: function notifyOpening() {
return _this.emit(OPENING_EVENT, {});
},
removeClass: function removeClass(className) {
return _this.root_.classList.remove(className);
}
};
__webpack_require__.o = function(object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
};
__webpack_require__.p = "";
return __webpack_require__(__webpack_require__.s = 145);
}({
0: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var MDCFoundation = function() {
function MDCFoundation(adapter) {
if (adapter === void 0) {
adapter = {};
}
this.adapter_ = adapter;
}
Object.defineProperty(MDCFoundation, "cssClasses", {
get: function get() {
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "strings", {
get: function get() {
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "numbers", {
get: function get() {
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCFoundation, "defaultAdapter", {
get: function get() {
return {};
},
enumerable: true,
configurable: true
});
MDCFoundation.prototype.init = function() {};
MDCFoundation.prototype.destroy = function() {};
return MDCFoundation;
}();
exports.MDCFoundation = MDCFoundation;
exports.default = MDCFoundation;
return new foundation_1.MDCSnackbarFoundation(adapter);
};
Object.defineProperty(MDCSnackbar.prototype, "timeoutMs", {
get: function get() {
return this.foundation_.getTimeoutMs();
},
1: function(module, exports, __webpack_require__) {
"use strict";
var __read = this && this.__read || function(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;
};
var __spread = this && this.__spread || function() {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}
return ar;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var foundation_1 = __webpack_require__(0);
var MDCComponent = function() {
function MDCComponent(root, foundation) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
this.root_ = root;
this.initialize.apply(this, __spread(args));
this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
this.foundation_.init();
this.initialSyncWithDOM();
}
MDCComponent.attachTo = function(root) {
return new MDCComponent(root, new foundation_1.MDCFoundation({}));
};
MDCComponent.prototype.initialize = function() {
var _args = [];
for (var _i = 0; _i < arguments.length; _i++) {
_args[_i] = arguments[_i];
}
};
MDCComponent.prototype.getDefaultFoundation = function() {
throw new Error("Subclasses must override getDefaultFoundation to return a properly configured " + "foundation class");
};
MDCComponent.prototype.initialSyncWithDOM = function() {};
MDCComponent.prototype.destroy = function() {
this.foundation_.destroy();
};
MDCComponent.prototype.listen = function(evtType, handler, options) {
this.root_.addEventListener(evtType, handler, options);
};
MDCComponent.prototype.unlisten = function(evtType, handler, options) {
this.root_.removeEventListener(evtType, handler, options);
};
MDCComponent.prototype.emit = function(evtType, evtData, shouldBubble) {
if (shouldBubble === void 0) {
shouldBubble = false;
}
var evt;
if (typeof CustomEvent === "function") {
evt = new CustomEvent(evtType, {
bubbles: shouldBubble,
detail: evtData
});
} else {
evt = document.createEvent("CustomEvent");
evt.initCustomEvent(evtType, shouldBubble, false, evtData);
}
this.root_.dispatchEvent(evt);
};
return MDCComponent;
}();
exports.MDCComponent = MDCComponent;
exports.default = MDCComponent;
set: function set(timeoutMs) {
this.foundation_.setTimeoutMs(timeoutMs);
},
145: function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {
for (var p in m) {
if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
}
var __importStar = this && this.__importStar || function(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;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var util = __importStar(__webpack_require__(86));
exports.util = util;
__export(__webpack_require__(146));
__export(__webpack_require__(36));
__export(__webpack_require__(87));
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "closeOnEscape", {
get: function get() {
return this.foundation_.getCloseOnEscape();
},
146: function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function() {
var _extendStatics = function extendStatics(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);
};
return function(d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __importStar = this && this.__importStar || function(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;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var component_1 = __webpack_require__(1);
var ponyfill_1 = __webpack_require__(2);
var constants_1 = __webpack_require__(36);
var foundation_1 = __webpack_require__(87);
var util = __importStar(__webpack_require__(86));
var SURFACE_SELECTOR = constants_1.strings.SURFACE_SELECTOR, LABEL_SELECTOR = constants_1.strings.LABEL_SELECTOR, ACTION_SELECTOR = constants_1.strings.ACTION_SELECTOR, DISMISS_SELECTOR = constants_1.strings.DISMISS_SELECTOR, OPENING_EVENT = constants_1.strings.OPENING_EVENT, OPENED_EVENT = constants_1.strings.OPENED_EVENT, CLOSING_EVENT = constants_1.strings.CLOSING_EVENT, CLOSED_EVENT = constants_1.strings.CLOSED_EVENT;
var MDCSnackbar = function(_super) {
__extends(MDCSnackbar, _super);
function MDCSnackbar() {
return _super !== null && _super.apply(this, arguments) || this;
}
MDCSnackbar.attachTo = function(root) {
return new MDCSnackbar(root);
};
MDCSnackbar.prototype.initialize = function(announcerFactory) {
if (announcerFactory === void 0) {
announcerFactory = function announcerFactory() {
return util.announce;
};
}
this.announce_ = announcerFactory();
};
MDCSnackbar.prototype.initialSyncWithDOM = function() {
var _this = this;
this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR);
this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR);
this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR);
this.handleKeyDown_ = function(evt) {
return _this.foundation_.handleKeyDown(evt);
};
this.handleSurfaceClick_ = function(evt) {
var target = evt.target;
if (_this.isActionButton_(target)) {
_this.foundation_.handleActionButtonClick(evt);
} else if (_this.isActionIcon_(target)) {
_this.foundation_.handleActionIconClick(evt);
}
};
this.registerKeyDownHandler_(this.handleKeyDown_);
this.registerSurfaceClickHandler_(this.handleSurfaceClick_);
};
MDCSnackbar.prototype.destroy = function() {
_super.prototype.destroy.call(this);
this.deregisterKeyDownHandler_(this.handleKeyDown_);
this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);
};
MDCSnackbar.prototype.open = function() {
this.foundation_.open();
};
MDCSnackbar.prototype.close = function(reason) {
if (reason === void 0) {
reason = "";
}
this.foundation_.close(reason);
};
MDCSnackbar.prototype.getDefaultFoundation = function() {
var _this = this;
var adapter = {
addClass: function addClass(className) {
return _this.root_.classList.add(className);
},
announce: function announce() {
return _this.announce_(_this.labelEl_);
},
notifyClosed: function notifyClosed(reason) {
return _this.emit(CLOSED_EVENT, reason ? {
reason: reason
} : {});
},
notifyClosing: function notifyClosing(reason) {
return _this.emit(CLOSING_EVENT, reason ? {
reason: reason
} : {});
},
notifyOpened: function notifyOpened() {
return _this.emit(OPENED_EVENT, {});
},
notifyOpening: function notifyOpening() {
return _this.emit(OPENING_EVENT, {});
},
removeClass: function removeClass(className) {
return _this.root_.classList.remove(className);
}
};
return new foundation_1.MDCSnackbarFoundation(adapter);
};
Object.defineProperty(MDCSnackbar.prototype, "timeoutMs", {
get: function get() {
return this.foundation_.getTimeoutMs();
},
set: function set(timeoutMs) {
this.foundation_.setTimeoutMs(timeoutMs);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "closeOnEscape", {
get: function get() {
return this.foundation_.getCloseOnEscape();
},
set: function set(closeOnEscape) {
this.foundation_.setCloseOnEscape(closeOnEscape);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "isOpen", {
get: function get() {
return this.foundation_.isOpen();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "labelText", {
get: function get() {
return this.labelEl_.textContent;
},
set: function set(labelText) {
this.labelEl_.textContent = labelText;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "actionButtonText", {
get: function get() {
return this.actionEl_.textContent;
},
set: function set(actionButtonText) {
this.actionEl_.textContent = actionButtonText;
},
enumerable: true,
configurable: true
});
MDCSnackbar.prototype.registerKeyDownHandler_ = function(handler) {
this.listen("keydown", handler);
};
MDCSnackbar.prototype.deregisterKeyDownHandler_ = function(handler) {
this.unlisten("keydown", handler);
};
MDCSnackbar.prototype.registerSurfaceClickHandler_ = function(handler) {
this.surfaceEl_.addEventListener("click", handler);
};
MDCSnackbar.prototype.deregisterSurfaceClickHandler_ = function(handler) {
this.surfaceEl_.removeEventListener("click", handler);
};
MDCSnackbar.prototype.isActionButton_ = function(target) {
return Boolean(ponyfill_1.closest(target, ACTION_SELECTOR));
};
MDCSnackbar.prototype.isActionIcon_ = function(target) {
return Boolean(ponyfill_1.closest(target, DISMISS_SELECTOR));
};
return MDCSnackbar;
}(component_1.MDCComponent);
exports.MDCSnackbar = MDCSnackbar;
set: function set(closeOnEscape) {
this.foundation_.setCloseOnEscape(closeOnEscape);
},
2: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function closest(element, selector) {
if (element.closest) {
return element.closest(selector);
}
var el = element;
while (el) {
if (matches(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "isOpen", {
get: function get() {
return this.foundation_.isOpen();
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "labelText", {
get: function get() {
// This property only returns null if the node is a document, DOCTYPE, or notation.
// On Element nodes, it always returns a string.
return this.labelEl_.textContent;
},
set: function set(labelText) {
this.labelEl_.textContent = labelText;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbar.prototype, "actionButtonText", {
get: function get() {
return this.actionEl_.textContent;
},
set: function set(actionButtonText) {
this.actionEl_.textContent = actionButtonText;
},
enumerable: true,
configurable: true
});
MDCSnackbar.prototype.registerKeyDownHandler_ = function (handler) {
this.listen('keydown', handler);
};
MDCSnackbar.prototype.deregisterKeyDownHandler_ = function (handler) {
this.unlisten('keydown', handler);
};
MDCSnackbar.prototype.registerSurfaceClickHandler_ = function (handler) {
this.surfaceEl_.addEventListener('click', handler);
};
MDCSnackbar.prototype.deregisterSurfaceClickHandler_ = function (handler) {
this.surfaceEl_.removeEventListener('click', handler);
};
MDCSnackbar.prototype.isActionButton_ = function (target) {
return Boolean(ponyfill_1.closest(target, ACTION_SELECTOR));
};
MDCSnackbar.prototype.isActionIcon_ = function (target) {
return Boolean(ponyfill_1.closest(target, DISMISS_SELECTOR));
};
return MDCSnackbar;
}(component_1.MDCComponent);
exports.MDCSnackbar = MDCSnackbar;
/***/ }),
/***/ "./packages/mdc-snackbar/constants.ts":
/*!********************************************!*\
!*** ./packages/mdc-snackbar/constants.ts ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @license
* Copyright 2018 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(exports, "__esModule", { value: true });
var cssClasses = {
CLOSING: 'mdc-snackbar--closing',
OPEN: 'mdc-snackbar--open',
OPENING: 'mdc-snackbar--opening'
};
exports.cssClasses = cssClasses;
var strings = {
ACTION_SELECTOR: '.mdc-snackbar__action',
ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text',
CLOSED_EVENT: 'MDCSnackbar:closed',
CLOSING_EVENT: 'MDCSnackbar:closing',
DISMISS_SELECTOR: '.mdc-snackbar__dismiss',
LABEL_SELECTOR: '.mdc-snackbar__label',
OPENED_EVENT: 'MDCSnackbar:opened',
OPENING_EVENT: 'MDCSnackbar:opening',
REASON_ACTION: 'action',
REASON_DISMISS: 'dismiss',
SURFACE_SELECTOR: '.mdc-snackbar__surface'
};
exports.strings = strings;
var numbers = {
DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000,
MAX_AUTO_DISMISS_TIMEOUT_MS: 10000,
MIN_AUTO_DISMISS_TIMEOUT_MS: 4000,
// These variables need to be kept in sync with the values in _variables.scss.
SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,
SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,
/**
* Number of milliseconds to wait between temporarily clearing the label text
* in the DOM and subsequently restoring it. This is necessary to force IE 11
* to pick up the `aria-live` content change and announce it to the user.
*/
ARIA_LIVE_DELAY_MS: 1000
};
exports.numbers = numbers;
/***/ }),
/***/ "./packages/mdc-snackbar/foundation.ts":
/*!*********************************************!*\
!*** ./packages/mdc-snackbar/foundation.ts ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @license
* Copyright 2018 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.
*/
var __extends = this && this.__extends || function () {
var _extendStatics = function extendStatics(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];
}
exports.closest = closest;
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
};
return _extendStatics(d, b);
};
return function (d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || function () {
__assign = Object.assign || function (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];
}
exports.matches = matches;
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts");
var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-snackbar/constants.ts");
var OPENING = constants_1.cssClasses.OPENING,
OPEN = constants_1.cssClasses.OPEN,
CLOSING = constants_1.cssClasses.CLOSING;
var REASON_ACTION = constants_1.strings.REASON_ACTION,
REASON_DISMISS = constants_1.strings.REASON_DISMISS;
var MDCSnackbarFoundation = /** @class */function (_super) {
__extends(MDCSnackbarFoundation, _super);
function MDCSnackbarFoundation(adapter) {
var _this = _super.call(this, __assign({}, MDCSnackbarFoundation.defaultAdapter, adapter)) || this;
_this.isOpen_ = false;
_this.animationFrame_ = 0;
_this.animationTimer_ = 0;
_this.autoDismissTimer_ = 0;
_this.autoDismissTimeoutMs_ = constants_1.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;
_this.closeOnEscape_ = true;
return _this;
}
Object.defineProperty(MDCSnackbarFoundation, "cssClasses", {
get: function get() {
return constants_1.cssClasses;
},
36: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var cssClasses = {
CLOSING: "mdc-snackbar--closing",
OPEN: "mdc-snackbar--open",
OPENING: "mdc-snackbar--opening"
};
exports.cssClasses = cssClasses;
var strings = {
ACTION_SELECTOR: ".mdc-snackbar__action",
ARIA_LIVE_LABEL_TEXT_ATTR: "data-mdc-snackbar-label-text",
CLOSED_EVENT: "MDCSnackbar:closed",
CLOSING_EVENT: "MDCSnackbar:closing",
DISMISS_SELECTOR: ".mdc-snackbar__dismiss",
LABEL_SELECTOR: ".mdc-snackbar__label",
OPENED_EVENT: "MDCSnackbar:opened",
OPENING_EVENT: "MDCSnackbar:opening",
REASON_ACTION: "action",
REASON_DISMISS: "dismiss",
SURFACE_SELECTOR: ".mdc-snackbar__surface"
};
exports.strings = strings;
var numbers = {
DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5e3,
MAX_AUTO_DISMISS_TIMEOUT_MS: 1e4,
MIN_AUTO_DISMISS_TIMEOUT_MS: 4e3,
SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,
SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,
ARIA_LIVE_DELAY_MS: 1e3
};
exports.numbers = numbers;
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "strings", {
get: function get() {
return constants_1.strings;
},
86: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var constants_1 = __webpack_require__(36);
var ARIA_LIVE_DELAY_MS = constants_1.numbers.ARIA_LIVE_DELAY_MS;
var ARIA_LIVE_LABEL_TEXT_ATTR = constants_1.strings.ARIA_LIVE_LABEL_TEXT_ATTR;
function announce(ariaEl, labelEl) {
if (labelEl === void 0) {
labelEl = ariaEl;
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "numbers", {
get: function get() {
return constants_1.numbers;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "defaultAdapter", {
get: function get() {
return {
addClass: function addClass() {
return undefined;
},
announce: function announce() {
return undefined;
},
notifyClosed: function notifyClosed() {
return undefined;
},
notifyClosing: function notifyClosing() {
return undefined;
},
notifyOpened: function notifyOpened() {
return undefined;
},
notifyOpening: function notifyOpening() {
return undefined;
},
removeClass: function removeClass() {
return undefined;
}
var priority = ariaEl.getAttribute("aria-live");
var labelText = labelEl.textContent.trim();
if (!labelText || !priority) {
return;
}
ariaEl.setAttribute("aria-live", "off");
labelEl.textContent = "";
labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>';
labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);
setTimeout(function() {
ariaEl.setAttribute("aria-live", priority);
labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);
labelEl.textContent = labelText;
}, ARIA_LIVE_DELAY_MS);
}
exports.announce = announce;
};
},
87: function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function() {
var _extendStatics = function extendStatics(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);
};
return function(d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || function() {
__assign = Object.assign || function(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);
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var foundation_1 = __webpack_require__(0);
var constants_1 = __webpack_require__(36);
var OPENING = constants_1.cssClasses.OPENING, OPEN = constants_1.cssClasses.OPEN, CLOSING = constants_1.cssClasses.CLOSING;
var REASON_ACTION = constants_1.strings.REASON_ACTION, REASON_DISMISS = constants_1.strings.REASON_DISMISS;
var MDCSnackbarFoundation = function(_super) {
__extends(MDCSnackbarFoundation, _super);
function MDCSnackbarFoundation(adapter) {
var _this = _super.call(this, __assign({}, MDCSnackbarFoundation.defaultAdapter, adapter)) || this;
_this.isOpen_ = false;
_this.animationFrame_ = 0;
_this.animationTimer_ = 0;
_this.autoDismissTimer_ = 0;
_this.autoDismissTimeoutMs_ = constants_1.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;
_this.closeOnEscape_ = true;
return _this;
}
Object.defineProperty(MDCSnackbarFoundation, "cssClasses", {
get: function get() {
return constants_1.cssClasses;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "strings", {
get: function get() {
return constants_1.strings;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "numbers", {
get: function get() {
return constants_1.numbers;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCSnackbarFoundation, "defaultAdapter", {
get: function get() {
return {
addClass: function addClass() {
return undefined;
},
announce: function announce() {
return undefined;
},
notifyClosed: function notifyClosed() {
return undefined;
},
notifyClosing: function notifyClosing() {
return undefined;
},
notifyOpened: function notifyOpened() {
return undefined;
},
notifyOpening: function notifyOpening() {
return undefined;
},
removeClass: function removeClass() {
return undefined;
}
};
},
enumerable: true,
configurable: true
});
MDCSnackbarFoundation.prototype.destroy = function() {
this.clearAutoDismissTimer_();
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
clearTimeout(this.animationTimer_);
this.animationTimer_ = 0;
this.adapter_.removeClass(OPENING);
this.adapter_.removeClass(OPEN);
this.adapter_.removeClass(CLOSING);
};
MDCSnackbarFoundation.prototype.open = function() {
var _this = this;
this.clearAutoDismissTimer_();
this.isOpen_ = true;
this.adapter_.notifyOpening();
this.adapter_.removeClass(CLOSING);
this.adapter_.addClass(OPENING);
this.adapter_.announce();
this.runNextAnimationFrame_(function() {
_this.adapter_.addClass(OPEN);
_this.animationTimer_ = setTimeout(function() {
_this.handleAnimationTimerEnd_();
_this.adapter_.notifyOpened();
_this.autoDismissTimer_ = setTimeout(function() {
_this.close(REASON_DISMISS);
}, _this.getTimeoutMs());
}, constants_1.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);
});
};
MDCSnackbarFoundation.prototype.close = function(reason) {
var _this = this;
if (reason === void 0) {
reason = "";
}
if (!this.isOpen_) {
return;
}
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
this.clearAutoDismissTimer_();
this.isOpen_ = false;
this.adapter_.notifyClosing(reason);
this.adapter_.addClass(constants_1.cssClasses.CLOSING);
this.adapter_.removeClass(constants_1.cssClasses.OPEN);
this.adapter_.removeClass(constants_1.cssClasses.OPENING);
clearTimeout(this.animationTimer_);
this.animationTimer_ = setTimeout(function() {
_this.handleAnimationTimerEnd_();
_this.adapter_.notifyClosed(reason);
}, constants_1.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);
};
MDCSnackbarFoundation.prototype.isOpen = function() {
return this.isOpen_;
};
MDCSnackbarFoundation.prototype.getTimeoutMs = function() {
return this.autoDismissTimeoutMs_;
};
MDCSnackbarFoundation.prototype.setTimeoutMs = function(timeoutMs) {
var minValue = constants_1.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;
var maxValue = constants_1.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;
if (timeoutMs <= maxValue && timeoutMs >= minValue) {
this.autoDismissTimeoutMs_ = timeoutMs;
} else {
throw new Error("timeoutMs must be an integer in the range " + minValue + "–" + maxValue + ", but got '" + timeoutMs + "'");
}
};
MDCSnackbarFoundation.prototype.getCloseOnEscape = function() {
return this.closeOnEscape_;
};
MDCSnackbarFoundation.prototype.setCloseOnEscape = function(closeOnEscape) {
this.closeOnEscape_ = closeOnEscape;
};
MDCSnackbarFoundation.prototype.handleKeyDown = function(evt) {
var isEscapeKey = evt.key === "Escape" || evt.keyCode === 27;
if (isEscapeKey && this.getCloseOnEscape()) {
this.close(REASON_DISMISS);
}
};
MDCSnackbarFoundation.prototype.handleActionButtonClick = function(_evt) {
this.close(REASON_ACTION);
};
MDCSnackbarFoundation.prototype.handleActionIconClick = function(_evt) {
this.close(REASON_DISMISS);
};
MDCSnackbarFoundation.prototype.clearAutoDismissTimer_ = function() {
clearTimeout(this.autoDismissTimer_);
this.autoDismissTimer_ = 0;
};
MDCSnackbarFoundation.prototype.handleAnimationTimerEnd_ = function() {
this.animationTimer_ = 0;
this.adapter_.removeClass(constants_1.cssClasses.OPENING);
this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
};
MDCSnackbarFoundation.prototype.runNextAnimationFrame_ = function(callback) {
var _this = this;
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = requestAnimationFrame(function() {
_this.animationFrame_ = 0;
clearTimeout(_this.animationTimer_);
_this.animationTimer_ = setTimeout(callback, 0);
});
};
return MDCSnackbarFoundation;
}(foundation_1.MDCFoundation);
exports.MDCSnackbarFoundation = MDCSnackbarFoundation;
exports.default = MDCSnackbarFoundation;
enumerable: true,
configurable: true
});
MDCSnackbarFoundation.prototype.destroy = function () {
this.clearAutoDismissTimer_();
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
clearTimeout(this.animationTimer_);
this.animationTimer_ = 0;
this.adapter_.removeClass(OPENING);
this.adapter_.removeClass(OPEN);
this.adapter_.removeClass(CLOSING);
};
MDCSnackbarFoundation.prototype.open = function () {
var _this = this;
this.clearAutoDismissTimer_();
this.isOpen_ = true;
this.adapter_.notifyOpening();
this.adapter_.removeClass(CLOSING);
this.adapter_.addClass(OPENING);
this.adapter_.announce();
// Wait a frame once display is no longer "none", to establish basis for animation
this.runNextAnimationFrame_(function () {
_this.adapter_.addClass(OPEN);
_this.animationTimer_ = setTimeout(function () {
_this.handleAnimationTimerEnd_();
_this.adapter_.notifyOpened();
_this.autoDismissTimer_ = setTimeout(function () {
_this.close(REASON_DISMISS);
}, _this.getTimeoutMs());
}, constants_1.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);
});
};
/**
* @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the
* `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom
* client-specific values may also be used if desired.
*/
MDCSnackbarFoundation.prototype.close = function (reason) {
var _this = this;
if (reason === void 0) {
reason = '';
}
});
if (!this.isOpen_) {
// Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed
return;
}
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
this.clearAutoDismissTimer_();
this.isOpen_ = false;
this.adapter_.notifyClosing(reason);
this.adapter_.addClass(constants_1.cssClasses.CLOSING);
this.adapter_.removeClass(constants_1.cssClasses.OPEN);
this.adapter_.removeClass(constants_1.cssClasses.OPENING);
clearTimeout(this.animationTimer_);
this.animationTimer_ = setTimeout(function () {
_this.handleAnimationTimerEnd_();
_this.adapter_.notifyClosed(reason);
}, constants_1.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);
};
MDCSnackbarFoundation.prototype.isOpen = function () {
return this.isOpen_;
};
MDCSnackbarFoundation.prototype.getTimeoutMs = function () {
return this.autoDismissTimeoutMs_;
};
MDCSnackbarFoundation.prototype.setTimeoutMs = function (timeoutMs) {
// Use shorter variable names to make the code more readable
var minValue = constants_1.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;
var maxValue = constants_1.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;
if (timeoutMs <= maxValue && timeoutMs >= minValue) {
this.autoDismissTimeoutMs_ = timeoutMs;
} else {
throw new Error("timeoutMs must be an integer in the range " + minValue + "\u2013" + maxValue + ", but got '" + timeoutMs + "'");
}
};
MDCSnackbarFoundation.prototype.getCloseOnEscape = function () {
return this.closeOnEscape_;
};
MDCSnackbarFoundation.prototype.setCloseOnEscape = function (closeOnEscape) {
this.closeOnEscape_ = closeOnEscape;
};
MDCSnackbarFoundation.prototype.handleKeyDown = function (evt) {
var isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27;
if (isEscapeKey && this.getCloseOnEscape()) {
this.close(REASON_DISMISS);
}
};
MDCSnackbarFoundation.prototype.handleActionButtonClick = function (_evt) {
this.close(REASON_ACTION);
};
MDCSnackbarFoundation.prototype.handleActionIconClick = function (_evt) {
this.close(REASON_DISMISS);
};
MDCSnackbarFoundation.prototype.clearAutoDismissTimer_ = function () {
clearTimeout(this.autoDismissTimer_);
this.autoDismissTimer_ = 0;
};
MDCSnackbarFoundation.prototype.handleAnimationTimerEnd_ = function () {
this.animationTimer_ = 0;
this.adapter_.removeClass(constants_1.cssClasses.OPENING);
this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
};
/**
* Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
*/
MDCSnackbarFoundation.prototype.runNextAnimationFrame_ = function (callback) {
var _this = this;
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = requestAnimationFrame(function () {
_this.animationFrame_ = 0;
clearTimeout(_this.animationTimer_);
_this.animationTimer_ = setTimeout(callback, 0);
});
};
return MDCSnackbarFoundation;
}(foundation_1.MDCFoundation);
exports.MDCSnackbarFoundation = MDCSnackbarFoundation;
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
exports.default = MDCSnackbarFoundation;
/***/ }),
/***/ "./packages/mdc-snackbar/index.ts":
/*!****************************************!*\
!*** ./packages/mdc-snackbar/index.ts ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"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.
*/
function __export(m) {
for (var p in m) {
if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
}
var __importStar = this && this.__importStar || function (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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var util = __importStar(__webpack_require__(/*! ./util */ "./packages/mdc-snackbar/util.ts"));
exports.util = util;
__export(__webpack_require__(/*! ./component */ "./packages/mdc-snackbar/component.ts"));
__export(__webpack_require__(/*! ./constants */ "./packages/mdc-snackbar/constants.ts"));
__export(__webpack_require__(/*! ./foundation */ "./packages/mdc-snackbar/foundation.ts"));
/***/ }),
/***/ "./packages/mdc-snackbar/util.ts":
/*!***************************************!*\
!*** ./packages/mdc-snackbar/util.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @license
* Copyright 2018 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(exports, "__esModule", { value: true });
var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-snackbar/constants.ts");
var ARIA_LIVE_DELAY_MS = constants_1.numbers.ARIA_LIVE_DELAY_MS;
var ARIA_LIVE_LABEL_TEXT_ATTR = constants_1.strings.ARIA_LIVE_LABEL_TEXT_ATTR;
function announce(ariaEl, labelEl) {
if (labelEl === void 0) {
labelEl = ariaEl;
}
var priority = ariaEl.getAttribute('aria-live');
// Trim text to ignore `&nbsp;` (see below).
// textContent is only null if the node is a document, DOCTYPE, or notation.
var labelText = labelEl.textContent.trim();
if (!labelText || !priority) {
return;
}
// Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice.
ariaEl.setAttribute('aria-live', 'off');
// Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers.
// `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars
// sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first.
// Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event,
// so screen readers won't announce the second message unless we first clear `textContent`.
//
// We have to clear the label text two different ways to make it work in all browsers and screen readers:
//
// 1. `textContent = ''` is required for IE11 + JAWS
// 2. `innerHTML = '&nbsp;'` is required for Chrome + JAWS and NVDA
//
// All other browser/screen reader combinations support both methods.
//
// The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed.
// N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change.
//
// This technique has been tested in:
//
// * JAWS 2019:
// - Chrome 70
// - Firefox 60 (ESR)
// - IE 11
// * NVDA 2018:
// - Chrome 70
// - Firefox 60 (ESR)
// - IE 11
// * ChromeVox 53
labelEl.textContent = '';
labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>';
// Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.
// CSS generated content is normally announced by screen readers
// (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);
// however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.
labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);
setTimeout(function () {
// Allow screen readers to announce changes to the DOM again.
ariaEl.setAttribute('aria-live', priority);
// Remove the message from the ::before pseudo-element.
labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);
// Restore the original label text, which will be announced by screen readers.
labelEl.textContent = labelText;
}, ARIA_LIVE_DELAY_MS);
}
exports.announce = announce;
/***/ })
/******/ });
});
//# sourceMappingURL=mdc.snackbar.js.map

@@ -1,9 +0,1 @@

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE
*/
!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(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},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="",e(e.s=145)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();e.MDCFoundation=o,e.default=o},1:function(t,e,n){"use strict";var o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=function(){function t(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];this.root_=t,this.initialize.apply(this,i(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new r.MDCFoundation({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},t.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},t.prototype.emit=function(t,e,n){void 0===n&&(n=!1);var o;"function"==typeof CustomEvent?o=new CustomEvent(t,{bubbles:n,detail:e}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(o)},t}();e.MDCComponent=s,e.default=s},145:function(t,e,n){"use strict";function o(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(86));e.util=r,o(n(146)),o(n(36)),o(n(87))},146:function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(2),a=n(36),u=n(87),c=i(n(86)),l=a.strings.SURFACE_SELECTOR,f=a.strings.LABEL_SELECTOR,_=a.strings.ACTION_SELECTOR,p=a.strings.DISMISS_SELECTOR,d=a.strings.OPENING_EVENT,m=a.strings.OPENED_EVENT,h=a.strings.CLOSING_EVENT,y=a.strings.CLOSED_EVENT,O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){void 0===t&&(t=function(){return c.announce}),this.announce_=t()},e.prototype.initialSyncWithDOM=function(){var t=this;this.surfaceEl_=this.root_.querySelector(l),this.labelEl_=this.root_.querySelector(f),this.actionEl_=this.root_.querySelector(_),this.handleKeyDown_=function(e){return t.foundation_.handleKeyDown(e)},this.handleSurfaceClick_=function(e){var n=e.target;t.isActionButton_(n)?t.foundation_.handleActionButtonClick(e):t.isActionIcon_(n)&&t.foundation_.handleActionIconClick(e)},this.registerKeyDownHandler_(this.handleKeyDown_),this.registerSurfaceClickHandler_(this.handleSurfaceClick_)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.deregisterKeyDownHandler_(this.handleKeyDown_),this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_)},e.prototype.open=function(){this.foundation_.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation_.close(t)},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root_.classList.add(e)},announce:function(){return t.announce_(t.labelEl_)},notifyClosed:function(e){return t.emit(y,e?{reason:e}:{})},notifyClosing:function(e){return t.emit(h,e?{reason:e}:{})},notifyOpened:function(){return t.emit(m,{})},notifyOpening:function(){return t.emit(d,{})},removeClass:function(e){return t.root_.classList.remove(e)}};return new u.MDCSnackbarFoundation(e)},Object.defineProperty(e.prototype,"timeoutMs",{get:function(){return this.foundation_.getTimeoutMs()},set:function(t){this.foundation_.setTimeoutMs(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closeOnEscape",{get:function(){return this.foundation_.getCloseOnEscape()},set:function(t){this.foundation_.setCloseOnEscape(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation_.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labelText",{get:function(){return this.labelEl_.textContent},set:function(t){this.labelEl_.textContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actionButtonText",{get:function(){return this.actionEl_.textContent},set:function(t){this.actionEl_.textContent=t},enumerable:!0,configurable:!0}),e.prototype.registerKeyDownHandler_=function(t){this.listen("keydown",t)},e.prototype.deregisterKeyDownHandler_=function(t){this.unlisten("keydown",t)},e.prototype.registerSurfaceClickHandler_=function(t){this.surfaceEl_.addEventListener("click",t)},e.prototype.deregisterSurfaceClickHandler_=function(t){this.surfaceEl_.removeEventListener("click",t)},e.prototype.isActionButton_=function(t){return Boolean(s.closest(t,_))},e.prototype.isActionIcon_=function(t){return Boolean(s.closest(t,p))},e}(r.MDCComponent);e.MDCSnackbar=O},2:function(t,e,n){"use strict";function o(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(i(n,e))return n;n=n.parentElement}return null}function i(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=o,e.matches=i},36:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={CLOSING:"mdc-snackbar--closing",OPEN:"mdc-snackbar--open",OPENING:"mdc-snackbar--opening"};e.cssClasses=o;var i={ACTION_SELECTOR:".mdc-snackbar__action",ARIA_LIVE_LABEL_TEXT_ATTR:"data-mdc-snackbar-label-text",CLOSED_EVENT:"MDCSnackbar:closed",CLOSING_EVENT:"MDCSnackbar:closing",DISMISS_SELECTOR:".mdc-snackbar__dismiss",LABEL_SELECTOR:".mdc-snackbar__label",OPENED_EVENT:"MDCSnackbar:opened",OPENING_EVENT:"MDCSnackbar:opening",REASON_ACTION:"action",REASON_DISMISS:"dismiss",SURFACE_SELECTOR:".mdc-snackbar__surface"};e.strings=i;var r={DEFAULT_AUTO_DISMISS_TIMEOUT_MS:5e3,MAX_AUTO_DISMISS_TIMEOUT_MS:1e4,MIN_AUTO_DISMISS_TIMEOUT_MS:4e3,SNACKBAR_ANIMATION_CLOSE_TIME_MS:75,SNACKBAR_ANIMATION_OPEN_TIME_MS:150,ARIA_LIVE_DELAY_MS:1e3};e.numbers=r},86:function(t,e,n){"use strict";function o(t,e){void 0===e&&(e=t);var n=t.getAttribute("aria-live"),o=e.textContent.trim();o&&n&&(t.setAttribute("aria-live","off"),e.textContent="",e.innerHTML='<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>',e.setAttribute(s,o),setTimeout(function(){t.setAttribute("aria-live",n),e.removeAttribute(s),e.textContent=o},r))}Object.defineProperty(e,"__esModule",{value:!0});var i=n(36),r=i.numbers.ARIA_LIVE_DELAY_MS,s=i.strings.ARIA_LIVE_LABEL_TEXT_ATTR;e.announce=o},87:function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(36),a=s.cssClasses.OPENING,u=s.cssClasses.OPEN,c=s.cssClasses.CLOSING,l=s.strings.REASON_ACTION,f=s.strings.REASON_DISMISS,_=function(t){function e(n){var o=t.call(this,i({},e.defaultAdapter,n))||this;return o.isOpen_=!1,o.animationFrame_=0,o.animationTimer_=0,o.autoDismissTimer_=0,o.autoDismissTimeoutMs_=s.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS,o.closeOnEscape_=!0,o}return o(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return s.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return s.strings},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return s.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},announce:function(){},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},removeClass:function(){}}},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.clearAutoDismissTimer_(),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=0,this.adapter_.removeClass(a),this.adapter_.removeClass(u),this.adapter_.removeClass(c)},e.prototype.open=function(){var t=this;this.clearAutoDismissTimer_(),this.isOpen_=!0,this.adapter_.notifyOpening(),this.adapter_.removeClass(c),this.adapter_.addClass(a),this.adapter_.announce(),this.runNextAnimationFrame_(function(){t.adapter_.addClass(u),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter_.notifyOpened(),t.autoDismissTimer_=setTimeout(function(){t.close(f)},t.getTimeoutMs())},s.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS)})},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,this.clearAutoDismissTimer_(),this.isOpen_=!1,this.adapter_.notifyClosing(t),this.adapter_.addClass(s.cssClasses.CLOSING),this.adapter_.removeClass(s.cssClasses.OPEN),this.adapter_.removeClass(s.cssClasses.OPENING),clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){e.handleAnimationTimerEnd_(),e.adapter_.notifyClosed(t)},s.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getTimeoutMs=function(){return this.autoDismissTimeoutMs_},e.prototype.setTimeoutMs=function(t){var e=s.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS,n=s.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;if(!(t<=n&&t>=e))throw new Error("timeoutMs must be an integer in the range "+e+"–"+n+", but got '"+t+"'");this.autoDismissTimeoutMs_=t},e.prototype.getCloseOnEscape=function(){return this.closeOnEscape_},e.prototype.setCloseOnEscape=function(t){this.closeOnEscape_=t},e.prototype.handleKeyDown=function(t){("Escape"===t.key||27===t.keyCode)&&this.getCloseOnEscape()&&this.close(f)},e.prototype.handleActionButtonClick=function(t){this.close(l)},e.prototype.handleActionIconClick=function(t){this.close(f)},e.prototype.clearAutoDismissTimer_=function(){clearTimeout(this.autoDismissTimer_),this.autoDismissTimer_=0},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter_.removeClass(s.cssClasses.OPENING),this.adapter_.removeClass(s.cssClasses.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)})},e}(r.MDCFoundation);e.MDCSnackbarFoundation=_,e.default=_}})});
//# sourceMappingURL=mdc.snackbar.min.js.map
!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 o={},i.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=(Object.defineProperty(i,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),i.prototype.init=function(){},i.prototype.destroy=function(){},i);function i(t){void 0===t&&(t={}),this.adapter_=t}e.MDCFoundation=o,e.default=o},1:function(t,e,n){"use strict";var o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=(a.attachTo=function(t){return new a(t,new r.MDCFoundation({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var o;void 0===n&&(n=!1),"function"==typeof CustomEvent?o=new CustomEvent(t,{bubbles:n,detail:e}):(o=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(o)},a);function a(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];this.root_=t,this.initialize.apply(this,i(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=s,e.default=s},149:function(t,n,e){"use strict";function o(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var r=i(e(89));n.util=r,o(e(150)),o(e(38)),o(e(90))},150:function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s,a=n(1),u=n(2),c=n(38),l=n(90),f=r(n(89)),_=c.strings.SURFACE_SELECTOR,p=c.strings.LABEL_SELECTOR,d=c.strings.ACTION_SELECTOR,m=c.strings.DISMISS_SELECTOR,h=c.strings.OPENING_EVENT,y=c.strings.OPENED_EVENT,O=c.strings.CLOSING_EVENT,b=c.strings.CLOSED_EVENT,E=(s=a.MDCComponent,i(C,s),C.attachTo=function(t){return new C(t)},C.prototype.initialize=function(t){void 0===t&&(t=function(){return f.announce}),this.announce_=t()},C.prototype.initialSyncWithDOM=function(){var n=this;this.surfaceEl_=this.root_.querySelector(_),this.labelEl_=this.root_.querySelector(p),this.actionEl_=this.root_.querySelector(d),this.handleKeyDown_=function(t){return n.foundation_.handleKeyDown(t)},this.handleSurfaceClick_=function(t){var e=t.target;n.isActionButton_(e)?n.foundation_.handleActionButtonClick(t):n.isActionIcon_(e)&&n.foundation_.handleActionIconClick(t)},this.registerKeyDownHandler_(this.handleKeyDown_),this.registerSurfaceClickHandler_(this.handleSurfaceClick_)},C.prototype.destroy=function(){s.prototype.destroy.call(this),this.deregisterKeyDownHandler_(this.handleKeyDown_),this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_)},C.prototype.open=function(){this.foundation_.open()},C.prototype.close=function(t){void 0===t&&(t=""),this.foundation_.close(t)},C.prototype.getDefaultFoundation=function(){var e=this,t={addClass:function(t){return e.root_.classList.add(t)},announce:function(){return e.announce_(e.labelEl_)},notifyClosed:function(t){return e.emit(b,t?{reason:t}:{})},notifyClosing:function(t){return e.emit(O,t?{reason:t}:{})},notifyOpened:function(){return e.emit(y,{})},notifyOpening:function(){return e.emit(h,{})},removeClass:function(t){return e.root_.classList.remove(t)}};return new l.MDCSnackbarFoundation(t)},Object.defineProperty(C.prototype,"timeoutMs",{get:function(){return this.foundation_.getTimeoutMs()},set:function(t){this.foundation_.setTimeoutMs(t)},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"closeOnEscape",{get:function(){return this.foundation_.getCloseOnEscape()},set:function(t){this.foundation_.setCloseOnEscape(t)},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"isOpen",{get:function(){return this.foundation_.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"labelText",{get:function(){return this.labelEl_.textContent},set:function(t){this.labelEl_.textContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"actionButtonText",{get:function(){return this.actionEl_.textContent},set:function(t){this.actionEl_.textContent=t},enumerable:!0,configurable:!0}),C.prototype.registerKeyDownHandler_=function(t){this.listen("keydown",t)},C.prototype.deregisterKeyDownHandler_=function(t){this.unlisten("keydown",t)},C.prototype.registerSurfaceClickHandler_=function(t){this.surfaceEl_.addEventListener("click",t)},C.prototype.deregisterSurfaceClickHandler_=function(t){this.surfaceEl_.removeEventListener("click",t)},C.prototype.isActionButton_=function(t){return Boolean(u.closest(t,d))},C.prototype.isActionIcon_=function(t){return Boolean(u.closest(t,m))},C);function C(){return null!==s&&s.apply(this,arguments)||this}e.MDCSnackbar=E},2:function(t,e,n){"use strict";function o(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=function(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(o(n,e))return n;n=n.parentElement}return null},e.matches=o},38:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.cssClasses={CLOSING:"mdc-snackbar--closing",OPEN:"mdc-snackbar--open",OPENING:"mdc-snackbar--opening"};e.strings={ACTION_SELECTOR:".mdc-snackbar__action",ARIA_LIVE_LABEL_TEXT_ATTR:"data-mdc-snackbar-label-text",CLOSED_EVENT:"MDCSnackbar:closed",CLOSING_EVENT:"MDCSnackbar:closing",DISMISS_SELECTOR:".mdc-snackbar__dismiss",LABEL_SELECTOR:".mdc-snackbar__label",OPENED_EVENT:"MDCSnackbar:opened",OPENING_EVENT:"MDCSnackbar:opening",REASON_ACTION:"action",REASON_DISMISS:"dismiss",SURFACE_SELECTOR:".mdc-snackbar__surface"};e.numbers={DEFAULT_AUTO_DISMISS_TIMEOUT_MS:5e3,MAX_AUTO_DISMISS_TIMEOUT_MS:1e4,MIN_AUTO_DISMISS_TIMEOUT_MS:4e3,SNACKBAR_ANIMATION_CLOSE_TIME_MS:75,SNACKBAR_ANIMATION_OPEN_TIME_MS:150,ARIA_LIVE_DELAY_MS:1e3}},89:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(38),i=o.numbers.ARIA_LIVE_DELAY_MS,r=o.strings.ARIA_LIVE_LABEL_TEXT_ATTR;e.announce=function(t,e){void 0===e&&(e=t);var n=t.getAttribute("aria-live"),o=e.textContent.trim();o&&n&&(t.setAttribute("aria-live","off"),e.textContent="",e.innerHTML='<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>',e.setAttribute(r,o),setTimeout(function(){t.setAttribute("aria-live",n),e.removeAttribute(r),e.textContent=o},i))}},90:function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s,a=n(0),u=n(38),c=u.cssClasses.OPENING,l=u.cssClasses.OPEN,f=u.cssClasses.CLOSING,_=u.strings.REASON_ACTION,p=u.strings.REASON_DISMISS,d=(s=a.MDCFoundation,i(m,s),Object.defineProperty(m,"cssClasses",{get:function(){return u.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(m,"strings",{get:function(){return u.strings},enumerable:!0,configurable:!0}),Object.defineProperty(m,"numbers",{get:function(){return u.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(m,"defaultAdapter",{get:function(){return{addClass:function(){},announce:function(){},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},removeClass:function(){}}},enumerable:!0,configurable:!0}),m.prototype.destroy=function(){this.clearAutoDismissTimer_(),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=0,this.adapter_.removeClass(c),this.adapter_.removeClass(l),this.adapter_.removeClass(f)},m.prototype.open=function(){var t=this;this.clearAutoDismissTimer_(),this.isOpen_=!0,this.adapter_.notifyOpening(),this.adapter_.removeClass(f),this.adapter_.addClass(c),this.adapter_.announce(),this.runNextAnimationFrame_(function(){t.adapter_.addClass(l),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter_.notifyOpened(),t.autoDismissTimer_=setTimeout(function(){t.close(p)},t.getTimeoutMs())},u.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS)})},m.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,this.clearAutoDismissTimer_(),this.isOpen_=!1,this.adapter_.notifyClosing(t),this.adapter_.addClass(u.cssClasses.CLOSING),this.adapter_.removeClass(u.cssClasses.OPEN),this.adapter_.removeClass(u.cssClasses.OPENING),clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){e.handleAnimationTimerEnd_(),e.adapter_.notifyClosed(t)},u.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS))},m.prototype.isOpen=function(){return this.isOpen_},m.prototype.getTimeoutMs=function(){return this.autoDismissTimeoutMs_},m.prototype.setTimeoutMs=function(t){var e=u.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS,n=u.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;if(!(t<=n&&e<=t))throw new Error("timeoutMs must be an integer in the range "+e+"–"+n+", but got '"+t+"'");this.autoDismissTimeoutMs_=t},m.prototype.getCloseOnEscape=function(){return this.closeOnEscape_},m.prototype.setCloseOnEscape=function(t){this.closeOnEscape_=t},m.prototype.handleKeyDown=function(t){"Escape"!==t.key&&27!==t.keyCode||!this.getCloseOnEscape()||this.close(p)},m.prototype.handleActionButtonClick=function(t){this.close(_)},m.prototype.handleActionIconClick=function(t){this.close(p)},m.prototype.clearAutoDismissTimer_=function(){clearTimeout(this.autoDismissTimer_),this.autoDismissTimer_=0},m.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter_.removeClass(u.cssClasses.OPENING),this.adapter_.removeClass(u.cssClasses.CLOSING)},m.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)})},m);function m(t){var e=s.call(this,r({},m.defaultAdapter,t))||this;return e.isOpen_=!1,e.animationFrame_=0,e.animationTimer_=0,e.autoDismissTimer_=0,e.autoDismissTimeoutMs_=u.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS,e.closeOnEscape_=!0,e}e.MDCSnackbarFoundation=d,e.default=d}},i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=149);function i(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var n,o});
{
"name": "@material/snackbar",
"description": "The Material Components for the web snackbar component",
"version": "3.0.0",
"version": "3.1.0-alpha.0",
"license": "MIT",

@@ -22,13 +22,14 @@ "keywords": [

"@material/base": "^3.0.0",
"@material/button": "^3.0.0",
"@material/button": "^3.1.0-alpha.0",
"@material/dom": "^3.0.0",
"@material/icon-button": "^3.0.0",
"@material/ripple": "^3.0.0",
"@material/feature-targeting": "^3.0.0",
"@material/icon-button": "^3.1.0-alpha.0",
"@material/ripple": "^3.1.0-alpha.0",
"@material/rtl": "^3.0.0",
"@material/shape": "^3.0.0",
"@material/theme": "^3.0.0",
"@material/theme": "^3.1.0-alpha.0",
"@material/typography": "^3.0.0",
"tslib": "^1.9.3"
},
"gitHead": "747f6ed544e3a3bb3fde71ceaa51359f2212bfb9"
"gitHead": "42b485550d87a4c3328a07847b4070d15f09af8f"
}

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc