@lanxuexing/vue2toast 0.0.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue2toast.js DELETED
@@ -1,947 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["Vue2Toast"] = factory();
8
- else
9
- root["Vue2Toast"] = factory();
10
- })(typeof self !== 'undefined' ? self : this, function() {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, {
50
- /******/ configurable: false,
51
- /******/ enumerable: true,
52
- /******/ get: getter
53
- /******/ });
54
- /******/ }
55
- /******/ };
56
- /******/
57
- /******/ // getDefaultExport function for compatibility with non-harmony modules
58
- /******/ __webpack_require__.n = function(module) {
59
- /******/ var getter = module && module.__esModule ?
60
- /******/ function getDefault() { return module['default']; } :
61
- /******/ function getModuleExports() { return module; };
62
- /******/ __webpack_require__.d(getter, 'a', getter);
63
- /******/ return getter;
64
- /******/ };
65
- /******/
66
- /******/ // Object.prototype.hasOwnProperty.call
67
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68
- /******/
69
- /******/ // __webpack_public_path__
70
- /******/ __webpack_require__.p = "";
71
- /******/
72
- /******/ // Load entry module and return exports
73
- /******/ return __webpack_require__(__webpack_require__.s = 1);
74
- /******/ })
75
- /************************************************************************/
76
- /******/ ([
77
- /* 0 */
78
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
79
-
80
- "use strict";
81
- //
82
- //
83
- //
84
- //
85
- //
86
- //
87
- //
88
- //
89
-
90
- /* harmony default export */ __webpack_exports__["a"] = ({
91
- data() {
92
- return {
93
- visible: false,
94
- message: ""
95
- };
96
- }
97
- });
98
-
99
- /***/ }),
100
- /* 1 */
101
- /***/ (function(module, exports, __webpack_require__) {
102
-
103
- "use strict";
104
-
105
-
106
- Object.defineProperty(exports, "__esModule", {
107
- value: true
108
- });
109
-
110
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
111
-
112
- var _vue2toast = __webpack_require__(2);
113
-
114
- var _vue2toast2 = _interopRequireDefault(_vue2toast);
115
-
116
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
117
-
118
- var Toast = {};
119
- Toast.install = function (Vue, options) {
120
- var opt = {
121
- duration: 3000 // 时长
122
- };
123
- var callback = ''; // 回调函数
124
-
125
- // 设置用户自定义配置项
126
- for (var key in options) {
127
- if (options.hasOwnProperty(key)) {
128
- var element = options[key];
129
- opt[key] = element;
130
- }
131
- }
132
-
133
- Vue.prototype.$toast = function (message, options) {
134
- if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) == 'object') {
135
- for (var _key in options) {
136
- if (options.hasOwnProperty(_key)) {
137
- var _element = options[_key];
138
- opt[_key] = _element;
139
- }
140
- }
141
- } else if (typeof options == 'function') {
142
- callback = options;
143
- }
144
- var ToastController = Vue.extend(_vue2toast2.default);
145
- var instance = new ToastController().$mount(document.createElement('div'));
146
- instance.message = message;
147
- instance.visible = true;
148
- document.body.appendChild(instance.$el);
149
- setTimeout(function () {
150
- instance.visible = false;
151
- setTimeout(function () {
152
- document.body.removeChild(instance.$el);
153
- callback && callback();
154
- }, 0);
155
- }, opt.duration);
156
- };
157
-
158
- // 扩展自定义配置项
159
- Vue.prototype.$toast['show'] = function (message, options) {
160
- return Vue.prototype.$toast(message, options);
161
- };
162
- };
163
-
164
- if (typeof window !== 'undefined' && window.Vue) {
165
- window.Vue.use(Toast);
166
- }
167
-
168
- exports.default = Toast;
169
-
170
- /***/ }),
171
- /* 2 */
172
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
173
-
174
- "use strict";
175
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
176
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue2toast_vue__ = __webpack_require__(0);
177
- /* empty harmony namespace reexport */
178
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4b4fb8b0_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_vue2toast_vue__ = __webpack_require__(9);
179
- var disposed = false
180
- function injectStyle (ssrContext) {
181
- if (disposed) return
182
- __webpack_require__(3)
183
- }
184
- var normalizeComponent = __webpack_require__(8)
185
- /* script */
186
-
187
-
188
- /* template */
189
-
190
- /* template functional */
191
- var __vue_template_functional__ = false
192
- /* styles */
193
- var __vue_styles__ = injectStyle
194
- /* scopeId */
195
- var __vue_scopeId__ = null
196
- /* moduleIdentifier (server only) */
197
- var __vue_module_identifier__ = null
198
- var Component = normalizeComponent(
199
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue2toast_vue__["a" /* default */],
200
- __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4b4fb8b0_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_vue2toast_vue__["a" /* default */],
201
- __vue_template_functional__,
202
- __vue_styles__,
203
- __vue_scopeId__,
204
- __vue_module_identifier__
205
- )
206
- Component.options.__file = "src/lib/vue2toast.vue"
207
-
208
- /* hot reload */
209
- if (false) {(function () {
210
- var hotAPI = require("vue-hot-reload-api")
211
- hotAPI.install(require("vue"), false)
212
- if (!hotAPI.compatible) return
213
- module.hot.accept()
214
- if (!module.hot.data) {
215
- hotAPI.createRecord("data-v-4b4fb8b0", Component.options)
216
- } else {
217
- hotAPI.reload("data-v-4b4fb8b0", Component.options)
218
- }
219
- module.hot.dispose(function (data) {
220
- disposed = true
221
- })
222
- })()}
223
-
224
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
225
-
226
-
227
- /***/ }),
228
- /* 3 */
229
- /***/ (function(module, exports, __webpack_require__) {
230
-
231
- // style-loader: Adds some css to the DOM by adding a <style> tag
232
-
233
- // load the styles
234
- var content = __webpack_require__(4);
235
- if(typeof content === 'string') content = [[module.i, content, '']];
236
- // Prepare cssTransformation
237
- var transform;
238
-
239
- var options = {}
240
- options.transform = transform
241
- // add the styles to the DOM
242
- var update = __webpack_require__(6)(content, options);
243
- if(content.locals) module.exports = content.locals;
244
- // Hot Module Replacement
245
- if(false) {
246
- // When the styles change, update the <style> tags
247
- if(!content.locals) {
248
- module.hot.accept("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-4b4fb8b0\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/postcss-loader/lib/index.js!../../node_modules/sass-loader/lib/loader.js!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./vue2toast.vue", function() {
249
- var newContent = require("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-4b4fb8b0\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/postcss-loader/lib/index.js!../../node_modules/sass-loader/lib/loader.js!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./vue2toast.vue");
250
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
251
- update(newContent);
252
- });
253
- }
254
- // When the module is disposed, remove the <style> tags
255
- module.hot.dispose(function() { update(); });
256
- }
257
-
258
- /***/ }),
259
- /* 4 */
260
- /***/ (function(module, exports, __webpack_require__) {
261
-
262
- exports = module.exports = __webpack_require__(5)(false);
263
- // imports
264
-
265
-
266
- // module
267
- exports.push([module.i, "\n.toast-container {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 9999 !important;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.toast-container .toast {\n width: 180px;\n height: 60px;\n line-height: 60px;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.61);\n border-radius: 10px;\n color: white;\n}\n.toast-container .fade-in {\n -webkit-animation-name: fade-in;\n animation-name: fade-in;\n -webkit-animation-duration: 0.3s;\n animation-duration: 0.3s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n.toast-container .fade-out {\n -webkit-animation-name: fade-out;\n animation-name: fade-out;\n -webkit-animation-duration: 0.3s;\n animation-duration: 0.3s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n.toast-container .message {\n font-size: 14px;\n color: #fff;\n}\n@-webkit-keyframes fade-in {\n0% {\n opacity: 0;\n -webkit-transform: scale(0.7);\n transform: scale(0.7);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@keyframes fade-in {\n0% {\n opacity: 0;\n -webkit-transform: scale(0.7);\n transform: scale(0.7);\n}\n100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n}\n@-webkit-keyframes fade-out {\n0% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n100% {\n opacity: 0;\n -webkit-transform: scale(0.7);\n transform: scale(0.7);\n}\n}\n@keyframes fade-out {\n0% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n100% {\n opacity: 0;\n -webkit-transform: scale(0.7);\n transform: scale(0.7);\n}\n}\n", ""]);
268
-
269
- // exports
270
-
271
-
272
- /***/ }),
273
- /* 5 */
274
- /***/ (function(module, exports) {
275
-
276
- /*
277
- MIT License http://www.opensource.org/licenses/mit-license.php
278
- Author Tobias Koppers @sokra
279
- */
280
- // css base code, injected by the css-loader
281
- module.exports = function(useSourceMap) {
282
- var list = [];
283
-
284
- // return the list of modules as css string
285
- list.toString = function toString() {
286
- return this.map(function (item) {
287
- var content = cssWithMappingToString(item, useSourceMap);
288
- if(item[2]) {
289
- return "@media " + item[2] + "{" + content + "}";
290
- } else {
291
- return content;
292
- }
293
- }).join("");
294
- };
295
-
296
- // import a list of modules into the list
297
- list.i = function(modules, mediaQuery) {
298
- if(typeof modules === "string")
299
- modules = [[null, modules, ""]];
300
- var alreadyImportedModules = {};
301
- for(var i = 0; i < this.length; i++) {
302
- var id = this[i][0];
303
- if(typeof id === "number")
304
- alreadyImportedModules[id] = true;
305
- }
306
- for(i = 0; i < modules.length; i++) {
307
- var item = modules[i];
308
- // skip already imported module
309
- // this implementation is not 100% perfect for weird media query combinations
310
- // when a module is imported multiple times with different media queries.
311
- // I hope this will never occur (Hey this way we have smaller bundles)
312
- if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
313
- if(mediaQuery && !item[2]) {
314
- item[2] = mediaQuery;
315
- } else if(mediaQuery) {
316
- item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
317
- }
318
- list.push(item);
319
- }
320
- }
321
- };
322
- return list;
323
- };
324
-
325
- function cssWithMappingToString(item, useSourceMap) {
326
- var content = item[1] || '';
327
- var cssMapping = item[3];
328
- if (!cssMapping) {
329
- return content;
330
- }
331
-
332
- if (useSourceMap && typeof btoa === 'function') {
333
- var sourceMapping = toComment(cssMapping);
334
- var sourceURLs = cssMapping.sources.map(function (source) {
335
- return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
336
- });
337
-
338
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
339
- }
340
-
341
- return [content].join('\n');
342
- }
343
-
344
- // Adapted from convert-source-map (MIT)
345
- function toComment(sourceMap) {
346
- // eslint-disable-next-line no-undef
347
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
348
- var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
349
-
350
- return '/*# ' + data + ' */';
351
- }
352
-
353
-
354
- /***/ }),
355
- /* 6 */
356
- /***/ (function(module, exports, __webpack_require__) {
357
-
358
- /*
359
- MIT License http://www.opensource.org/licenses/mit-license.php
360
- Author Tobias Koppers @sokra
361
- */
362
-
363
- var stylesInDom = {};
364
-
365
- var memoize = function (fn) {
366
- var memo;
367
-
368
- return function () {
369
- if (typeof memo === "undefined") memo = fn.apply(this, arguments);
370
- return memo;
371
- };
372
- };
373
-
374
- var isOldIE = memoize(function () {
375
- // Test for IE <= 9 as proposed by Browserhacks
376
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
377
- // Tests for existence of standard globals is to allow style-loader
378
- // to operate correctly into non-standard environments
379
- // @see https://github.com/webpack-contrib/style-loader/issues/177
380
- return window && document && document.all && !window.atob;
381
- });
382
-
383
- var getElement = (function (fn) {
384
- var memo = {};
385
-
386
- return function(selector) {
387
- if (typeof memo[selector] === "undefined") {
388
- memo[selector] = fn.call(this, selector);
389
- }
390
-
391
- return memo[selector]
392
- };
393
- })(function (target) {
394
- return document.querySelector(target)
395
- });
396
-
397
- var singleton = null;
398
- var singletonCounter = 0;
399
- var stylesInsertedAtTop = [];
400
-
401
- var fixUrls = __webpack_require__(7);
402
-
403
- module.exports = function(list, options) {
404
- if (typeof DEBUG !== "undefined" && DEBUG) {
405
- if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
406
- }
407
-
408
- options = options || {};
409
-
410
- options.attrs = typeof options.attrs === "object" ? options.attrs : {};
411
-
412
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
413
- // tags it will allow on a page
414
- if (!options.singleton) options.singleton = isOldIE();
415
-
416
- // By default, add <style> tags to the <head> element
417
- if (!options.insertInto) options.insertInto = "head";
418
-
419
- // By default, add <style> tags to the bottom of the target
420
- if (!options.insertAt) options.insertAt = "bottom";
421
-
422
- var styles = listToStyles(list, options);
423
-
424
- addStylesToDom(styles, options);
425
-
426
- return function update (newList) {
427
- var mayRemove = [];
428
-
429
- for (var i = 0; i < styles.length; i++) {
430
- var item = styles[i];
431
- var domStyle = stylesInDom[item.id];
432
-
433
- domStyle.refs--;
434
- mayRemove.push(domStyle);
435
- }
436
-
437
- if(newList) {
438
- var newStyles = listToStyles(newList, options);
439
- addStylesToDom(newStyles, options);
440
- }
441
-
442
- for (var i = 0; i < mayRemove.length; i++) {
443
- var domStyle = mayRemove[i];
444
-
445
- if(domStyle.refs === 0) {
446
- for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
447
-
448
- delete stylesInDom[domStyle.id];
449
- }
450
- }
451
- };
452
- };
453
-
454
- function addStylesToDom (styles, options) {
455
- for (var i = 0; i < styles.length; i++) {
456
- var item = styles[i];
457
- var domStyle = stylesInDom[item.id];
458
-
459
- if(domStyle) {
460
- domStyle.refs++;
461
-
462
- for(var j = 0; j < domStyle.parts.length; j++) {
463
- domStyle.parts[j](item.parts[j]);
464
- }
465
-
466
- for(; j < item.parts.length; j++) {
467
- domStyle.parts.push(addStyle(item.parts[j], options));
468
- }
469
- } else {
470
- var parts = [];
471
-
472
- for(var j = 0; j < item.parts.length; j++) {
473
- parts.push(addStyle(item.parts[j], options));
474
- }
475
-
476
- stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
477
- }
478
- }
479
- }
480
-
481
- function listToStyles (list, options) {
482
- var styles = [];
483
- var newStyles = {};
484
-
485
- for (var i = 0; i < list.length; i++) {
486
- var item = list[i];
487
- var id = options.base ? item[0] + options.base : item[0];
488
- var css = item[1];
489
- var media = item[2];
490
- var sourceMap = item[3];
491
- var part = {css: css, media: media, sourceMap: sourceMap};
492
-
493
- if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
494
- else newStyles[id].parts.push(part);
495
- }
496
-
497
- return styles;
498
- }
499
-
500
- function insertStyleElement (options, style) {
501
- var target = getElement(options.insertInto)
502
-
503
- if (!target) {
504
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
505
- }
506
-
507
- var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
508
-
509
- if (options.insertAt === "top") {
510
- if (!lastStyleElementInsertedAtTop) {
511
- target.insertBefore(style, target.firstChild);
512
- } else if (lastStyleElementInsertedAtTop.nextSibling) {
513
- target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
514
- } else {
515
- target.appendChild(style);
516
- }
517
- stylesInsertedAtTop.push(style);
518
- } else if (options.insertAt === "bottom") {
519
- target.appendChild(style);
520
- } else {
521
- throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
522
- }
523
- }
524
-
525
- function removeStyleElement (style) {
526
- if (style.parentNode === null) return false;
527
- style.parentNode.removeChild(style);
528
-
529
- var idx = stylesInsertedAtTop.indexOf(style);
530
- if(idx >= 0) {
531
- stylesInsertedAtTop.splice(idx, 1);
532
- }
533
- }
534
-
535
- function createStyleElement (options) {
536
- var style = document.createElement("style");
537
-
538
- options.attrs.type = "text/css";
539
-
540
- addAttrs(style, options.attrs);
541
- insertStyleElement(options, style);
542
-
543
- return style;
544
- }
545
-
546
- function createLinkElement (options) {
547
- var link = document.createElement("link");
548
-
549
- options.attrs.type = "text/css";
550
- options.attrs.rel = "stylesheet";
551
-
552
- addAttrs(link, options.attrs);
553
- insertStyleElement(options, link);
554
-
555
- return link;
556
- }
557
-
558
- function addAttrs (el, attrs) {
559
- Object.keys(attrs).forEach(function (key) {
560
- el.setAttribute(key, attrs[key]);
561
- });
562
- }
563
-
564
- function addStyle (obj, options) {
565
- var style, update, remove, result;
566
-
567
- // If a transform function was defined, run it on the css
568
- if (options.transform && obj.css) {
569
- result = options.transform(obj.css);
570
-
571
- if (result) {
572
- // If transform returns a value, use that instead of the original css.
573
- // This allows running runtime transformations on the css.
574
- obj.css = result;
575
- } else {
576
- // If the transform function returns a falsy value, don't add this css.
577
- // This allows conditional loading of css
578
- return function() {
579
- // noop
580
- };
581
- }
582
- }
583
-
584
- if (options.singleton) {
585
- var styleIndex = singletonCounter++;
586
-
587
- style = singleton || (singleton = createStyleElement(options));
588
-
589
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
590
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
591
-
592
- } else if (
593
- obj.sourceMap &&
594
- typeof URL === "function" &&
595
- typeof URL.createObjectURL === "function" &&
596
- typeof URL.revokeObjectURL === "function" &&
597
- typeof Blob === "function" &&
598
- typeof btoa === "function"
599
- ) {
600
- style = createLinkElement(options);
601
- update = updateLink.bind(null, style, options);
602
- remove = function () {
603
- removeStyleElement(style);
604
-
605
- if(style.href) URL.revokeObjectURL(style.href);
606
- };
607
- } else {
608
- style = createStyleElement(options);
609
- update = applyToTag.bind(null, style);
610
- remove = function () {
611
- removeStyleElement(style);
612
- };
613
- }
614
-
615
- update(obj);
616
-
617
- return function updateStyle (newObj) {
618
- if (newObj) {
619
- if (
620
- newObj.css === obj.css &&
621
- newObj.media === obj.media &&
622
- newObj.sourceMap === obj.sourceMap
623
- ) {
624
- return;
625
- }
626
-
627
- update(obj = newObj);
628
- } else {
629
- remove();
630
- }
631
- };
632
- }
633
-
634
- var replaceText = (function () {
635
- var textStore = [];
636
-
637
- return function (index, replacement) {
638
- textStore[index] = replacement;
639
-
640
- return textStore.filter(Boolean).join('\n');
641
- };
642
- })();
643
-
644
- function applyToSingletonTag (style, index, remove, obj) {
645
- var css = remove ? "" : obj.css;
646
-
647
- if (style.styleSheet) {
648
- style.styleSheet.cssText = replaceText(index, css);
649
- } else {
650
- var cssNode = document.createTextNode(css);
651
- var childNodes = style.childNodes;
652
-
653
- if (childNodes[index]) style.removeChild(childNodes[index]);
654
-
655
- if (childNodes.length) {
656
- style.insertBefore(cssNode, childNodes[index]);
657
- } else {
658
- style.appendChild(cssNode);
659
- }
660
- }
661
- }
662
-
663
- function applyToTag (style, obj) {
664
- var css = obj.css;
665
- var media = obj.media;
666
-
667
- if(media) {
668
- style.setAttribute("media", media)
669
- }
670
-
671
- if(style.styleSheet) {
672
- style.styleSheet.cssText = css;
673
- } else {
674
- while(style.firstChild) {
675
- style.removeChild(style.firstChild);
676
- }
677
-
678
- style.appendChild(document.createTextNode(css));
679
- }
680
- }
681
-
682
- function updateLink (link, options, obj) {
683
- var css = obj.css;
684
- var sourceMap = obj.sourceMap;
685
-
686
- /*
687
- If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
688
- and there is no publicPath defined then lets turn convertToAbsoluteUrls
689
- on by default. Otherwise default to the convertToAbsoluteUrls option
690
- directly
691
- */
692
- var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
693
-
694
- if (options.convertToAbsoluteUrls || autoFixUrls) {
695
- css = fixUrls(css);
696
- }
697
-
698
- if (sourceMap) {
699
- // http://stackoverflow.com/a/26603875
700
- css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
701
- }
702
-
703
- var blob = new Blob([css], { type: "text/css" });
704
-
705
- var oldSrc = link.href;
706
-
707
- link.href = URL.createObjectURL(blob);
708
-
709
- if(oldSrc) URL.revokeObjectURL(oldSrc);
710
- }
711
-
712
-
713
- /***/ }),
714
- /* 7 */
715
- /***/ (function(module, exports) {
716
-
717
-
718
- /**
719
- * When source maps are enabled, `style-loader` uses a link element with a data-uri to
720
- * embed the css on the page. This breaks all relative urls because now they are relative to a
721
- * bundle instead of the current page.
722
- *
723
- * One solution is to only use full urls, but that may be impossible.
724
- *
725
- * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
726
- *
727
- * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
728
- *
729
- */
730
-
731
- module.exports = function (css) {
732
- // get current location
733
- var location = typeof window !== "undefined" && window.location;
734
-
735
- if (!location) {
736
- throw new Error("fixUrls requires window.location");
737
- }
738
-
739
- // blank or null?
740
- if (!css || typeof css !== "string") {
741
- return css;
742
- }
743
-
744
- var baseUrl = location.protocol + "//" + location.host;
745
- var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
746
-
747
- // convert each url(...)
748
- /*
749
- This regular expression is just a way to recursively match brackets within
750
- a string.
751
-
752
- /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
753
- ( = Start a capturing group
754
- (?: = Start a non-capturing group
755
- [^)(] = Match anything that isn't a parentheses
756
- | = OR
757
- \( = Match a start parentheses
758
- (?: = Start another non-capturing groups
759
- [^)(]+ = Match anything that isn't a parentheses
760
- | = OR
761
- \( = Match a start parentheses
762
- [^)(]* = Match anything that isn't a parentheses
763
- \) = Match a end parentheses
764
- ) = End Group
765
- *\) = Match anything and then a close parens
766
- ) = Close non-capturing group
767
- * = Match anything
768
- ) = Close capturing group
769
- \) = Match a close parens
770
-
771
- /gi = Get all matches, not the first. Be case insensitive.
772
- */
773
- var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
774
- // strip quotes (if they exist)
775
- var unquotedOrigUrl = origUrl
776
- .trim()
777
- .replace(/^"(.*)"$/, function(o, $1){ return $1; })
778
- .replace(/^'(.*)'$/, function(o, $1){ return $1; });
779
-
780
- // already a full url? no change
781
- if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
782
- return fullMatch;
783
- }
784
-
785
- // convert the url to a full url
786
- var newUrl;
787
-
788
- if (unquotedOrigUrl.indexOf("//") === 0) {
789
- //TODO: should we add protocol?
790
- newUrl = unquotedOrigUrl;
791
- } else if (unquotedOrigUrl.indexOf("/") === 0) {
792
- // path should be relative to the base url
793
- newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
794
- } else {
795
- // path should be relative to current directory
796
- newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
797
- }
798
-
799
- // send back the fixed url(...)
800
- return "url(" + JSON.stringify(newUrl) + ")";
801
- });
802
-
803
- // send back the fixed css
804
- return fixedCss;
805
- };
806
-
807
-
808
- /***/ }),
809
- /* 8 */
810
- /***/ (function(module, exports) {
811
-
812
- /* globals __VUE_SSR_CONTEXT__ */
813
-
814
- // IMPORTANT: Do NOT use ES2015 features in this file.
815
- // This module is a runtime utility for cleaner component module output and will
816
- // be included in the final webpack user bundle.
817
-
818
- module.exports = function normalizeComponent (
819
- rawScriptExports,
820
- compiledTemplate,
821
- functionalTemplate,
822
- injectStyles,
823
- scopeId,
824
- moduleIdentifier /* server only */
825
- ) {
826
- var esModule
827
- var scriptExports = rawScriptExports = rawScriptExports || {}
828
-
829
- // ES6 modules interop
830
- var type = typeof rawScriptExports.default
831
- if (type === 'object' || type === 'function') {
832
- esModule = rawScriptExports
833
- scriptExports = rawScriptExports.default
834
- }
835
-
836
- // Vue.extend constructor export interop
837
- var options = typeof scriptExports === 'function'
838
- ? scriptExports.options
839
- : scriptExports
840
-
841
- // render functions
842
- if (compiledTemplate) {
843
- options.render = compiledTemplate.render
844
- options.staticRenderFns = compiledTemplate.staticRenderFns
845
- options._compiled = true
846
- }
847
-
848
- // functional template
849
- if (functionalTemplate) {
850
- options.functional = true
851
- }
852
-
853
- // scopedId
854
- if (scopeId) {
855
- options._scopeId = scopeId
856
- }
857
-
858
- var hook
859
- if (moduleIdentifier) { // server build
860
- hook = function (context) {
861
- // 2.3 injection
862
- context =
863
- context || // cached call
864
- (this.$vnode && this.$vnode.ssrContext) || // stateful
865
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
866
- // 2.2 with runInNewContext: true
867
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
868
- context = __VUE_SSR_CONTEXT__
869
- }
870
- // inject component styles
871
- if (injectStyles) {
872
- injectStyles.call(this, context)
873
- }
874
- // register component module identifier for async chunk inferrence
875
- if (context && context._registeredComponents) {
876
- context._registeredComponents.add(moduleIdentifier)
877
- }
878
- }
879
- // used by ssr in case component is cached and beforeCreate
880
- // never gets called
881
- options._ssrRegister = hook
882
- } else if (injectStyles) {
883
- hook = injectStyles
884
- }
885
-
886
- if (hook) {
887
- var functional = options.functional
888
- var existing = functional
889
- ? options.render
890
- : options.beforeCreate
891
-
892
- if (!functional) {
893
- // inject component registration as beforeCreate hook
894
- options.beforeCreate = existing
895
- ? [].concat(existing, hook)
896
- : [hook]
897
- } else {
898
- // for template-only hot-reload because in that case the render fn doesn't
899
- // go through the normalizer
900
- options._injectStyles = hook
901
- // register for functioal component in vue file
902
- options.render = function renderWithStyleInjection (h, context) {
903
- hook.call(context)
904
- return existing(h, context)
905
- }
906
- }
907
- }
908
-
909
- return {
910
- esModule: esModule,
911
- exports: scriptExports,
912
- options: options
913
- }
914
- }
915
-
916
-
917
- /***/ }),
918
- /* 9 */
919
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
920
-
921
- "use strict";
922
- var render = function() {
923
- var _vm = this
924
- var _h = _vm.$createElement
925
- var _c = _vm._self._c || _h
926
- return _c("section", { staticClass: "toast-container" }, [
927
- _c(
928
- "div",
929
- { staticClass: "toast", class: [_vm.visible ? "fade-in" : "fade-out"] },
930
- [_c("span", { staticClass: "message" }, [_vm._v(_vm._s(_vm.message))])]
931
- )
932
- ])
933
- }
934
- var staticRenderFns = []
935
- render._withStripped = true
936
- var esExports = { render: render, staticRenderFns: staticRenderFns }
937
- /* harmony default export */ __webpack_exports__["a"] = (esExports);
938
- if (false) {
939
- module.hot.accept()
940
- if (module.hot.data) {
941
- require("vue-hot-reload-api") .rerender("data-v-4b4fb8b0", esExports)
942
- }
943
- }
944
-
945
- /***/ })
946
- /******/ ]);
947
- });