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