diff --git a/dist/vue-toasted.js b/dist/vue-toasted.js index 0fb4589..bf1b767 100644 --- a/dist/vue-toasted.js +++ b/dist/vue-toasted.js @@ -83,7 +83,7 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var randomFromSeed = __webpack_require__(19); +var randomFromSeed = __webpack_require__(18); var ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; var alphabet; @@ -280,7 +280,7 @@ var duration = 300; "use strict"; -module.exports = __webpack_require__(16); +module.exports = __webpack_require__(15); /***/ }), @@ -299,69 +299,66 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var uuid = __webpack_require__(2); -// add Object.assign Polyfill -__webpack_require__(11).polyfill(); - -/** - * Toast - * core instance of toast - * - * @param _options - * @returns {Toasted} - * @constructor +/** + * Toast + * core instance of toast + * + * @param _options + * @returns {Toasted} + * @constructor */ var Toasted = function Toasted(_options) { var _this = this; - /** - * Unique id of the toast + /** + * Unique id of the toast */ this.id = uuid.generate(); - /** - * Shared Options of the Toast + /** + * Shared Options of the Toast */ this.options = _options; - /** - * Cached Options of the Toast + /** + * Cached Options of the Toast */ this.cached_options = {}; - /** - * Shared Toasts list + /** + * Shared Toasts list */ this.global = {}; - /** - * All Registered Groups + /** + * All Registered Groups */ this.groups = []; - /** - * All Registered Toasts + /** + * All Registered Toasts */ this.toasts = []; - /** - * Element of the Toast Container + /** + * Element of the Toast Container */ this.container = null; - /** - * Initiate toast container + /** + * Initiate toast container */ initiateToastContainer(this); - /** - * Initiate custom toasts + /** + * Initiate custom toasts */ initiateCustomToasts(this); - /** - * Create New Group of Toasts - * - * @param o + /** + * Create New Group of Toasts + * + * @param o */ this.group = function (o) { @@ -381,35 +378,35 @@ var Toasted = function Toasted(_options) { return group; }; - /** - * Register a Global Toast - * - * @param name - * @param payload - * @param options + /** + * Register a Global Toast + * + * @param name + * @param payload + * @param options */ this.register = function (name, payload, options) { options = options || {}; return register(_this, name, payload, options); }; - /** - * Show a Simple Toast - * - * @param message - * @param options - * @returns {*} + /** + * Show a Simple Toast + * + * @param message + * @param options + * @returns {*} */ this.show = function (message, options) { return _show(_this, message, options); }; - /** - * Show a Toast with Success Style - * - * @param message - * @param options - * @returns {*} + /** + * Show a Toast with Success Style + * + * @param message + * @param options + * @returns {*} */ this.success = function (message, options) { options = options || {}; @@ -417,12 +414,12 @@ var Toasted = function Toasted(_options) { return _show(_this, message, options); }; - /** - * Show a Toast with Info Style - * - * @param message - * @param options - * @returns {*} + /** + * Show a Toast with Info Style + * + * @param message + * @param options + * @returns {*} */ this.info = function (message, options) { options = options || {}; @@ -430,12 +427,12 @@ var Toasted = function Toasted(_options) { return _show(_this, message, options); }; - /** - * Show a Toast with Error Style - * - * @param message - * @param options - * @returns {*} + /** + * Show a Toast with Error Style + * + * @param message + * @param options + * @returns {*} */ this.error = function (message, options) { options = options || {}; @@ -443,9 +440,9 @@ var Toasted = function Toasted(_options) { return _show(_this, message, options); }; - /** - * Remove a Toast - * @param el + /** + * Remove a Toast + * @param el */ this.remove = function (el) { _this.toasts = _this.toasts.filter(function (t) { @@ -454,10 +451,10 @@ var Toasted = function Toasted(_options) { if (el.parentNode) el.parentNode.removeChild(el); }; - /** - * Clear All Toasts - * - * @returns {boolean} + /** + * Clear All Toasts + * + * @returns {boolean} */ this.clear = function (onClear) { __WEBPACK_IMPORTED_MODULE_1__animations__["a" /* default */].clearAnimation(_this.toasts, function () { @@ -471,14 +468,14 @@ var Toasted = function Toasted(_options) { return this; }; -/** - * Wrapper for show method in order to manipulate options - * - * @param instance - * @param message - * @param options - * @returns {*} - * @private +/** + * Wrapper for show method in order to manipulate options + * + * @param instance + * @param message + * @param options + * @returns {*} + * @private */ var _show = function _show(instance, message, options) { options = options || {}; @@ -507,8 +504,8 @@ var _show = function _show(instance, message, options) { return toast; }; -/** - * Register the Custom Toasts +/** + * Register the Custom Toasts */ var initiateCustomToasts = function initiateCustomToasts(instance) { @@ -588,9 +585,9 @@ var register = function register(instance, name, callback, options) { /* styles */ -__webpack_require__(22) +__webpack_require__(21) -var Component = __webpack_require__(21)( +var Component = __webpack_require__(20)( /* script */ null, /* template */ @@ -644,7 +641,7 @@ n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q}); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(24))) /***/ }), /* 6 */ @@ -755,7 +752,7 @@ var toastObject = function toastObject(el, instance) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hammerjs__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hammerjs__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hammerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hammerjs__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__animations__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__object__ = __webpack_require__(7); @@ -766,30 +763,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var uuid = __webpack_require__(2); -// string includes polyfill -if (!String.prototype.includes) { - Object.defineProperty(String.prototype, 'includes', { - value: function value(search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > this.length) { - return false; - } else { - return this.indexOf(search, start) !== -1; - } - } - }); -} - var _options = {}; var _instance = null; -/** - * parse Options - * - * @param options - * @returns {{el: *, text: text, goAway: goAway}} +/** + * parse Options + * + * @param options + * @returns {{el: *, text: text, goAway: goAway}} */ var parseOptions = function parseOptions(options) { @@ -1033,12 +1013,12 @@ var appendIcon = function appendIcon(options, el, toast) { } }; -/** - * Create Action for the toast - * - * @param action - * @param toastObject - * @returns {Element} +/** + * Create Action for the toast + * + * @param action + * @param toastObject + * @returns {Element} */ var createAction = function createAction(action, toastObject) { @@ -1160,13 +1140,13 @@ var createAction = function createAction(action, toastObject) { return el; }; -/** - * this method will create the toast - * - * @param instance - * @param message - * @param options - * @returns {{el: *, text: text, goAway: goAway}} +/** + * this method will create the toast + * + * @param instance + * @param message + * @param options + * @returns {{el: *, text: text, goAway: goAway}} */ /* harmony default export */ __webpack_exports__["a"] = (function (instance, message, options) { @@ -1320,59 +1300,6 @@ module.exports = function() { /* 11 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/** - * Code refactored from Mozilla Developer Network: - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - */ - - - -function assign(target, firstSource) { - if (target === undefined || target === null) { - throw new TypeError('Cannot convert first argument to object'); - } - - var to = Object(target); - for (var i = 1; i < arguments.length; i++) { - var nextSource = arguments[i]; - if (nextSource === undefined || nextSource === null) { - continue; - } - - var keysArray = Object.keys(Object(nextSource)); - for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { - var nextKey = keysArray[nextIndex]; - var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); - if (desc !== undefined && desc.enumerable) { - to[nextKey] = nextSource[nextKey]; - } - } - } - return to; -} - -function polyfill() { - if (!Object.assign) { - Object.defineProperty(Object, 'assign', { - enumerable: false, - configurable: true, - writable: true, - value: assign - }); - } -} - -module.exports = { - assign: assign, - polyfill: polyfill -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -4020,7 +3947,7 @@ if (true) { /***/ }), -/* 13 */ +/* 12 */ /***/ (function(module, exports) { /** @@ -4076,13 +4003,13 @@ module.exports = function (random, alphabet, size) { /***/ }), -/* 14 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var generate = __webpack_require__(15); +var generate = __webpack_require__(14); var alphabet = __webpack_require__(0); // Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness. @@ -4129,15 +4056,15 @@ module.exports = build; /***/ }), -/* 15 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var alphabet = __webpack_require__(0); -var random = __webpack_require__(18); -var format = __webpack_require__(13); +var random = __webpack_require__(17); +var format = __webpack_require__(12); function generate(number) { var loopCounter = 0; @@ -4157,21 +4084,21 @@ module.exports = generate; /***/ }), -/* 16 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var alphabet = __webpack_require__(0); -var build = __webpack_require__(14); -var isValid = __webpack_require__(17); +var build = __webpack_require__(13); +var isValid = __webpack_require__(16); // if you are using cluster or multiple servers use this to make each instance // has a unique value for worker // Note: I don't know if this is automatically set when using third // party cluster solutions such as pm2. -var clusterWorkerId = __webpack_require__(20) || 0; +var clusterWorkerId = __webpack_require__(19) || 0; /** * Set the seed. @@ -4226,7 +4153,7 @@ module.exports.isValid = isValid; /***/ }), -/* 17 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4248,7 +4175,7 @@ module.exports = isShortId; /***/ }), -/* 18 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4276,7 +4203,7 @@ module.exports = randomByte; /***/ }), -/* 19 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4308,7 +4235,7 @@ module.exports = { /***/ }), -/* 20 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4318,7 +4245,7 @@ module.exports = 0; /***/ }), -/* 21 */ +/* 20 */ /***/ (function(module, exports) { // this module is a runtime utility for cleaner component module output and will @@ -4375,7 +4302,7 @@ module.exports = function normalizeComponent ( /***/ }), -/* 22 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a