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["Aimer"] = factory();
|
8 | else
|
9 | root["Aimer"] = factory();
|
10 | })(this, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
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 |
|
67 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
68 |
|
69 |
|
70 | __webpack_require__.p = "/";
|
71 |
|
72 |
|
73 | return __webpack_require__(__webpack_require__.s = 5);
|
74 | })
|
75 |
|
76 | ([
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | (function(module, exports) {
|
84 |
|
85 | var g;
|
86 |
|
87 |
|
88 | g = (function() {
|
89 | return this;
|
90 | })();
|
91 |
|
92 | try {
|
93 |
|
94 | g = g || Function("return this")() || (1,eval)("this");
|
95 | } catch(e) {
|
96 |
|
97 | if(typeof window === "object")
|
98 | g = window;
|
99 | }
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | module.exports = g;
|
106 |
|
107 |
|
108 | }),
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | (function(module, __webpack_exports__, __webpack_require__) {
|
116 |
|
117 | "use strict";
|
118 | (function(global, setImmediate) { |
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | function isUndef (v) {
|
128 | return v === undefined || v === null
|
129 | }
|
130 |
|
131 | function isDef (v) {
|
132 | return v !== undefined && v !== null
|
133 | }
|
134 |
|
135 | function isTrue (v) {
|
136 | return v === true
|
137 | }
|
138 |
|
139 | function isFalse (v) {
|
140 | return v === false
|
141 | }
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | function isPrimitive (value) {
|
147 | return (
|
148 | typeof value === 'string' ||
|
149 | typeof value === 'number' ||
|
150 | typeof value === 'boolean'
|
151 | )
|
152 | }
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | function isObject (obj) {
|
160 | return obj !== null && typeof obj === 'object'
|
161 | }
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | var _toString = Object.prototype.toString;
|
167 |
|
168 | function toRawType (value) {
|
169 | return _toString.call(value).slice(8, -1)
|
170 | }
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | function isPlainObject (obj) {
|
177 | return _toString.call(obj) === '[object Object]'
|
178 | }
|
179 |
|
180 | function isRegExp (v) {
|
181 | return _toString.call(v) === '[object RegExp]'
|
182 | }
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | function isValidArrayIndex (val) {
|
188 | var n = parseFloat(String(val));
|
189 | return n >= 0 && Math.floor(n) === n && isFinite(val)
|
190 | }
|
191 |
|
192 |
|
193 |
|
194 |
|
195 | function toString (val) {
|
196 | return val == null
|
197 | ? ''
|
198 | : typeof val === 'object'
|
199 | ? JSON.stringify(val, null, 2)
|
200 | : String(val)
|
201 | }
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 | function toNumber (val) {
|
208 | var n = parseFloat(val);
|
209 | return isNaN(n) ? val : n
|
210 | }
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | function makeMap (
|
217 | str,
|
218 | expectsLowerCase
|
219 | ) {
|
220 | var map = Object.create(null);
|
221 | var list = str.split(',');
|
222 | for (var i = 0; i < list.length; i++) {
|
223 | map[list[i]] = true;
|
224 | }
|
225 | return expectsLowerCase
|
226 | ? function (val) { return map[val.toLowerCase()]; }
|
227 | : function (val) { return map[val]; }
|
228 | }
|
229 |
|
230 |
|
231 |
|
232 |
|
233 | var isBuiltInTag = makeMap('slot,component', true);
|
234 |
|
235 |
|
236 |
|
237 |
|
238 | var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
|
239 |
|
240 |
|
241 |
|
242 |
|
243 | function remove (arr, item) {
|
244 | if (arr.length) {
|
245 | var index = arr.indexOf(item);
|
246 | if (index > -1) {
|
247 | return arr.splice(index, 1)
|
248 | }
|
249 | }
|
250 | }
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
256 | function hasOwn (obj, key) {
|
257 | return hasOwnProperty.call(obj, key)
|
258 | }
|
259 |
|
260 |
|
261 |
|
262 |
|
263 | function cached (fn) {
|
264 | var cache = Object.create(null);
|
265 | return (function cachedFn (str) {
|
266 | var hit = cache[str];
|
267 | return hit || (cache[str] = fn(str))
|
268 | })
|
269 | }
|
270 |
|
271 |
|
272 |
|
273 |
|
274 | var camelizeRE = /-(\w)/g;
|
275 | var camelize = cached(function (str) {
|
276 | return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
|
277 | });
|
278 |
|
279 |
|
280 |
|
281 |
|
282 | var capitalize = cached(function (str) {
|
283 | return str.charAt(0).toUpperCase() + str.slice(1)
|
284 | });
|
285 |
|
286 |
|
287 |
|
288 |
|
289 | var hyphenateRE = /\B([A-Z])/g;
|
290 | var hyphenate = cached(function (str) {
|
291 | return str.replace(hyphenateRE, '-$1').toLowerCase()
|
292 | });
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | function bind (fn, ctx) {
|
298 | function boundFn (a) {
|
299 | var l = arguments.length;
|
300 | return l
|
301 | ? l > 1
|
302 | ? fn.apply(ctx, arguments)
|
303 | : fn.call(ctx, a)
|
304 | : fn.call(ctx)
|
305 | }
|
306 |
|
307 | boundFn._length = fn.length;
|
308 | return boundFn
|
309 | }
|
310 |
|
311 |
|
312 |
|
313 |
|
314 | function toArray (list, start) {
|
315 | start = start || 0;
|
316 | var i = list.length - start;
|
317 | var ret = new Array(i);
|
318 | while (i--) {
|
319 | ret[i] = list[i + start];
|
320 | }
|
321 | return ret
|
322 | }
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | function extend (to, _from) {
|
328 | for (var key in _from) {
|
329 | to[key] = _from[key];
|
330 | }
|
331 | return to
|
332 | }
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | function toObject (arr) {
|
338 | var res = {};
|
339 | for (var i = 0; i < arr.length; i++) {
|
340 | if (arr[i]) {
|
341 | extend(res, arr[i]);
|
342 | }
|
343 | }
|
344 | return res
|
345 | }
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 | function noop (a, b, c) {}
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | var no = function (a, b, c) { return false; };
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | var identity = function (_) { return _; };
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 | function looseEqual (a, b) {
|
374 | if (a === b) { return true }
|
375 | var isObjectA = isObject(a);
|
376 | var isObjectB = isObject(b);
|
377 | if (isObjectA && isObjectB) {
|
378 | try {
|
379 | var isArrayA = Array.isArray(a);
|
380 | var isArrayB = Array.isArray(b);
|
381 | if (isArrayA && isArrayB) {
|
382 | return a.length === b.length && a.every(function (e, i) {
|
383 | return looseEqual(e, b[i])
|
384 | })
|
385 | } else if (!isArrayA && !isArrayB) {
|
386 | var keysA = Object.keys(a);
|
387 | var keysB = Object.keys(b);
|
388 | return keysA.length === keysB.length && keysA.every(function (key) {
|
389 | return looseEqual(a[key], b[key])
|
390 | })
|
391 | } else {
|
392 |
|
393 | return false
|
394 | }
|
395 | } catch (e) {
|
396 |
|
397 | return false
|
398 | }
|
399 | } else if (!isObjectA && !isObjectB) {
|
400 | return String(a) === String(b)
|
401 | } else {
|
402 | return false
|
403 | }
|
404 | }
|
405 |
|
406 | function looseIndexOf (arr, val) {
|
407 | for (var i = 0; i < arr.length; i++) {
|
408 | if (looseEqual(arr[i], val)) { return i }
|
409 | }
|
410 | return -1
|
411 | }
|
412 |
|
413 |
|
414 |
|
415 |
|
416 | function once (fn) {
|
417 | var called = false;
|
418 | return function () {
|
419 | if (!called) {
|
420 | called = true;
|
421 | fn.apply(this, arguments);
|
422 | }
|
423 | }
|
424 | }
|
425 |
|
426 | var SSR_ATTR = 'data-server-rendered';
|
427 |
|
428 | var ASSET_TYPES = [
|
429 | 'component',
|
430 | 'directive',
|
431 | 'filter'
|
432 | ];
|
433 |
|
434 | var LIFECYCLE_HOOKS = [
|
435 | 'beforeCreate',
|
436 | 'created',
|
437 | 'beforeMount',
|
438 | 'mounted',
|
439 | 'beforeUpdate',
|
440 | 'updated',
|
441 | 'beforeDestroy',
|
442 | 'destroyed',
|
443 | 'activated',
|
444 | 'deactivated',
|
445 | 'errorCaptured'
|
446 | ];
|
447 |
|
448 |
|
449 |
|
450 | var config = ({
|
451 | |
452 |
|
453 |
|
454 | optionMergeStrategies: Object.create(null),
|
455 |
|
456 | |
457 |
|
458 |
|
459 | silent: false,
|
460 |
|
461 | |
462 |
|
463 |
|
464 | productionTip: "production" !== 'production',
|
465 |
|
466 | |
467 |
|
468 |
|
469 | devtools: "production" !== 'production',
|
470 |
|
471 | |
472 |
|
473 |
|
474 | performance: false,
|
475 |
|
476 | |
477 |
|
478 |
|
479 | errorHandler: null,
|
480 |
|
481 | |
482 |
|
483 |
|
484 | warnHandler: null,
|
485 |
|
486 | |
487 |
|
488 |
|
489 | ignoredElements: [],
|
490 |
|
491 | |
492 |
|
493 |
|
494 | keyCodes: Object.create(null),
|
495 |
|
496 | |
497 |
|
498 |
|
499 |
|
500 | isReservedTag: no,
|
501 |
|
502 | |
503 |
|
504 |
|
505 |
|
506 | isReservedAttr: no,
|
507 |
|
508 | |
509 |
|
510 |
|
511 |
|
512 | isUnknownElement: no,
|
513 |
|
514 | |
515 |
|
516 |
|
517 | getTagNamespace: noop,
|
518 |
|
519 | |
520 |
|
521 |
|
522 | parsePlatformTagName: identity,
|
523 |
|
524 | |
525 |
|
526 |
|
527 |
|
528 | mustUseProp: no,
|
529 |
|
530 | |
531 |
|
532 |
|
533 | _lifecycleHooks: LIFECYCLE_HOOKS
|
534 | });
|
535 |
|
536 |
|
537 |
|
538 | var emptyObject = Object.freeze({});
|
539 |
|
540 |
|
541 |
|
542 |
|
543 | function isReserved (str) {
|
544 | var c = (str + '').charCodeAt(0);
|
545 | return c === 0x24 || c === 0x5F
|
546 | }
|
547 |
|
548 |
|
549 |
|
550 |
|
551 | function def (obj, key, val, enumerable) {
|
552 | Object.defineProperty(obj, key, {
|
553 | value: val,
|
554 | enumerable: !!enumerable,
|
555 | writable: true,
|
556 | configurable: true
|
557 | });
|
558 | }
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | var bailRE = /[^\w.$]/;
|
564 | function parsePath (path) {
|
565 | if (bailRE.test(path)) {
|
566 | return
|
567 | }
|
568 | var segments = path.split('.');
|
569 | return function (obj) {
|
570 | for (var i = 0; i < segments.length; i++) {
|
571 | if (!obj) { return }
|
572 | obj = obj[segments[i]];
|
573 | }
|
574 | return obj
|
575 | }
|
576 | }
|
577 |
|
578 |
|
579 |
|
580 |
|
581 | var hasProto = '__proto__' in {};
|
582 |
|
583 |
|
584 | var inBrowser = typeof window !== 'undefined';
|
585 | var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
586 | var isIE = UA && /msie|trident/.test(UA);
|
587 | var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
588 | var isEdge = UA && UA.indexOf('edge/') > 0;
|
589 | var isAndroid = UA && UA.indexOf('android') > 0;
|
590 | var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
|
591 | var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
592 |
|
593 |
|
594 | var nativeWatch = ({}).watch;
|
595 |
|
596 | var supportsPassive = false;
|
597 | if (inBrowser) {
|
598 | try {
|
599 | var opts = {};
|
600 | Object.defineProperty(opts, 'passive', ({
|
601 | get: function get () {
|
602 |
|
603 | supportsPassive = true;
|
604 | }
|
605 | }));
|
606 | window.addEventListener('test-passive', null, opts);
|
607 | } catch (e) {}
|
608 | }
|
609 |
|
610 |
|
611 |
|
612 | var _isServer;
|
613 | var isServerRendering = function () {
|
614 | if (_isServer === undefined) {
|
615 |
|
616 | if (!inBrowser && typeof global !== 'undefined') {
|
617 |
|
618 |
|
619 | _isServer = global['process'].env.VUE_ENV === 'server';
|
620 | } else {
|
621 | _isServer = false;
|
622 | }
|
623 | }
|
624 | return _isServer
|
625 | };
|
626 |
|
627 |
|
628 | var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
629 |
|
630 |
|
631 | function isNative (Ctor) {
|
632 | return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
|
633 | }
|
634 |
|
635 | var hasSymbol =
|
636 | typeof Symbol !== 'undefined' && isNative(Symbol) &&
|
637 | typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
|
638 |
|
639 | var _Set;
|
640 |
|
641 | if (typeof Set !== 'undefined' && isNative(Set)) {
|
642 |
|
643 | _Set = Set;
|
644 | } else {
|
645 |
|
646 | _Set = (function () {
|
647 | function Set () {
|
648 | this.set = Object.create(null);
|
649 | }
|
650 | Set.prototype.has = function has (key) {
|
651 | return this.set[key] === true
|
652 | };
|
653 | Set.prototype.add = function add (key) {
|
654 | this.set[key] = true;
|
655 | };
|
656 | Set.prototype.clear = function clear () {
|
657 | this.set = Object.create(null);
|
658 | };
|
659 |
|
660 | return Set;
|
661 | }());
|
662 | }
|
663 |
|
664 |
|
665 |
|
666 | var warn = noop;
|
667 | var tip = noop;
|
668 | var generateComponentTrace = (noop);
|
669 | var formatComponentName = (noop);
|
670 |
|
671 | if (false) {
|
672 | var hasConsole = typeof console !== 'undefined';
|
673 | var classifyRE = /(?:^|[-_])(\w)/g;
|
674 | var classify = function (str) { return str
|
675 | .replace(classifyRE, function (c) { return c.toUpperCase(); })
|
676 | .replace(/[-_]/g, ''); };
|
677 |
|
678 | warn = function (msg, vm) {
|
679 | var trace = vm ? generateComponentTrace(vm) : '';
|
680 |
|
681 | if (config.warnHandler) {
|
682 | config.warnHandler.call(null, msg, vm, trace);
|
683 | } else if (hasConsole && (!config.silent)) {
|
684 | console.error(("[Vue warn]: " + msg + trace));
|
685 | }
|
686 | };
|
687 |
|
688 | tip = function (msg, vm) {
|
689 | if (hasConsole && (!config.silent)) {
|
690 | console.warn("[Vue tip]: " + msg + (
|
691 | vm ? generateComponentTrace(vm) : ''
|
692 | ));
|
693 | }
|
694 | };
|
695 |
|
696 | formatComponentName = function (vm, includeFile) {
|
697 | if (vm.$root === vm) {
|
698 | return '<Root>'
|
699 | }
|
700 | var options = typeof vm === 'function' && vm.cid != null
|
701 | ? vm.options
|
702 | : vm._isVue
|
703 | ? vm.$options || vm.constructor.options
|
704 | : vm || {};
|
705 | var name = options.name || options._componentTag;
|
706 | var file = options.__file;
|
707 | if (!name && file) {
|
708 | var match = file.match(/([^/\\]+)\.vue$/);
|
709 | name = match && match[1];
|
710 | }
|
711 |
|
712 | return (
|
713 | (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
|
714 | (file && includeFile !== false ? (" at " + file) : '')
|
715 | )
|
716 | };
|
717 |
|
718 | var repeat = function (str, n) {
|
719 | var res = '';
|
720 | while (n) {
|
721 | if (n % 2 === 1) { res += str; }
|
722 | if (n > 1) { str += str; }
|
723 | n >>= 1;
|
724 | }
|
725 | return res
|
726 | };
|
727 |
|
728 | generateComponentTrace = function (vm) {
|
729 | if (vm._isVue && vm.$parent) {
|
730 | var tree = [];
|
731 | var currentRecursiveSequence = 0;
|
732 | while (vm) {
|
733 | if (tree.length > 0) {
|
734 | var last = tree[tree.length - 1];
|
735 | if (last.constructor === vm.constructor) {
|
736 | currentRecursiveSequence++;
|
737 | vm = vm.$parent;
|
738 | continue
|
739 | } else if (currentRecursiveSequence > 0) {
|
740 | tree[tree.length - 1] = [last, currentRecursiveSequence];
|
741 | currentRecursiveSequence = 0;
|
742 | }
|
743 | }
|
744 | tree.push(vm);
|
745 | vm = vm.$parent;
|
746 | }
|
747 | return '\n\nfound in\n\n' + tree
|
748 | .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
|
749 | ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
|
750 | : formatComponentName(vm))); })
|
751 | .join('\n')
|
752 | } else {
|
753 | return ("\n\n(found in " + (formatComponentName(vm)) + ")")
|
754 | }
|
755 | };
|
756 | }
|
757 |
|
758 |
|
759 |
|
760 |
|
761 | var uid$1 = 0;
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 | var Dep = function Dep () {
|
768 | this.id = uid$1++;
|
769 | this.subs = [];
|
770 | };
|
771 |
|
772 | Dep.prototype.addSub = function addSub (sub) {
|
773 | this.subs.push(sub);
|
774 | };
|
775 |
|
776 | Dep.prototype.removeSub = function removeSub (sub) {
|
777 | remove(this.subs, sub);
|
778 | };
|
779 |
|
780 | Dep.prototype.depend = function depend () {
|
781 | if (Dep.target) {
|
782 | Dep.target.addDep(this);
|
783 | }
|
784 | };
|
785 |
|
786 | Dep.prototype.notify = function notify () {
|
787 |
|
788 | var subs = this.subs.slice();
|
789 | for (var i = 0, l = subs.length; i < l; i++) {
|
790 | subs[i].update();
|
791 | }
|
792 | };
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | Dep.target = null;
|
798 | var targetStack = [];
|
799 |
|
800 | function pushTarget (_target) {
|
801 | if (Dep.target) { targetStack.push(Dep.target); }
|
802 | Dep.target = _target;
|
803 | }
|
804 |
|
805 | function popTarget () {
|
806 | Dep.target = targetStack.pop();
|
807 | }
|
808 |
|
809 |
|
810 |
|
811 | var VNode = function VNode (
|
812 | tag,
|
813 | data,
|
814 | children,
|
815 | text,
|
816 | elm,
|
817 | context,
|
818 | componentOptions,
|
819 | asyncFactory
|
820 | ) {
|
821 | this.tag = tag;
|
822 | this.data = data;
|
823 | this.children = children;
|
824 | this.text = text;
|
825 | this.elm = elm;
|
826 | this.ns = undefined;
|
827 | this.context = context;
|
828 | this.functionalContext = undefined;
|
829 | this.functionalOptions = undefined;
|
830 | this.functionalScopeId = undefined;
|
831 | this.key = data && data.key;
|
832 | this.componentOptions = componentOptions;
|
833 | this.componentInstance = undefined;
|
834 | this.parent = undefined;
|
835 | this.raw = false;
|
836 | this.isStatic = false;
|
837 | this.isRootInsert = true;
|
838 | this.isComment = false;
|
839 | this.isCloned = false;
|
840 | this.isOnce = false;
|
841 | this.asyncFactory = asyncFactory;
|
842 | this.asyncMeta = undefined;
|
843 | this.isAsyncPlaceholder = false;
|
844 | };
|
845 |
|
846 | var prototypeAccessors = { child: { configurable: true } };
|
847 |
|
848 |
|
849 |
|
850 | prototypeAccessors.child.get = function () {
|
851 | return this.componentInstance
|
852 | };
|
853 |
|
854 | Object.defineProperties( VNode.prototype, prototypeAccessors );
|
855 |
|
856 | var createEmptyVNode = function (text) {
|
857 | if ( text === void 0 ) text = '';
|
858 |
|
859 | var node = new VNode();
|
860 | node.text = text;
|
861 | node.isComment = true;
|
862 | return node
|
863 | };
|
864 |
|
865 | function createTextVNode (val) {
|
866 | return new VNode(undefined, undefined, undefined, String(val))
|
867 | }
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 | function cloneVNode (vnode, deep) {
|
874 | var cloned = new VNode(
|
875 | vnode.tag,
|
876 | vnode.data,
|
877 | vnode.children,
|
878 | vnode.text,
|
879 | vnode.elm,
|
880 | vnode.context,
|
881 | vnode.componentOptions,
|
882 | vnode.asyncFactory
|
883 | );
|
884 | cloned.ns = vnode.ns;
|
885 | cloned.isStatic = vnode.isStatic;
|
886 | cloned.key = vnode.key;
|
887 | cloned.isComment = vnode.isComment;
|
888 | cloned.isCloned = true;
|
889 | if (deep && vnode.children) {
|
890 | cloned.children = cloneVNodes(vnode.children);
|
891 | }
|
892 | return cloned
|
893 | }
|
894 |
|
895 | function cloneVNodes (vnodes, deep) {
|
896 | var len = vnodes.length;
|
897 | var res = new Array(len);
|
898 | for (var i = 0; i < len; i++) {
|
899 | res[i] = cloneVNode(vnodes[i], deep);
|
900 | }
|
901 | return res
|
902 | }
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 | var arrayProto = Array.prototype;
|
910 | var arrayMethods = Object.create(arrayProto);[
|
911 | 'push',
|
912 | 'pop',
|
913 | 'shift',
|
914 | 'unshift',
|
915 | 'splice',
|
916 | 'sort',
|
917 | 'reverse'
|
918 | ]
|
919 | .forEach(function (method) {
|
920 |
|
921 | var original = arrayProto[method];
|
922 | def(arrayMethods, method, function mutator () {
|
923 | var args = [], len = arguments.length;
|
924 | while ( len-- ) args[ len ] = arguments[ len ];
|
925 |
|
926 | var result = original.apply(this, args);
|
927 | var ob = this.__ob__;
|
928 | var inserted;
|
929 | switch (method) {
|
930 | case 'push':
|
931 | case 'unshift':
|
932 | inserted = args;
|
933 | break
|
934 | case 'splice':
|
935 | inserted = args.slice(2);
|
936 | break
|
937 | }
|
938 | if (inserted) { ob.observeArray(inserted); }
|
939 |
|
940 | ob.dep.notify();
|
941 | return result
|
942 | });
|
943 | });
|
944 |
|
945 |
|
946 |
|
947 | var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 | var observerState = {
|
956 | shouldConvert: true
|
957 | };
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | var Observer = function Observer (value) {
|
966 | this.value = value;
|
967 | this.dep = new Dep();
|
968 | this.vmCount = 0;
|
969 | def(value, '__ob__', this);
|
970 | if (Array.isArray(value)) {
|
971 | var augment = hasProto
|
972 | ? protoAugment
|
973 | : copyAugment;
|
974 | augment(value, arrayMethods, arrayKeys);
|
975 | this.observeArray(value);
|
976 | } else {
|
977 | this.walk(value);
|
978 | }
|
979 | };
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 | Observer.prototype.walk = function walk (obj) {
|
987 | var keys = Object.keys(obj);
|
988 | for (var i = 0; i < keys.length; i++) {
|
989 | defineReactive(obj, keys[i], obj[keys[i]]);
|
990 | }
|
991 | };
|
992 |
|
993 |
|
994 |
|
995 |
|
996 | Observer.prototype.observeArray = function observeArray (items) {
|
997 | for (var i = 0, l = items.length; i < l; i++) {
|
998 | observe(items[i]);
|
999 | }
|
1000 | };
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 | function protoAugment (target, src, keys) {
|
1009 |
|
1010 | target.__proto__ = src;
|
1011 |
|
1012 | }
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 | function copyAugment (target, src, keys) {
|
1020 | for (var i = 0, l = keys.length; i < l; i++) {
|
1021 | var key = keys[i];
|
1022 | def(target, key, src[key]);
|
1023 | }
|
1024 | }
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 | function observe (value, asRootData) {
|
1032 | if (!isObject(value) || value instanceof VNode) {
|
1033 | return
|
1034 | }
|
1035 | var ob;
|
1036 | if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
|
1037 | ob = value.__ob__;
|
1038 | } else if (
|
1039 | observerState.shouldConvert &&
|
1040 | !isServerRendering() &&
|
1041 | (Array.isArray(value) || isPlainObject(value)) &&
|
1042 | Object.isExtensible(value) &&
|
1043 | !value._isVue
|
1044 | ) {
|
1045 | ob = new Observer(value);
|
1046 | }
|
1047 | if (asRootData && ob) {
|
1048 | ob.vmCount++;
|
1049 | }
|
1050 | return ob
|
1051 | }
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 | function defineReactive (
|
1057 | obj,
|
1058 | key,
|
1059 | val,
|
1060 | customSetter,
|
1061 | shallow
|
1062 | ) {
|
1063 | var dep = new Dep();
|
1064 |
|
1065 | var property = Object.getOwnPropertyDescriptor(obj, key);
|
1066 | if (property && property.configurable === false) {
|
1067 | return
|
1068 | }
|
1069 |
|
1070 |
|
1071 | var getter = property && property.get;
|
1072 | var setter = property && property.set;
|
1073 |
|
1074 | var childOb = !shallow && observe(val);
|
1075 | Object.defineProperty(obj, key, {
|
1076 | enumerable: true,
|
1077 | configurable: true,
|
1078 | get: function reactiveGetter () {
|
1079 | var value = getter ? getter.call(obj) : val;
|
1080 | if (Dep.target) {
|
1081 | dep.depend();
|
1082 | if (childOb) {
|
1083 | childOb.dep.depend();
|
1084 | if (Array.isArray(value)) {
|
1085 | dependArray(value);
|
1086 | }
|
1087 | }
|
1088 | }
|
1089 | return value
|
1090 | },
|
1091 | set: function reactiveSetter (newVal) {
|
1092 | var value = getter ? getter.call(obj) : val;
|
1093 |
|
1094 | if (newVal === value || (newVal !== newVal && value !== value)) {
|
1095 | return
|
1096 | }
|
1097 |
|
1098 | if (false) {
|
1099 | customSetter();
|
1100 | }
|
1101 | if (setter) {
|
1102 | setter.call(obj, newVal);
|
1103 | } else {
|
1104 | val = newVal;
|
1105 | }
|
1106 | childOb = !shallow && observe(newVal);
|
1107 | dep.notify();
|
1108 | }
|
1109 | });
|
1110 | }
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 | function set (target, key, val) {
|
1118 | if (Array.isArray(target) && isValidArrayIndex(key)) {
|
1119 | target.length = Math.max(target.length, key);
|
1120 | target.splice(key, 1, val);
|
1121 | return val
|
1122 | }
|
1123 | if (hasOwn(target, key)) {
|
1124 | target[key] = val;
|
1125 | return val
|
1126 | }
|
1127 | var ob = (target).__ob__;
|
1128 | if (target._isVue || (ob && ob.vmCount)) {
|
1129 | "production" !== 'production' && warn(
|
1130 | 'Avoid adding reactive properties to a Vue instance or its root $data ' +
|
1131 | 'at runtime - declare it upfront in the data option.'
|
1132 | );
|
1133 | return val
|
1134 | }
|
1135 | if (!ob) {
|
1136 | target[key] = val;
|
1137 | return val
|
1138 | }
|
1139 | defineReactive(ob.value, key, val);
|
1140 | ob.dep.notify();
|
1141 | return val
|
1142 | }
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 | function del (target, key) {
|
1148 | if (Array.isArray(target) && isValidArrayIndex(key)) {
|
1149 | target.splice(key, 1);
|
1150 | return
|
1151 | }
|
1152 | var ob = (target).__ob__;
|
1153 | if (target._isVue || (ob && ob.vmCount)) {
|
1154 | "production" !== 'production' && warn(
|
1155 | 'Avoid deleting properties on a Vue instance or its root $data ' +
|
1156 | '- just set it to null.'
|
1157 | );
|
1158 | return
|
1159 | }
|
1160 | if (!hasOwn(target, key)) {
|
1161 | return
|
1162 | }
|
1163 | delete target[key];
|
1164 | if (!ob) {
|
1165 | return
|
1166 | }
|
1167 | ob.dep.notify();
|
1168 | }
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 | function dependArray (value) {
|
1175 | for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
|
1176 | e = value[i];
|
1177 | e && e.__ob__ && e.__ob__.dep.depend();
|
1178 | if (Array.isArray(e)) {
|
1179 | dependArray(e);
|
1180 | }
|
1181 | }
|
1182 | }
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 | var strats = config.optionMergeStrategies;
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 | if (false) {
|
1197 | strats.el = strats.propsData = function (parent, child, vm, key) {
|
1198 | if (!vm) {
|
1199 | warn(
|
1200 | "option \"" + key + "\" can only be used during instance " +
|
1201 | 'creation with the `new` keyword.'
|
1202 | );
|
1203 | }
|
1204 | return defaultStrat(parent, child)
|
1205 | };
|
1206 | }
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 | function mergeData (to, from) {
|
1212 | if (!from) { return to }
|
1213 | var key, toVal, fromVal;
|
1214 | var keys = Object.keys(from);
|
1215 | for (var i = 0; i < keys.length; i++) {
|
1216 | key = keys[i];
|
1217 | toVal = to[key];
|
1218 | fromVal = from[key];
|
1219 | if (!hasOwn(to, key)) {
|
1220 | set(to, key, fromVal);
|
1221 | } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
|
1222 | mergeData(toVal, fromVal);
|
1223 | }
|
1224 | }
|
1225 | return to
|
1226 | }
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 | function mergeDataOrFn (
|
1232 | parentVal,
|
1233 | childVal,
|
1234 | vm
|
1235 | ) {
|
1236 | if (!vm) {
|
1237 |
|
1238 | if (!childVal) {
|
1239 | return parentVal
|
1240 | }
|
1241 | if (!parentVal) {
|
1242 | return childVal
|
1243 | }
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 | return function mergedDataFn () {
|
1250 | return mergeData(
|
1251 | typeof childVal === 'function' ? childVal.call(this) : childVal,
|
1252 | typeof parentVal === 'function' ? parentVal.call(this) : parentVal
|
1253 | )
|
1254 | }
|
1255 | } else if (parentVal || childVal) {
|
1256 | return function mergedInstanceDataFn () {
|
1257 |
|
1258 | var instanceData = typeof childVal === 'function'
|
1259 | ? childVal.call(vm)
|
1260 | : childVal;
|
1261 | var defaultData = typeof parentVal === 'function'
|
1262 | ? parentVal.call(vm)
|
1263 | : parentVal;
|
1264 | if (instanceData) {
|
1265 | return mergeData(instanceData, defaultData)
|
1266 | } else {
|
1267 | return defaultData
|
1268 | }
|
1269 | }
|
1270 | }
|
1271 | }
|
1272 |
|
1273 | strats.data = function (
|
1274 | parentVal,
|
1275 | childVal,
|
1276 | vm
|
1277 | ) {
|
1278 | if (!vm) {
|
1279 | if (childVal && typeof childVal !== 'function') {
|
1280 | "production" !== 'production' && warn(
|
1281 | 'The "data" option should be a function ' +
|
1282 | 'that returns a per-instance value in component ' +
|
1283 | 'definitions.',
|
1284 | vm
|
1285 | );
|
1286 |
|
1287 | return parentVal
|
1288 | }
|
1289 | return mergeDataOrFn.call(this, parentVal, childVal)
|
1290 | }
|
1291 |
|
1292 | return mergeDataOrFn(parentVal, childVal, vm)
|
1293 | };
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 | function mergeHook (
|
1299 | parentVal,
|
1300 | childVal
|
1301 | ) {
|
1302 | return childVal
|
1303 | ? parentVal
|
1304 | ? parentVal.concat(childVal)
|
1305 | : Array.isArray(childVal)
|
1306 | ? childVal
|
1307 | : [childVal]
|
1308 | : parentVal
|
1309 | }
|
1310 |
|
1311 | LIFECYCLE_HOOKS.forEach(function (hook) {
|
1312 | strats[hook] = mergeHook;
|
1313 | });
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 | function mergeAssets (
|
1323 | parentVal,
|
1324 | childVal,
|
1325 | vm,
|
1326 | key
|
1327 | ) {
|
1328 | var res = Object.create(parentVal || null);
|
1329 | if (childVal) {
|
1330 | "production" !== 'production' && assertObjectType(key, childVal, vm);
|
1331 | return extend(res, childVal)
|
1332 | } else {
|
1333 | return res
|
1334 | }
|
1335 | }
|
1336 |
|
1337 | ASSET_TYPES.forEach(function (type) {
|
1338 | strats[type + 's'] = mergeAssets;
|
1339 | });
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 | strats.watch = function (
|
1348 | parentVal,
|
1349 | childVal,
|
1350 | vm,
|
1351 | key
|
1352 | ) {
|
1353 |
|
1354 | if (parentVal === nativeWatch) { parentVal = undefined; }
|
1355 | if (childVal === nativeWatch) { childVal = undefined; }
|
1356 |
|
1357 | if (!childVal) { return Object.create(parentVal || null) }
|
1358 | if (false) {
|
1359 | assertObjectType(key, childVal, vm);
|
1360 | }
|
1361 | if (!parentVal) { return childVal }
|
1362 | var ret = {};
|
1363 | extend(ret, parentVal);
|
1364 | for (var key$1 in childVal) {
|
1365 | var parent = ret[key$1];
|
1366 | var child = childVal[key$1];
|
1367 | if (parent && !Array.isArray(parent)) {
|
1368 | parent = [parent];
|
1369 | }
|
1370 | ret[key$1] = parent
|
1371 | ? parent.concat(child)
|
1372 | : Array.isArray(child) ? child : [child];
|
1373 | }
|
1374 | return ret
|
1375 | };
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 | strats.props =
|
1381 | strats.methods =
|
1382 | strats.inject =
|
1383 | strats.computed = function (
|
1384 | parentVal,
|
1385 | childVal,
|
1386 | vm,
|
1387 | key
|
1388 | ) {
|
1389 | if (childVal && "production" !== 'production') {
|
1390 | assertObjectType(key, childVal, vm);
|
1391 | }
|
1392 | if (!parentVal) { return childVal }
|
1393 | var ret = Object.create(null);
|
1394 | extend(ret, parentVal);
|
1395 | if (childVal) { extend(ret, childVal); }
|
1396 | return ret
|
1397 | };
|
1398 | strats.provide = mergeDataOrFn;
|
1399 |
|
1400 |
|
1401 |
|
1402 |
|
1403 | var defaultStrat = function (parentVal, childVal) {
|
1404 | return childVal === undefined
|
1405 | ? parentVal
|
1406 | : childVal
|
1407 | };
|
1408 |
|
1409 |
|
1410 |
|
1411 |
|
1412 | function checkComponents (options) {
|
1413 | for (var key in options.components) {
|
1414 | var lower = key.toLowerCase();
|
1415 | if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
|
1416 | warn(
|
1417 | 'Do not use built-in or reserved HTML elements as component ' +
|
1418 | 'id: ' + key
|
1419 | );
|
1420 | }
|
1421 | }
|
1422 | }
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 | function normalizeProps (options, vm) {
|
1429 | var props = options.props;
|
1430 | if (!props) { return }
|
1431 | var res = {};
|
1432 | var i, val, name;
|
1433 | if (Array.isArray(props)) {
|
1434 | i = props.length;
|
1435 | while (i--) {
|
1436 | val = props[i];
|
1437 | if (typeof val === 'string') {
|
1438 | name = camelize(val);
|
1439 | res[name] = { type: null };
|
1440 | } else if (false) {
|
1441 | warn('props must be strings when using array syntax.');
|
1442 | }
|
1443 | }
|
1444 | } else if (isPlainObject(props)) {
|
1445 | for (var key in props) {
|
1446 | val = props[key];
|
1447 | name = camelize(key);
|
1448 | res[name] = isPlainObject(val)
|
1449 | ? val
|
1450 | : { type: val };
|
1451 | }
|
1452 | } else if (false) {
|
1453 | warn(
|
1454 | "Invalid value for option \"props\": expected an Array or an Object, " +
|
1455 | "but got " + (toRawType(props)) + ".",
|
1456 | vm
|
1457 | );
|
1458 | }
|
1459 | options.props = res;
|
1460 | }
|
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 | function normalizeInject (options, vm) {
|
1466 | var inject = options.inject;
|
1467 | var normalized = options.inject = {};
|
1468 | if (Array.isArray(inject)) {
|
1469 | for (var i = 0; i < inject.length; i++) {
|
1470 | normalized[inject[i]] = { from: inject[i] };
|
1471 | }
|
1472 | } else if (isPlainObject(inject)) {
|
1473 | for (var key in inject) {
|
1474 | var val = inject[key];
|
1475 | normalized[key] = isPlainObject(val)
|
1476 | ? extend({ from: key }, val)
|
1477 | : { from: val };
|
1478 | }
|
1479 | } else if (false) {
|
1480 | warn(
|
1481 | "Invalid value for option \"inject\": expected an Array or an Object, " +
|
1482 | "but got " + (toRawType(inject)) + ".",
|
1483 | vm
|
1484 | );
|
1485 | }
|
1486 | }
|
1487 |
|
1488 |
|
1489 |
|
1490 |
|
1491 | function normalizeDirectives (options) {
|
1492 | var dirs = options.directives;
|
1493 | if (dirs) {
|
1494 | for (var key in dirs) {
|
1495 | var def = dirs[key];
|
1496 | if (typeof def === 'function') {
|
1497 | dirs[key] = { bind: def, update: def };
|
1498 | }
|
1499 | }
|
1500 | }
|
1501 | }
|
1502 |
|
1503 | function assertObjectType (name, value, vm) {
|
1504 | if (!isPlainObject(value)) {
|
1505 | warn(
|
1506 | "Invalid value for option \"" + name + "\": expected an Object, " +
|
1507 | "but got " + (toRawType(value)) + ".",
|
1508 | vm
|
1509 | );
|
1510 | }
|
1511 | }
|
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 | function mergeOptions (
|
1518 | parent,
|
1519 | child,
|
1520 | vm
|
1521 | ) {
|
1522 | if (false) {
|
1523 | checkComponents(child);
|
1524 | }
|
1525 |
|
1526 | if (typeof child === 'function') {
|
1527 | child = child.options;
|
1528 | }
|
1529 |
|
1530 | normalizeProps(child, vm);
|
1531 | normalizeInject(child, vm);
|
1532 | normalizeDirectives(child);
|
1533 | var extendsFrom = child.extends;
|
1534 | if (extendsFrom) {
|
1535 | parent = mergeOptions(parent, extendsFrom, vm);
|
1536 | }
|
1537 | if (child.mixins) {
|
1538 | for (var i = 0, l = child.mixins.length; i < l; i++) {
|
1539 | parent = mergeOptions(parent, child.mixins[i], vm);
|
1540 | }
|
1541 | }
|
1542 | var options = {};
|
1543 | var key;
|
1544 | for (key in parent) {
|
1545 | mergeField(key);
|
1546 | }
|
1547 | for (key in child) {
|
1548 | if (!hasOwn(parent, key)) {
|
1549 | mergeField(key);
|
1550 | }
|
1551 | }
|
1552 | function mergeField (key) {
|
1553 | var strat = strats[key] || defaultStrat;
|
1554 | options[key] = strat(parent[key], child[key], vm, key);
|
1555 | }
|
1556 | return options
|
1557 | }
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 | function resolveAsset (
|
1565 | options,
|
1566 | type,
|
1567 | id,
|
1568 | warnMissing
|
1569 | ) {
|
1570 |
|
1571 | if (typeof id !== 'string') {
|
1572 | return
|
1573 | }
|
1574 | var assets = options[type];
|
1575 |
|
1576 | if (hasOwn(assets, id)) { return assets[id] }
|
1577 | var camelizedId = camelize(id);
|
1578 | if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
|
1579 | var PascalCaseId = capitalize(camelizedId);
|
1580 | if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
|
1581 |
|
1582 | var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
|
1583 | if (false) {
|
1584 | warn(
|
1585 | 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
|
1586 | options
|
1587 | );
|
1588 | }
|
1589 | return res
|
1590 | }
|
1591 |
|
1592 |
|
1593 |
|
1594 | function validateProp (
|
1595 | key,
|
1596 | propOptions,
|
1597 | propsData,
|
1598 | vm
|
1599 | ) {
|
1600 | var prop = propOptions[key];
|
1601 | var absent = !hasOwn(propsData, key);
|
1602 | var value = propsData[key];
|
1603 |
|
1604 | if (isType(Boolean, prop.type)) {
|
1605 | if (absent && !hasOwn(prop, 'default')) {
|
1606 | value = false;
|
1607 | } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
|
1608 | value = true;
|
1609 | }
|
1610 | }
|
1611 |
|
1612 | if (value === undefined) {
|
1613 | value = getPropDefaultValue(vm, prop, key);
|
1614 |
|
1615 |
|
1616 | var prevShouldConvert = observerState.shouldConvert;
|
1617 | observerState.shouldConvert = true;
|
1618 | observe(value);
|
1619 | observerState.shouldConvert = prevShouldConvert;
|
1620 | }
|
1621 | if (false) {
|
1622 | assertProp(prop, key, value, vm, absent);
|
1623 | }
|
1624 | return value
|
1625 | }
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 | function getPropDefaultValue (vm, prop, key) {
|
1631 |
|
1632 | if (!hasOwn(prop, 'default')) {
|
1633 | return undefined
|
1634 | }
|
1635 | var def = prop.default;
|
1636 |
|
1637 | if (false) {
|
1638 | warn(
|
1639 | 'Invalid default value for prop "' + key + '": ' +
|
1640 | 'Props with type Object/Array must use a factory function ' +
|
1641 | 'to return the default value.',
|
1642 | vm
|
1643 | );
|
1644 | }
|
1645 |
|
1646 |
|
1647 | if (vm && vm.$options.propsData &&
|
1648 | vm.$options.propsData[key] === undefined &&
|
1649 | vm._props[key] !== undefined
|
1650 | ) {
|
1651 | return vm._props[key]
|
1652 | }
|
1653 |
|
1654 |
|
1655 | return typeof def === 'function' && getType(prop.type) !== 'Function'
|
1656 | ? def.call(vm)
|
1657 | : def
|
1658 | }
|
1659 |
|
1660 |
|
1661 |
|
1662 |
|
1663 | function assertProp (
|
1664 | prop,
|
1665 | name,
|
1666 | value,
|
1667 | vm,
|
1668 | absent
|
1669 | ) {
|
1670 | if (prop.required && absent) {
|
1671 | warn(
|
1672 | 'Missing required prop: "' + name + '"',
|
1673 | vm
|
1674 | );
|
1675 | return
|
1676 | }
|
1677 | if (value == null && !prop.required) {
|
1678 | return
|
1679 | }
|
1680 | var type = prop.type;
|
1681 | var valid = !type || type === true;
|
1682 | var expectedTypes = [];
|
1683 | if (type) {
|
1684 | if (!Array.isArray(type)) {
|
1685 | type = [type];
|
1686 | }
|
1687 | for (var i = 0; i < type.length && !valid; i++) {
|
1688 | var assertedType = assertType(value, type[i]);
|
1689 | expectedTypes.push(assertedType.expectedType || '');
|
1690 | valid = assertedType.valid;
|
1691 | }
|
1692 | }
|
1693 | if (!valid) {
|
1694 | warn(
|
1695 | "Invalid prop: type check failed for prop \"" + name + "\"." +
|
1696 | " Expected " + (expectedTypes.map(capitalize).join(', ')) +
|
1697 | ", got " + (toRawType(value)) + ".",
|
1698 | vm
|
1699 | );
|
1700 | return
|
1701 | }
|
1702 | var validator = prop.validator;
|
1703 | if (validator) {
|
1704 | if (!validator(value)) {
|
1705 | warn(
|
1706 | 'Invalid prop: custom validator check failed for prop "' + name + '".',
|
1707 | vm
|
1708 | );
|
1709 | }
|
1710 | }
|
1711 | }
|
1712 |
|
1713 | var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
|
1714 |
|
1715 | function assertType (value, type) {
|
1716 | var valid;
|
1717 | var expectedType = getType(type);
|
1718 | if (simpleCheckRE.test(expectedType)) {
|
1719 | var t = typeof value;
|
1720 | valid = t === expectedType.toLowerCase();
|
1721 |
|
1722 | if (!valid && t === 'object') {
|
1723 | valid = value instanceof type;
|
1724 | }
|
1725 | } else if (expectedType === 'Object') {
|
1726 | valid = isPlainObject(value);
|
1727 | } else if (expectedType === 'Array') {
|
1728 | valid = Array.isArray(value);
|
1729 | } else {
|
1730 | valid = value instanceof type;
|
1731 | }
|
1732 | return {
|
1733 | valid: valid,
|
1734 | expectedType: expectedType
|
1735 | }
|
1736 | }
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 | function getType (fn) {
|
1744 | var match = fn && fn.toString().match(/^\s*function (\w+)/);
|
1745 | return match ? match[1] : ''
|
1746 | }
|
1747 |
|
1748 | function isType (type, fn) {
|
1749 | if (!Array.isArray(fn)) {
|
1750 | return getType(fn) === getType(type)
|
1751 | }
|
1752 | for (var i = 0, len = fn.length; i < len; i++) {
|
1753 | if (getType(fn[i]) === getType(type)) {
|
1754 | return true
|
1755 | }
|
1756 | }
|
1757 |
|
1758 | return false
|
1759 | }
|
1760 |
|
1761 |
|
1762 |
|
1763 | function handleError (err, vm, info) {
|
1764 | if (vm) {
|
1765 | var cur = vm;
|
1766 | while ((cur = cur.$parent)) {
|
1767 | var hooks = cur.$options.errorCaptured;
|
1768 | if (hooks) {
|
1769 | for (var i = 0; i < hooks.length; i++) {
|
1770 | try {
|
1771 | var capture = hooks[i].call(cur, err, vm, info) === false;
|
1772 | if (capture) { return }
|
1773 | } catch (e) {
|
1774 | globalHandleError(e, cur, 'errorCaptured hook');
|
1775 | }
|
1776 | }
|
1777 | }
|
1778 | }
|
1779 | }
|
1780 | globalHandleError(err, vm, info);
|
1781 | }
|
1782 |
|
1783 | function globalHandleError (err, vm, info) {
|
1784 | if (config.errorHandler) {
|
1785 | try {
|
1786 | return config.errorHandler.call(null, err, vm, info)
|
1787 | } catch (e) {
|
1788 | logError(e, null, 'config.errorHandler');
|
1789 | }
|
1790 | }
|
1791 | logError(err, vm, info);
|
1792 | }
|
1793 |
|
1794 | function logError (err, vm, info) {
|
1795 | if (false) {
|
1796 | warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
|
1797 | }
|
1798 |
|
1799 | if (inBrowser && typeof console !== 'undefined') {
|
1800 | console.error(err);
|
1801 | } else {
|
1802 | throw err
|
1803 | }
|
1804 | }
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 | var callbacks = [];
|
1810 | var pending = false;
|
1811 |
|
1812 | function flushCallbacks () {
|
1813 | pending = false;
|
1814 | var copies = callbacks.slice(0);
|
1815 | callbacks.length = 0;
|
1816 | for (var i = 0; i < copies.length; i++) {
|
1817 | copies[i]();
|
1818 | }
|
1819 | }
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 | var microTimerFunc;
|
1830 | var macroTimerFunc;
|
1831 | var useMacroTask = false;
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 | if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
1839 | macroTimerFunc = function () {
|
1840 | setImmediate(flushCallbacks);
|
1841 | };
|
1842 | } else if (typeof MessageChannel !== 'undefined' && (
|
1843 | isNative(MessageChannel) ||
|
1844 |
|
1845 | MessageChannel.toString() === '[object MessageChannelConstructor]'
|
1846 | )) {
|
1847 | var channel = new MessageChannel();
|
1848 | var port = channel.port2;
|
1849 | channel.port1.onmessage = flushCallbacks;
|
1850 | macroTimerFunc = function () {
|
1851 | port.postMessage(1);
|
1852 | };
|
1853 | } else {
|
1854 |
|
1855 | macroTimerFunc = function () {
|
1856 | setTimeout(flushCallbacks, 0);
|
1857 | };
|
1858 | }
|
1859 |
|
1860 |
|
1861 |
|
1862 | if (typeof Promise !== 'undefined' && isNative(Promise)) {
|
1863 | var p = Promise.resolve();
|
1864 | microTimerFunc = function () {
|
1865 | p.then(flushCallbacks);
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 | if (isIOS) { setTimeout(noop); }
|
1872 | };
|
1873 | } else {
|
1874 |
|
1875 | microTimerFunc = macroTimerFunc;
|
1876 | }
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 | function withMacroTask (fn) {
|
1883 | return fn._withTask || (fn._withTask = function () {
|
1884 | useMacroTask = true;
|
1885 | var res = fn.apply(null, arguments);
|
1886 | useMacroTask = false;
|
1887 | return res
|
1888 | })
|
1889 | }
|
1890 |
|
1891 | function nextTick (cb, ctx) {
|
1892 | var _resolve;
|
1893 | callbacks.push(function () {
|
1894 | if (cb) {
|
1895 | try {
|
1896 | cb.call(ctx);
|
1897 | } catch (e) {
|
1898 | handleError(e, ctx, 'nextTick');
|
1899 | }
|
1900 | } else if (_resolve) {
|
1901 | _resolve(ctx);
|
1902 | }
|
1903 | });
|
1904 | if (!pending) {
|
1905 | pending = true;
|
1906 | if (useMacroTask) {
|
1907 | macroTimerFunc();
|
1908 | } else {
|
1909 | microTimerFunc();
|
1910 | }
|
1911 | }
|
1912 |
|
1913 | if (!cb && typeof Promise !== 'undefined') {
|
1914 | return new Promise(function (resolve) {
|
1915 | _resolve = resolve;
|
1916 | })
|
1917 | }
|
1918 | }
|
1919 |
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 | var initProxy;
|
1925 |
|
1926 | if (false) {
|
1927 | var allowedGlobals = makeMap(
|
1928 | 'Infinity,undefined,NaN,isFinite,isNaN,' +
|
1929 | 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
1930 | 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
|
1931 | 'require'
|
1932 | );
|
1933 |
|
1934 | var warnNonPresent = function (target, key) {
|
1935 | warn(
|
1936 | "Property or method \"" + key + "\" is not defined on the instance but " +
|
1937 | 'referenced during render. Make sure that this property is reactive, ' +
|
1938 | 'either in the data option, or for class-based components, by ' +
|
1939 | 'initializing the property. ' +
|
1940 | 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
|
1941 | target
|
1942 | );
|
1943 | };
|
1944 |
|
1945 | var hasProxy =
|
1946 | typeof Proxy !== 'undefined' &&
|
1947 | Proxy.toString().match(/native code/);
|
1948 |
|
1949 | if (hasProxy) {
|
1950 | var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
|
1951 | config.keyCodes = new Proxy(config.keyCodes, {
|
1952 | set: function set (target, key, value) {
|
1953 | if (isBuiltInModifier(key)) {
|
1954 | warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
|
1955 | return false
|
1956 | } else {
|
1957 | target[key] = value;
|
1958 | return true
|
1959 | }
|
1960 | }
|
1961 | });
|
1962 | }
|
1963 |
|
1964 | var hasHandler = {
|
1965 | has: function has (target, key) {
|
1966 | var has = key in target;
|
1967 | var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
|
1968 | if (!has && !isAllowed) {
|
1969 | warnNonPresent(target, key);
|
1970 | }
|
1971 | return has || !isAllowed
|
1972 | }
|
1973 | };
|
1974 |
|
1975 | var getHandler = {
|
1976 | get: function get (target, key) {
|
1977 | if (typeof key === 'string' && !(key in target)) {
|
1978 | warnNonPresent(target, key);
|
1979 | }
|
1980 | return target[key]
|
1981 | }
|
1982 | };
|
1983 |
|
1984 | initProxy = function initProxy (vm) {
|
1985 | if (hasProxy) {
|
1986 |
|
1987 | var options = vm.$options;
|
1988 | var handlers = options.render && options.render._withStripped
|
1989 | ? getHandler
|
1990 | : hasHandler;
|
1991 | vm._renderProxy = new Proxy(vm, handlers);
|
1992 | } else {
|
1993 | vm._renderProxy = vm;
|
1994 | }
|
1995 | };
|
1996 | }
|
1997 |
|
1998 | var mark;
|
1999 | var measure;
|
2000 |
|
2001 | if (false) {
|
2002 | var perf = inBrowser && window.performance;
|
2003 |
|
2004 | if (
|
2005 | perf &&
|
2006 | perf.mark &&
|
2007 | perf.measure &&
|
2008 | perf.clearMarks &&
|
2009 | perf.clearMeasures
|
2010 | ) {
|
2011 | mark = function (tag) { return perf.mark(tag); };
|
2012 | measure = function (name, startTag, endTag) {
|
2013 | perf.measure(name, startTag, endTag);
|
2014 | perf.clearMarks(startTag);
|
2015 | perf.clearMarks(endTag);
|
2016 | perf.clearMeasures(name);
|
2017 | };
|
2018 | }
|
2019 | }
|
2020 |
|
2021 |
|
2022 |
|
2023 | var normalizeEvent = cached(function (name) {
|
2024 | var passive = name.charAt(0) === '&';
|
2025 | name = passive ? name.slice(1) : name;
|
2026 | var once$$1 = name.charAt(0) === '~';
|
2027 | name = once$$1 ? name.slice(1) : name;
|
2028 | var capture = name.charAt(0) === '!';
|
2029 | name = capture ? name.slice(1) : name;
|
2030 | return {
|
2031 | name: name,
|
2032 | once: once$$1,
|
2033 | capture: capture,
|
2034 | passive: passive
|
2035 | }
|
2036 | });
|
2037 |
|
2038 | function createFnInvoker (fns) {
|
2039 | function invoker () {
|
2040 | var arguments$1 = arguments;
|
2041 |
|
2042 | var fns = invoker.fns;
|
2043 | if (Array.isArray(fns)) {
|
2044 | var cloned = fns.slice();
|
2045 | for (var i = 0; i < cloned.length; i++) {
|
2046 | cloned[i].apply(null, arguments$1);
|
2047 | }
|
2048 | } else {
|
2049 |
|
2050 | return fns.apply(null, arguments)
|
2051 | }
|
2052 | }
|
2053 | invoker.fns = fns;
|
2054 | return invoker
|
2055 | }
|
2056 |
|
2057 | function updateListeners (
|
2058 | on,
|
2059 | oldOn,
|
2060 | add,
|
2061 | remove$$1,
|
2062 | vm
|
2063 | ) {
|
2064 | var name, cur, old, event;
|
2065 | for (name in on) {
|
2066 | cur = on[name];
|
2067 | old = oldOn[name];
|
2068 | event = normalizeEvent(name);
|
2069 | if (isUndef(cur)) {
|
2070 | "production" !== 'production' && warn(
|
2071 | "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
|
2072 | vm
|
2073 | );
|
2074 | } else if (isUndef(old)) {
|
2075 | if (isUndef(cur.fns)) {
|
2076 | cur = on[name] = createFnInvoker(cur);
|
2077 | }
|
2078 | add(event.name, cur, event.once, event.capture, event.passive);
|
2079 | } else if (cur !== old) {
|
2080 | old.fns = cur;
|
2081 | on[name] = old;
|
2082 | }
|
2083 | }
|
2084 | for (name in oldOn) {
|
2085 | if (isUndef(on[name])) {
|
2086 | event = normalizeEvent(name);
|
2087 | remove$$1(event.name, oldOn[name], event.capture);
|
2088 | }
|
2089 | }
|
2090 | }
|
2091 |
|
2092 |
|
2093 |
|
2094 | function mergeVNodeHook (def, hookKey, hook) {
|
2095 | var invoker;
|
2096 | var oldHook = def[hookKey];
|
2097 |
|
2098 | function wrappedHook () {
|
2099 | hook.apply(this, arguments);
|
2100 |
|
2101 |
|
2102 | remove(invoker.fns, wrappedHook);
|
2103 | }
|
2104 |
|
2105 | if (isUndef(oldHook)) {
|
2106 |
|
2107 | invoker = createFnInvoker([wrappedHook]);
|
2108 | } else {
|
2109 |
|
2110 | if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
|
2111 |
|
2112 | invoker = oldHook;
|
2113 | invoker.fns.push(wrappedHook);
|
2114 | } else {
|
2115 |
|
2116 | invoker = createFnInvoker([oldHook, wrappedHook]);
|
2117 | }
|
2118 | }
|
2119 |
|
2120 | invoker.merged = true;
|
2121 | def[hookKey] = invoker;
|
2122 | }
|
2123 |
|
2124 |
|
2125 |
|
2126 | function extractPropsFromVNodeData (
|
2127 | data,
|
2128 | Ctor,
|
2129 | tag
|
2130 | ) {
|
2131 |
|
2132 |
|
2133 |
|
2134 | var propOptions = Ctor.options.props;
|
2135 | if (isUndef(propOptions)) {
|
2136 | return
|
2137 | }
|
2138 | var res = {};
|
2139 | var attrs = data.attrs;
|
2140 | var props = data.props;
|
2141 | if (isDef(attrs) || isDef(props)) {
|
2142 | for (var key in propOptions) {
|
2143 | var altKey = hyphenate(key);
|
2144 | if (false) {
|
2145 | var keyInLowerCase = key.toLowerCase();
|
2146 | if (
|
2147 | key !== keyInLowerCase &&
|
2148 | attrs && hasOwn(attrs, keyInLowerCase)
|
2149 | ) {
|
2150 | tip(
|
2151 | "Prop \"" + keyInLowerCase + "\" is passed to component " +
|
2152 | (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
|
2153 | " \"" + key + "\". " +
|
2154 | "Note that HTML attributes are case-insensitive and camelCased " +
|
2155 | "props need to use their kebab-case equivalents when using in-DOM " +
|
2156 | "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
|
2157 | );
|
2158 | }
|
2159 | }
|
2160 | checkProp(res, props, key, altKey, true) ||
|
2161 | checkProp(res, attrs, key, altKey, false);
|
2162 | }
|
2163 | }
|
2164 | return res
|
2165 | }
|
2166 |
|
2167 | function checkProp (
|
2168 | res,
|
2169 | hash,
|
2170 | key,
|
2171 | altKey,
|
2172 | preserve
|
2173 | ) {
|
2174 | if (isDef(hash)) {
|
2175 | if (hasOwn(hash, key)) {
|
2176 | res[key] = hash[key];
|
2177 | if (!preserve) {
|
2178 | delete hash[key];
|
2179 | }
|
2180 | return true
|
2181 | } else if (hasOwn(hash, altKey)) {
|
2182 | res[key] = hash[altKey];
|
2183 | if (!preserve) {
|
2184 | delete hash[altKey];
|
2185 | }
|
2186 | return true
|
2187 | }
|
2188 | }
|
2189 | return false
|
2190 | }
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 | function simpleNormalizeChildren (children) {
|
2207 | for (var i = 0; i < children.length; i++) {
|
2208 | if (Array.isArray(children[i])) {
|
2209 | return Array.prototype.concat.apply([], children)
|
2210 | }
|
2211 | }
|
2212 | return children
|
2213 | }
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 |
|
2219 | function normalizeChildren (children) {
|
2220 | return isPrimitive(children)
|
2221 | ? [createTextVNode(children)]
|
2222 | : Array.isArray(children)
|
2223 | ? normalizeArrayChildren(children)
|
2224 | : undefined
|
2225 | }
|
2226 |
|
2227 | function isTextNode (node) {
|
2228 | return isDef(node) && isDef(node.text) && isFalse(node.isComment)
|
2229 | }
|
2230 |
|
2231 | function normalizeArrayChildren (children, nestedIndex) {
|
2232 | var res = [];
|
2233 | var i, c, lastIndex, last;
|
2234 | for (i = 0; i < children.length; i++) {
|
2235 | c = children[i];
|
2236 | if (isUndef(c) || typeof c === 'boolean') { continue }
|
2237 | lastIndex = res.length - 1;
|
2238 | last = res[lastIndex];
|
2239 |
|
2240 | if (Array.isArray(c)) {
|
2241 | if (c.length > 0) {
|
2242 | c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
|
2243 |
|
2244 | if (isTextNode(c[0]) && isTextNode(last)) {
|
2245 | res[lastIndex] = createTextVNode(last.text + (c[0]).text);
|
2246 | c.shift();
|
2247 | }
|
2248 | res.push.apply(res, c);
|
2249 | }
|
2250 | } else if (isPrimitive(c)) {
|
2251 | if (isTextNode(last)) {
|
2252 |
|
2253 |
|
2254 |
|
2255 | res[lastIndex] = createTextVNode(last.text + c);
|
2256 | } else if (c !== '') {
|
2257 |
|
2258 | res.push(createTextVNode(c));
|
2259 | }
|
2260 | } else {
|
2261 | if (isTextNode(c) && isTextNode(last)) {
|
2262 |
|
2263 | res[lastIndex] = createTextVNode(last.text + c.text);
|
2264 | } else {
|
2265 |
|
2266 | if (isTrue(children._isVList) &&
|
2267 | isDef(c.tag) &&
|
2268 | isUndef(c.key) &&
|
2269 | isDef(nestedIndex)) {
|
2270 | c.key = "__vlist" + nestedIndex + "_" + i + "__";
|
2271 | }
|
2272 | res.push(c);
|
2273 | }
|
2274 | }
|
2275 | }
|
2276 | return res
|
2277 | }
|
2278 |
|
2279 |
|
2280 |
|
2281 | function ensureCtor (comp, base) {
|
2282 | if (
|
2283 | comp.__esModule ||
|
2284 | (hasSymbol && comp[Symbol.toStringTag] === 'Module')
|
2285 | ) {
|
2286 | comp = comp.default;
|
2287 | }
|
2288 | return isObject(comp)
|
2289 | ? base.extend(comp)
|
2290 | : comp
|
2291 | }
|
2292 |
|
2293 | function createAsyncPlaceholder (
|
2294 | factory,
|
2295 | data,
|
2296 | context,
|
2297 | children,
|
2298 | tag
|
2299 | ) {
|
2300 | var node = createEmptyVNode();
|
2301 | node.asyncFactory = factory;
|
2302 | node.asyncMeta = { data: data, context: context, children: children, tag: tag };
|
2303 | return node
|
2304 | }
|
2305 |
|
2306 | function resolveAsyncComponent (
|
2307 | factory,
|
2308 | baseCtor,
|
2309 | context
|
2310 | ) {
|
2311 | if (isTrue(factory.error) && isDef(factory.errorComp)) {
|
2312 | return factory.errorComp
|
2313 | }
|
2314 |
|
2315 | if (isDef(factory.resolved)) {
|
2316 | return factory.resolved
|
2317 | }
|
2318 |
|
2319 | if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
2320 | return factory.loadingComp
|
2321 | }
|
2322 |
|
2323 | if (isDef(factory.contexts)) {
|
2324 |
|
2325 | factory.contexts.push(context);
|
2326 | } else {
|
2327 | var contexts = factory.contexts = [context];
|
2328 | var sync = true;
|
2329 |
|
2330 | var forceRender = function () {
|
2331 | for (var i = 0, l = contexts.length; i < l; i++) {
|
2332 | contexts[i].$forceUpdate();
|
2333 | }
|
2334 | };
|
2335 |
|
2336 | var resolve = once(function (res) {
|
2337 |
|
2338 | factory.resolved = ensureCtor(res, baseCtor);
|
2339 |
|
2340 |
|
2341 | if (!sync) {
|
2342 | forceRender();
|
2343 | }
|
2344 | });
|
2345 |
|
2346 | var reject = once(function (reason) {
|
2347 | "production" !== 'production' && warn(
|
2348 | "Failed to resolve async component: " + (String(factory)) +
|
2349 | (reason ? ("\nReason: " + reason) : '')
|
2350 | );
|
2351 | if (isDef(factory.errorComp)) {
|
2352 | factory.error = true;
|
2353 | forceRender();
|
2354 | }
|
2355 | });
|
2356 |
|
2357 | var res = factory(resolve, reject);
|
2358 |
|
2359 | if (isObject(res)) {
|
2360 | if (typeof res.then === 'function') {
|
2361 |
|
2362 | if (isUndef(factory.resolved)) {
|
2363 | res.then(resolve, reject);
|
2364 | }
|
2365 | } else if (isDef(res.component) && typeof res.component.then === 'function') {
|
2366 | res.component.then(resolve, reject);
|
2367 |
|
2368 | if (isDef(res.error)) {
|
2369 | factory.errorComp = ensureCtor(res.error, baseCtor);
|
2370 | }
|
2371 |
|
2372 | if (isDef(res.loading)) {
|
2373 | factory.loadingComp = ensureCtor(res.loading, baseCtor);
|
2374 | if (res.delay === 0) {
|
2375 | factory.loading = true;
|
2376 | } else {
|
2377 | setTimeout(function () {
|
2378 | if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
2379 | factory.loading = true;
|
2380 | forceRender();
|
2381 | }
|
2382 | }, res.delay || 200);
|
2383 | }
|
2384 | }
|
2385 |
|
2386 | if (isDef(res.timeout)) {
|
2387 | setTimeout(function () {
|
2388 | if (isUndef(factory.resolved)) {
|
2389 | reject(
|
2390 | false
|
2391 | ? ("timeout (" + (res.timeout) + "ms)")
|
2392 | : null
|
2393 | );
|
2394 | }
|
2395 | }, res.timeout);
|
2396 | }
|
2397 | }
|
2398 | }
|
2399 |
|
2400 | sync = false;
|
2401 |
|
2402 | return factory.loading
|
2403 | ? factory.loadingComp
|
2404 | : factory.resolved
|
2405 | }
|
2406 | }
|
2407 |
|
2408 |
|
2409 |
|
2410 | function isAsyncPlaceholder (node) {
|
2411 | return node.isComment && node.asyncFactory
|
2412 | }
|
2413 |
|
2414 |
|
2415 |
|
2416 | function getFirstComponentChild (children) {
|
2417 | if (Array.isArray(children)) {
|
2418 | for (var i = 0; i < children.length; i++) {
|
2419 | var c = children[i];
|
2420 | if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
|
2421 | return c
|
2422 | }
|
2423 | }
|
2424 | }
|
2425 | }
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 |
|
2431 | function initEvents (vm) {
|
2432 | vm._events = Object.create(null);
|
2433 | vm._hasHookEvent = false;
|
2434 |
|
2435 | var listeners = vm.$options._parentListeners;
|
2436 | if (listeners) {
|
2437 | updateComponentListeners(vm, listeners);
|
2438 | }
|
2439 | }
|
2440 |
|
2441 | var target;
|
2442 |
|
2443 | function add (event, fn, once) {
|
2444 | if (once) {
|
2445 | target.$once(event, fn);
|
2446 | } else {
|
2447 | target.$on(event, fn);
|
2448 | }
|
2449 | }
|
2450 |
|
2451 | function remove$1 (event, fn) {
|
2452 | target.$off(event, fn);
|
2453 | }
|
2454 |
|
2455 | function updateComponentListeners (
|
2456 | vm,
|
2457 | listeners,
|
2458 | oldListeners
|
2459 | ) {
|
2460 | target = vm;
|
2461 | updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
|
2462 | }
|
2463 |
|
2464 | function eventsMixin (Vue) {
|
2465 | var hookRE = /^hook:/;
|
2466 | Vue.prototype.$on = function (event, fn) {
|
2467 | var this$1 = this;
|
2468 |
|
2469 | var vm = this;
|
2470 | if (Array.isArray(event)) {
|
2471 | for (var i = 0, l = event.length; i < l; i++) {
|
2472 | this$1.$on(event[i], fn);
|
2473 | }
|
2474 | } else {
|
2475 | (vm._events[event] || (vm._events[event] = [])).push(fn);
|
2476 |
|
2477 |
|
2478 | if (hookRE.test(event)) {
|
2479 | vm._hasHookEvent = true;
|
2480 | }
|
2481 | }
|
2482 | return vm
|
2483 | };
|
2484 |
|
2485 | Vue.prototype.$once = function (event, fn) {
|
2486 | var vm = this;
|
2487 | function on () {
|
2488 | vm.$off(event, on);
|
2489 | fn.apply(vm, arguments);
|
2490 | }
|
2491 | on.fn = fn;
|
2492 | vm.$on(event, on);
|
2493 | return vm
|
2494 | };
|
2495 |
|
2496 | Vue.prototype.$off = function (event, fn) {
|
2497 | var this$1 = this;
|
2498 |
|
2499 | var vm = this;
|
2500 |
|
2501 | if (!arguments.length) {
|
2502 | vm._events = Object.create(null);
|
2503 | return vm
|
2504 | }
|
2505 |
|
2506 | if (Array.isArray(event)) {
|
2507 | for (var i = 0, l = event.length; i < l; i++) {
|
2508 | this$1.$off(event[i], fn);
|
2509 | }
|
2510 | return vm
|
2511 | }
|
2512 |
|
2513 | var cbs = vm._events[event];
|
2514 | if (!cbs) {
|
2515 | return vm
|
2516 | }
|
2517 | if (arguments.length === 1) {
|
2518 | vm._events[event] = null;
|
2519 | return vm
|
2520 | }
|
2521 | if (fn) {
|
2522 |
|
2523 | var cb;
|
2524 | var i$1 = cbs.length;
|
2525 | while (i$1--) {
|
2526 | cb = cbs[i$1];
|
2527 | if (cb === fn || cb.fn === fn) {
|
2528 | cbs.splice(i$1, 1);
|
2529 | break
|
2530 | }
|
2531 | }
|
2532 | }
|
2533 | return vm
|
2534 | };
|
2535 |
|
2536 | Vue.prototype.$emit = function (event) {
|
2537 | var vm = this;
|
2538 | if (false) {
|
2539 | var lowerCaseEvent = event.toLowerCase();
|
2540 | if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
|
2541 | tip(
|
2542 | "Event \"" + lowerCaseEvent + "\" is emitted in component " +
|
2543 | (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
|
2544 | "Note that HTML attributes are case-insensitive and you cannot use " +
|
2545 | "v-on to listen to camelCase events when using in-DOM templates. " +
|
2546 | "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
|
2547 | );
|
2548 | }
|
2549 | }
|
2550 | var cbs = vm._events[event];
|
2551 | if (cbs) {
|
2552 | cbs = cbs.length > 1 ? toArray(cbs) : cbs;
|
2553 | var args = toArray(arguments, 1);
|
2554 | for (var i = 0, l = cbs.length; i < l; i++) {
|
2555 | try {
|
2556 | cbs[i].apply(vm, args);
|
2557 | } catch (e) {
|
2558 | handleError(e, vm, ("event handler for \"" + event + "\""));
|
2559 | }
|
2560 | }
|
2561 | }
|
2562 | return vm
|
2563 | };
|
2564 | }
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 | function resolveSlots (
|
2572 | children,
|
2573 | context
|
2574 | ) {
|
2575 | var slots = {};
|
2576 | if (!children) {
|
2577 | return slots
|
2578 | }
|
2579 | var defaultSlot = [];
|
2580 | for (var i = 0, l = children.length; i < l; i++) {
|
2581 | var child = children[i];
|
2582 | var data = child.data;
|
2583 |
|
2584 | if (data && data.attrs && data.attrs.slot) {
|
2585 | delete data.attrs.slot;
|
2586 | }
|
2587 |
|
2588 |
|
2589 | if ((child.context === context || child.functionalContext === context) &&
|
2590 | data && data.slot != null
|
2591 | ) {
|
2592 | var name = child.data.slot;
|
2593 | var slot = (slots[name] || (slots[name] = []));
|
2594 | if (child.tag === 'template') {
|
2595 | slot.push.apply(slot, child.children);
|
2596 | } else {
|
2597 | slot.push(child);
|
2598 | }
|
2599 | } else {
|
2600 | defaultSlot.push(child);
|
2601 | }
|
2602 | }
|
2603 |
|
2604 | if (!defaultSlot.every(isWhitespace)) {
|
2605 | slots.default = defaultSlot;
|
2606 | }
|
2607 | return slots
|
2608 | }
|
2609 |
|
2610 | function isWhitespace (node) {
|
2611 | return node.isComment || node.text === ' '
|
2612 | }
|
2613 |
|
2614 | function resolveScopedSlots (
|
2615 | fns, // see flow/vnode
|
2616 | res
|
2617 | ) {
|
2618 | res = res || {};
|
2619 | for (var i = 0; i < fns.length; i++) {
|
2620 | if (Array.isArray(fns[i])) {
|
2621 | resolveScopedSlots(fns[i], res);
|
2622 | } else {
|
2623 | res[fns[i].key] = fns[i].fn;
|
2624 | }
|
2625 | }
|
2626 | return res
|
2627 | }
|
2628 |
|
2629 |
|
2630 |
|
2631 | var activeInstance = null;
|
2632 | var isUpdatingChildComponent = false;
|
2633 |
|
2634 | function initLifecycle (vm) {
|
2635 | var options = vm.$options;
|
2636 |
|
2637 |
|
2638 | var parent = options.parent;
|
2639 | if (parent && !options.abstract) {
|
2640 | while (parent.$options.abstract && parent.$parent) {
|
2641 | parent = parent.$parent;
|
2642 | }
|
2643 | parent.$children.push(vm);
|
2644 | }
|
2645 |
|
2646 | vm.$parent = parent;
|
2647 | vm.$root = parent ? parent.$root : vm;
|
2648 |
|
2649 | vm.$children = [];
|
2650 | vm.$refs = {};
|
2651 |
|
2652 | vm._watcher = null;
|
2653 | vm._inactive = null;
|
2654 | vm._directInactive = false;
|
2655 | vm._isMounted = false;
|
2656 | vm._isDestroyed = false;
|
2657 | vm._isBeingDestroyed = false;
|
2658 | }
|
2659 |
|
2660 | function lifecycleMixin (Vue) {
|
2661 | Vue.prototype._update = function (vnode, hydrating) {
|
2662 | var vm = this;
|
2663 | if (vm._isMounted) {
|
2664 | callHook(vm, 'beforeUpdate');
|
2665 | }
|
2666 | var prevEl = vm.$el;
|
2667 | var prevVnode = vm._vnode;
|
2668 | var prevActiveInstance = activeInstance;
|
2669 | activeInstance = vm;
|
2670 | vm._vnode = vnode;
|
2671 |
|
2672 |
|
2673 | if (!prevVnode) {
|
2674 |
|
2675 | vm.$el = vm.__patch__(
|
2676 | vm.$el, vnode, hydrating, false ,
|
2677 | vm.$options._parentElm,
|
2678 | vm.$options._refElm
|
2679 | );
|
2680 |
|
2681 |
|
2682 | vm.$options._parentElm = vm.$options._refElm = null;
|
2683 | } else {
|
2684 |
|
2685 | vm.$el = vm.__patch__(prevVnode, vnode);
|
2686 | }
|
2687 | activeInstance = prevActiveInstance;
|
2688 |
|
2689 | if (prevEl) {
|
2690 | prevEl.__vue__ = null;
|
2691 | }
|
2692 | if (vm.$el) {
|
2693 | vm.$el.__vue__ = vm;
|
2694 | }
|
2695 |
|
2696 | if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
|
2697 | vm.$parent.$el = vm.$el;
|
2698 | }
|
2699 |
|
2700 |
|
2701 | };
|
2702 |
|
2703 | Vue.prototype.$forceUpdate = function () {
|
2704 | var vm = this;
|
2705 | if (vm._watcher) {
|
2706 | vm._watcher.update();
|
2707 | }
|
2708 | };
|
2709 |
|
2710 | Vue.prototype.$destroy = function () {
|
2711 | var vm = this;
|
2712 | if (vm._isBeingDestroyed) {
|
2713 | return
|
2714 | }
|
2715 | callHook(vm, 'beforeDestroy');
|
2716 | vm._isBeingDestroyed = true;
|
2717 |
|
2718 | var parent = vm.$parent;
|
2719 | if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
|
2720 | remove(parent.$children, vm);
|
2721 | }
|
2722 |
|
2723 | if (vm._watcher) {
|
2724 | vm._watcher.teardown();
|
2725 | }
|
2726 | var i = vm._watchers.length;
|
2727 | while (i--) {
|
2728 | vm._watchers[i].teardown();
|
2729 | }
|
2730 |
|
2731 |
|
2732 | if (vm._data.__ob__) {
|
2733 | vm._data.__ob__.vmCount--;
|
2734 | }
|
2735 |
|
2736 | vm._isDestroyed = true;
|
2737 |
|
2738 | vm.__patch__(vm._vnode, null);
|
2739 |
|
2740 | callHook(vm, 'destroyed');
|
2741 |
|
2742 | vm.$off();
|
2743 |
|
2744 | if (vm.$el) {
|
2745 | vm.$el.__vue__ = null;
|
2746 | }
|
2747 |
|
2748 | if (vm.$vnode) {
|
2749 | vm.$vnode.parent = null;
|
2750 | }
|
2751 | };
|
2752 | }
|
2753 |
|
2754 | function mountComponent (
|
2755 | vm,
|
2756 | el,
|
2757 | hydrating
|
2758 | ) {
|
2759 | vm.$el = el;
|
2760 | if (!vm.$options.render) {
|
2761 | vm.$options.render = createEmptyVNode;
|
2762 | if (false) {
|
2763 |
|
2764 | if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
|
2765 | vm.$options.el || el) {
|
2766 | warn(
|
2767 | 'You are using the runtime-only build of Vue where the template ' +
|
2768 | 'compiler is not available. Either pre-compile the templates into ' +
|
2769 | 'render functions, or use the compiler-included build.',
|
2770 | vm
|
2771 | );
|
2772 | } else {
|
2773 | warn(
|
2774 | 'Failed to mount component: template or render function not defined.',
|
2775 | vm
|
2776 | );
|
2777 | }
|
2778 | }
|
2779 | }
|
2780 | callHook(vm, 'beforeMount');
|
2781 |
|
2782 | var updateComponent;
|
2783 |
|
2784 | if (false) {
|
2785 | updateComponent = function () {
|
2786 | var name = vm._name;
|
2787 | var id = vm._uid;
|
2788 | var startTag = "vue-perf-start:" + id;
|
2789 | var endTag = "vue-perf-end:" + id;
|
2790 |
|
2791 | mark(startTag);
|
2792 | var vnode = vm._render();
|
2793 | mark(endTag);
|
2794 | measure(("vue " + name + " render"), startTag, endTag);
|
2795 |
|
2796 | mark(startTag);
|
2797 | vm._update(vnode, hydrating);
|
2798 | mark(endTag);
|
2799 | measure(("vue " + name + " patch"), startTag, endTag);
|
2800 | };
|
2801 | } else {
|
2802 | updateComponent = function () {
|
2803 | vm._update(vm._render(), hydrating);
|
2804 | };
|
2805 | }
|
2806 |
|
2807 | vm._watcher = new Watcher(vm, updateComponent, noop);
|
2808 | hydrating = false;
|
2809 |
|
2810 |
|
2811 |
|
2812 | if (vm.$vnode == null) {
|
2813 | vm._isMounted = true;
|
2814 | callHook(vm, 'mounted');
|
2815 | }
|
2816 | return vm
|
2817 | }
|
2818 |
|
2819 | function updateChildComponent (
|
2820 | vm,
|
2821 | propsData,
|
2822 | listeners,
|
2823 | parentVnode,
|
2824 | renderChildren
|
2825 | ) {
|
2826 | if (false) {
|
2827 | isUpdatingChildComponent = true;
|
2828 | }
|
2829 |
|
2830 |
|
2831 |
|
2832 | var hasChildren = !!(
|
2833 | renderChildren ||
|
2834 | vm.$options._renderChildren ||
|
2835 | parentVnode.data.scopedSlots ||
|
2836 | vm.$scopedSlots !== emptyObject
|
2837 | );
|
2838 |
|
2839 | vm.$options._parentVnode = parentVnode;
|
2840 | vm.$vnode = parentVnode;
|
2841 |
|
2842 | if (vm._vnode) {
|
2843 | vm._vnode.parent = parentVnode;
|
2844 | }
|
2845 | vm.$options._renderChildren = renderChildren;
|
2846 |
|
2847 |
|
2848 |
|
2849 |
|
2850 | vm.$attrs = (parentVnode.data && parentVnode.data.attrs) || emptyObject;
|
2851 | vm.$listeners = listeners || emptyObject;
|
2852 |
|
2853 |
|
2854 | if (propsData && vm.$options.props) {
|
2855 | observerState.shouldConvert = false;
|
2856 | var props = vm._props;
|
2857 | var propKeys = vm.$options._propKeys || [];
|
2858 | for (var i = 0; i < propKeys.length; i++) {
|
2859 | var key = propKeys[i];
|
2860 | props[key] = validateProp(key, vm.$options.props, propsData, vm);
|
2861 | }
|
2862 | observerState.shouldConvert = true;
|
2863 |
|
2864 | vm.$options.propsData = propsData;
|
2865 | }
|
2866 |
|
2867 |
|
2868 | if (listeners) {
|
2869 | var oldListeners = vm.$options._parentListeners;
|
2870 | vm.$options._parentListeners = listeners;
|
2871 | updateComponentListeners(vm, listeners, oldListeners);
|
2872 | }
|
2873 |
|
2874 | if (hasChildren) {
|
2875 | vm.$slots = resolveSlots(renderChildren, parentVnode.context);
|
2876 | vm.$forceUpdate();
|
2877 | }
|
2878 |
|
2879 | if (false) {
|
2880 | isUpdatingChildComponent = false;
|
2881 | }
|
2882 | }
|
2883 |
|
2884 | function isInInactiveTree (vm) {
|
2885 | while (vm && (vm = vm.$parent)) {
|
2886 | if (vm._inactive) { return true }
|
2887 | }
|
2888 | return false
|
2889 | }
|
2890 |
|
2891 | function activateChildComponent (vm, direct) {
|
2892 | if (direct) {
|
2893 | vm._directInactive = false;
|
2894 | if (isInInactiveTree(vm)) {
|
2895 | return
|
2896 | }
|
2897 | } else if (vm._directInactive) {
|
2898 | return
|
2899 | }
|
2900 | if (vm._inactive || vm._inactive === null) {
|
2901 | vm._inactive = false;
|
2902 | for (var i = 0; i < vm.$children.length; i++) {
|
2903 | activateChildComponent(vm.$children[i]);
|
2904 | }
|
2905 | callHook(vm, 'activated');
|
2906 | }
|
2907 | }
|
2908 |
|
2909 | function deactivateChildComponent (vm, direct) {
|
2910 | if (direct) {
|
2911 | vm._directInactive = true;
|
2912 | if (isInInactiveTree(vm)) {
|
2913 | return
|
2914 | }
|
2915 | }
|
2916 | if (!vm._inactive) {
|
2917 | vm._inactive = true;
|
2918 | for (var i = 0; i < vm.$children.length; i++) {
|
2919 | deactivateChildComponent(vm.$children[i]);
|
2920 | }
|
2921 | callHook(vm, 'deactivated');
|
2922 | }
|
2923 | }
|
2924 |
|
2925 | function callHook (vm, hook) {
|
2926 | var handlers = vm.$options[hook];
|
2927 | if (handlers) {
|
2928 | for (var i = 0, j = handlers.length; i < j; i++) {
|
2929 | try {
|
2930 | handlers[i].call(vm);
|
2931 | } catch (e) {
|
2932 | handleError(e, vm, (hook + " hook"));
|
2933 | }
|
2934 | }
|
2935 | }
|
2936 | if (vm._hasHookEvent) {
|
2937 | vm.$emit('hook:' + hook);
|
2938 | }
|
2939 | }
|
2940 |
|
2941 |
|
2942 |
|
2943 |
|
2944 | var MAX_UPDATE_COUNT = 100;
|
2945 |
|
2946 | var queue = [];
|
2947 | var activatedChildren = [];
|
2948 | var has = {};
|
2949 | var circular = {};
|
2950 | var waiting = false;
|
2951 | var flushing = false;
|
2952 | var index = 0;
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 | function resetSchedulerState () {
|
2958 | index = queue.length = activatedChildren.length = 0;
|
2959 | has = {};
|
2960 | if (false) {
|
2961 | circular = {};
|
2962 | }
|
2963 | waiting = flushing = false;
|
2964 | }
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 | function flushSchedulerQueue () {
|
2970 | flushing = true;
|
2971 | var watcher, id;
|
2972 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 | queue.sort(function (a, b) { return a.id - b.id; });
|
2982 |
|
2983 |
|
2984 |
|
2985 | for (index = 0; index < queue.length; index++) {
|
2986 | watcher = queue[index];
|
2987 | id = watcher.id;
|
2988 | has[id] = null;
|
2989 | watcher.run();
|
2990 |
|
2991 | if (false) {
|
2992 | circular[id] = (circular[id] || 0) + 1;
|
2993 | if (circular[id] > MAX_UPDATE_COUNT) {
|
2994 | warn(
|
2995 | 'You may have an infinite update loop ' + (
|
2996 | watcher.user
|
2997 | ? ("in watcher with expression \"" + (watcher.expression) + "\"")
|
2998 | : "in a component render function."
|
2999 | ),
|
3000 | watcher.vm
|
3001 | );
|
3002 | break
|
3003 | }
|
3004 | }
|
3005 | }
|
3006 |
|
3007 |
|
3008 | var activatedQueue = activatedChildren.slice();
|
3009 | var updatedQueue = queue.slice();
|
3010 |
|
3011 | resetSchedulerState();
|
3012 |
|
3013 |
|
3014 | callActivatedHooks(activatedQueue);
|
3015 | callUpdatedHooks(updatedQueue);
|
3016 |
|
3017 |
|
3018 |
|
3019 | if (devtools && config.devtools) {
|
3020 | devtools.emit('flush');
|
3021 | }
|
3022 | }
|
3023 |
|
3024 | function callUpdatedHooks (queue) {
|
3025 | var i = queue.length;
|
3026 | while (i--) {
|
3027 | var watcher = queue[i];
|
3028 | var vm = watcher.vm;
|
3029 | if (vm._watcher === watcher && vm._isMounted) {
|
3030 | callHook(vm, 'updated');
|
3031 | }
|
3032 | }
|
3033 | }
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 | function queueActivatedComponent (vm) {
|
3040 |
|
3041 |
|
3042 | vm._inactive = false;
|
3043 | activatedChildren.push(vm);
|
3044 | }
|
3045 |
|
3046 | function callActivatedHooks (queue) {
|
3047 | for (var i = 0; i < queue.length; i++) {
|
3048 | queue[i]._inactive = true;
|
3049 | activateChildComponent(queue[i], true );
|
3050 | }
|
3051 | }
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 | function queueWatcher (watcher) {
|
3059 | var id = watcher.id;
|
3060 | if (has[id] == null) {
|
3061 | has[id] = true;
|
3062 | if (!flushing) {
|
3063 | queue.push(watcher);
|
3064 | } else {
|
3065 |
|
3066 |
|
3067 | var i = queue.length - 1;
|
3068 | while (i > index && queue[i].id > watcher.id) {
|
3069 | i--;
|
3070 | }
|
3071 | queue.splice(i + 1, 0, watcher);
|
3072 | }
|
3073 |
|
3074 | if (!waiting) {
|
3075 | waiting = true;
|
3076 | nextTick(flushSchedulerQueue);
|
3077 | }
|
3078 | }
|
3079 | }
|
3080 |
|
3081 |
|
3082 |
|
3083 | var uid$2 = 0;
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 | var Watcher = function Watcher (
|
3091 | vm,
|
3092 | expOrFn,
|
3093 | cb,
|
3094 | options
|
3095 | ) {
|
3096 | this.vm = vm;
|
3097 | vm._watchers.push(this);
|
3098 |
|
3099 | if (options) {
|
3100 | this.deep = !!options.deep;
|
3101 | this.user = !!options.user;
|
3102 | this.lazy = !!options.lazy;
|
3103 | this.sync = !!options.sync;
|
3104 | } else {
|
3105 | this.deep = this.user = this.lazy = this.sync = false;
|
3106 | }
|
3107 | this.cb = cb;
|
3108 | this.id = ++uid$2;
|
3109 | this.active = true;
|
3110 | this.dirty = this.lazy;
|
3111 | this.deps = [];
|
3112 | this.newDeps = [];
|
3113 | this.depIds = new _Set();
|
3114 | this.newDepIds = new _Set();
|
3115 | this.expression = false
|
3116 | ? expOrFn.toString()
|
3117 | : '';
|
3118 |
|
3119 | if (typeof expOrFn === 'function') {
|
3120 | this.getter = expOrFn;
|
3121 | } else {
|
3122 | this.getter = parsePath(expOrFn);
|
3123 | if (!this.getter) {
|
3124 | this.getter = function () {};
|
3125 | "production" !== 'production' && warn(
|
3126 | "Failed watching path: \"" + expOrFn + "\" " +
|
3127 | 'Watcher only accepts simple dot-delimited paths. ' +
|
3128 | 'For full control, use a function instead.',
|
3129 | vm
|
3130 | );
|
3131 | }
|
3132 | }
|
3133 | this.value = this.lazy
|
3134 | ? undefined
|
3135 | : this.get();
|
3136 | };
|
3137 |
|
3138 |
|
3139 |
|
3140 |
|
3141 | Watcher.prototype.get = function get () {
|
3142 | pushTarget(this);
|
3143 | var value;
|
3144 | var vm = this.vm;
|
3145 | try {
|
3146 | value = this.getter.call(vm, vm);
|
3147 | } catch (e) {
|
3148 | if (this.user) {
|
3149 | handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
|
3150 | } else {
|
3151 | throw e
|
3152 | }
|
3153 | } finally {
|
3154 |
|
3155 |
|
3156 | if (this.deep) {
|
3157 | traverse(value);
|
3158 | }
|
3159 | popTarget();
|
3160 | this.cleanupDeps();
|
3161 | }
|
3162 | return value
|
3163 | };
|
3164 |
|
3165 |
|
3166 |
|
3167 |
|
3168 | Watcher.prototype.addDep = function addDep (dep) {
|
3169 | var id = dep.id;
|
3170 | if (!this.newDepIds.has(id)) {
|
3171 | this.newDepIds.add(id);
|
3172 | this.newDeps.push(dep);
|
3173 | if (!this.depIds.has(id)) {
|
3174 | dep.addSub(this);
|
3175 | }
|
3176 | }
|
3177 | };
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | Watcher.prototype.cleanupDeps = function cleanupDeps () {
|
3183 | var this$1 = this;
|
3184 |
|
3185 | var i = this.deps.length;
|
3186 | while (i--) {
|
3187 | var dep = this$1.deps[i];
|
3188 | if (!this$1.newDepIds.has(dep.id)) {
|
3189 | dep.removeSub(this$1);
|
3190 | }
|
3191 | }
|
3192 | var tmp = this.depIds;
|
3193 | this.depIds = this.newDepIds;
|
3194 | this.newDepIds = tmp;
|
3195 | this.newDepIds.clear();
|
3196 | tmp = this.deps;
|
3197 | this.deps = this.newDeps;
|
3198 | this.newDeps = tmp;
|
3199 | this.newDeps.length = 0;
|
3200 | };
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 | Watcher.prototype.update = function update () {
|
3207 |
|
3208 | if (this.lazy) {
|
3209 | this.dirty = true;
|
3210 | } else if (this.sync) {
|
3211 | this.run();
|
3212 | } else {
|
3213 | queueWatcher(this);
|
3214 | }
|
3215 | };
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 | Watcher.prototype.run = function run () {
|
3222 | if (this.active) {
|
3223 | var value = this.get();
|
3224 | if (
|
3225 | value !== this.value ||
|
3226 |
|
3227 |
|
3228 |
|
3229 | isObject(value) ||
|
3230 | this.deep
|
3231 | ) {
|
3232 |
|
3233 | var oldValue = this.value;
|
3234 | this.value = value;
|
3235 | if (this.user) {
|
3236 | try {
|
3237 | this.cb.call(this.vm, value, oldValue);
|
3238 | } catch (e) {
|
3239 | handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
|
3240 | }
|
3241 | } else {
|
3242 | this.cb.call(this.vm, value, oldValue);
|
3243 | }
|
3244 | }
|
3245 | }
|
3246 | };
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 | Watcher.prototype.evaluate = function evaluate () {
|
3253 | this.value = this.get();
|
3254 | this.dirty = false;
|
3255 | };
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 | Watcher.prototype.depend = function depend () {
|
3261 | var this$1 = this;
|
3262 |
|
3263 | var i = this.deps.length;
|
3264 | while (i--) {
|
3265 | this$1.deps[i].depend();
|
3266 | }
|
3267 | };
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 | Watcher.prototype.teardown = function teardown () {
|
3273 | var this$1 = this;
|
3274 |
|
3275 | if (this.active) {
|
3276 |
|
3277 |
|
3278 |
|
3279 | if (!this.vm._isBeingDestroyed) {
|
3280 | remove(this.vm._watchers, this);
|
3281 | }
|
3282 | var i = this.deps.length;
|
3283 | while (i--) {
|
3284 | this$1.deps[i].removeSub(this$1);
|
3285 | }
|
3286 | this.active = false;
|
3287 | }
|
3288 | };
|
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 | var seenObjects = new _Set();
|
3296 | function traverse (val) {
|
3297 | seenObjects.clear();
|
3298 | _traverse(val, seenObjects);
|
3299 | }
|
3300 |
|
3301 | function _traverse (val, seen) {
|
3302 | var i, keys;
|
3303 | var isA = Array.isArray(val);
|
3304 | if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
|
3305 | return
|
3306 | }
|
3307 | if (val.__ob__) {
|
3308 | var depId = val.__ob__.dep.id;
|
3309 | if (seen.has(depId)) {
|
3310 | return
|
3311 | }
|
3312 | seen.add(depId);
|
3313 | }
|
3314 | if (isA) {
|
3315 | i = val.length;
|
3316 | while (i--) { _traverse(val[i], seen); }
|
3317 | } else {
|
3318 | keys = Object.keys(val);
|
3319 | i = keys.length;
|
3320 | while (i--) { _traverse(val[keys[i]], seen); }
|
3321 | }
|
3322 | }
|
3323 |
|
3324 |
|
3325 |
|
3326 | var sharedPropertyDefinition = {
|
3327 | enumerable: true,
|
3328 | configurable: true,
|
3329 | get: noop,
|
3330 | set: noop
|
3331 | };
|
3332 |
|
3333 | function proxy (target, sourceKey, key) {
|
3334 | sharedPropertyDefinition.get = function proxyGetter () {
|
3335 | return this[sourceKey][key]
|
3336 | };
|
3337 | sharedPropertyDefinition.set = function proxySetter (val) {
|
3338 | this[sourceKey][key] = val;
|
3339 | };
|
3340 | Object.defineProperty(target, key, sharedPropertyDefinition);
|
3341 | }
|
3342 |
|
3343 | function initState (vm) {
|
3344 | vm._watchers = [];
|
3345 | var opts = vm.$options;
|
3346 | if (opts.props) { initProps(vm, opts.props); }
|
3347 | if (opts.methods) { initMethods(vm, opts.methods); }
|
3348 | if (opts.data) {
|
3349 | initData(vm);
|
3350 | } else {
|
3351 | observe(vm._data = {}, true );
|
3352 | }
|
3353 | if (opts.computed) { initComputed(vm, opts.computed); }
|
3354 | if (opts.watch && opts.watch !== nativeWatch) {
|
3355 | initWatch(vm, opts.watch);
|
3356 | }
|
3357 | }
|
3358 |
|
3359 | function initProps (vm, propsOptions) {
|
3360 | var propsData = vm.$options.propsData || {};
|
3361 | var props = vm._props = {};
|
3362 |
|
3363 |
|
3364 | var keys = vm.$options._propKeys = [];
|
3365 | var isRoot = !vm.$parent;
|
3366 |
|
3367 | observerState.shouldConvert = isRoot;
|
3368 | var loop = function ( key ) {
|
3369 | keys.push(key);
|
3370 | var value = validateProp(key, propsOptions, propsData, vm);
|
3371 |
|
3372 | if (false) {
|
3373 | var hyphenatedKey = hyphenate(key);
|
3374 | if (isReservedAttribute(hyphenatedKey) ||
|
3375 | config.isReservedAttr(hyphenatedKey)) {
|
3376 | warn(
|
3377 | ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
|
3378 | vm
|
3379 | );
|
3380 | }
|
3381 | defineReactive(props, key, value, function () {
|
3382 | if (vm.$parent && !isUpdatingChildComponent) {
|
3383 | warn(
|
3384 | "Avoid mutating a prop directly since the value will be " +
|
3385 | "overwritten whenever the parent component re-renders. " +
|
3386 | "Instead, use a data or computed property based on the prop's " +
|
3387 | "value. Prop being mutated: \"" + key + "\"",
|
3388 | vm
|
3389 | );
|
3390 | }
|
3391 | });
|
3392 | } else {
|
3393 | defineReactive(props, key, value);
|
3394 | }
|
3395 |
|
3396 |
|
3397 |
|
3398 | if (!(key in vm)) {
|
3399 | proxy(vm, "_props", key);
|
3400 | }
|
3401 | };
|
3402 |
|
3403 | for (var key in propsOptions) loop( key );
|
3404 | observerState.shouldConvert = true;
|
3405 | }
|
3406 |
|
3407 | function initData (vm) {
|
3408 | var data = vm.$options.data;
|
3409 | data = vm._data = typeof data === 'function'
|
3410 | ? getData(data, vm)
|
3411 | : data || {};
|
3412 | if (!isPlainObject(data)) {
|
3413 | data = {};
|
3414 | "production" !== 'production' && warn(
|
3415 | 'data functions should return an object:\n' +
|
3416 | 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
|
3417 | vm
|
3418 | );
|
3419 | }
|
3420 |
|
3421 | var keys = Object.keys(data);
|
3422 | var props = vm.$options.props;
|
3423 | var methods = vm.$options.methods;
|
3424 | var i = keys.length;
|
3425 | while (i--) {
|
3426 | var key = keys[i];
|
3427 | if (false) {
|
3428 | if (methods && hasOwn(methods, key)) {
|
3429 | warn(
|
3430 | ("Method \"" + key + "\" has already been defined as a data property."),
|
3431 | vm
|
3432 | );
|
3433 | }
|
3434 | }
|
3435 | if (props && hasOwn(props, key)) {
|
3436 | "production" !== 'production' && warn(
|
3437 | "The data property \"" + key + "\" is already declared as a prop. " +
|
3438 | "Use prop default value instead.",
|
3439 | vm
|
3440 | );
|
3441 | } else if (!isReserved(key)) {
|
3442 | proxy(vm, "_data", key);
|
3443 | }
|
3444 | }
|
3445 |
|
3446 | observe(data, true );
|
3447 | }
|
3448 |
|
3449 | function getData (data, vm) {
|
3450 | try {
|
3451 | return data.call(vm, vm)
|
3452 | } catch (e) {
|
3453 | handleError(e, vm, "data()");
|
3454 | return {}
|
3455 | }
|
3456 | }
|
3457 |
|
3458 | var computedWatcherOptions = { lazy: true };
|
3459 |
|
3460 | function initComputed (vm, computed) {
|
3461 | var watchers = vm._computedWatchers = Object.create(null);
|
3462 |
|
3463 | var isSSR = isServerRendering();
|
3464 |
|
3465 | for (var key in computed) {
|
3466 | var userDef = computed[key];
|
3467 | var getter = typeof userDef === 'function' ? userDef : userDef.get;
|
3468 | if (false) {
|
3469 | warn(
|
3470 | ("Getter is missing for computed property \"" + key + "\"."),
|
3471 | vm
|
3472 | );
|
3473 | }
|
3474 |
|
3475 | if (!isSSR) {
|
3476 |
|
3477 | watchers[key] = new Watcher(
|
3478 | vm,
|
3479 | getter || noop,
|
3480 | noop,
|
3481 | computedWatcherOptions
|
3482 | );
|
3483 | }
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 | if (!(key in vm)) {
|
3489 | defineComputed(vm, key, userDef);
|
3490 | } else if (false) {
|
3491 | if (key in vm.$data) {
|
3492 | warn(("The computed property \"" + key + "\" is already defined in data."), vm);
|
3493 | } else if (vm.$options.props && key in vm.$options.props) {
|
3494 | warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
|
3495 | }
|
3496 | }
|
3497 | }
|
3498 | }
|
3499 |
|
3500 | function defineComputed (
|
3501 | target,
|
3502 | key,
|
3503 | userDef
|
3504 | ) {
|
3505 | var shouldCache = !isServerRendering();
|
3506 | if (typeof userDef === 'function') {
|
3507 | sharedPropertyDefinition.get = shouldCache
|
3508 | ? createComputedGetter(key)
|
3509 | : userDef;
|
3510 | sharedPropertyDefinition.set = noop;
|
3511 | } else {
|
3512 | sharedPropertyDefinition.get = userDef.get
|
3513 | ? shouldCache && userDef.cache !== false
|
3514 | ? createComputedGetter(key)
|
3515 | : userDef.get
|
3516 | : noop;
|
3517 | sharedPropertyDefinition.set = userDef.set
|
3518 | ? userDef.set
|
3519 | : noop;
|
3520 | }
|
3521 | if (false) {
|
3522 | sharedPropertyDefinition.set = function () {
|
3523 | warn(
|
3524 | ("Computed property \"" + key + "\" was assigned to but it has no setter."),
|
3525 | this
|
3526 | );
|
3527 | };
|
3528 | }
|
3529 | Object.defineProperty(target, key, sharedPropertyDefinition);
|
3530 | }
|
3531 |
|
3532 | function createComputedGetter (key) {
|
3533 | return function computedGetter () {
|
3534 | var watcher = this._computedWatchers && this._computedWatchers[key];
|
3535 | if (watcher) {
|
3536 | if (watcher.dirty) {
|
3537 | watcher.evaluate();
|
3538 | }
|
3539 | if (Dep.target) {
|
3540 | watcher.depend();
|
3541 | }
|
3542 | return watcher.value
|
3543 | }
|
3544 | }
|
3545 | }
|
3546 |
|
3547 | function initMethods (vm, methods) {
|
3548 | var props = vm.$options.props;
|
3549 | for (var key in methods) {
|
3550 | if (false) {
|
3551 | if (methods[key] == null) {
|
3552 | warn(
|
3553 | "Method \"" + key + "\" has an undefined value in the component definition. " +
|
3554 | "Did you reference the function correctly?",
|
3555 | vm
|
3556 | );
|
3557 | }
|
3558 | if (props && hasOwn(props, key)) {
|
3559 | warn(
|
3560 | ("Method \"" + key + "\" has already been defined as a prop."),
|
3561 | vm
|
3562 | );
|
3563 | }
|
3564 | if ((key in vm) && isReserved(key)) {
|
3565 | warn(
|
3566 | "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
|
3567 | "Avoid defining component methods that start with _ or $."
|
3568 | );
|
3569 | }
|
3570 | }
|
3571 | vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
|
3572 | }
|
3573 | }
|
3574 |
|
3575 | function initWatch (vm, watch) {
|
3576 | for (var key in watch) {
|
3577 | var handler = watch[key];
|
3578 | if (Array.isArray(handler)) {
|
3579 | for (var i = 0; i < handler.length; i++) {
|
3580 | createWatcher(vm, key, handler[i]);
|
3581 | }
|
3582 | } else {
|
3583 | createWatcher(vm, key, handler);
|
3584 | }
|
3585 | }
|
3586 | }
|
3587 |
|
3588 | function createWatcher (
|
3589 | vm,
|
3590 | keyOrFn,
|
3591 | handler,
|
3592 | options
|
3593 | ) {
|
3594 | if (isPlainObject(handler)) {
|
3595 | options = handler;
|
3596 | handler = handler.handler;
|
3597 | }
|
3598 | if (typeof handler === 'string') {
|
3599 | handler = vm[handler];
|
3600 | }
|
3601 | return vm.$watch(keyOrFn, handler, options)
|
3602 | }
|
3603 |
|
3604 | function stateMixin (Vue) {
|
3605 |
|
3606 |
|
3607 |
|
3608 | var dataDef = {};
|
3609 | dataDef.get = function () { return this._data };
|
3610 | var propsDef = {};
|
3611 | propsDef.get = function () { return this._props };
|
3612 | if (false) {
|
3613 | dataDef.set = function (newData) {
|
3614 | warn(
|
3615 | 'Avoid replacing instance root $data. ' +
|
3616 | 'Use nested data properties instead.',
|
3617 | this
|
3618 | );
|
3619 | };
|
3620 | propsDef.set = function () {
|
3621 | warn("$props is readonly.", this);
|
3622 | };
|
3623 | }
|
3624 | Object.defineProperty(Vue.prototype, '$data', dataDef);
|
3625 | Object.defineProperty(Vue.prototype, '$props', propsDef);
|
3626 |
|
3627 | Vue.prototype.$set = set;
|
3628 | Vue.prototype.$delete = del;
|
3629 |
|
3630 | Vue.prototype.$watch = function (
|
3631 | expOrFn,
|
3632 | cb,
|
3633 | options
|
3634 | ) {
|
3635 | var vm = this;
|
3636 | if (isPlainObject(cb)) {
|
3637 | return createWatcher(vm, expOrFn, cb, options)
|
3638 | }
|
3639 | options = options || {};
|
3640 | options.user = true;
|
3641 | var watcher = new Watcher(vm, expOrFn, cb, options);
|
3642 | if (options.immediate) {
|
3643 | cb.call(vm, watcher.value);
|
3644 | }
|
3645 | return function unwatchFn () {
|
3646 | watcher.teardown();
|
3647 | }
|
3648 | };
|
3649 | }
|
3650 |
|
3651 |
|
3652 |
|
3653 | function initProvide (vm) {
|
3654 | var provide = vm.$options.provide;
|
3655 | if (provide) {
|
3656 | vm._provided = typeof provide === 'function'
|
3657 | ? provide.call(vm)
|
3658 | : provide;
|
3659 | }
|
3660 | }
|
3661 |
|
3662 | function initInjections (vm) {
|
3663 | var result = resolveInject(vm.$options.inject, vm);
|
3664 | if (result) {
|
3665 | observerState.shouldConvert = false;
|
3666 | Object.keys(result).forEach(function (key) {
|
3667 |
|
3668 | if (false) {
|
3669 | defineReactive(vm, key, result[key], function () {
|
3670 | warn(
|
3671 | "Avoid mutating an injected value directly since the changes will be " +
|
3672 | "overwritten whenever the provided component re-renders. " +
|
3673 | "injection being mutated: \"" + key + "\"",
|
3674 | vm
|
3675 | );
|
3676 | });
|
3677 | } else {
|
3678 | defineReactive(vm, key, result[key]);
|
3679 | }
|
3680 | });
|
3681 | observerState.shouldConvert = true;
|
3682 | }
|
3683 | }
|
3684 |
|
3685 | function resolveInject (inject, vm) {
|
3686 | if (inject) {
|
3687 |
|
3688 | var result = Object.create(null);
|
3689 | var keys = hasSymbol
|
3690 | ? Reflect.ownKeys(inject).filter(function (key) {
|
3691 |
|
3692 | return Object.getOwnPropertyDescriptor(inject, key).enumerable
|
3693 | })
|
3694 | : Object.keys(inject);
|
3695 |
|
3696 | for (var i = 0; i < keys.length; i++) {
|
3697 | var key = keys[i];
|
3698 | var provideKey = inject[key].from;
|
3699 | var source = vm;
|
3700 | while (source) {
|
3701 | if (source._provided && provideKey in source._provided) {
|
3702 | result[key] = source._provided[provideKey];
|
3703 | break
|
3704 | }
|
3705 | source = source.$parent;
|
3706 | }
|
3707 | if (!source) {
|
3708 | if ('default' in inject[key]) {
|
3709 | var provideDefault = inject[key].default;
|
3710 | result[key] = typeof provideDefault === 'function'
|
3711 | ? provideDefault.call(vm)
|
3712 | : provideDefault;
|
3713 | } else if (false) {
|
3714 | warn(("Injection \"" + key + "\" not found"), vm);
|
3715 | }
|
3716 | }
|
3717 | }
|
3718 | return result
|
3719 | }
|
3720 | }
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 | function renderList (
|
3728 | val,
|
3729 | render
|
3730 | ) {
|
3731 | var ret, i, l, keys, key;
|
3732 | if (Array.isArray(val) || typeof val === 'string') {
|
3733 | ret = new Array(val.length);
|
3734 | for (i = 0, l = val.length; i < l; i++) {
|
3735 | ret[i] = render(val[i], i);
|
3736 | }
|
3737 | } else if (typeof val === 'number') {
|
3738 | ret = new Array(val);
|
3739 | for (i = 0; i < val; i++) {
|
3740 | ret[i] = render(i + 1, i);
|
3741 | }
|
3742 | } else if (isObject(val)) {
|
3743 | keys = Object.keys(val);
|
3744 | ret = new Array(keys.length);
|
3745 | for (i = 0, l = keys.length; i < l; i++) {
|
3746 | key = keys[i];
|
3747 | ret[i] = render(val[key], key, i);
|
3748 | }
|
3749 | }
|
3750 | if (isDef(ret)) {
|
3751 | (ret)._isVList = true;
|
3752 | }
|
3753 | return ret
|
3754 | }
|
3755 |
|
3756 |
|
3757 |
|
3758 |
|
3759 |
|
3760 |
|
3761 | function renderSlot (
|
3762 | name,
|
3763 | fallback,
|
3764 | props,
|
3765 | bindObject
|
3766 | ) {
|
3767 | var scopedSlotFn = this.$scopedSlots[name];
|
3768 | if (scopedSlotFn) {
|
3769 | props = props || {};
|
3770 | if (bindObject) {
|
3771 | if (false) {
|
3772 | warn(
|
3773 | 'slot v-bind without argument expects an Object',
|
3774 | this
|
3775 | );
|
3776 | }
|
3777 | props = extend(extend({}, bindObject), props);
|
3778 | }
|
3779 | return scopedSlotFn(props) || fallback
|
3780 | } else {
|
3781 | var slotNodes = this.$slots[name];
|
3782 |
|
3783 | if (slotNodes && "production" !== 'production') {
|
3784 | slotNodes._rendered && warn(
|
3785 | "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
|
3786 | "- this will likely cause render errors.",
|
3787 | this
|
3788 | );
|
3789 | slotNodes._rendered = true;
|
3790 | }
|
3791 | return slotNodes || fallback
|
3792 | }
|
3793 | }
|
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 | function resolveFilter (id) {
|
3801 | return resolveAsset(this.$options, 'filters', id, true) || identity
|
3802 | }
|
3803 |
|
3804 |
|
3805 |
|
3806 |
|
3807 |
|
3808 |
|
3809 |
|
3810 |
|
3811 | function checkKeyCodes (
|
3812 | eventKeyCode,
|
3813 | key,
|
3814 | builtInAlias,
|
3815 | eventKeyName
|
3816 | ) {
|
3817 | var keyCodes = config.keyCodes[key] || builtInAlias;
|
3818 | if (keyCodes) {
|
3819 | if (Array.isArray(keyCodes)) {
|
3820 | return keyCodes.indexOf(eventKeyCode) === -1
|
3821 | } else {
|
3822 | return keyCodes !== eventKeyCode
|
3823 | }
|
3824 | } else if (eventKeyName) {
|
3825 | return hyphenate(eventKeyName) !== key
|
3826 | }
|
3827 | }
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 | function bindObjectProps (
|
3835 | data,
|
3836 | tag,
|
3837 | value,
|
3838 | asProp,
|
3839 | isSync
|
3840 | ) {
|
3841 | if (value) {
|
3842 | if (!isObject(value)) {
|
3843 | "production" !== 'production' && warn(
|
3844 | 'v-bind without argument expects an Object or Array value',
|
3845 | this
|
3846 | );
|
3847 | } else {
|
3848 | if (Array.isArray(value)) {
|
3849 | value = toObject(value);
|
3850 | }
|
3851 | var hash;
|
3852 | var loop = function ( key ) {
|
3853 | if (
|
3854 | key === 'class' ||
|
3855 | key === 'style' ||
|
3856 | isReservedAttribute(key)
|
3857 | ) {
|
3858 | hash = data;
|
3859 | } else {
|
3860 | var type = data.attrs && data.attrs.type;
|
3861 | hash = asProp || config.mustUseProp(tag, type, key)
|
3862 | ? data.domProps || (data.domProps = {})
|
3863 | : data.attrs || (data.attrs = {});
|
3864 | }
|
3865 | if (!(key in hash)) {
|
3866 | hash[key] = value[key];
|
3867 |
|
3868 | if (isSync) {
|
3869 | var on = data.on || (data.on = {});
|
3870 | on[("update:" + key)] = function ($event) {
|
3871 | value[key] = $event;
|
3872 | };
|
3873 | }
|
3874 | }
|
3875 | };
|
3876 |
|
3877 | for (var key in value) loop( key );
|
3878 | }
|
3879 | }
|
3880 | return data
|
3881 | }
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 | function renderStatic (
|
3889 | index,
|
3890 | isInFor
|
3891 | ) {
|
3892 |
|
3893 |
|
3894 | var renderFns = this.$options.staticRenderFns;
|
3895 | var cached = renderFns.cached || (renderFns.cached = []);
|
3896 | var tree = cached[index];
|
3897 |
|
3898 |
|
3899 | if (tree && !isInFor) {
|
3900 | return Array.isArray(tree)
|
3901 | ? cloneVNodes(tree)
|
3902 | : cloneVNode(tree)
|
3903 | }
|
3904 |
|
3905 | tree = cached[index] = renderFns[index].call(this._renderProxy, null, this);
|
3906 | markStatic(tree, ("__static__" + index), false);
|
3907 | return tree
|
3908 | }
|
3909 |
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 | function markOnce (
|
3915 | tree,
|
3916 | index,
|
3917 | key
|
3918 | ) {
|
3919 | markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
|
3920 | return tree
|
3921 | }
|
3922 |
|
3923 | function markStatic (
|
3924 | tree,
|
3925 | key,
|
3926 | isOnce
|
3927 | ) {
|
3928 | if (Array.isArray(tree)) {
|
3929 | for (var i = 0; i < tree.length; i++) {
|
3930 | if (tree[i] && typeof tree[i] !== 'string') {
|
3931 | markStaticNode(tree[i], (key + "_" + i), isOnce);
|
3932 | }
|
3933 | }
|
3934 | } else {
|
3935 | markStaticNode(tree, key, isOnce);
|
3936 | }
|
3937 | }
|
3938 |
|
3939 | function markStaticNode (node, key, isOnce) {
|
3940 | node.isStatic = true;
|
3941 | node.key = key;
|
3942 | node.isOnce = isOnce;
|
3943 | }
|
3944 |
|
3945 |
|
3946 |
|
3947 | function bindObjectListeners (data, value) {
|
3948 | if (value) {
|
3949 | if (!isPlainObject(value)) {
|
3950 | "production" !== 'production' && warn(
|
3951 | 'v-on without argument expects an Object value',
|
3952 | this
|
3953 | );
|
3954 | } else {
|
3955 | var on = data.on = data.on ? extend({}, data.on) : {};
|
3956 | for (var key in value) {
|
3957 | var existing = on[key];
|
3958 | var ours = value[key];
|
3959 | on[key] = existing ? [].concat(existing, ours) : ours;
|
3960 | }
|
3961 | }
|
3962 | }
|
3963 | return data
|
3964 | }
|
3965 |
|
3966 |
|
3967 |
|
3968 | function installRenderHelpers (target) {
|
3969 | target._o = markOnce;
|
3970 | target._n = toNumber;
|
3971 | target._s = toString;
|
3972 | target._l = renderList;
|
3973 | target._t = renderSlot;
|
3974 | target._q = looseEqual;
|
3975 | target._i = looseIndexOf;
|
3976 | target._m = renderStatic;
|
3977 | target._f = resolveFilter;
|
3978 | target._k = checkKeyCodes;
|
3979 | target._b = bindObjectProps;
|
3980 | target._v = createTextVNode;
|
3981 | target._e = createEmptyVNode;
|
3982 | target._u = resolveScopedSlots;
|
3983 | target._g = bindObjectListeners;
|
3984 | }
|
3985 |
|
3986 |
|
3987 |
|
3988 | function FunctionalRenderContext (
|
3989 | data,
|
3990 | props,
|
3991 | children,
|
3992 | parent,
|
3993 | Ctor
|
3994 | ) {
|
3995 | var options = Ctor.options;
|
3996 | this.data = data;
|
3997 | this.props = props;
|
3998 | this.children = children;
|
3999 | this.parent = parent;
|
4000 | this.listeners = data.on || emptyObject;
|
4001 | this.injections = resolveInject(options.inject, parent);
|
4002 | this.slots = function () { return resolveSlots(children, parent); };
|
4003 |
|
4004 |
|
4005 |
|
4006 | var contextVm = Object.create(parent);
|
4007 | var isCompiled = isTrue(options._compiled);
|
4008 | var needNormalization = !isCompiled;
|
4009 |
|
4010 |
|
4011 | if (isCompiled) {
|
4012 |
|
4013 | this.$options = options;
|
4014 |
|
4015 | this.$slots = this.slots();
|
4016 | this.$scopedSlots = data.scopedSlots || emptyObject;
|
4017 | }
|
4018 |
|
4019 | if (options._scopeId) {
|
4020 | this._c = function (a, b, c, d) {
|
4021 | var vnode = createElement(contextVm, a, b, c, d, needNormalization);
|
4022 | if (vnode) {
|
4023 | vnode.functionalScopeId = options._scopeId;
|
4024 | vnode.functionalContext = parent;
|
4025 | }
|
4026 | return vnode
|
4027 | };
|
4028 | } else {
|
4029 | this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
|
4030 | }
|
4031 | }
|
4032 |
|
4033 | installRenderHelpers(FunctionalRenderContext.prototype);
|
4034 |
|
4035 | function createFunctionalComponent (
|
4036 | Ctor,
|
4037 | propsData,
|
4038 | data,
|
4039 | contextVm,
|
4040 | children
|
4041 | ) {
|
4042 | var options = Ctor.options;
|
4043 | var props = {};
|
4044 | var propOptions = options.props;
|
4045 | if (isDef(propOptions)) {
|
4046 | for (var key in propOptions) {
|
4047 | props[key] = validateProp(key, propOptions, propsData || emptyObject);
|
4048 | }
|
4049 | } else {
|
4050 | if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
|
4051 | if (isDef(data.props)) { mergeProps(props, data.props); }
|
4052 | }
|
4053 |
|
4054 | var renderContext = new FunctionalRenderContext(
|
4055 | data,
|
4056 | props,
|
4057 | children,
|
4058 | contextVm,
|
4059 | Ctor
|
4060 | );
|
4061 |
|
4062 | var vnode = options.render.call(null, renderContext._c, renderContext);
|
4063 |
|
4064 | if (vnode instanceof VNode) {
|
4065 | vnode.functionalContext = contextVm;
|
4066 | vnode.functionalOptions = options;
|
4067 | if (data.slot) {
|
4068 | (vnode.data || (vnode.data = {})).slot = data.slot;
|
4069 | }
|
4070 | }
|
4071 |
|
4072 | return vnode
|
4073 | }
|
4074 |
|
4075 | function mergeProps (to, from) {
|
4076 | for (var key in from) {
|
4077 | to[camelize(key)] = from[key];
|
4078 | }
|
4079 | }
|
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 | var componentVNodeHooks = {
|
4085 | init: function init (
|
4086 | vnode,
|
4087 | hydrating,
|
4088 | parentElm,
|
4089 | refElm
|
4090 | ) {
|
4091 | if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
|
4092 | var child = vnode.componentInstance = createComponentInstanceForVnode(
|
4093 | vnode,
|
4094 | activeInstance,
|
4095 | parentElm,
|
4096 | refElm
|
4097 | );
|
4098 | child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
4099 | } else if (vnode.data.keepAlive) {
|
4100 |
|
4101 | var mountedNode = vnode;
|
4102 | componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
4103 | }
|
4104 | },
|
4105 |
|
4106 | prepatch: function prepatch (oldVnode, vnode) {
|
4107 | var options = vnode.componentOptions;
|
4108 | var child = vnode.componentInstance = oldVnode.componentInstance;
|
4109 | updateChildComponent(
|
4110 | child,
|
4111 | options.propsData,
|
4112 | options.listeners,
|
4113 | vnode,
|
4114 | options.children
|
4115 | );
|
4116 | },
|
4117 |
|
4118 | insert: function insert (vnode) {
|
4119 | var context = vnode.context;
|
4120 | var componentInstance = vnode.componentInstance;
|
4121 | if (!componentInstance._isMounted) {
|
4122 | componentInstance._isMounted = true;
|
4123 | callHook(componentInstance, 'mounted');
|
4124 | }
|
4125 | if (vnode.data.keepAlive) {
|
4126 | if (context._isMounted) {
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 |
|
4132 | queueActivatedComponent(componentInstance);
|
4133 | } else {
|
4134 | activateChildComponent(componentInstance, true );
|
4135 | }
|
4136 | }
|
4137 | },
|
4138 |
|
4139 | destroy: function destroy (vnode) {
|
4140 | var componentInstance = vnode.componentInstance;
|
4141 | if (!componentInstance._isDestroyed) {
|
4142 | if (!vnode.data.keepAlive) {
|
4143 | componentInstance.$destroy();
|
4144 | } else {
|
4145 | deactivateChildComponent(componentInstance, true );
|
4146 | }
|
4147 | }
|
4148 | }
|
4149 | };
|
4150 |
|
4151 | var hooksToMerge = Object.keys(componentVNodeHooks);
|
4152 |
|
4153 | function createComponent (
|
4154 | Ctor,
|
4155 | data,
|
4156 | context,
|
4157 | children,
|
4158 | tag
|
4159 | ) {
|
4160 | if (isUndef(Ctor)) {
|
4161 | return
|
4162 | }
|
4163 |
|
4164 | var baseCtor = context.$options._base;
|
4165 |
|
4166 |
|
4167 | if (isObject(Ctor)) {
|
4168 | Ctor = baseCtor.extend(Ctor);
|
4169 | }
|
4170 |
|
4171 |
|
4172 |
|
4173 | if (typeof Ctor !== 'function') {
|
4174 | if (false) {
|
4175 | warn(("Invalid Component definition: " + (String(Ctor))), context);
|
4176 | }
|
4177 | return
|
4178 | }
|
4179 |
|
4180 |
|
4181 | var asyncFactory;
|
4182 | if (isUndef(Ctor.cid)) {
|
4183 | asyncFactory = Ctor;
|
4184 | Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context);
|
4185 | if (Ctor === undefined) {
|
4186 |
|
4187 |
|
4188 |
|
4189 | return createAsyncPlaceholder(
|
4190 | asyncFactory,
|
4191 | data,
|
4192 | context,
|
4193 | children,
|
4194 | tag
|
4195 | )
|
4196 | }
|
4197 | }
|
4198 |
|
4199 | data = data || {};
|
4200 |
|
4201 |
|
4202 |
|
4203 | resolveConstructorOptions(Ctor);
|
4204 |
|
4205 |
|
4206 | if (isDef(data.model)) {
|
4207 | transformModel(Ctor.options, data);
|
4208 | }
|
4209 |
|
4210 |
|
4211 | var propsData = extractPropsFromVNodeData(data, Ctor, tag);
|
4212 |
|
4213 |
|
4214 | if (isTrue(Ctor.options.functional)) {
|
4215 | return createFunctionalComponent(Ctor, propsData, data, context, children)
|
4216 | }
|
4217 |
|
4218 |
|
4219 |
|
4220 | var listeners = data.on;
|
4221 |
|
4222 |
|
4223 | data.on = data.nativeOn;
|
4224 |
|
4225 | if (isTrue(Ctor.options.abstract)) {
|
4226 |
|
4227 |
|
4228 |
|
4229 |
|
4230 | var slot = data.slot;
|
4231 | data = {};
|
4232 | if (slot) {
|
4233 | data.slot = slot;
|
4234 | }
|
4235 | }
|
4236 |
|
4237 |
|
4238 | mergeHooks(data);
|
4239 |
|
4240 |
|
4241 | var name = Ctor.options.name || tag;
|
4242 | var vnode = new VNode(
|
4243 | ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
|
4244 | data, undefined, undefined, undefined, context,
|
4245 | { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
|
4246 | asyncFactory
|
4247 | );
|
4248 | return vnode
|
4249 | }
|
4250 |
|
4251 | function createComponentInstanceForVnode (
|
4252 | vnode, // we know it's MountedComponentVNode but flow doesn't
|
4253 | parent, // activeInstance in lifecycle state
|
4254 | parentElm,
|
4255 | refElm
|
4256 | ) {
|
4257 | var vnodeComponentOptions = vnode.componentOptions;
|
4258 | var options = {
|
4259 | _isComponent: true,
|
4260 | parent: parent,
|
4261 | propsData: vnodeComponentOptions.propsData,
|
4262 | _componentTag: vnodeComponentOptions.tag,
|
4263 | _parentVnode: vnode,
|
4264 | _parentListeners: vnodeComponentOptions.listeners,
|
4265 | _renderChildren: vnodeComponentOptions.children,
|
4266 | _parentElm: parentElm || null,
|
4267 | _refElm: refElm || null
|
4268 | };
|
4269 |
|
4270 | var inlineTemplate = vnode.data.inlineTemplate;
|
4271 | if (isDef(inlineTemplate)) {
|
4272 | options.render = inlineTemplate.render;
|
4273 | options.staticRenderFns = inlineTemplate.staticRenderFns;
|
4274 | }
|
4275 | return new vnodeComponentOptions.Ctor(options)
|
4276 | }
|
4277 |
|
4278 | function mergeHooks (data) {
|
4279 | if (!data.hook) {
|
4280 | data.hook = {};
|
4281 | }
|
4282 | for (var i = 0; i < hooksToMerge.length; i++) {
|
4283 | var key = hooksToMerge[i];
|
4284 | var fromParent = data.hook[key];
|
4285 | var ours = componentVNodeHooks[key];
|
4286 | data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
|
4287 | }
|
4288 | }
|
4289 |
|
4290 | function mergeHook$1 (one, two) {
|
4291 | return function (a, b, c, d) {
|
4292 | one(a, b, c, d);
|
4293 | two(a, b, c, d);
|
4294 | }
|
4295 | }
|
4296 |
|
4297 |
|
4298 |
|
4299 | function transformModel (options, data) {
|
4300 | var prop = (options.model && options.model.prop) || 'value';
|
4301 | var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
|
4302 | var on = data.on || (data.on = {});
|
4303 | if (isDef(on[event])) {
|
4304 | on[event] = [data.model.callback].concat(on[event]);
|
4305 | } else {
|
4306 | on[event] = data.model.callback;
|
4307 | }
|
4308 | }
|
4309 |
|
4310 |
|
4311 |
|
4312 | var SIMPLE_NORMALIZE = 1;
|
4313 | var ALWAYS_NORMALIZE = 2;
|
4314 |
|
4315 |
|
4316 |
|
4317 | function createElement (
|
4318 | context,
|
4319 | tag,
|
4320 | data,
|
4321 | children,
|
4322 | normalizationType,
|
4323 | alwaysNormalize
|
4324 | ) {
|
4325 | if (Array.isArray(data) || isPrimitive(data)) {
|
4326 | normalizationType = children;
|
4327 | children = data;
|
4328 | data = undefined;
|
4329 | }
|
4330 | if (isTrue(alwaysNormalize)) {
|
4331 | normalizationType = ALWAYS_NORMALIZE;
|
4332 | }
|
4333 | return _createElement(context, tag, data, children, normalizationType)
|
4334 | }
|
4335 |
|
4336 | function _createElement (
|
4337 | context,
|
4338 | tag,
|
4339 | data,
|
4340 | children,
|
4341 | normalizationType
|
4342 | ) {
|
4343 | if (isDef(data) && isDef((data).__ob__)) {
|
4344 | "production" !== 'production' && warn(
|
4345 | "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
|
4346 | 'Always create fresh vnode data objects in each render!',
|
4347 | context
|
4348 | );
|
4349 | return createEmptyVNode()
|
4350 | }
|
4351 |
|
4352 | if (isDef(data) && isDef(data.is)) {
|
4353 | tag = data.is;
|
4354 | }
|
4355 | if (!tag) {
|
4356 |
|
4357 | return createEmptyVNode()
|
4358 | }
|
4359 |
|
4360 | if (false
|
4361 | ) {
|
4362 | warn(
|
4363 | 'Avoid using non-primitive value as key, ' +
|
4364 | 'use string/number value instead.',
|
4365 | context
|
4366 | );
|
4367 | }
|
4368 |
|
4369 | if (Array.isArray(children) &&
|
4370 | typeof children[0] === 'function'
|
4371 | ) {
|
4372 | data = data || {};
|
4373 | data.scopedSlots = { default: children[0] };
|
4374 | children.length = 0;
|
4375 | }
|
4376 | if (normalizationType === ALWAYS_NORMALIZE) {
|
4377 | children = normalizeChildren(children);
|
4378 | } else if (normalizationType === SIMPLE_NORMALIZE) {
|
4379 | children = simpleNormalizeChildren(children);
|
4380 | }
|
4381 | var vnode, ns;
|
4382 | if (typeof tag === 'string') {
|
4383 | var Ctor;
|
4384 | ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
|
4385 | if (config.isReservedTag(tag)) {
|
4386 |
|
4387 | vnode = new VNode(
|
4388 | config.parsePlatformTagName(tag), data, children,
|
4389 | undefined, undefined, context
|
4390 | );
|
4391 | } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
|
4392 |
|
4393 | vnode = createComponent(Ctor, data, context, children, tag);
|
4394 | } else {
|
4395 |
|
4396 |
|
4397 |
|
4398 | vnode = new VNode(
|
4399 | tag, data, children,
|
4400 | undefined, undefined, context
|
4401 | );
|
4402 | }
|
4403 | } else {
|
4404 |
|
4405 | vnode = createComponent(tag, data, context, children);
|
4406 | }
|
4407 | if (isDef(vnode)) {
|
4408 | if (ns) { applyNS(vnode, ns); }
|
4409 | return vnode
|
4410 | } else {
|
4411 | return createEmptyVNode()
|
4412 | }
|
4413 | }
|
4414 |
|
4415 | function applyNS (vnode, ns, force) {
|
4416 | vnode.ns = ns;
|
4417 | if (vnode.tag === 'foreignObject') {
|
4418 |
|
4419 | ns = undefined;
|
4420 | force = true;
|
4421 | }
|
4422 | if (isDef(vnode.children)) {
|
4423 | for (var i = 0, l = vnode.children.length; i < l; i++) {
|
4424 | var child = vnode.children[i];
|
4425 | if (isDef(child.tag) && (isUndef(child.ns) || isTrue(force))) {
|
4426 | applyNS(child, ns, force);
|
4427 | }
|
4428 | }
|
4429 | }
|
4430 | }
|
4431 |
|
4432 |
|
4433 |
|
4434 | function initRender (vm) {
|
4435 | vm._vnode = null;
|
4436 | var options = vm.$options;
|
4437 | var parentVnode = vm.$vnode = options._parentVnode;
|
4438 | var renderContext = parentVnode && parentVnode.context;
|
4439 | vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
4440 | vm.$scopedSlots = emptyObject;
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 | vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
|
4446 |
|
4447 |
|
4448 | vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
|
4449 |
|
4450 |
|
4451 |
|
4452 | var parentData = parentVnode && parentVnode.data;
|
4453 |
|
4454 |
|
4455 | if (false) {
|
4456 | defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
|
4457 | !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
|
4458 | }, true);
|
4459 | defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
|
4460 | !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
|
4461 | }, true);
|
4462 | } else {
|
4463 | defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true);
|
4464 | defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
|
4465 | }
|
4466 | }
|
4467 |
|
4468 | function renderMixin (Vue) {
|
4469 |
|
4470 | installRenderHelpers(Vue.prototype);
|
4471 |
|
4472 | Vue.prototype.$nextTick = function (fn) {
|
4473 | return nextTick(fn, this)
|
4474 | };
|
4475 |
|
4476 | Vue.prototype._render = function () {
|
4477 | var vm = this;
|
4478 | var ref = vm.$options;
|
4479 | var render = ref.render;
|
4480 | var _parentVnode = ref._parentVnode;
|
4481 |
|
4482 | if (vm._isMounted) {
|
4483 |
|
4484 |
|
4485 | for (var key in vm.$slots) {
|
4486 | var slot = vm.$slots[key];
|
4487 | if (slot._rendered) {
|
4488 | vm.$slots[key] = cloneVNodes(slot, true );
|
4489 | }
|
4490 | }
|
4491 | }
|
4492 |
|
4493 | vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject;
|
4494 |
|
4495 |
|
4496 |
|
4497 | vm.$vnode = _parentVnode;
|
4498 |
|
4499 | var vnode;
|
4500 | try {
|
4501 | vnode = render.call(vm._renderProxy, vm.$createElement);
|
4502 | } catch (e) {
|
4503 | handleError(e, vm, "render");
|
4504 |
|
4505 |
|
4506 |
|
4507 | if (false) {
|
4508 | if (vm.$options.renderError) {
|
4509 | try {
|
4510 | vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
|
4511 | } catch (e) {
|
4512 | handleError(e, vm, "renderError");
|
4513 | vnode = vm._vnode;
|
4514 | }
|
4515 | } else {
|
4516 | vnode = vm._vnode;
|
4517 | }
|
4518 | } else {
|
4519 | vnode = vm._vnode;
|
4520 | }
|
4521 | }
|
4522 |
|
4523 | if (!(vnode instanceof VNode)) {
|
4524 | if (false) {
|
4525 | warn(
|
4526 | 'Multiple root nodes returned from render function. Render function ' +
|
4527 | 'should return a single root node.',
|
4528 | vm
|
4529 | );
|
4530 | }
|
4531 | vnode = createEmptyVNode();
|
4532 | }
|
4533 |
|
4534 | vnode.parent = _parentVnode;
|
4535 | return vnode
|
4536 | };
|
4537 | }
|
4538 |
|
4539 |
|
4540 |
|
4541 | var uid = 0;
|
4542 |
|
4543 | function initMixin (Vue) {
|
4544 | Vue.prototype._init = function (options) {
|
4545 | var vm = this;
|
4546 |
|
4547 | vm._uid = uid++;
|
4548 |
|
4549 | var startTag, endTag;
|
4550 |
|
4551 | if (false) {
|
4552 | startTag = "vue-perf-start:" + (vm._uid);
|
4553 | endTag = "vue-perf-end:" + (vm._uid);
|
4554 | mark(startTag);
|
4555 | }
|
4556 |
|
4557 |
|
4558 | vm._isVue = true;
|
4559 |
|
4560 | if (options && options._isComponent) {
|
4561 |
|
4562 |
|
4563 |
|
4564 | initInternalComponent(vm, options);
|
4565 | } else {
|
4566 | vm.$options = mergeOptions(
|
4567 | resolveConstructorOptions(vm.constructor),
|
4568 | options || {},
|
4569 | vm
|
4570 | );
|
4571 | }
|
4572 |
|
4573 | if (false) {
|
4574 | initProxy(vm);
|
4575 | } else {
|
4576 | vm._renderProxy = vm;
|
4577 | }
|
4578 |
|
4579 | vm._self = vm;
|
4580 | initLifecycle(vm);
|
4581 | initEvents(vm);
|
4582 | initRender(vm);
|
4583 | callHook(vm, 'beforeCreate');
|
4584 | initInjections(vm);
|
4585 | initState(vm);
|
4586 | initProvide(vm);
|
4587 | callHook(vm, 'created');
|
4588 |
|
4589 |
|
4590 | if (false) {
|
4591 | vm._name = formatComponentName(vm, false);
|
4592 | mark(endTag);
|
4593 | measure(("vue " + (vm._name) + " init"), startTag, endTag);
|
4594 | }
|
4595 |
|
4596 | if (vm.$options.el) {
|
4597 | vm.$mount(vm.$options.el);
|
4598 | }
|
4599 | };
|
4600 | }
|
4601 |
|
4602 | function initInternalComponent (vm, options) {
|
4603 | var opts = vm.$options = Object.create(vm.constructor.options);
|
4604 |
|
4605 | opts.parent = options.parent;
|
4606 | opts.propsData = options.propsData;
|
4607 | opts._parentVnode = options._parentVnode;
|
4608 | opts._parentListeners = options._parentListeners;
|
4609 | opts._renderChildren = options._renderChildren;
|
4610 | opts._componentTag = options._componentTag;
|
4611 | opts._parentElm = options._parentElm;
|
4612 | opts._refElm = options._refElm;
|
4613 | if (options.render) {
|
4614 | opts.render = options.render;
|
4615 | opts.staticRenderFns = options.staticRenderFns;
|
4616 | }
|
4617 | }
|
4618 |
|
4619 | function resolveConstructorOptions (Ctor) {
|
4620 | var options = Ctor.options;
|
4621 | if (Ctor.super) {
|
4622 | var superOptions = resolveConstructorOptions(Ctor.super);
|
4623 | var cachedSuperOptions = Ctor.superOptions;
|
4624 | if (superOptions !== cachedSuperOptions) {
|
4625 |
|
4626 |
|
4627 | Ctor.superOptions = superOptions;
|
4628 |
|
4629 | var modifiedOptions = resolveModifiedOptions(Ctor);
|
4630 |
|
4631 | if (modifiedOptions) {
|
4632 | extend(Ctor.extendOptions, modifiedOptions);
|
4633 | }
|
4634 | options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
|
4635 | if (options.name) {
|
4636 | options.components[options.name] = Ctor;
|
4637 | }
|
4638 | }
|
4639 | }
|
4640 | return options
|
4641 | }
|
4642 |
|
4643 | function resolveModifiedOptions (Ctor) {
|
4644 | var modified;
|
4645 | var latest = Ctor.options;
|
4646 | var extended = Ctor.extendOptions;
|
4647 | var sealed = Ctor.sealedOptions;
|
4648 | for (var key in latest) {
|
4649 | if (latest[key] !== sealed[key]) {
|
4650 | if (!modified) { modified = {}; }
|
4651 | modified[key] = dedupe(latest[key], extended[key], sealed[key]);
|
4652 | }
|
4653 | }
|
4654 | return modified
|
4655 | }
|
4656 |
|
4657 | function dedupe (latest, extended, sealed) {
|
4658 |
|
4659 |
|
4660 | if (Array.isArray(latest)) {
|
4661 | var res = [];
|
4662 | sealed = Array.isArray(sealed) ? sealed : [sealed];
|
4663 | extended = Array.isArray(extended) ? extended : [extended];
|
4664 | for (var i = 0; i < latest.length; i++) {
|
4665 |
|
4666 | if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
|
4667 | res.push(latest[i]);
|
4668 | }
|
4669 | }
|
4670 | return res
|
4671 | } else {
|
4672 | return latest
|
4673 | }
|
4674 | }
|
4675 |
|
4676 | function Vue$3 (options) {
|
4677 | if (false
|
4678 | ) {
|
4679 | warn('Vue is a constructor and should be called with the `new` keyword');
|
4680 | }
|
4681 | this._init(options);
|
4682 | }
|
4683 |
|
4684 | initMixin(Vue$3);
|
4685 | stateMixin(Vue$3);
|
4686 | eventsMixin(Vue$3);
|
4687 | lifecycleMixin(Vue$3);
|
4688 | renderMixin(Vue$3);
|
4689 |
|
4690 |
|
4691 |
|
4692 | function initUse (Vue) {
|
4693 | Vue.use = function (plugin) {
|
4694 | var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
|
4695 | if (installedPlugins.indexOf(plugin) > -1) {
|
4696 | return this
|
4697 | }
|
4698 |
|
4699 |
|
4700 | var args = toArray(arguments, 1);
|
4701 | args.unshift(this);
|
4702 | if (typeof plugin.install === 'function') {
|
4703 | plugin.install.apply(plugin, args);
|
4704 | } else if (typeof plugin === 'function') {
|
4705 | plugin.apply(null, args);
|
4706 | }
|
4707 | installedPlugins.push(plugin);
|
4708 | return this
|
4709 | };
|
4710 | }
|
4711 |
|
4712 |
|
4713 |
|
4714 | function initMixin$1 (Vue) {
|
4715 | Vue.mixin = function (mixin) {
|
4716 | this.options = mergeOptions(this.options, mixin);
|
4717 | return this
|
4718 | };
|
4719 | }
|
4720 |
|
4721 |
|
4722 |
|
4723 | function initExtend (Vue) {
|
4724 | |
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 | Vue.cid = 0;
|
4730 | var cid = 1;
|
4731 |
|
4732 | |
4733 |
|
4734 |
|
4735 | Vue.extend = function (extendOptions) {
|
4736 | extendOptions = extendOptions || {};
|
4737 | var Super = this;
|
4738 | var SuperId = Super.cid;
|
4739 | var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
|
4740 | if (cachedCtors[SuperId]) {
|
4741 | return cachedCtors[SuperId]
|
4742 | }
|
4743 |
|
4744 | var name = extendOptions.name || Super.options.name;
|
4745 | if (false) {
|
4746 | if (!/^[a-zA-Z][\w-]*$/.test(name)) {
|
4747 | warn(
|
4748 | 'Invalid component name: "' + name + '". Component names ' +
|
4749 | 'can only contain alphanumeric characters and the hyphen, ' +
|
4750 | 'and must start with a letter.'
|
4751 | );
|
4752 | }
|
4753 | }
|
4754 |
|
4755 | var Sub = function VueComponent (options) {
|
4756 | this._init(options);
|
4757 | };
|
4758 | Sub.prototype = Object.create(Super.prototype);
|
4759 | Sub.prototype.constructor = Sub;
|
4760 | Sub.cid = cid++;
|
4761 | Sub.options = mergeOptions(
|
4762 | Super.options,
|
4763 | extendOptions
|
4764 | );
|
4765 | Sub['super'] = Super;
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 | if (Sub.options.props) {
|
4771 | initProps$1(Sub);
|
4772 | }
|
4773 | if (Sub.options.computed) {
|
4774 | initComputed$1(Sub);
|
4775 | }
|
4776 |
|
4777 |
|
4778 | Sub.extend = Super.extend;
|
4779 | Sub.mixin = Super.mixin;
|
4780 | Sub.use = Super.use;
|
4781 |
|
4782 |
|
4783 |
|
4784 | ASSET_TYPES.forEach(function (type) {
|
4785 | Sub[type] = Super[type];
|
4786 | });
|
4787 |
|
4788 | if (name) {
|
4789 | Sub.options.components[name] = Sub;
|
4790 | }
|
4791 |
|
4792 |
|
4793 |
|
4794 |
|
4795 | Sub.superOptions = Super.options;
|
4796 | Sub.extendOptions = extendOptions;
|
4797 | Sub.sealedOptions = extend({}, Sub.options);
|
4798 |
|
4799 |
|
4800 | cachedCtors[SuperId] = Sub;
|
4801 | return Sub
|
4802 | };
|
4803 | }
|
4804 |
|
4805 | function initProps$1 (Comp) {
|
4806 | var props = Comp.options.props;
|
4807 | for (var key in props) {
|
4808 | proxy(Comp.prototype, "_props", key);
|
4809 | }
|
4810 | }
|
4811 |
|
4812 | function initComputed$1 (Comp) {
|
4813 | var computed = Comp.options.computed;
|
4814 | for (var key in computed) {
|
4815 | defineComputed(Comp.prototype, key, computed[key]);
|
4816 | }
|
4817 | }
|
4818 |
|
4819 |
|
4820 |
|
4821 | function initAssetRegisters (Vue) {
|
4822 | |
4823 |
|
4824 |
|
4825 | ASSET_TYPES.forEach(function (type) {
|
4826 | Vue[type] = function (
|
4827 | id,
|
4828 | definition
|
4829 | ) {
|
4830 | if (!definition) {
|
4831 | return this.options[type + 's'][id]
|
4832 | } else {
|
4833 |
|
4834 | if (false) {
|
4835 | if (type === 'component' && config.isReservedTag(id)) {
|
4836 | warn(
|
4837 | 'Do not use built-in or reserved HTML elements as component ' +
|
4838 | 'id: ' + id
|
4839 | );
|
4840 | }
|
4841 | }
|
4842 | if (type === 'component' && isPlainObject(definition)) {
|
4843 | definition.name = definition.name || id;
|
4844 | definition = this.options._base.extend(definition);
|
4845 | }
|
4846 | if (type === 'directive' && typeof definition === 'function') {
|
4847 | definition = { bind: definition, update: definition };
|
4848 | }
|
4849 | this.options[type + 's'][id] = definition;
|
4850 | return definition
|
4851 | }
|
4852 | };
|
4853 | });
|
4854 | }
|
4855 |
|
4856 |
|
4857 |
|
4858 | function getComponentName (opts) {
|
4859 | return opts && (opts.Ctor.options.name || opts.tag)
|
4860 | }
|
4861 |
|
4862 | function matches (pattern, name) {
|
4863 | if (Array.isArray(pattern)) {
|
4864 | return pattern.indexOf(name) > -1
|
4865 | } else if (typeof pattern === 'string') {
|
4866 | return pattern.split(',').indexOf(name) > -1
|
4867 | } else if (isRegExp(pattern)) {
|
4868 | return pattern.test(name)
|
4869 | }
|
4870 |
|
4871 | return false
|
4872 | }
|
4873 |
|
4874 | function pruneCache (keepAliveInstance, filter) {
|
4875 | var cache = keepAliveInstance.cache;
|
4876 | var keys = keepAliveInstance.keys;
|
4877 | var _vnode = keepAliveInstance._vnode;
|
4878 | for (var key in cache) {
|
4879 | var cachedNode = cache[key];
|
4880 | if (cachedNode) {
|
4881 | var name = getComponentName(cachedNode.componentOptions);
|
4882 | if (name && !filter(name)) {
|
4883 | pruneCacheEntry(cache, key, keys, _vnode);
|
4884 | }
|
4885 | }
|
4886 | }
|
4887 | }
|
4888 |
|
4889 | function pruneCacheEntry (
|
4890 | cache,
|
4891 | key,
|
4892 | keys,
|
4893 | current
|
4894 | ) {
|
4895 | var cached$$1 = cache[key];
|
4896 | if (cached$$1 && cached$$1 !== current) {
|
4897 | cached$$1.componentInstance.$destroy();
|
4898 | }
|
4899 | cache[key] = null;
|
4900 | remove(keys, key);
|
4901 | }
|
4902 |
|
4903 | var patternTypes = [String, RegExp, Array];
|
4904 |
|
4905 | var KeepAlive = {
|
4906 | name: 'keep-alive',
|
4907 | abstract: true,
|
4908 |
|
4909 | props: {
|
4910 | include: patternTypes,
|
4911 | exclude: patternTypes,
|
4912 | max: [String, Number]
|
4913 | },
|
4914 |
|
4915 | created: function created () {
|
4916 | this.cache = Object.create(null);
|
4917 | this.keys = [];
|
4918 | },
|
4919 |
|
4920 | destroyed: function destroyed () {
|
4921 | var this$1 = this;
|
4922 |
|
4923 | for (var key in this$1.cache) {
|
4924 | pruneCacheEntry(this$1.cache, key, this$1.keys);
|
4925 | }
|
4926 | },
|
4927 |
|
4928 | watch: {
|
4929 | include: function include (val) {
|
4930 | pruneCache(this, function (name) { return matches(val, name); });
|
4931 | },
|
4932 | exclude: function exclude (val) {
|
4933 | pruneCache(this, function (name) { return !matches(val, name); });
|
4934 | }
|
4935 | },
|
4936 |
|
4937 | render: function render () {
|
4938 | var vnode = getFirstComponentChild(this.$slots.default);
|
4939 | var componentOptions = vnode && vnode.componentOptions;
|
4940 | if (componentOptions) {
|
4941 |
|
4942 | var name = getComponentName(componentOptions);
|
4943 | if (name && (
|
4944 | (this.include && !matches(this.include, name)) ||
|
4945 | (this.exclude && matches(this.exclude, name))
|
4946 | )) {
|
4947 | return vnode
|
4948 | }
|
4949 |
|
4950 | var ref = this;
|
4951 | var cache = ref.cache;
|
4952 | var keys = ref.keys;
|
4953 | var key = vnode.key == null
|
4954 |
|
4955 |
|
4956 | ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
|
4957 | : vnode.key;
|
4958 | if (cache[key]) {
|
4959 | vnode.componentInstance = cache[key].componentInstance;
|
4960 |
|
4961 | remove(keys, key);
|
4962 | keys.push(key);
|
4963 | } else {
|
4964 | cache[key] = vnode;
|
4965 | keys.push(key);
|
4966 |
|
4967 | if (this.max && keys.length > parseInt(this.max)) {
|
4968 | pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
4969 | }
|
4970 | }
|
4971 |
|
4972 | vnode.data.keepAlive = true;
|
4973 | }
|
4974 | return vnode
|
4975 | }
|
4976 | };
|
4977 |
|
4978 | var builtInComponents = {
|
4979 | KeepAlive: KeepAlive
|
4980 | };
|
4981 |
|
4982 |
|
4983 |
|
4984 | function initGlobalAPI (Vue) {
|
4985 |
|
4986 | var configDef = {};
|
4987 | configDef.get = function () { return config; };
|
4988 | if (false) {
|
4989 | configDef.set = function () {
|
4990 | warn(
|
4991 | 'Do not replace the Vue.config object, set individual fields instead.'
|
4992 | );
|
4993 | };
|
4994 | }
|
4995 | Object.defineProperty(Vue, 'config', configDef);
|
4996 |
|
4997 |
|
4998 |
|
4999 |
|
5000 | Vue.util = {
|
5001 | warn: warn,
|
5002 | extend: extend,
|
5003 | mergeOptions: mergeOptions,
|
5004 | defineReactive: defineReactive
|
5005 | };
|
5006 |
|
5007 | Vue.set = set;
|
5008 | Vue.delete = del;
|
5009 | Vue.nextTick = nextTick;
|
5010 |
|
5011 | Vue.options = Object.create(null);
|
5012 | ASSET_TYPES.forEach(function (type) {
|
5013 | Vue.options[type + 's'] = Object.create(null);
|
5014 | });
|
5015 |
|
5016 |
|
5017 |
|
5018 | Vue.options._base = Vue;
|
5019 |
|
5020 | extend(Vue.options.components, builtInComponents);
|
5021 |
|
5022 | initUse(Vue);
|
5023 | initMixin$1(Vue);
|
5024 | initExtend(Vue);
|
5025 | initAssetRegisters(Vue);
|
5026 | }
|
5027 |
|
5028 | initGlobalAPI(Vue$3);
|
5029 |
|
5030 | Object.defineProperty(Vue$3.prototype, '$isServer', {
|
5031 | get: isServerRendering
|
5032 | });
|
5033 |
|
5034 | Object.defineProperty(Vue$3.prototype, '$ssrContext', {
|
5035 | get: function get () {
|
5036 |
|
5037 | return this.$vnode && this.$vnode.ssrContext
|
5038 | }
|
5039 | });
|
5040 |
|
5041 | Vue$3.version = '2.5.2';
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 | var isReservedAttr = makeMap('style,class');
|
5048 |
|
5049 |
|
5050 | var acceptValue = makeMap('input,textarea,option,select,progress');
|
5051 | var mustUseProp = function (tag, type, attr) {
|
5052 | return (
|
5053 | (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
|
5054 | (attr === 'selected' && tag === 'option') ||
|
5055 | (attr === 'checked' && tag === 'input') ||
|
5056 | (attr === 'muted' && tag === 'video')
|
5057 | )
|
5058 | };
|
5059 |
|
5060 | var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
5061 |
|
5062 | var isBooleanAttr = makeMap(
|
5063 | 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
|
5064 | 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
|
5065 | 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
|
5066 | 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
|
5067 | 'required,reversed,scoped,seamless,selected,sortable,translate,' +
|
5068 | 'truespeed,typemustmatch,visible'
|
5069 | );
|
5070 |
|
5071 | var xlinkNS = 'http://www.w3.org/1999/xlink';
|
5072 |
|
5073 | var isXlink = function (name) {
|
5074 | return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
|
5075 | };
|
5076 |
|
5077 | var getXlinkProp = function (name) {
|
5078 | return isXlink(name) ? name.slice(6, name.length) : ''
|
5079 | };
|
5080 |
|
5081 | var isFalsyAttrValue = function (val) {
|
5082 | return val == null || val === false
|
5083 | };
|
5084 |
|
5085 |
|
5086 |
|
5087 | function genClassForVnode (vnode) {
|
5088 | var data = vnode.data;
|
5089 | var parentNode = vnode;
|
5090 | var childNode = vnode;
|
5091 | while (isDef(childNode.componentInstance)) {
|
5092 | childNode = childNode.componentInstance._vnode;
|
5093 | if (childNode.data) {
|
5094 | data = mergeClassData(childNode.data, data);
|
5095 | }
|
5096 | }
|
5097 | while (isDef(parentNode = parentNode.parent)) {
|
5098 | if (parentNode.data) {
|
5099 | data = mergeClassData(data, parentNode.data);
|
5100 | }
|
5101 | }
|
5102 | return renderClass(data.staticClass, data.class)
|
5103 | }
|
5104 |
|
5105 | function mergeClassData (child, parent) {
|
5106 | return {
|
5107 | staticClass: concat(child.staticClass, parent.staticClass),
|
5108 | class: isDef(child.class)
|
5109 | ? [child.class, parent.class]
|
5110 | : parent.class
|
5111 | }
|
5112 | }
|
5113 |
|
5114 | function renderClass (
|
5115 | staticClass,
|
5116 | dynamicClass
|
5117 | ) {
|
5118 | if (isDef(staticClass) || isDef(dynamicClass)) {
|
5119 | return concat(staticClass, stringifyClass(dynamicClass))
|
5120 | }
|
5121 |
|
5122 | return ''
|
5123 | }
|
5124 |
|
5125 | function concat (a, b) {
|
5126 | return a ? b ? (a + ' ' + b) : a : (b || '')
|
5127 | }
|
5128 |
|
5129 | function stringifyClass (value) {
|
5130 | if (Array.isArray(value)) {
|
5131 | return stringifyArray(value)
|
5132 | }
|
5133 | if (isObject(value)) {
|
5134 | return stringifyObject(value)
|
5135 | }
|
5136 | if (typeof value === 'string') {
|
5137 | return value
|
5138 | }
|
5139 |
|
5140 | return ''
|
5141 | }
|
5142 |
|
5143 | function stringifyArray (value) {
|
5144 | var res = '';
|
5145 | var stringified;
|
5146 | for (var i = 0, l = value.length; i < l; i++) {
|
5147 | if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
|
5148 | if (res) { res += ' '; }
|
5149 | res += stringified;
|
5150 | }
|
5151 | }
|
5152 | return res
|
5153 | }
|
5154 |
|
5155 | function stringifyObject (value) {
|
5156 | var res = '';
|
5157 | for (var key in value) {
|
5158 | if (value[key]) {
|
5159 | if (res) { res += ' '; }
|
5160 | res += key;
|
5161 | }
|
5162 | }
|
5163 | return res
|
5164 | }
|
5165 |
|
5166 |
|
5167 |
|
5168 | var namespaceMap = {
|
5169 | svg: 'http://www.w3.org/2000/svg',
|
5170 | math: 'http://www.w3.org/1998/Math/MathML'
|
5171 | };
|
5172 |
|
5173 | var isHTMLTag = makeMap(
|
5174 | 'html,body,base,head,link,meta,style,title,' +
|
5175 | 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
|
5176 | 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
|
5177 | 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
|
5178 | 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
|
5179 | 'embed,object,param,source,canvas,script,noscript,del,ins,' +
|
5180 | 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
|
5181 | 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
|
5182 | 'output,progress,select,textarea,' +
|
5183 | 'details,dialog,menu,menuitem,summary,' +
|
5184 | 'content,element,shadow,template,blockquote,iframe,tfoot'
|
5185 | );
|
5186 |
|
5187 |
|
5188 |
|
5189 | var isSVG = makeMap(
|
5190 | 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
5191 | 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
5192 | 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
|
5193 | true
|
5194 | );
|
5195 |
|
5196 |
|
5197 |
|
5198 | var isReservedTag = function (tag) {
|
5199 | return isHTMLTag(tag) || isSVG(tag)
|
5200 | };
|
5201 |
|
5202 | function getTagNamespace (tag) {
|
5203 | if (isSVG(tag)) {
|
5204 | return 'svg'
|
5205 | }
|
5206 |
|
5207 |
|
5208 | if (tag === 'math') {
|
5209 | return 'math'
|
5210 | }
|
5211 | }
|
5212 |
|
5213 | var unknownElementCache = Object.create(null);
|
5214 | function isUnknownElement (tag) {
|
5215 |
|
5216 | if (!inBrowser) {
|
5217 | return true
|
5218 | }
|
5219 | if (isReservedTag(tag)) {
|
5220 | return false
|
5221 | }
|
5222 | tag = tag.toLowerCase();
|
5223 |
|
5224 | if (unknownElementCache[tag] != null) {
|
5225 | return unknownElementCache[tag]
|
5226 | }
|
5227 | var el = document.createElement(tag);
|
5228 | if (tag.indexOf('-') > -1) {
|
5229 |
|
5230 | return (unknownElementCache[tag] = (
|
5231 | el.constructor === window.HTMLUnknownElement ||
|
5232 | el.constructor === window.HTMLElement
|
5233 | ))
|
5234 | } else {
|
5235 | return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
|
5236 | }
|
5237 | }
|
5238 |
|
5239 | var isTextInputType = makeMap('text,number,password,search,email,tel,url');
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 | function query (el) {
|
5247 | if (typeof el === 'string') {
|
5248 | var selected = document.querySelector(el);
|
5249 | if (!selected) {
|
5250 | "production" !== 'production' && warn(
|
5251 | 'Cannot find element: ' + el
|
5252 | );
|
5253 | return document.createElement('div')
|
5254 | }
|
5255 | return selected
|
5256 | } else {
|
5257 | return el
|
5258 | }
|
5259 | }
|
5260 |
|
5261 |
|
5262 |
|
5263 | function createElement$1 (tagName, vnode) {
|
5264 | var elm = document.createElement(tagName);
|
5265 | if (tagName !== 'select') {
|
5266 | return elm
|
5267 | }
|
5268 |
|
5269 | if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
|
5270 | elm.setAttribute('multiple', 'multiple');
|
5271 | }
|
5272 | return elm
|
5273 | }
|
5274 |
|
5275 | function createElementNS (namespace, tagName) {
|
5276 | return document.createElementNS(namespaceMap[namespace], tagName)
|
5277 | }
|
5278 |
|
5279 | function createTextNode (text) {
|
5280 | return document.createTextNode(text)
|
5281 | }
|
5282 |
|
5283 | function createComment (text) {
|
5284 | return document.createComment(text)
|
5285 | }
|
5286 |
|
5287 | function insertBefore (parentNode, newNode, referenceNode) {
|
5288 | parentNode.insertBefore(newNode, referenceNode);
|
5289 | }
|
5290 |
|
5291 | function removeChild (node, child) {
|
5292 | node.removeChild(child);
|
5293 | }
|
5294 |
|
5295 | function appendChild (node, child) {
|
5296 | node.appendChild(child);
|
5297 | }
|
5298 |
|
5299 | function parentNode (node) {
|
5300 | return node.parentNode
|
5301 | }
|
5302 |
|
5303 | function nextSibling (node) {
|
5304 | return node.nextSibling
|
5305 | }
|
5306 |
|
5307 | function tagName (node) {
|
5308 | return node.tagName
|
5309 | }
|
5310 |
|
5311 | function setTextContent (node, text) {
|
5312 | node.textContent = text;
|
5313 | }
|
5314 |
|
5315 | function setAttribute (node, key, val) {
|
5316 | node.setAttribute(key, val);
|
5317 | }
|
5318 |
|
5319 |
|
5320 | var nodeOps = Object.freeze({
|
5321 | createElement: createElement$1,
|
5322 | createElementNS: createElementNS,
|
5323 | createTextNode: createTextNode,
|
5324 | createComment: createComment,
|
5325 | insertBefore: insertBefore,
|
5326 | removeChild: removeChild,
|
5327 | appendChild: appendChild,
|
5328 | parentNode: parentNode,
|
5329 | nextSibling: nextSibling,
|
5330 | tagName: tagName,
|
5331 | setTextContent: setTextContent,
|
5332 | setAttribute: setAttribute
|
5333 | });
|
5334 |
|
5335 |
|
5336 |
|
5337 | var ref = {
|
5338 | create: function create (_, vnode) {
|
5339 | registerRef(vnode);
|
5340 | },
|
5341 | update: function update (oldVnode, vnode) {
|
5342 | if (oldVnode.data.ref !== vnode.data.ref) {
|
5343 | registerRef(oldVnode, true);
|
5344 | registerRef(vnode);
|
5345 | }
|
5346 | },
|
5347 | destroy: function destroy (vnode) {
|
5348 | registerRef(vnode, true);
|
5349 | }
|
5350 | };
|
5351 |
|
5352 | function registerRef (vnode, isRemoval) {
|
5353 | var key = vnode.data.ref;
|
5354 | if (!key) { return }
|
5355 |
|
5356 | var vm = vnode.context;
|
5357 | var ref = vnode.componentInstance || vnode.elm;
|
5358 | var refs = vm.$refs;
|
5359 | if (isRemoval) {
|
5360 | if (Array.isArray(refs[key])) {
|
5361 | remove(refs[key], ref);
|
5362 | } else if (refs[key] === ref) {
|
5363 | refs[key] = undefined;
|
5364 | }
|
5365 | } else {
|
5366 | if (vnode.data.refInFor) {
|
5367 | if (!Array.isArray(refs[key])) {
|
5368 | refs[key] = [ref];
|
5369 | } else if (refs[key].indexOf(ref) < 0) {
|
5370 |
|
5371 | refs[key].push(ref);
|
5372 | }
|
5373 | } else {
|
5374 | refs[key] = ref;
|
5375 | }
|
5376 | }
|
5377 | }
|
5378 |
|
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 |
|
5384 |
|
5385 |
|
5386 |
|
5387 |
|
5388 |
|
5389 |
|
5390 |
|
5391 | var emptyNode = new VNode('', {}, []);
|
5392 |
|
5393 | var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
|
5394 |
|
5395 | function sameVnode (a, b) {
|
5396 | return (
|
5397 | a.key === b.key && (
|
5398 | (
|
5399 | a.tag === b.tag &&
|
5400 | a.isComment === b.isComment &&
|
5401 | isDef(a.data) === isDef(b.data) &&
|
5402 | sameInputType(a, b)
|
5403 | ) || (
|
5404 | isTrue(a.isAsyncPlaceholder) &&
|
5405 | a.asyncFactory === b.asyncFactory &&
|
5406 | isUndef(b.asyncFactory.error)
|
5407 | )
|
5408 | )
|
5409 | )
|
5410 | }
|
5411 |
|
5412 | function sameInputType (a, b) {
|
5413 | if (a.tag !== 'input') { return true }
|
5414 | var i;
|
5415 | var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
|
5416 | var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
|
5417 | return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
|
5418 | }
|
5419 |
|
5420 | function createKeyToOldIdx (children, beginIdx, endIdx) {
|
5421 | var i, key;
|
5422 | var map = {};
|
5423 | for (i = beginIdx; i <= endIdx; ++i) {
|
5424 | key = children[i].key;
|
5425 | if (isDef(key)) { map[key] = i; }
|
5426 | }
|
5427 | return map
|
5428 | }
|
5429 |
|
5430 | function createPatchFunction (backend) {
|
5431 | var i, j;
|
5432 | var cbs = {};
|
5433 |
|
5434 | var modules = backend.modules;
|
5435 | var nodeOps = backend.nodeOps;
|
5436 |
|
5437 | for (i = 0; i < hooks.length; ++i) {
|
5438 | cbs[hooks[i]] = [];
|
5439 | for (j = 0; j < modules.length; ++j) {
|
5440 | if (isDef(modules[j][hooks[i]])) {
|
5441 | cbs[hooks[i]].push(modules[j][hooks[i]]);
|
5442 | }
|
5443 | }
|
5444 | }
|
5445 |
|
5446 | function emptyNodeAt (elm) {
|
5447 | return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
|
5448 | }
|
5449 |
|
5450 | function createRmCb (childElm, listeners) {
|
5451 | function remove () {
|
5452 | if (--remove.listeners === 0) {
|
5453 | removeNode(childElm);
|
5454 | }
|
5455 | }
|
5456 | remove.listeners = listeners;
|
5457 | return remove
|
5458 | }
|
5459 |
|
5460 | function removeNode (el) {
|
5461 | var parent = nodeOps.parentNode(el);
|
5462 |
|
5463 | if (isDef(parent)) {
|
5464 | nodeOps.removeChild(parent, el);
|
5465 | }
|
5466 | }
|
5467 |
|
5468 | var inPre = 0;
|
5469 | function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
|
5470 | vnode.isRootInsert = !nested;
|
5471 | if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
|
5472 | return
|
5473 | }
|
5474 |
|
5475 | var data = vnode.data;
|
5476 | var children = vnode.children;
|
5477 | var tag = vnode.tag;
|
5478 | if (isDef(tag)) {
|
5479 | if (false) {
|
5480 | if (data && data.pre) {
|
5481 | inPre++;
|
5482 | }
|
5483 | if (
|
5484 | !inPre &&
|
5485 | !vnode.ns &&
|
5486 | !(
|
5487 | config.ignoredElements.length &&
|
5488 | config.ignoredElements.some(function (ignore) {
|
5489 | return isRegExp(ignore)
|
5490 | ? ignore.test(tag)
|
5491 | : ignore === tag
|
5492 | })
|
5493 | ) &&
|
5494 | config.isUnknownElement(tag)
|
5495 | ) {
|
5496 | warn(
|
5497 | 'Unknown custom element: <' + tag + '> - did you ' +
|
5498 | 'register the component correctly? For recursive components, ' +
|
5499 | 'make sure to provide the "name" option.',
|
5500 | vnode.context
|
5501 | );
|
5502 | }
|
5503 | }
|
5504 | vnode.elm = vnode.ns
|
5505 | ? nodeOps.createElementNS(vnode.ns, tag)
|
5506 | : nodeOps.createElement(tag, vnode);
|
5507 | setScope(vnode);
|
5508 |
|
5509 |
|
5510 | {
|
5511 | createChildren(vnode, children, insertedVnodeQueue);
|
5512 | if (isDef(data)) {
|
5513 | invokeCreateHooks(vnode, insertedVnodeQueue);
|
5514 | }
|
5515 | insert(parentElm, vnode.elm, refElm);
|
5516 | }
|
5517 |
|
5518 | if (false) {
|
5519 | inPre--;
|
5520 | }
|
5521 | } else if (isTrue(vnode.isComment)) {
|
5522 | vnode.elm = nodeOps.createComment(vnode.text);
|
5523 | insert(parentElm, vnode.elm, refElm);
|
5524 | } else {
|
5525 | vnode.elm = nodeOps.createTextNode(vnode.text);
|
5526 | insert(parentElm, vnode.elm, refElm);
|
5527 | }
|
5528 | }
|
5529 |
|
5530 | function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
|
5531 | var i = vnode.data;
|
5532 | if (isDef(i)) {
|
5533 | var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
|
5534 | if (isDef(i = i.hook) && isDef(i = i.init)) {
|
5535 | i(vnode, false , parentElm, refElm);
|
5536 | }
|
5537 |
|
5538 |
|
5539 |
|
5540 |
|
5541 | if (isDef(vnode.componentInstance)) {
|
5542 | initComponent(vnode, insertedVnodeQueue);
|
5543 | if (isTrue(isReactivated)) {
|
5544 | reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
|
5545 | }
|
5546 | return true
|
5547 | }
|
5548 | }
|
5549 | }
|
5550 |
|
5551 | function initComponent (vnode, insertedVnodeQueue) {
|
5552 | if (isDef(vnode.data.pendingInsert)) {
|
5553 | insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
|
5554 | vnode.data.pendingInsert = null;
|
5555 | }
|
5556 | vnode.elm = vnode.componentInstance.$el;
|
5557 | if (isPatchable(vnode)) {
|
5558 | invokeCreateHooks(vnode, insertedVnodeQueue);
|
5559 | setScope(vnode);
|
5560 | } else {
|
5561 |
|
5562 |
|
5563 | registerRef(vnode);
|
5564 |
|
5565 | insertedVnodeQueue.push(vnode);
|
5566 | }
|
5567 | }
|
5568 |
|
5569 | function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
|
5570 | var i;
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 | var innerNode = vnode;
|
5576 | while (innerNode.componentInstance) {
|
5577 | innerNode = innerNode.componentInstance._vnode;
|
5578 | if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
|
5579 | for (i = 0; i < cbs.activate.length; ++i) {
|
5580 | cbs.activate[i](emptyNode, innerNode);
|
5581 | }
|
5582 | insertedVnodeQueue.push(innerNode);
|
5583 | break
|
5584 | }
|
5585 | }
|
5586 |
|
5587 |
|
5588 | insert(parentElm, vnode.elm, refElm);
|
5589 | }
|
5590 |
|
5591 | function insert (parent, elm, ref$$1) {
|
5592 | if (isDef(parent)) {
|
5593 | if (isDef(ref$$1)) {
|
5594 | if (ref$$1.parentNode === parent) {
|
5595 | nodeOps.insertBefore(parent, elm, ref$$1);
|
5596 | }
|
5597 | } else {
|
5598 | nodeOps.appendChild(parent, elm);
|
5599 | }
|
5600 | }
|
5601 | }
|
5602 |
|
5603 | function createChildren (vnode, children, insertedVnodeQueue) {
|
5604 | if (Array.isArray(children)) {
|
5605 | for (var i = 0; i < children.length; ++i) {
|
5606 | createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
|
5607 | }
|
5608 | } else if (isPrimitive(vnode.text)) {
|
5609 | nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
|
5610 | }
|
5611 | }
|
5612 |
|
5613 | function isPatchable (vnode) {
|
5614 | while (vnode.componentInstance) {
|
5615 | vnode = vnode.componentInstance._vnode;
|
5616 | }
|
5617 | return isDef(vnode.tag)
|
5618 | }
|
5619 |
|
5620 | function invokeCreateHooks (vnode, insertedVnodeQueue) {
|
5621 | for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
5622 | cbs.create[i$1](emptyNode, vnode);
|
5623 | }
|
5624 | i = vnode.data.hook;
|
5625 | if (isDef(i)) {
|
5626 | if (isDef(i.create)) { i.create(emptyNode, vnode); }
|
5627 | if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
|
5628 | }
|
5629 | }
|
5630 |
|
5631 |
|
5632 |
|
5633 |
|
5634 | function setScope (vnode) {
|
5635 | var i;
|
5636 | if (isDef(i = vnode.functionalScopeId)) {
|
5637 | nodeOps.setAttribute(vnode.elm, i, '');
|
5638 | } else {
|
5639 | var ancestor = vnode;
|
5640 | while (ancestor) {
|
5641 | if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
|
5642 | nodeOps.setAttribute(vnode.elm, i, '');
|
5643 | }
|
5644 | ancestor = ancestor.parent;
|
5645 | }
|
5646 | }
|
5647 |
|
5648 | if (isDef(i = activeInstance) &&
|
5649 | i !== vnode.context &&
|
5650 | i !== vnode.functionalContext &&
|
5651 | isDef(i = i.$options._scopeId)
|
5652 | ) {
|
5653 | nodeOps.setAttribute(vnode.elm, i, '');
|
5654 | }
|
5655 | }
|
5656 |
|
5657 | function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
5658 | for (; startIdx <= endIdx; ++startIdx) {
|
5659 | createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
|
5660 | }
|
5661 | }
|
5662 |
|
5663 | function invokeDestroyHook (vnode) {
|
5664 | var i, j;
|
5665 | var data = vnode.data;
|
5666 | if (isDef(data)) {
|
5667 | if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
|
5668 | for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
|
5669 | }
|
5670 | if (isDef(i = vnode.children)) {
|
5671 | for (j = 0; j < vnode.children.length; ++j) {
|
5672 | invokeDestroyHook(vnode.children[j]);
|
5673 | }
|
5674 | }
|
5675 | }
|
5676 |
|
5677 | function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
|
5678 | for (; startIdx <= endIdx; ++startIdx) {
|
5679 | var ch = vnodes[startIdx];
|
5680 | if (isDef(ch)) {
|
5681 | if (isDef(ch.tag)) {
|
5682 | removeAndInvokeRemoveHook(ch);
|
5683 | invokeDestroyHook(ch);
|
5684 | } else {
|
5685 | removeNode(ch.elm);
|
5686 | }
|
5687 | }
|
5688 | }
|
5689 | }
|
5690 |
|
5691 | function removeAndInvokeRemoveHook (vnode, rm) {
|
5692 | if (isDef(rm) || isDef(vnode.data)) {
|
5693 | var i;
|
5694 | var listeners = cbs.remove.length + 1;
|
5695 | if (isDef(rm)) {
|
5696 |
|
5697 |
|
5698 | rm.listeners += listeners;
|
5699 | } else {
|
5700 |
|
5701 | rm = createRmCb(vnode.elm, listeners);
|
5702 | }
|
5703 |
|
5704 | if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
|
5705 | removeAndInvokeRemoveHook(i, rm);
|
5706 | }
|
5707 | for (i = 0; i < cbs.remove.length; ++i) {
|
5708 | cbs.remove[i](vnode, rm);
|
5709 | }
|
5710 | if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
|
5711 | i(vnode, rm);
|
5712 | } else {
|
5713 | rm();
|
5714 | }
|
5715 | } else {
|
5716 | removeNode(vnode.elm);
|
5717 | }
|
5718 | }
|
5719 |
|
5720 | function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
|
5721 | var oldStartIdx = 0;
|
5722 | var newStartIdx = 0;
|
5723 | var oldEndIdx = oldCh.length - 1;
|
5724 | var oldStartVnode = oldCh[0];
|
5725 | var oldEndVnode = oldCh[oldEndIdx];
|
5726 | var newEndIdx = newCh.length - 1;
|
5727 | var newStartVnode = newCh[0];
|
5728 | var newEndVnode = newCh[newEndIdx];
|
5729 | var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
|
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 | var canMove = !removeOnly;
|
5735 |
|
5736 | while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
5737 | if (isUndef(oldStartVnode)) {
|
5738 | oldStartVnode = oldCh[++oldStartIdx];
|
5739 | } else if (isUndef(oldEndVnode)) {
|
5740 | oldEndVnode = oldCh[--oldEndIdx];
|
5741 | } else if (sameVnode(oldStartVnode, newStartVnode)) {
|
5742 | patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
|
5743 | oldStartVnode = oldCh[++oldStartIdx];
|
5744 | newStartVnode = newCh[++newStartIdx];
|
5745 | } else if (sameVnode(oldEndVnode, newEndVnode)) {
|
5746 | patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
|
5747 | oldEndVnode = oldCh[--oldEndIdx];
|
5748 | newEndVnode = newCh[--newEndIdx];
|
5749 | } else if (sameVnode(oldStartVnode, newEndVnode)) {
|
5750 | patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
|
5751 | canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
|
5752 | oldStartVnode = oldCh[++oldStartIdx];
|
5753 | newEndVnode = newCh[--newEndIdx];
|
5754 | } else if (sameVnode(oldEndVnode, newStartVnode)) {
|
5755 | patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
|
5756 | canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
|
5757 | oldEndVnode = oldCh[--oldEndIdx];
|
5758 | newStartVnode = newCh[++newStartIdx];
|
5759 | } else {
|
5760 | if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
|
5761 | idxInOld = isDef(newStartVnode.key)
|
5762 | ? oldKeyToIdx[newStartVnode.key]
|
5763 | : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
|
5764 | if (isUndef(idxInOld)) {
|
5765 | createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
|
5766 | } else {
|
5767 | vnodeToMove = oldCh[idxInOld];
|
5768 |
|
5769 | if (false) {
|
5770 | warn(
|
5771 | 'It seems there are duplicate keys that is causing an update error. ' +
|
5772 | 'Make sure each v-for item has a unique key.'
|
5773 | );
|
5774 | }
|
5775 | if (sameVnode(vnodeToMove, newStartVnode)) {
|
5776 | patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue);
|
5777 | oldCh[idxInOld] = undefined;
|
5778 | canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
|
5779 | } else {
|
5780 |
|
5781 | createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
|
5782 | }
|
5783 | }
|
5784 | newStartVnode = newCh[++newStartIdx];
|
5785 | }
|
5786 | }
|
5787 | if (oldStartIdx > oldEndIdx) {
|
5788 | refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
5789 | addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
5790 | } else if (newStartIdx > newEndIdx) {
|
5791 | removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
|
5792 | }
|
5793 | }
|
5794 |
|
5795 | function findIdxInOld (node, oldCh, start, end) {
|
5796 | for (var i = start; i < end; i++) {
|
5797 | var c = oldCh[i];
|
5798 | if (isDef(c) && sameVnode(node, c)) { return i }
|
5799 | }
|
5800 | }
|
5801 |
|
5802 | function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
|
5803 | if (oldVnode === vnode) {
|
5804 | return
|
5805 | }
|
5806 |
|
5807 | var elm = vnode.elm = oldVnode.elm;
|
5808 |
|
5809 | if (isTrue(oldVnode.isAsyncPlaceholder)) {
|
5810 | if (isDef(vnode.asyncFactory.resolved)) {
|
5811 | hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
|
5812 | } else {
|
5813 | vnode.isAsyncPlaceholder = true;
|
5814 | }
|
5815 | return
|
5816 | }
|
5817 |
|
5818 |
|
5819 |
|
5820 |
|
5821 |
|
5822 | if (isTrue(vnode.isStatic) &&
|
5823 | isTrue(oldVnode.isStatic) &&
|
5824 | vnode.key === oldVnode.key &&
|
5825 | (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
|
5826 | ) {
|
5827 | vnode.componentInstance = oldVnode.componentInstance;
|
5828 | return
|
5829 | }
|
5830 |
|
5831 | var i;
|
5832 | var data = vnode.data;
|
5833 | if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
|
5834 | i(oldVnode, vnode);
|
5835 | }
|
5836 |
|
5837 | var oldCh = oldVnode.children;
|
5838 | var ch = vnode.children;
|
5839 | if (isDef(data) && isPatchable(vnode)) {
|
5840 | for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
|
5841 | if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
|
5842 | }
|
5843 | if (isUndef(vnode.text)) {
|
5844 | if (isDef(oldCh) && isDef(ch)) {
|
5845 | if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
|
5846 | } else if (isDef(ch)) {
|
5847 | if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
|
5848 | addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
5849 | } else if (isDef(oldCh)) {
|
5850 | removeVnodes(elm, oldCh, 0, oldCh.length - 1);
|
5851 | } else if (isDef(oldVnode.text)) {
|
5852 | nodeOps.setTextContent(elm, '');
|
5853 | }
|
5854 | } else if (oldVnode.text !== vnode.text) {
|
5855 | nodeOps.setTextContent(elm, vnode.text);
|
5856 | }
|
5857 | if (isDef(data)) {
|
5858 | if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
|
5859 | }
|
5860 | }
|
5861 |
|
5862 | function invokeInsertHook (vnode, queue, initial) {
|
5863 |
|
5864 |
|
5865 | if (isTrue(initial) && isDef(vnode.parent)) {
|
5866 | vnode.parent.data.pendingInsert = queue;
|
5867 | } else {
|
5868 | for (var i = 0; i < queue.length; ++i) {
|
5869 | queue[i].data.hook.insert(queue[i]);
|
5870 | }
|
5871 | }
|
5872 | }
|
5873 |
|
5874 | var bailed = false;
|
5875 |
|
5876 |
|
5877 | var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
|
5878 |
|
5879 |
|
5880 | function hydrate (elm, vnode, insertedVnodeQueue) {
|
5881 | if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
|
5882 | vnode.elm = elm;
|
5883 | vnode.isAsyncPlaceholder = true;
|
5884 | return true
|
5885 | }
|
5886 | if (false) {
|
5887 | if (!assertNodeMatch(elm, vnode)) {
|
5888 | return false
|
5889 | }
|
5890 | }
|
5891 | vnode.elm = elm;
|
5892 | var tag = vnode.tag;
|
5893 | var data = vnode.data;
|
5894 | var children = vnode.children;
|
5895 | if (isDef(data)) {
|
5896 | if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true ); }
|
5897 | if (isDef(i = vnode.componentInstance)) {
|
5898 |
|
5899 | initComponent(vnode, insertedVnodeQueue);
|
5900 | return true
|
5901 | }
|
5902 | }
|
5903 | if (isDef(tag)) {
|
5904 | if (isDef(children)) {
|
5905 |
|
5906 | if (!elm.hasChildNodes()) {
|
5907 | createChildren(vnode, children, insertedVnodeQueue);
|
5908 | } else {
|
5909 |
|
5910 | if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
|
5911 | if (i !== elm.innerHTML) {
|
5912 |
|
5913 | if (false
|
5914 | ) {
|
5915 | bailed = true;
|
5916 | console.warn('Parent: ', elm);
|
5917 | console.warn('server innerHTML: ', i);
|
5918 | console.warn('client innerHTML: ', elm.innerHTML);
|
5919 | }
|
5920 | return false
|
5921 | }
|
5922 | } else {
|
5923 |
|
5924 | var childrenMatch = true;
|
5925 | var childNode = elm.firstChild;
|
5926 | for (var i$1 = 0; i$1 < children.length; i$1++) {
|
5927 | if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
|
5928 | childrenMatch = false;
|
5929 | break
|
5930 | }
|
5931 | childNode = childNode.nextSibling;
|
5932 | }
|
5933 |
|
5934 |
|
5935 | if (!childrenMatch || childNode) {
|
5936 |
|
5937 | if (false
|
5938 | ) {
|
5939 | bailed = true;
|
5940 | console.warn('Parent: ', elm);
|
5941 | console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
|
5942 | }
|
5943 | return false
|
5944 | }
|
5945 | }
|
5946 | }
|
5947 | }
|
5948 | if (isDef(data)) {
|
5949 | for (var key in data) {
|
5950 | if (!isRenderedModule(key)) {
|
5951 | invokeCreateHooks(vnode, insertedVnodeQueue);
|
5952 | break
|
5953 | }
|
5954 | }
|
5955 | }
|
5956 | } else if (elm.data !== vnode.text) {
|
5957 | elm.data = vnode.text;
|
5958 | }
|
5959 | return true
|
5960 | }
|
5961 |
|
5962 | function assertNodeMatch (node, vnode) {
|
5963 | if (isDef(vnode.tag)) {
|
5964 | return (
|
5965 | vnode.tag.indexOf('vue-component') === 0 ||
|
5966 | vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
|
5967 | )
|
5968 | } else {
|
5969 | return node.nodeType === (vnode.isComment ? 8 : 3)
|
5970 | }
|
5971 | }
|
5972 |
|
5973 | return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
|
5974 | if (isUndef(vnode)) {
|
5975 | if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
|
5976 | return
|
5977 | }
|
5978 |
|
5979 | var isInitialPatch = false;
|
5980 | var insertedVnodeQueue = [];
|
5981 |
|
5982 | if (isUndef(oldVnode)) {
|
5983 |
|
5984 | isInitialPatch = true;
|
5985 | createElm(vnode, insertedVnodeQueue, parentElm, refElm);
|
5986 | } else {
|
5987 | var isRealElement = isDef(oldVnode.nodeType);
|
5988 | if (!isRealElement && sameVnode(oldVnode, vnode)) {
|
5989 |
|
5990 | patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
|
5991 | } else {
|
5992 | if (isRealElement) {
|
5993 |
|
5994 |
|
5995 |
|
5996 | if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
|
5997 | oldVnode.removeAttribute(SSR_ATTR);
|
5998 | hydrating = true;
|
5999 | }
|
6000 | if (isTrue(hydrating)) {
|
6001 | if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
|
6002 | invokeInsertHook(vnode, insertedVnodeQueue, true);
|
6003 | return oldVnode
|
6004 | } else if (false) {
|
6005 | warn(
|
6006 | 'The client-side rendered virtual DOM tree is not matching ' +
|
6007 | 'server-rendered content. This is likely caused by incorrect ' +
|
6008 | 'HTML markup, for example nesting block-level elements inside ' +
|
6009 | '<p>, or missing <tbody>. Bailing hydration and performing ' +
|
6010 | 'full client-side render.'
|
6011 | );
|
6012 | }
|
6013 | }
|
6014 |
|
6015 |
|
6016 | oldVnode = emptyNodeAt(oldVnode);
|
6017 | }
|
6018 |
|
6019 | var oldElm = oldVnode.elm;
|
6020 | var parentElm$1 = nodeOps.parentNode(oldElm);
|
6021 | createElm(
|
6022 | vnode,
|
6023 | insertedVnodeQueue,
|
6024 |
|
6025 |
|
6026 |
|
6027 | oldElm._leaveCb ? null : parentElm$1,
|
6028 | nodeOps.nextSibling(oldElm)
|
6029 | );
|
6030 |
|
6031 | if (isDef(vnode.parent)) {
|
6032 |
|
6033 |
|
6034 | var ancestor = vnode.parent;
|
6035 | var patchable = isPatchable(vnode);
|
6036 | while (ancestor) {
|
6037 | for (var i = 0; i < cbs.destroy.length; ++i) {
|
6038 | cbs.destroy[i](ancestor);
|
6039 | }
|
6040 | ancestor.elm = vnode.elm;
|
6041 | if (patchable) {
|
6042 | for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
6043 | cbs.create[i$1](emptyNode, ancestor);
|
6044 | }
|
6045 |
|
6046 |
|
6047 |
|
6048 | var insert = ancestor.data.hook.insert;
|
6049 | if (insert.merged) {
|
6050 |
|
6051 | for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
|
6052 | insert.fns[i$2]();
|
6053 | }
|
6054 | }
|
6055 | } else {
|
6056 | registerRef(ancestor);
|
6057 | }
|
6058 | ancestor = ancestor.parent;
|
6059 | }
|
6060 | }
|
6061 |
|
6062 | if (isDef(parentElm$1)) {
|
6063 | removeVnodes(parentElm$1, [oldVnode], 0, 0);
|
6064 | } else if (isDef(oldVnode.tag)) {
|
6065 | invokeDestroyHook(oldVnode);
|
6066 | }
|
6067 | }
|
6068 | }
|
6069 |
|
6070 | invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
|
6071 | return vnode.elm
|
6072 | }
|
6073 | }
|
6074 |
|
6075 |
|
6076 |
|
6077 | var directives = {
|
6078 | create: updateDirectives,
|
6079 | update: updateDirectives,
|
6080 | destroy: function unbindDirectives (vnode) {
|
6081 | updateDirectives(vnode, emptyNode);
|
6082 | }
|
6083 | };
|
6084 |
|
6085 | function updateDirectives (oldVnode, vnode) {
|
6086 | if (oldVnode.data.directives || vnode.data.directives) {
|
6087 | _update(oldVnode, vnode);
|
6088 | }
|
6089 | }
|
6090 |
|
6091 | function _update (oldVnode, vnode) {
|
6092 | var isCreate = oldVnode === emptyNode;
|
6093 | var isDestroy = vnode === emptyNode;
|
6094 | var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
|
6095 | var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
|
6096 |
|
6097 | var dirsWithInsert = [];
|
6098 | var dirsWithPostpatch = [];
|
6099 |
|
6100 | var key, oldDir, dir;
|
6101 | for (key in newDirs) {
|
6102 | oldDir = oldDirs[key];
|
6103 | dir = newDirs[key];
|
6104 | if (!oldDir) {
|
6105 |
|
6106 | callHook$1(dir, 'bind', vnode, oldVnode);
|
6107 | if (dir.def && dir.def.inserted) {
|
6108 | dirsWithInsert.push(dir);
|
6109 | }
|
6110 | } else {
|
6111 |
|
6112 | dir.oldValue = oldDir.value;
|
6113 | callHook$1(dir, 'update', vnode, oldVnode);
|
6114 | if (dir.def && dir.def.componentUpdated) {
|
6115 | dirsWithPostpatch.push(dir);
|
6116 | }
|
6117 | }
|
6118 | }
|
6119 |
|
6120 | if (dirsWithInsert.length) {
|
6121 | var callInsert = function () {
|
6122 | for (var i = 0; i < dirsWithInsert.length; i++) {
|
6123 | callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
|
6124 | }
|
6125 | };
|
6126 | if (isCreate) {
|
6127 | mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
|
6128 | } else {
|
6129 | callInsert();
|
6130 | }
|
6131 | }
|
6132 |
|
6133 | if (dirsWithPostpatch.length) {
|
6134 | mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
|
6135 | for (var i = 0; i < dirsWithPostpatch.length; i++) {
|
6136 | callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
|
6137 | }
|
6138 | });
|
6139 | }
|
6140 |
|
6141 | if (!isCreate) {
|
6142 | for (key in oldDirs) {
|
6143 | if (!newDirs[key]) {
|
6144 |
|
6145 | callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
|
6146 | }
|
6147 | }
|
6148 | }
|
6149 | }
|
6150 |
|
6151 | var emptyModifiers = Object.create(null);
|
6152 |
|
6153 | function normalizeDirectives$1 (
|
6154 | dirs,
|
6155 | vm
|
6156 | ) {
|
6157 | var res = Object.create(null);
|
6158 | if (!dirs) {
|
6159 | return res
|
6160 | }
|
6161 | var i, dir;
|
6162 | for (i = 0; i < dirs.length; i++) {
|
6163 | dir = dirs[i];
|
6164 | if (!dir.modifiers) {
|
6165 | dir.modifiers = emptyModifiers;
|
6166 | }
|
6167 | res[getRawDirName(dir)] = dir;
|
6168 | dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
|
6169 | }
|
6170 | return res
|
6171 | }
|
6172 |
|
6173 | function getRawDirName (dir) {
|
6174 | return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
|
6175 | }
|
6176 |
|
6177 | function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
|
6178 | var fn = dir.def && dir.def[hook];
|
6179 | if (fn) {
|
6180 | try {
|
6181 | fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
|
6182 | } catch (e) {
|
6183 | handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
|
6184 | }
|
6185 | }
|
6186 | }
|
6187 |
|
6188 | var baseModules = [
|
6189 | ref,
|
6190 | directives
|
6191 | ];
|
6192 |
|
6193 |
|
6194 |
|
6195 | function updateAttrs (oldVnode, vnode) {
|
6196 | var opts = vnode.componentOptions;
|
6197 | if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
|
6198 | return
|
6199 | }
|
6200 | if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
|
6201 | return
|
6202 | }
|
6203 | var key, cur, old;
|
6204 | var elm = vnode.elm;
|
6205 | var oldAttrs = oldVnode.data.attrs || {};
|
6206 | var attrs = vnode.data.attrs || {};
|
6207 |
|
6208 | if (isDef(attrs.__ob__)) {
|
6209 | attrs = vnode.data.attrs = extend({}, attrs);
|
6210 | }
|
6211 |
|
6212 | for (key in attrs) {
|
6213 | cur = attrs[key];
|
6214 | old = oldAttrs[key];
|
6215 | if (old !== cur) {
|
6216 | setAttr(elm, key, cur);
|
6217 | }
|
6218 | }
|
6219 |
|
6220 |
|
6221 |
|
6222 | if ((isIE9 || isEdge) && attrs.value !== oldAttrs.value) {
|
6223 | setAttr(elm, 'value', attrs.value);
|
6224 | }
|
6225 | for (key in oldAttrs) {
|
6226 | if (isUndef(attrs[key])) {
|
6227 | if (isXlink(key)) {
|
6228 | elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
6229 | } else if (!isEnumeratedAttr(key)) {
|
6230 | elm.removeAttribute(key);
|
6231 | }
|
6232 | }
|
6233 | }
|
6234 | }
|
6235 |
|
6236 | function setAttr (el, key, value) {
|
6237 | if (isBooleanAttr(key)) {
|
6238 |
|
6239 |
|
6240 | if (isFalsyAttrValue(value)) {
|
6241 | el.removeAttribute(key);
|
6242 | } else {
|
6243 |
|
6244 |
|
6245 | value = key === 'allowfullscreen' && el.tagName === 'EMBED'
|
6246 | ? 'true'
|
6247 | : key;
|
6248 | el.setAttribute(key, value);
|
6249 | }
|
6250 | } else if (isEnumeratedAttr(key)) {
|
6251 | el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
|
6252 | } else if (isXlink(key)) {
|
6253 | if (isFalsyAttrValue(value)) {
|
6254 | el.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
6255 | } else {
|
6256 | el.setAttributeNS(xlinkNS, key, value);
|
6257 | }
|
6258 | } else {
|
6259 | if (isFalsyAttrValue(value)) {
|
6260 | el.removeAttribute(key);
|
6261 | } else {
|
6262 | el.setAttribute(key, value);
|
6263 | }
|
6264 | }
|
6265 | }
|
6266 |
|
6267 | var attrs = {
|
6268 | create: updateAttrs,
|
6269 | update: updateAttrs
|
6270 | };
|
6271 |
|
6272 |
|
6273 |
|
6274 | function updateClass (oldVnode, vnode) {
|
6275 | var el = vnode.elm;
|
6276 | var data = vnode.data;
|
6277 | var oldData = oldVnode.data;
|
6278 | if (
|
6279 | isUndef(data.staticClass) &&
|
6280 | isUndef(data.class) && (
|
6281 | isUndef(oldData) || (
|
6282 | isUndef(oldData.staticClass) &&
|
6283 | isUndef(oldData.class)
|
6284 | )
|
6285 | )
|
6286 | ) {
|
6287 | return
|
6288 | }
|
6289 |
|
6290 | var cls = genClassForVnode(vnode);
|
6291 |
|
6292 |
|
6293 | var transitionClass = el._transitionClasses;
|
6294 | if (isDef(transitionClass)) {
|
6295 | cls = concat(cls, stringifyClass(transitionClass));
|
6296 | }
|
6297 |
|
6298 |
|
6299 | if (cls !== el._prevClass) {
|
6300 | el.setAttribute('class', cls);
|
6301 | el._prevClass = cls;
|
6302 | }
|
6303 | }
|
6304 |
|
6305 | var klass = {
|
6306 | create: updateClass,
|
6307 | update: updateClass
|
6308 | };
|
6309 |
|
6310 |
|
6311 |
|
6312 |
|
6313 |
|
6314 |
|
6315 |
|
6316 |
|
6317 |
|
6318 |
|
6319 |
|
6320 |
|
6321 |
|
6322 |
|
6323 |
|
6324 |
|
6325 |
|
6326 |
|
6327 |
|
6328 |
|
6329 |
|
6330 |
|
6331 |
|
6332 |
|
6333 |
|
6334 |
|
6335 |
|
6336 |
|
6337 |
|
6338 |
|
6339 |
|
6340 |
|
6341 |
|
6342 |
|
6343 |
|
6344 |
|
6345 |
|
6346 |
|
6347 |
|
6348 | var RANGE_TOKEN = '__r';
|
6349 | var CHECKBOX_RADIO_TOKEN = '__c';
|
6350 |
|
6351 |
|
6352 |
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 | function normalizeEvents (on) {
|
6358 |
|
6359 | if (isDef(on[RANGE_TOKEN])) {
|
6360 |
|
6361 | var event = isIE ? 'change' : 'input';
|
6362 | on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
|
6363 | delete on[RANGE_TOKEN];
|
6364 | }
|
6365 |
|
6366 |
|
6367 |
|
6368 | if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
|
6369 | on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
|
6370 | delete on[CHECKBOX_RADIO_TOKEN];
|
6371 | }
|
6372 | }
|
6373 |
|
6374 | var target$1;
|
6375 |
|
6376 | function createOnceHandler (handler, event, capture) {
|
6377 | var _target = target$1;
|
6378 | return function onceHandler () {
|
6379 | var res = handler.apply(null, arguments);
|
6380 | if (res !== null) {
|
6381 | remove$2(event, onceHandler, capture, _target);
|
6382 | }
|
6383 | }
|
6384 | }
|
6385 |
|
6386 | function add$1 (
|
6387 | event,
|
6388 | handler,
|
6389 | once$$1,
|
6390 | capture,
|
6391 | passive
|
6392 | ) {
|
6393 | handler = withMacroTask(handler);
|
6394 | if (once$$1) { handler = createOnceHandler(handler, event, capture); }
|
6395 | target$1.addEventListener(
|
6396 | event,
|
6397 | handler,
|
6398 | supportsPassive
|
6399 | ? { capture: capture, passive: passive }
|
6400 | : capture
|
6401 | );
|
6402 | }
|
6403 |
|
6404 | function remove$2 (
|
6405 | event,
|
6406 | handler,
|
6407 | capture,
|
6408 | _target
|
6409 | ) {
|
6410 | (_target || target$1).removeEventListener(
|
6411 | event,
|
6412 | handler._withTask || handler,
|
6413 | capture
|
6414 | );
|
6415 | }
|
6416 |
|
6417 | function updateDOMListeners (oldVnode, vnode) {
|
6418 | if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
|
6419 | return
|
6420 | }
|
6421 | var on = vnode.data.on || {};
|
6422 | var oldOn = oldVnode.data.on || {};
|
6423 | target$1 = vnode.elm;
|
6424 | normalizeEvents(on);
|
6425 | updateListeners(on, oldOn, add$1, remove$2, vnode.context);
|
6426 | }
|
6427 |
|
6428 | var events = {
|
6429 | create: updateDOMListeners,
|
6430 | update: updateDOMListeners
|
6431 | };
|
6432 |
|
6433 |
|
6434 |
|
6435 | function updateDOMProps (oldVnode, vnode) {
|
6436 | if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
|
6437 | return
|
6438 | }
|
6439 | var key, cur;
|
6440 | var elm = vnode.elm;
|
6441 | var oldProps = oldVnode.data.domProps || {};
|
6442 | var props = vnode.data.domProps || {};
|
6443 |
|
6444 | if (isDef(props.__ob__)) {
|
6445 | props = vnode.data.domProps = extend({}, props);
|
6446 | }
|
6447 |
|
6448 | for (key in oldProps) {
|
6449 | if (isUndef(props[key])) {
|
6450 | elm[key] = '';
|
6451 | }
|
6452 | }
|
6453 | for (key in props) {
|
6454 | cur = props[key];
|
6455 |
|
6456 |
|
6457 |
|
6458 | if (key === 'textContent' || key === 'innerHTML') {
|
6459 | if (vnode.children) { vnode.children.length = 0; }
|
6460 | if (cur === oldProps[key]) { continue }
|
6461 |
|
6462 |
|
6463 | if (elm.childNodes.length === 1) {
|
6464 | elm.removeChild(elm.childNodes[0]);
|
6465 | }
|
6466 | }
|
6467 |
|
6468 | if (key === 'value') {
|
6469 |
|
6470 |
|
6471 | elm._value = cur;
|
6472 |
|
6473 | var strCur = isUndef(cur) ? '' : String(cur);
|
6474 | if (shouldUpdateValue(elm, strCur)) {
|
6475 | elm.value = strCur;
|
6476 | }
|
6477 | } else {
|
6478 | elm[key] = cur;
|
6479 | }
|
6480 | }
|
6481 | }
|
6482 |
|
6483 |
|
6484 |
|
6485 |
|
6486 | function shouldUpdateValue (elm, checkVal) {
|
6487 | return (!elm.composing && (
|
6488 | elm.tagName === 'OPTION' ||
|
6489 | isDirty(elm, checkVal) ||
|
6490 | isInputChanged(elm, checkVal)
|
6491 | ))
|
6492 | }
|
6493 |
|
6494 | function isDirty (elm, checkVal) {
|
6495 |
|
6496 |
|
6497 | var notInFocus = true;
|
6498 |
|
6499 |
|
6500 | try { notInFocus = document.activeElement !== elm; } catch (e) {}
|
6501 | return notInFocus && elm.value !== checkVal
|
6502 | }
|
6503 |
|
6504 | function isInputChanged (elm, newVal) {
|
6505 | var value = elm.value;
|
6506 | var modifiers = elm._vModifiers;
|
6507 | if (isDef(modifiers) && modifiers.number) {
|
6508 | return toNumber(value) !== toNumber(newVal)
|
6509 | }
|
6510 | if (isDef(modifiers) && modifiers.trim) {
|
6511 | return value.trim() !== newVal.trim()
|
6512 | }
|
6513 | return value !== newVal
|
6514 | }
|
6515 |
|
6516 | var domProps = {
|
6517 | create: updateDOMProps,
|
6518 | update: updateDOMProps
|
6519 | };
|
6520 |
|
6521 |
|
6522 |
|
6523 | var parseStyleText = cached(function (cssText) {
|
6524 | var res = {};
|
6525 | var listDelimiter = /;(?![^(]*\))/g;
|
6526 | var propertyDelimiter = /:(.+)/;
|
6527 | cssText.split(listDelimiter).forEach(function (item) {
|
6528 | if (item) {
|
6529 | var tmp = item.split(propertyDelimiter);
|
6530 | tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
6531 | }
|
6532 | });
|
6533 | return res
|
6534 | });
|
6535 |
|
6536 |
|
6537 | function normalizeStyleData (data) {
|
6538 | var style = normalizeStyleBinding(data.style);
|
6539 |
|
6540 |
|
6541 | return data.staticStyle
|
6542 | ? extend(data.staticStyle, style)
|
6543 | : style
|
6544 | }
|
6545 |
|
6546 |
|
6547 | function normalizeStyleBinding (bindingStyle) {
|
6548 | if (Array.isArray(bindingStyle)) {
|
6549 | return toObject(bindingStyle)
|
6550 | }
|
6551 | if (typeof bindingStyle === 'string') {
|
6552 | return parseStyleText(bindingStyle)
|
6553 | }
|
6554 | return bindingStyle
|
6555 | }
|
6556 |
|
6557 |
|
6558 |
|
6559 |
|
6560 |
|
6561 | function getStyle (vnode, checkChild) {
|
6562 | var res = {};
|
6563 | var styleData;
|
6564 |
|
6565 | if (checkChild) {
|
6566 | var childNode = vnode;
|
6567 | while (childNode.componentInstance) {
|
6568 | childNode = childNode.componentInstance._vnode;
|
6569 | if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
|
6570 | extend(res, styleData);
|
6571 | }
|
6572 | }
|
6573 | }
|
6574 |
|
6575 | if ((styleData = normalizeStyleData(vnode.data))) {
|
6576 | extend(res, styleData);
|
6577 | }
|
6578 |
|
6579 | var parentNode = vnode;
|
6580 | while ((parentNode = parentNode.parent)) {
|
6581 | if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
|
6582 | extend(res, styleData);
|
6583 | }
|
6584 | }
|
6585 | return res
|
6586 | }
|
6587 |
|
6588 |
|
6589 |
|
6590 | var cssVarRE = /^--/;
|
6591 | var importantRE = /\s*!important$/;
|
6592 | var setProp = function (el, name, val) {
|
6593 |
|
6594 | if (cssVarRE.test(name)) {
|
6595 | el.style.setProperty(name, val);
|
6596 | } else if (importantRE.test(val)) {
|
6597 | el.style.setProperty(name, val.replace(importantRE, ''), 'important');
|
6598 | } else {
|
6599 | var normalizedName = normalize(name);
|
6600 | if (Array.isArray(val)) {
|
6601 |
|
6602 |
|
6603 |
|
6604 | for (var i = 0, len = val.length; i < len; i++) {
|
6605 | el.style[normalizedName] = val[i];
|
6606 | }
|
6607 | } else {
|
6608 | el.style[normalizedName] = val;
|
6609 | }
|
6610 | }
|
6611 | };
|
6612 |
|
6613 | var vendorNames = ['Webkit', 'Moz', 'ms'];
|
6614 |
|
6615 | var emptyStyle;
|
6616 | var normalize = cached(function (prop) {
|
6617 | emptyStyle = emptyStyle || document.createElement('div').style;
|
6618 | prop = camelize(prop);
|
6619 | if (prop !== 'filter' && (prop in emptyStyle)) {
|
6620 | return prop
|
6621 | }
|
6622 | var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
|
6623 | for (var i = 0; i < vendorNames.length; i++) {
|
6624 | var name = vendorNames[i] + capName;
|
6625 | if (name in emptyStyle) {
|
6626 | return name
|
6627 | }
|
6628 | }
|
6629 | });
|
6630 |
|
6631 | function updateStyle (oldVnode, vnode) {
|
6632 | var data = vnode.data;
|
6633 | var oldData = oldVnode.data;
|
6634 |
|
6635 | if (isUndef(data.staticStyle) && isUndef(data.style) &&
|
6636 | isUndef(oldData.staticStyle) && isUndef(oldData.style)
|
6637 | ) {
|
6638 | return
|
6639 | }
|
6640 |
|
6641 | var cur, name;
|
6642 | var el = vnode.elm;
|
6643 | var oldStaticStyle = oldData.staticStyle;
|
6644 | var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
|
6645 |
|
6646 |
|
6647 | var oldStyle = oldStaticStyle || oldStyleBinding;
|
6648 |
|
6649 | var style = normalizeStyleBinding(vnode.data.style) || {};
|
6650 |
|
6651 |
|
6652 |
|
6653 |
|
6654 | vnode.data.normalizedStyle = isDef(style.__ob__)
|
6655 | ? extend({}, style)
|
6656 | : style;
|
6657 |
|
6658 | var newStyle = getStyle(vnode, true);
|
6659 |
|
6660 | for (name in oldStyle) {
|
6661 | if (isUndef(newStyle[name])) {
|
6662 | setProp(el, name, '');
|
6663 | }
|
6664 | }
|
6665 | for (name in newStyle) {
|
6666 | cur = newStyle[name];
|
6667 | if (cur !== oldStyle[name]) {
|
6668 |
|
6669 | setProp(el, name, cur == null ? '' : cur);
|
6670 | }
|
6671 | }
|
6672 | }
|
6673 |
|
6674 | var style = {
|
6675 | create: updateStyle,
|
6676 | update: updateStyle
|
6677 | };
|
6678 |
|
6679 |
|
6680 |
|
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 | function addClass (el, cls) {
|
6686 |
|
6687 | if (!cls || !(cls = cls.trim())) {
|
6688 | return
|
6689 | }
|
6690 |
|
6691 |
|
6692 | if (el.classList) {
|
6693 | if (cls.indexOf(' ') > -1) {
|
6694 | cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
|
6695 | } else {
|
6696 | el.classList.add(cls);
|
6697 | }
|
6698 | } else {
|
6699 | var cur = " " + (el.getAttribute('class') || '') + " ";
|
6700 | if (cur.indexOf(' ' + cls + ' ') < 0) {
|
6701 | el.setAttribute('class', (cur + cls).trim());
|
6702 | }
|
6703 | }
|
6704 | }
|
6705 |
|
6706 |
|
6707 |
|
6708 |
|
6709 |
|
6710 | function removeClass (el, cls) {
|
6711 |
|
6712 | if (!cls || !(cls = cls.trim())) {
|
6713 | return
|
6714 | }
|
6715 |
|
6716 |
|
6717 | if (el.classList) {
|
6718 | if (cls.indexOf(' ') > -1) {
|
6719 | cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
|
6720 | } else {
|
6721 | el.classList.remove(cls);
|
6722 | }
|
6723 | if (!el.classList.length) {
|
6724 | el.removeAttribute('class');
|
6725 | }
|
6726 | } else {
|
6727 | var cur = " " + (el.getAttribute('class') || '') + " ";
|
6728 | var tar = ' ' + cls + ' ';
|
6729 | while (cur.indexOf(tar) >= 0) {
|
6730 | cur = cur.replace(tar, ' ');
|
6731 | }
|
6732 | cur = cur.trim();
|
6733 | if (cur) {
|
6734 | el.setAttribute('class', cur);
|
6735 | } else {
|
6736 | el.removeAttribute('class');
|
6737 | }
|
6738 | }
|
6739 | }
|
6740 |
|
6741 |
|
6742 |
|
6743 | function resolveTransition (def) {
|
6744 | if (!def) {
|
6745 | return
|
6746 | }
|
6747 |
|
6748 | if (typeof def === 'object') {
|
6749 | var res = {};
|
6750 | if (def.css !== false) {
|
6751 | extend(res, autoCssTransition(def.name || 'v'));
|
6752 | }
|
6753 | extend(res, def);
|
6754 | return res
|
6755 | } else if (typeof def === 'string') {
|
6756 | return autoCssTransition(def)
|
6757 | }
|
6758 | }
|
6759 |
|
6760 | var autoCssTransition = cached(function (name) {
|
6761 | return {
|
6762 | enterClass: (name + "-enter"),
|
6763 | enterToClass: (name + "-enter-to"),
|
6764 | enterActiveClass: (name + "-enter-active"),
|
6765 | leaveClass: (name + "-leave"),
|
6766 | leaveToClass: (name + "-leave-to"),
|
6767 | leaveActiveClass: (name + "-leave-active")
|
6768 | }
|
6769 | });
|
6770 |
|
6771 | var hasTransition = inBrowser && !isIE9;
|
6772 | var TRANSITION = 'transition';
|
6773 | var ANIMATION = 'animation';
|
6774 |
|
6775 |
|
6776 | var transitionProp = 'transition';
|
6777 | var transitionEndEvent = 'transitionend';
|
6778 | var animationProp = 'animation';
|
6779 | var animationEndEvent = 'animationend';
|
6780 | if (hasTransition) {
|
6781 |
|
6782 | if (window.ontransitionend === undefined &&
|
6783 | window.onwebkittransitionend !== undefined
|
6784 | ) {
|
6785 | transitionProp = 'WebkitTransition';
|
6786 | transitionEndEvent = 'webkitTransitionEnd';
|
6787 | }
|
6788 | if (window.onanimationend === undefined &&
|
6789 | window.onwebkitanimationend !== undefined
|
6790 | ) {
|
6791 | animationProp = 'WebkitAnimation';
|
6792 | animationEndEvent = 'webkitAnimationEnd';
|
6793 | }
|
6794 | }
|
6795 |
|
6796 |
|
6797 | var raf = inBrowser
|
6798 | ? window.requestAnimationFrame
|
6799 | ? window.requestAnimationFrame.bind(window)
|
6800 | : setTimeout
|
6801 | : function (fn) { return fn(); };
|
6802 |
|
6803 | function nextFrame (fn) {
|
6804 | raf(function () {
|
6805 | raf(fn);
|
6806 | });
|
6807 | }
|
6808 |
|
6809 | function addTransitionClass (el, cls) {
|
6810 | var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
|
6811 | if (transitionClasses.indexOf(cls) < 0) {
|
6812 | transitionClasses.push(cls);
|
6813 | addClass(el, cls);
|
6814 | }
|
6815 | }
|
6816 |
|
6817 | function removeTransitionClass (el, cls) {
|
6818 | if (el._transitionClasses) {
|
6819 | remove(el._transitionClasses, cls);
|
6820 | }
|
6821 | removeClass(el, cls);
|
6822 | }
|
6823 |
|
6824 | function whenTransitionEnds (
|
6825 | el,
|
6826 | expectedType,
|
6827 | cb
|
6828 | ) {
|
6829 | var ref = getTransitionInfo(el, expectedType);
|
6830 | var type = ref.type;
|
6831 | var timeout = ref.timeout;
|
6832 | var propCount = ref.propCount;
|
6833 | if (!type) { return cb() }
|
6834 | var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
6835 | var ended = 0;
|
6836 | var end = function () {
|
6837 | el.removeEventListener(event, onEnd);
|
6838 | cb();
|
6839 | };
|
6840 | var onEnd = function (e) {
|
6841 | if (e.target === el) {
|
6842 | if (++ended >= propCount) {
|
6843 | end();
|
6844 | }
|
6845 | }
|
6846 | };
|
6847 | setTimeout(function () {
|
6848 | if (ended < propCount) {
|
6849 | end();
|
6850 | }
|
6851 | }, timeout + 1);
|
6852 | el.addEventListener(event, onEnd);
|
6853 | }
|
6854 |
|
6855 | var transformRE = /\b(transform|all)(,|$)/;
|
6856 |
|
6857 | function getTransitionInfo (el, expectedType) {
|
6858 | var styles = window.getComputedStyle(el);
|
6859 | var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
|
6860 | var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
|
6861 | var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
6862 | var animationDelays = styles[animationProp + 'Delay'].split(', ');
|
6863 | var animationDurations = styles[animationProp + 'Duration'].split(', ');
|
6864 | var animationTimeout = getTimeout(animationDelays, animationDurations);
|
6865 |
|
6866 | var type;
|
6867 | var timeout = 0;
|
6868 | var propCount = 0;
|
6869 |
|
6870 | if (expectedType === TRANSITION) {
|
6871 | if (transitionTimeout > 0) {
|
6872 | type = TRANSITION;
|
6873 | timeout = transitionTimeout;
|
6874 | propCount = transitionDurations.length;
|
6875 | }
|
6876 | } else if (expectedType === ANIMATION) {
|
6877 | if (animationTimeout > 0) {
|
6878 | type = ANIMATION;
|
6879 | timeout = animationTimeout;
|
6880 | propCount = animationDurations.length;
|
6881 | }
|
6882 | } else {
|
6883 | timeout = Math.max(transitionTimeout, animationTimeout);
|
6884 | type = timeout > 0
|
6885 | ? transitionTimeout > animationTimeout
|
6886 | ? TRANSITION
|
6887 | : ANIMATION
|
6888 | : null;
|
6889 | propCount = type
|
6890 | ? type === TRANSITION
|
6891 | ? transitionDurations.length
|
6892 | : animationDurations.length
|
6893 | : 0;
|
6894 | }
|
6895 | var hasTransform =
|
6896 | type === TRANSITION &&
|
6897 | transformRE.test(styles[transitionProp + 'Property']);
|
6898 | return {
|
6899 | type: type,
|
6900 | timeout: timeout,
|
6901 | propCount: propCount,
|
6902 | hasTransform: hasTransform
|
6903 | }
|
6904 | }
|
6905 |
|
6906 | function getTimeout (delays, durations) {
|
6907 |
|
6908 | while (delays.length < durations.length) {
|
6909 | delays = delays.concat(delays);
|
6910 | }
|
6911 |
|
6912 | return Math.max.apply(null, durations.map(function (d, i) {
|
6913 | return toMs(d) + toMs(delays[i])
|
6914 | }))
|
6915 | }
|
6916 |
|
6917 | function toMs (s) {
|
6918 | return Number(s.slice(0, -1)) * 1000
|
6919 | }
|
6920 |
|
6921 |
|
6922 |
|
6923 | function enter (vnode, toggleDisplay) {
|
6924 | var el = vnode.elm;
|
6925 |
|
6926 |
|
6927 | if (isDef(el._leaveCb)) {
|
6928 | el._leaveCb.cancelled = true;
|
6929 | el._leaveCb();
|
6930 | }
|
6931 |
|
6932 | var data = resolveTransition(vnode.data.transition);
|
6933 | if (isUndef(data)) {
|
6934 | return
|
6935 | }
|
6936 |
|
6937 |
|
6938 | if (isDef(el._enterCb) || el.nodeType !== 1) {
|
6939 | return
|
6940 | }
|
6941 |
|
6942 | var css = data.css;
|
6943 | var type = data.type;
|
6944 | var enterClass = data.enterClass;
|
6945 | var enterToClass = data.enterToClass;
|
6946 | var enterActiveClass = data.enterActiveClass;
|
6947 | var appearClass = data.appearClass;
|
6948 | var appearToClass = data.appearToClass;
|
6949 | var appearActiveClass = data.appearActiveClass;
|
6950 | var beforeEnter = data.beforeEnter;
|
6951 | var enter = data.enter;
|
6952 | var afterEnter = data.afterEnter;
|
6953 | var enterCancelled = data.enterCancelled;
|
6954 | var beforeAppear = data.beforeAppear;
|
6955 | var appear = data.appear;
|
6956 | var afterAppear = data.afterAppear;
|
6957 | var appearCancelled = data.appearCancelled;
|
6958 | var duration = data.duration;
|
6959 |
|
6960 |
|
6961 |
|
6962 |
|
6963 |
|
6964 | var context = activeInstance;
|
6965 | var transitionNode = activeInstance.$vnode;
|
6966 | while (transitionNode && transitionNode.parent) {
|
6967 | transitionNode = transitionNode.parent;
|
6968 | context = transitionNode.context;
|
6969 | }
|
6970 |
|
6971 | var isAppear = !context._isMounted || !vnode.isRootInsert;
|
6972 |
|
6973 | if (isAppear && !appear && appear !== '') {
|
6974 | return
|
6975 | }
|
6976 |
|
6977 | var startClass = isAppear && appearClass
|
6978 | ? appearClass
|
6979 | : enterClass;
|
6980 | var activeClass = isAppear && appearActiveClass
|
6981 | ? appearActiveClass
|
6982 | : enterActiveClass;
|
6983 | var toClass = isAppear && appearToClass
|
6984 | ? appearToClass
|
6985 | : enterToClass;
|
6986 |
|
6987 | var beforeEnterHook = isAppear
|
6988 | ? (beforeAppear || beforeEnter)
|
6989 | : beforeEnter;
|
6990 | var enterHook = isAppear
|
6991 | ? (typeof appear === 'function' ? appear : enter)
|
6992 | : enter;
|
6993 | var afterEnterHook = isAppear
|
6994 | ? (afterAppear || afterEnter)
|
6995 | : afterEnter;
|
6996 | var enterCancelledHook = isAppear
|
6997 | ? (appearCancelled || enterCancelled)
|
6998 | : enterCancelled;
|
6999 |
|
7000 | var explicitEnterDuration = toNumber(
|
7001 | isObject(duration)
|
7002 | ? duration.enter
|
7003 | : duration
|
7004 | );
|
7005 |
|
7006 | if (false) {
|
7007 | checkDuration(explicitEnterDuration, 'enter', vnode);
|
7008 | }
|
7009 |
|
7010 | var expectsCSS = css !== false && !isIE9;
|
7011 | var userWantsControl = getHookArgumentsLength(enterHook);
|
7012 |
|
7013 | var cb = el._enterCb = once(function () {
|
7014 | if (expectsCSS) {
|
7015 | removeTransitionClass(el, toClass);
|
7016 | removeTransitionClass(el, activeClass);
|
7017 | }
|
7018 | if (cb.cancelled) {
|
7019 | if (expectsCSS) {
|
7020 | removeTransitionClass(el, startClass);
|
7021 | }
|
7022 | enterCancelledHook && enterCancelledHook(el);
|
7023 | } else {
|
7024 | afterEnterHook && afterEnterHook(el);
|
7025 | }
|
7026 | el._enterCb = null;
|
7027 | });
|
7028 |
|
7029 | if (!vnode.data.show) {
|
7030 |
|
7031 | mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
|
7032 | var parent = el.parentNode;
|
7033 | var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
7034 | if (pendingNode &&
|
7035 | pendingNode.tag === vnode.tag &&
|
7036 | pendingNode.elm._leaveCb
|
7037 | ) {
|
7038 | pendingNode.elm._leaveCb();
|
7039 | }
|
7040 | enterHook && enterHook(el, cb);
|
7041 | });
|
7042 | }
|
7043 |
|
7044 |
|
7045 | beforeEnterHook && beforeEnterHook(el);
|
7046 | if (expectsCSS) {
|
7047 | addTransitionClass(el, startClass);
|
7048 | addTransitionClass(el, activeClass);
|
7049 | nextFrame(function () {
|
7050 | addTransitionClass(el, toClass);
|
7051 | removeTransitionClass(el, startClass);
|
7052 | if (!cb.cancelled && !userWantsControl) {
|
7053 | if (isValidDuration(explicitEnterDuration)) {
|
7054 | setTimeout(cb, explicitEnterDuration);
|
7055 | } else {
|
7056 | whenTransitionEnds(el, type, cb);
|
7057 | }
|
7058 | }
|
7059 | });
|
7060 | }
|
7061 |
|
7062 | if (vnode.data.show) {
|
7063 | toggleDisplay && toggleDisplay();
|
7064 | enterHook && enterHook(el, cb);
|
7065 | }
|
7066 |
|
7067 | if (!expectsCSS && !userWantsControl) {
|
7068 | cb();
|
7069 | }
|
7070 | }
|
7071 |
|
7072 | function leave (vnode, rm) {
|
7073 | var el = vnode.elm;
|
7074 |
|
7075 |
|
7076 | if (isDef(el._enterCb)) {
|
7077 | el._enterCb.cancelled = true;
|
7078 | el._enterCb();
|
7079 | }
|
7080 |
|
7081 | var data = resolveTransition(vnode.data.transition);
|
7082 | if (isUndef(data)) {
|
7083 | return rm()
|
7084 | }
|
7085 |
|
7086 |
|
7087 | if (isDef(el._leaveCb) || el.nodeType !== 1) {
|
7088 | return
|
7089 | }
|
7090 |
|
7091 | var css = data.css;
|
7092 | var type = data.type;
|
7093 | var leaveClass = data.leaveClass;
|
7094 | var leaveToClass = data.leaveToClass;
|
7095 | var leaveActiveClass = data.leaveActiveClass;
|
7096 | var beforeLeave = data.beforeLeave;
|
7097 | var leave = data.leave;
|
7098 | var afterLeave = data.afterLeave;
|
7099 | var leaveCancelled = data.leaveCancelled;
|
7100 | var delayLeave = data.delayLeave;
|
7101 | var duration = data.duration;
|
7102 |
|
7103 | var expectsCSS = css !== false && !isIE9;
|
7104 | var userWantsControl = getHookArgumentsLength(leave);
|
7105 |
|
7106 | var explicitLeaveDuration = toNumber(
|
7107 | isObject(duration)
|
7108 | ? duration.leave
|
7109 | : duration
|
7110 | );
|
7111 |
|
7112 | if (false) {
|
7113 | checkDuration(explicitLeaveDuration, 'leave', vnode);
|
7114 | }
|
7115 |
|
7116 | var cb = el._leaveCb = once(function () {
|
7117 | if (el.parentNode && el.parentNode._pending) {
|
7118 | el.parentNode._pending[vnode.key] = null;
|
7119 | }
|
7120 | if (expectsCSS) {
|
7121 | removeTransitionClass(el, leaveToClass);
|
7122 | removeTransitionClass(el, leaveActiveClass);
|
7123 | }
|
7124 | if (cb.cancelled) {
|
7125 | if (expectsCSS) {
|
7126 | removeTransitionClass(el, leaveClass);
|
7127 | }
|
7128 | leaveCancelled && leaveCancelled(el);
|
7129 | } else {
|
7130 | rm();
|
7131 | afterLeave && afterLeave(el);
|
7132 | }
|
7133 | el._leaveCb = null;
|
7134 | });
|
7135 |
|
7136 | if (delayLeave) {
|
7137 | delayLeave(performLeave);
|
7138 | } else {
|
7139 | performLeave();
|
7140 | }
|
7141 |
|
7142 | function performLeave () {
|
7143 |
|
7144 | if (cb.cancelled) {
|
7145 | return
|
7146 | }
|
7147 |
|
7148 | if (!vnode.data.show) {
|
7149 | (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
|
7150 | }
|
7151 | beforeLeave && beforeLeave(el);
|
7152 | if (expectsCSS) {
|
7153 | addTransitionClass(el, leaveClass);
|
7154 | addTransitionClass(el, leaveActiveClass);
|
7155 | nextFrame(function () {
|
7156 | addTransitionClass(el, leaveToClass);
|
7157 | removeTransitionClass(el, leaveClass);
|
7158 | if (!cb.cancelled && !userWantsControl) {
|
7159 | if (isValidDuration(explicitLeaveDuration)) {
|
7160 | setTimeout(cb, explicitLeaveDuration);
|
7161 | } else {
|
7162 | whenTransitionEnds(el, type, cb);
|
7163 | }
|
7164 | }
|
7165 | });
|
7166 | }
|
7167 | leave && leave(el, cb);
|
7168 | if (!expectsCSS && !userWantsControl) {
|
7169 | cb();
|
7170 | }
|
7171 | }
|
7172 | }
|
7173 |
|
7174 |
|
7175 | function checkDuration (val, name, vnode) {
|
7176 | if (typeof val !== 'number') {
|
7177 | warn(
|
7178 | "<transition> explicit " + name + " duration is not a valid number - " +
|
7179 | "got " + (JSON.stringify(val)) + ".",
|
7180 | vnode.context
|
7181 | );
|
7182 | } else if (isNaN(val)) {
|
7183 | warn(
|
7184 | "<transition> explicit " + name + " duration is NaN - " +
|
7185 | 'the duration expression might be incorrect.',
|
7186 | vnode.context
|
7187 | );
|
7188 | }
|
7189 | }
|
7190 |
|
7191 | function isValidDuration (val) {
|
7192 | return typeof val === 'number' && !isNaN(val)
|
7193 | }
|
7194 |
|
7195 |
|
7196 |
|
7197 |
|
7198 |
|
7199 |
|
7200 |
|
7201 | function getHookArgumentsLength (fn) {
|
7202 | if (isUndef(fn)) {
|
7203 | return false
|
7204 | }
|
7205 | var invokerFns = fn.fns;
|
7206 | if (isDef(invokerFns)) {
|
7207 |
|
7208 | return getHookArgumentsLength(
|
7209 | Array.isArray(invokerFns)
|
7210 | ? invokerFns[0]
|
7211 | : invokerFns
|
7212 | )
|
7213 | } else {
|
7214 | return (fn._length || fn.length) > 1
|
7215 | }
|
7216 | }
|
7217 |
|
7218 | function _enter (_, vnode) {
|
7219 | if (vnode.data.show !== true) {
|
7220 | enter(vnode);
|
7221 | }
|
7222 | }
|
7223 |
|
7224 | var transition = inBrowser ? {
|
7225 | create: _enter,
|
7226 | activate: _enter,
|
7227 | remove: function remove$$1 (vnode, rm) {
|
7228 |
|
7229 | if (vnode.data.show !== true) {
|
7230 | leave(vnode, rm);
|
7231 | } else {
|
7232 | rm();
|
7233 | }
|
7234 | }
|
7235 | } : {};
|
7236 |
|
7237 | var platformModules = [
|
7238 | attrs,
|
7239 | klass,
|
7240 | events,
|
7241 | domProps,
|
7242 | style,
|
7243 | transition
|
7244 | ];
|
7245 |
|
7246 |
|
7247 |
|
7248 |
|
7249 |
|
7250 | var modules = platformModules.concat(baseModules);
|
7251 |
|
7252 | var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
|
7253 |
|
7254 |
|
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 | if (isIE9) {
|
7261 |
|
7262 | document.addEventListener('selectionchange', function () {
|
7263 | var el = document.activeElement;
|
7264 | if (el && el.vmodel) {
|
7265 | trigger(el, 'input');
|
7266 | }
|
7267 | });
|
7268 | }
|
7269 |
|
7270 | var model$1 = {
|
7271 | inserted: function inserted (el, binding, vnode) {
|
7272 | if (vnode.tag === 'select') {
|
7273 | setSelected(el, binding, vnode.context);
|
7274 | el._vOptions = [].map.call(el.options, getValue);
|
7275 | } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
|
7276 | el._vModifiers = binding.modifiers;
|
7277 | if (!binding.modifiers.lazy) {
|
7278 |
|
7279 |
|
7280 |
|
7281 |
|
7282 | el.addEventListener('change', onCompositionEnd);
|
7283 | if (!isAndroid) {
|
7284 | el.addEventListener('compositionstart', onCompositionStart);
|
7285 | el.addEventListener('compositionend', onCompositionEnd);
|
7286 | }
|
7287 |
|
7288 | if (isIE9) {
|
7289 | el.vmodel = true;
|
7290 | }
|
7291 | }
|
7292 | }
|
7293 | },
|
7294 | componentUpdated: function componentUpdated (el, binding, vnode) {
|
7295 | if (vnode.tag === 'select') {
|
7296 | setSelected(el, binding, vnode.context);
|
7297 |
|
7298 |
|
7299 |
|
7300 |
|
7301 | var prevOptions = el._vOptions;
|
7302 | var curOptions = el._vOptions = [].map.call(el.options, getValue);
|
7303 | if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
|
7304 |
|
7305 |
|
7306 | var needReset = el.multiple
|
7307 | ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
|
7308 | : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
|
7309 | if (needReset) {
|
7310 | trigger(el, 'change');
|
7311 | }
|
7312 | }
|
7313 | }
|
7314 | }
|
7315 | };
|
7316 |
|
7317 | function setSelected (el, binding, vm) {
|
7318 | actuallySetSelected(el, binding, vm);
|
7319 |
|
7320 | if (isIE || isEdge) {
|
7321 | setTimeout(function () {
|
7322 | actuallySetSelected(el, binding, vm);
|
7323 | }, 0);
|
7324 | }
|
7325 | }
|
7326 |
|
7327 | function actuallySetSelected (el, binding, vm) {
|
7328 | var value = binding.value;
|
7329 | var isMultiple = el.multiple;
|
7330 | if (isMultiple && !Array.isArray(value)) {
|
7331 | "production" !== 'production' && warn(
|
7332 | "<select multiple v-model=\"" + (binding.expression) + "\"> " +
|
7333 | "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
|
7334 | vm
|
7335 | );
|
7336 | return
|
7337 | }
|
7338 | var selected, option;
|
7339 | for (var i = 0, l = el.options.length; i < l; i++) {
|
7340 | option = el.options[i];
|
7341 | if (isMultiple) {
|
7342 | selected = looseIndexOf(value, getValue(option)) > -1;
|
7343 | if (option.selected !== selected) {
|
7344 | option.selected = selected;
|
7345 | }
|
7346 | } else {
|
7347 | if (looseEqual(getValue(option), value)) {
|
7348 | if (el.selectedIndex !== i) {
|
7349 | el.selectedIndex = i;
|
7350 | }
|
7351 | return
|
7352 | }
|
7353 | }
|
7354 | }
|
7355 | if (!isMultiple) {
|
7356 | el.selectedIndex = -1;
|
7357 | }
|
7358 | }
|
7359 |
|
7360 | function hasNoMatchingOption (value, options) {
|
7361 | return options.every(function (o) { return !looseEqual(o, value); })
|
7362 | }
|
7363 |
|
7364 | function getValue (option) {
|
7365 | return '_value' in option
|
7366 | ? option._value
|
7367 | : option.value
|
7368 | }
|
7369 |
|
7370 | function onCompositionStart (e) {
|
7371 | e.target.composing = true;
|
7372 | }
|
7373 |
|
7374 | function onCompositionEnd (e) {
|
7375 |
|
7376 | if (!e.target.composing) { return }
|
7377 | e.target.composing = false;
|
7378 | trigger(e.target, 'input');
|
7379 | }
|
7380 |
|
7381 | function trigger (el, type) {
|
7382 | var e = document.createEvent('HTMLEvents');
|
7383 | e.initEvent(type, true, true);
|
7384 | el.dispatchEvent(e);
|
7385 | }
|
7386 |
|
7387 |
|
7388 |
|
7389 |
|
7390 | function locateNode (vnode) {
|
7391 | return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
|
7392 | ? locateNode(vnode.componentInstance._vnode)
|
7393 | : vnode
|
7394 | }
|
7395 |
|
7396 | var show = {
|
7397 | bind: function bind (el, ref, vnode) {
|
7398 | var value = ref.value;
|
7399 |
|
7400 | vnode = locateNode(vnode);
|
7401 | var transition$$1 = vnode.data && vnode.data.transition;
|
7402 | var originalDisplay = el.__vOriginalDisplay =
|
7403 | el.style.display === 'none' ? '' : el.style.display;
|
7404 | if (value && transition$$1) {
|
7405 | vnode.data.show = true;
|
7406 | enter(vnode, function () {
|
7407 | el.style.display = originalDisplay;
|
7408 | });
|
7409 | } else {
|
7410 | el.style.display = value ? originalDisplay : 'none';
|
7411 | }
|
7412 | },
|
7413 |
|
7414 | update: function update (el, ref, vnode) {
|
7415 | var value = ref.value;
|
7416 | var oldValue = ref.oldValue;
|
7417 |
|
7418 |
|
7419 | if (value === oldValue) { return }
|
7420 | vnode = locateNode(vnode);
|
7421 | var transition$$1 = vnode.data && vnode.data.transition;
|
7422 | if (transition$$1) {
|
7423 | vnode.data.show = true;
|
7424 | if (value) {
|
7425 | enter(vnode, function () {
|
7426 | el.style.display = el.__vOriginalDisplay;
|
7427 | });
|
7428 | } else {
|
7429 | leave(vnode, function () {
|
7430 | el.style.display = 'none';
|
7431 | });
|
7432 | }
|
7433 | } else {
|
7434 | el.style.display = value ? el.__vOriginalDisplay : 'none';
|
7435 | }
|
7436 | },
|
7437 |
|
7438 | unbind: function unbind (
|
7439 | el,
|
7440 | binding,
|
7441 | vnode,
|
7442 | oldVnode,
|
7443 | isDestroy
|
7444 | ) {
|
7445 | if (!isDestroy) {
|
7446 | el.style.display = el.__vOriginalDisplay;
|
7447 | }
|
7448 | }
|
7449 | };
|
7450 |
|
7451 | var platformDirectives = {
|
7452 | model: model$1,
|
7453 | show: show
|
7454 | };
|
7455 |
|
7456 |
|
7457 |
|
7458 |
|
7459 |
|
7460 |
|
7461 | var transitionProps = {
|
7462 | name: String,
|
7463 | appear: Boolean,
|
7464 | css: Boolean,
|
7465 | mode: String,
|
7466 | type: String,
|
7467 | enterClass: String,
|
7468 | leaveClass: String,
|
7469 | enterToClass: String,
|
7470 | leaveToClass: String,
|
7471 | enterActiveClass: String,
|
7472 | leaveActiveClass: String,
|
7473 | appearClass: String,
|
7474 | appearActiveClass: String,
|
7475 | appearToClass: String,
|
7476 | duration: [Number, String, Object]
|
7477 | };
|
7478 |
|
7479 |
|
7480 |
|
7481 | function getRealChild (vnode) {
|
7482 | var compOptions = vnode && vnode.componentOptions;
|
7483 | if (compOptions && compOptions.Ctor.options.abstract) {
|
7484 | return getRealChild(getFirstComponentChild(compOptions.children))
|
7485 | } else {
|
7486 | return vnode
|
7487 | }
|
7488 | }
|
7489 |
|
7490 | function extractTransitionData (comp) {
|
7491 | var data = {};
|
7492 | var options = comp.$options;
|
7493 |
|
7494 | for (var key in options.propsData) {
|
7495 | data[key] = comp[key];
|
7496 | }
|
7497 |
|
7498 |
|
7499 | var listeners = options._parentListeners;
|
7500 | for (var key$1 in listeners) {
|
7501 | data[camelize(key$1)] = listeners[key$1];
|
7502 | }
|
7503 | return data
|
7504 | }
|
7505 |
|
7506 | function placeholder (h, rawChild) {
|
7507 | if (/\d-keep-alive$/.test(rawChild.tag)) {
|
7508 | return h('keep-alive', {
|
7509 | props: rawChild.componentOptions.propsData
|
7510 | })
|
7511 | }
|
7512 | }
|
7513 |
|
7514 | function hasParentTransition (vnode) {
|
7515 | while ((vnode = vnode.parent)) {
|
7516 | if (vnode.data.transition) {
|
7517 | return true
|
7518 | }
|
7519 | }
|
7520 | }
|
7521 |
|
7522 | function isSameChild (child, oldChild) {
|
7523 | return oldChild.key === child.key && oldChild.tag === child.tag
|
7524 | }
|
7525 |
|
7526 | var Transition = {
|
7527 | name: 'transition',
|
7528 | props: transitionProps,
|
7529 | abstract: true,
|
7530 |
|
7531 | render: function render (h) {
|
7532 | var this$1 = this;
|
7533 |
|
7534 | var children = this.$options._renderChildren;
|
7535 | if (!children) {
|
7536 | return
|
7537 | }
|
7538 |
|
7539 |
|
7540 | children = children.filter(function (c) { return c.tag || isAsyncPlaceholder(c); });
|
7541 |
|
7542 | if (!children.length) {
|
7543 | return
|
7544 | }
|
7545 |
|
7546 |
|
7547 | if (false) {
|
7548 | warn(
|
7549 | '<transition> can only be used on a single element. Use ' +
|
7550 | '<transition-group> for lists.',
|
7551 | this.$parent
|
7552 | );
|
7553 | }
|
7554 |
|
7555 | var mode = this.mode;
|
7556 |
|
7557 |
|
7558 | if (false
|
7559 | ) {
|
7560 | warn(
|
7561 | 'invalid <transition> mode: ' + mode,
|
7562 | this.$parent
|
7563 | );
|
7564 | }
|
7565 |
|
7566 | var rawChild = children[0];
|
7567 |
|
7568 |
|
7569 |
|
7570 | if (hasParentTransition(this.$vnode)) {
|
7571 | return rawChild
|
7572 | }
|
7573 |
|
7574 |
|
7575 |
|
7576 | var child = getRealChild(rawChild);
|
7577 |
|
7578 | if (!child) {
|
7579 | return rawChild
|
7580 | }
|
7581 |
|
7582 | if (this._leaving) {
|
7583 | return placeholder(h, rawChild)
|
7584 | }
|
7585 |
|
7586 |
|
7587 |
|
7588 |
|
7589 | var id = "__transition-" + (this._uid) + "-";
|
7590 | child.key = child.key == null
|
7591 | ? child.isComment
|
7592 | ? id + 'comment'
|
7593 | : id + child.tag
|
7594 | : isPrimitive(child.key)
|
7595 | ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
|
7596 | : child.key;
|
7597 |
|
7598 | var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
|
7599 | var oldRawChild = this._vnode;
|
7600 | var oldChild = getRealChild(oldRawChild);
|
7601 |
|
7602 |
|
7603 |
|
7604 | if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
|
7605 | child.data.show = true;
|
7606 | }
|
7607 |
|
7608 | if (
|
7609 | oldChild &&
|
7610 | oldChild.data &&
|
7611 | !isSameChild(child, oldChild) &&
|
7612 | !isAsyncPlaceholder(oldChild)
|
7613 | ) {
|
7614 |
|
7615 |
|
7616 | var oldData = oldChild.data.transition = extend({}, data);
|
7617 |
|
7618 | if (mode === 'out-in') {
|
7619 |
|
7620 | this._leaving = true;
|
7621 | mergeVNodeHook(oldData, 'afterLeave', function () {
|
7622 | this$1._leaving = false;
|
7623 | this$1.$forceUpdate();
|
7624 | });
|
7625 | return placeholder(h, rawChild)
|
7626 | } else if (mode === 'in-out') {
|
7627 | if (isAsyncPlaceholder(child)) {
|
7628 | return oldRawChild
|
7629 | }
|
7630 | var delayedLeave;
|
7631 | var performLeave = function () { delayedLeave(); };
|
7632 | mergeVNodeHook(data, 'afterEnter', performLeave);
|
7633 | mergeVNodeHook(data, 'enterCancelled', performLeave);
|
7634 | mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
|
7635 | }
|
7636 | }
|
7637 |
|
7638 | return rawChild
|
7639 | }
|
7640 | };
|
7641 |
|
7642 |
|
7643 |
|
7644 |
|
7645 |
|
7646 |
|
7647 |
|
7648 |
|
7649 |
|
7650 |
|
7651 |
|
7652 |
|
7653 |
|
7654 |
|
7655 | var props = extend({
|
7656 | tag: String,
|
7657 | moveClass: String
|
7658 | }, transitionProps);
|
7659 |
|
7660 | delete props.mode;
|
7661 |
|
7662 | var TransitionGroup = {
|
7663 | props: props,
|
7664 |
|
7665 | render: function render (h) {
|
7666 | var tag = this.tag || this.$vnode.data.tag || 'span';
|
7667 | var map = Object.create(null);
|
7668 | var prevChildren = this.prevChildren = this.children;
|
7669 | var rawChildren = this.$slots.default || [];
|
7670 | var children = this.children = [];
|
7671 | var transitionData = extractTransitionData(this);
|
7672 |
|
7673 | for (var i = 0; i < rawChildren.length; i++) {
|
7674 | var c = rawChildren[i];
|
7675 | if (c.tag) {
|
7676 | if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
|
7677 | children.push(c);
|
7678 | map[c.key] = c
|
7679 | ;(c.data || (c.data = {})).transition = transitionData;
|
7680 | } else if (false) {
|
7681 | var opts = c.componentOptions;
|
7682 | var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
|
7683 | warn(("<transition-group> children must be keyed: <" + name + ">"));
|
7684 | }
|
7685 | }
|
7686 | }
|
7687 |
|
7688 | if (prevChildren) {
|
7689 | var kept = [];
|
7690 | var removed = [];
|
7691 | for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
|
7692 | var c$1 = prevChildren[i$1];
|
7693 | c$1.data.transition = transitionData;
|
7694 | c$1.data.pos = c$1.elm.getBoundingClientRect();
|
7695 | if (map[c$1.key]) {
|
7696 | kept.push(c$1);
|
7697 | } else {
|
7698 | removed.push(c$1);
|
7699 | }
|
7700 | }
|
7701 | this.kept = h(tag, null, kept);
|
7702 | this.removed = removed;
|
7703 | }
|
7704 |
|
7705 | return h(tag, null, children)
|
7706 | },
|
7707 |
|
7708 | beforeUpdate: function beforeUpdate () {
|
7709 |
|
7710 | this.__patch__(
|
7711 | this._vnode,
|
7712 | this.kept,
|
7713 | false,
|
7714 | true
|
7715 | );
|
7716 | this._vnode = this.kept;
|
7717 | },
|
7718 |
|
7719 | updated: function updated () {
|
7720 | var children = this.prevChildren;
|
7721 | var moveClass = this.moveClass || ((this.name || 'v') + '-move');
|
7722 | if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
|
7723 | return
|
7724 | }
|
7725 |
|
7726 |
|
7727 |
|
7728 | children.forEach(callPendingCbs);
|
7729 | children.forEach(recordPosition);
|
7730 | children.forEach(applyTranslation);
|
7731 |
|
7732 |
|
7733 |
|
7734 |
|
7735 | this._reflow = document.body.offsetHeight;
|
7736 |
|
7737 | children.forEach(function (c) {
|
7738 | if (c.data.moved) {
|
7739 | var el = c.elm;
|
7740 | var s = el.style;
|
7741 | addTransitionClass(el, moveClass);
|
7742 | s.transform = s.WebkitTransform = s.transitionDuration = '';
|
7743 | el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
|
7744 | if (!e || /transform$/.test(e.propertyName)) {
|
7745 | el.removeEventListener(transitionEndEvent, cb);
|
7746 | el._moveCb = null;
|
7747 | removeTransitionClass(el, moveClass);
|
7748 | }
|
7749 | });
|
7750 | }
|
7751 | });
|
7752 | },
|
7753 |
|
7754 | methods: {
|
7755 | hasMove: function hasMove (el, moveClass) {
|
7756 |
|
7757 | if (!hasTransition) {
|
7758 | return false
|
7759 | }
|
7760 |
|
7761 | if (this._hasMove) {
|
7762 | return this._hasMove
|
7763 | }
|
7764 |
|
7765 |
|
7766 |
|
7767 |
|
7768 |
|
7769 | var clone = el.cloneNode();
|
7770 | if (el._transitionClasses) {
|
7771 | el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
|
7772 | }
|
7773 | addClass(clone, moveClass);
|
7774 | clone.style.display = 'none';
|
7775 | this.$el.appendChild(clone);
|
7776 | var info = getTransitionInfo(clone);
|
7777 | this.$el.removeChild(clone);
|
7778 | return (this._hasMove = info.hasTransform)
|
7779 | }
|
7780 | }
|
7781 | };
|
7782 |
|
7783 | function callPendingCbs (c) {
|
7784 |
|
7785 | if (c.elm._moveCb) {
|
7786 | c.elm._moveCb();
|
7787 | }
|
7788 |
|
7789 | if (c.elm._enterCb) {
|
7790 | c.elm._enterCb();
|
7791 | }
|
7792 | }
|
7793 |
|
7794 | function recordPosition (c) {
|
7795 | c.data.newPos = c.elm.getBoundingClientRect();
|
7796 | }
|
7797 |
|
7798 | function applyTranslation (c) {
|
7799 | var oldPos = c.data.pos;
|
7800 | var newPos = c.data.newPos;
|
7801 | var dx = oldPos.left - newPos.left;
|
7802 | var dy = oldPos.top - newPos.top;
|
7803 | if (dx || dy) {
|
7804 | c.data.moved = true;
|
7805 | var s = c.elm.style;
|
7806 | s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
|
7807 | s.transitionDuration = '0s';
|
7808 | }
|
7809 | }
|
7810 |
|
7811 | var platformComponents = {
|
7812 | Transition: Transition,
|
7813 | TransitionGroup: TransitionGroup
|
7814 | };
|
7815 |
|
7816 |
|
7817 |
|
7818 |
|
7819 | Vue$3.config.mustUseProp = mustUseProp;
|
7820 | Vue$3.config.isReservedTag = isReservedTag;
|
7821 | Vue$3.config.isReservedAttr = isReservedAttr;
|
7822 | Vue$3.config.getTagNamespace = getTagNamespace;
|
7823 | Vue$3.config.isUnknownElement = isUnknownElement;
|
7824 |
|
7825 |
|
7826 | extend(Vue$3.options.directives, platformDirectives);
|
7827 | extend(Vue$3.options.components, platformComponents);
|
7828 |
|
7829 |
|
7830 | Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
|
7831 |
|
7832 |
|
7833 | Vue$3.prototype.$mount = function (
|
7834 | el,
|
7835 | hydrating
|
7836 | ) {
|
7837 | el = el && inBrowser ? query(el) : undefined;
|
7838 | return mountComponent(this, el, hydrating)
|
7839 | };
|
7840 |
|
7841 |
|
7842 |
|
7843 | Vue$3.nextTick(function () {
|
7844 | if (config.devtools) {
|
7845 | if (devtools) {
|
7846 | devtools.emit('init', Vue$3);
|
7847 | } else if (false) {
|
7848 | console[console.info ? 'info' : 'log'](
|
7849 | 'Download the Vue Devtools extension for a better development experience:\n' +
|
7850 | 'https://github.com/vuejs/vue-devtools'
|
7851 | );
|
7852 | }
|
7853 | }
|
7854 | if (false
|
7855 | ) {
|
7856 | console[console.info ? 'info' : 'log'](
|
7857 | "You are running Vue in development mode.\n" +
|
7858 | "Make sure to turn on production mode when deploying for production.\n" +
|
7859 | "See more tips at https://vuejs.org/guide/deployment.html"
|
7860 | );
|
7861 | }
|
7862 | }, 0);
|
7863 |
|
7864 |
|
7865 |
|
7866 | __webpack_exports__["a"] = (Vue$3);
|
7867 |
|
7868 | }.call(__webpack_exports__, __webpack_require__( 0), __webpack_require__( 9).setImmediate))
|
7869 |
|
7870 | }),
|
7871 |
|
7872 |
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 | (function(module, exports) {
|
7878 |
|
7879 |
|
7880 | var process = module.exports = {};
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 |
|
7887 | var cachedSetTimeout;
|
7888 | var cachedClearTimeout;
|
7889 |
|
7890 | function defaultSetTimout() {
|
7891 | throw new Error('setTimeout has not been defined');
|
7892 | }
|
7893 | function defaultClearTimeout () {
|
7894 | throw new Error('clearTimeout has not been defined');
|
7895 | }
|
7896 | (function () {
|
7897 | try {
|
7898 | if (typeof setTimeout === 'function') {
|
7899 | cachedSetTimeout = setTimeout;
|
7900 | } else {
|
7901 | cachedSetTimeout = defaultSetTimout;
|
7902 | }
|
7903 | } catch (e) {
|
7904 | cachedSetTimeout = defaultSetTimout;
|
7905 | }
|
7906 | try {
|
7907 | if (typeof clearTimeout === 'function') {
|
7908 | cachedClearTimeout = clearTimeout;
|
7909 | } else {
|
7910 | cachedClearTimeout = defaultClearTimeout;
|
7911 | }
|
7912 | } catch (e) {
|
7913 | cachedClearTimeout = defaultClearTimeout;
|
7914 | }
|
7915 | } ())
|
7916 | function runTimeout(fun) {
|
7917 | if (cachedSetTimeout === setTimeout) {
|
7918 |
|
7919 | return setTimeout(fun, 0);
|
7920 | }
|
7921 |
|
7922 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
7923 | cachedSetTimeout = setTimeout;
|
7924 | return setTimeout(fun, 0);
|
7925 | }
|
7926 | try {
|
7927 |
|
7928 | return cachedSetTimeout(fun, 0);
|
7929 | } catch(e){
|
7930 | try {
|
7931 |
|
7932 | return cachedSetTimeout.call(null, fun, 0);
|
7933 | } catch(e){
|
7934 |
|
7935 | return cachedSetTimeout.call(this, fun, 0);
|
7936 | }
|
7937 | }
|
7938 |
|
7939 |
|
7940 | }
|
7941 | function runClearTimeout(marker) {
|
7942 | if (cachedClearTimeout === clearTimeout) {
|
7943 |
|
7944 | return clearTimeout(marker);
|
7945 | }
|
7946 |
|
7947 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
7948 | cachedClearTimeout = clearTimeout;
|
7949 | return clearTimeout(marker);
|
7950 | }
|
7951 | try {
|
7952 |
|
7953 | return cachedClearTimeout(marker);
|
7954 | } catch (e){
|
7955 | try {
|
7956 |
|
7957 | return cachedClearTimeout.call(null, marker);
|
7958 | } catch (e){
|
7959 |
|
7960 |
|
7961 | return cachedClearTimeout.call(this, marker);
|
7962 | }
|
7963 | }
|
7964 |
|
7965 |
|
7966 |
|
7967 | }
|
7968 | var queue = [];
|
7969 | var draining = false;
|
7970 | var currentQueue;
|
7971 | var queueIndex = -1;
|
7972 |
|
7973 | function cleanUpNextTick() {
|
7974 | if (!draining || !currentQueue) {
|
7975 | return;
|
7976 | }
|
7977 | draining = false;
|
7978 | if (currentQueue.length) {
|
7979 | queue = currentQueue.concat(queue);
|
7980 | } else {
|
7981 | queueIndex = -1;
|
7982 | }
|
7983 | if (queue.length) {
|
7984 | drainQueue();
|
7985 | }
|
7986 | }
|
7987 |
|
7988 | function drainQueue() {
|
7989 | if (draining) {
|
7990 | return;
|
7991 | }
|
7992 | var timeout = runTimeout(cleanUpNextTick);
|
7993 | draining = true;
|
7994 |
|
7995 | var len = queue.length;
|
7996 | while(len) {
|
7997 | currentQueue = queue;
|
7998 | queue = [];
|
7999 | while (++queueIndex < len) {
|
8000 | if (currentQueue) {
|
8001 | currentQueue[queueIndex].run();
|
8002 | }
|
8003 | }
|
8004 | queueIndex = -1;
|
8005 | len = queue.length;
|
8006 | }
|
8007 | currentQueue = null;
|
8008 | draining = false;
|
8009 | runClearTimeout(timeout);
|
8010 | }
|
8011 |
|
8012 | process.nextTick = function (fun) {
|
8013 | var args = new Array(arguments.length - 1);
|
8014 | if (arguments.length > 1) {
|
8015 | for (var i = 1; i < arguments.length; i++) {
|
8016 | args[i - 1] = arguments[i];
|
8017 | }
|
8018 | }
|
8019 | queue.push(new Item(fun, args));
|
8020 | if (queue.length === 1 && !draining) {
|
8021 | runTimeout(drainQueue);
|
8022 | }
|
8023 | };
|
8024 |
|
8025 |
|
8026 | function Item(fun, array) {
|
8027 | this.fun = fun;
|
8028 | this.array = array;
|
8029 | }
|
8030 | Item.prototype.run = function () {
|
8031 | this.fun.apply(null, this.array);
|
8032 | };
|
8033 | process.title = 'browser';
|
8034 | process.browser = true;
|
8035 | process.env = {};
|
8036 | process.argv = [];
|
8037 | process.version = '';
|
8038 | process.versions = {};
|
8039 |
|
8040 | function noop() {}
|
8041 |
|
8042 | process.on = noop;
|
8043 | process.addListener = noop;
|
8044 | process.once = noop;
|
8045 | process.off = noop;
|
8046 | process.removeListener = noop;
|
8047 | process.removeAllListeners = noop;
|
8048 | process.emit = noop;
|
8049 | process.prependListener = noop;
|
8050 | process.prependOnceListener = noop;
|
8051 |
|
8052 | process.listeners = function (name) { return [] }
|
8053 |
|
8054 | process.binding = function (name) {
|
8055 | throw new Error('process.binding is not supported');
|
8056 | };
|
8057 |
|
8058 | process.cwd = function () { return '/' };
|
8059 | process.chdir = function (dir) {
|
8060 | throw new Error('process.chdir is not supported');
|
8061 | };
|
8062 | process.umask = function() { return 0; };
|
8063 |
|
8064 |
|
8065 | }),
|
8066 |
|
8067 |
|
8068 |
|
8069 |
|
8070 |
|
8071 |
|
8072 | (function(module, exports) {
|
8073 |
|
8074 |
|
8075 |
|
8076 |
|
8077 |
|
8078 |
|
8079 |
|
8080 | module.exports = function normalizeComponent (
|
8081 | rawScriptExports,
|
8082 | compiledTemplate,
|
8083 | functionalTemplate,
|
8084 | injectStyles,
|
8085 | scopeId,
|
8086 | moduleIdentifier /* server only */
|
8087 | ) {
|
8088 | var esModule
|
8089 | var scriptExports = rawScriptExports = rawScriptExports || {}
|
8090 |
|
8091 |
|
8092 | var type = typeof rawScriptExports.default
|
8093 | if (type === 'object' || type === 'function') {
|
8094 | esModule = rawScriptExports
|
8095 | scriptExports = rawScriptExports.default
|
8096 | }
|
8097 |
|
8098 |
|
8099 | var options = typeof scriptExports === 'function'
|
8100 | ? scriptExports.options
|
8101 | : scriptExports
|
8102 |
|
8103 |
|
8104 | if (compiledTemplate) {
|
8105 | options.render = compiledTemplate.render
|
8106 | options.staticRenderFns = compiledTemplate.staticRenderFns
|
8107 | options._compiled = true
|
8108 | }
|
8109 |
|
8110 |
|
8111 | if (functionalTemplate) {
|
8112 | options.functional = true
|
8113 | }
|
8114 |
|
8115 |
|
8116 | if (scopeId) {
|
8117 | options._scopeId = scopeId
|
8118 | }
|
8119 |
|
8120 | var hook
|
8121 | if (moduleIdentifier) {
|
8122 | hook = function (context) {
|
8123 |
|
8124 | context =
|
8125 | context ||
|
8126 | (this.$vnode && this.$vnode.ssrContext) ||
|
8127 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
8128 |
|
8129 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
8130 | context = __VUE_SSR_CONTEXT__
|
8131 | }
|
8132 |
|
8133 | if (injectStyles) {
|
8134 | injectStyles.call(this, context)
|
8135 | }
|
8136 |
|
8137 | if (context && context._registeredComponents) {
|
8138 | context._registeredComponents.add(moduleIdentifier)
|
8139 | }
|
8140 | }
|
8141 |
|
8142 |
|
8143 | options._ssrRegister = hook
|
8144 | } else if (injectStyles) {
|
8145 | hook = injectStyles
|
8146 | }
|
8147 |
|
8148 | if (hook) {
|
8149 | var functional = options.functional
|
8150 | var existing = functional
|
8151 | ? options.render
|
8152 | : options.beforeCreate
|
8153 |
|
8154 | if (!functional) {
|
8155 |
|
8156 | options.beforeCreate = existing
|
8157 | ? [].concat(existing, hook)
|
8158 | : [hook]
|
8159 | } else {
|
8160 |
|
8161 |
|
8162 | options._injectStyles = hook
|
8163 |
|
8164 | options.render = function renderWithStyleInjection (h, context) {
|
8165 | hook.call(context)
|
8166 | return existing(h, context)
|
8167 | }
|
8168 | }
|
8169 | }
|
8170 |
|
8171 | return {
|
8172 | esModule: esModule,
|
8173 | exports: scriptExports,
|
8174 | options: options
|
8175 | }
|
8176 | }
|
8177 |
|
8178 |
|
8179 | }),
|
8180 |
|
8181 |
|
8182 |
|
8183 |
|
8184 |
|
8185 |
|
8186 | (function(module, exports) {
|
8187 |
|
8188 | var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
|
8189 |
|
8190 | module.exports = function mergeJSXProps (objs) {
|
8191 | return objs.reduce(function (a, b) {
|
8192 | var aa, bb, key, nestedKey, temp
|
8193 | for (key in b) {
|
8194 | aa = a[key]
|
8195 | bb = b[key]
|
8196 | if (aa && nestRE.test(key)) {
|
8197 |
|
8198 | if (key === 'class') {
|
8199 | if (typeof aa === 'string') {
|
8200 | temp = aa
|
8201 | a[key] = aa = {}
|
8202 | aa[temp] = true
|
8203 | }
|
8204 | if (typeof bb === 'string') {
|
8205 | temp = bb
|
8206 | b[key] = bb = {}
|
8207 | bb[temp] = true
|
8208 | }
|
8209 | }
|
8210 | if (key === 'on' || key === 'nativeOn' || key === 'hook') {
|
8211 |
|
8212 | for (nestedKey in bb) {
|
8213 | aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
|
8214 | }
|
8215 | } else if (Array.isArray(aa)) {
|
8216 | a[key] = aa.concat(bb)
|
8217 | } else if (Array.isArray(bb)) {
|
8218 | a[key] = [aa].concat(bb)
|
8219 | } else {
|
8220 | for (nestedKey in bb) {
|
8221 | aa[nestedKey] = bb[nestedKey]
|
8222 | }
|
8223 | }
|
8224 | } else {
|
8225 | a[key] = b[key]
|
8226 | }
|
8227 | }
|
8228 | return a
|
8229 | }, {})
|
8230 | }
|
8231 |
|
8232 | function mergeFn (a, b) {
|
8233 | return function () {
|
8234 | a.apply(this, arguments)
|
8235 | b.apply(this, arguments)
|
8236 | }
|
8237 | }
|
8238 |
|
8239 |
|
8240 | }),
|
8241 |
|
8242 |
|
8243 |
|
8244 |
|
8245 |
|
8246 |
|
8247 | (function(module, exports, __webpack_require__) {
|
8248 |
|
8249 | module.exports = __webpack_require__(6);
|
8250 |
|
8251 |
|
8252 | }),
|
8253 |
|
8254 |
|
8255 |
|
8256 |
|
8257 |
|
8258 |
|
8259 | (function(module, __webpack_exports__, __webpack_require__) {
|
8260 |
|
8261 | "use strict";
|
8262 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
8263 | var __WEBPACK_IMPORTED_MODULE_0__polyfills__ = __webpack_require__( 7);
|
8264 | var __WEBPACK_IMPORTED_MODULE_0__polyfills___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__polyfills__);
|
8265 | var __WEBPACK_IMPORTED_MODULE_1_vue__ = __webpack_require__( 1);
|
8266 | var __WEBPACK_IMPORTED_MODULE_2_slugo__ = __webpack_require__( 11);
|
8267 | var __WEBPACK_IMPORTED_MODULE_2_slugo___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_slugo__);
|
8268 | var __WEBPACK_IMPORTED_MODULE_3__AimerVue__ = __webpack_require__( 12);
|
8269 | var __WEBPACK_IMPORTED_MODULE_4__Aimer_vue__ = __webpack_require__( 13);
|
8270 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
8271 |
|
8272 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
8273 |
|
8274 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8275 |
|
8276 |
|
8277 |
|
8278 |
|
8279 |
|
8280 |
|
8281 |
|
8282 |
|
8283 | if (typeof window !== 'undefined') {
|
8284 | window.AIMER_VERSION = "2.0.4";
|
8285 | }
|
8286 |
|
8287 | var Aimer = function () {
|
8288 | function Aimer() {
|
8289 | var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8290 |
|
8291 | var _ref$adapter = _ref.adapter,
|
8292 | Adapter = _ref$adapter === undefined ? __WEBPACK_IMPORTED_MODULE_3__AimerVue__["a" ] : _ref$adapter,
|
8293 | config = _objectWithoutProperties(_ref, ['adapter']);
|
8294 |
|
8295 | _classCallCheck(this, Aimer);
|
8296 |
|
8297 | this.Adapter = Adapter;
|
8298 | this.stories = [];
|
8299 | this.config = config;
|
8300 | }
|
8301 |
|
8302 | _createClass(Aimer, [{
|
8303 | key: 'add',
|
8304 | value: function add(story) {
|
8305 | this.stories.push(Object.assign({}, story, {
|
8306 | slug: __WEBPACK_IMPORTED_MODULE_2_slugo___default()(story.title)
|
8307 | }));
|
8308 | return this;
|
8309 | }
|
8310 | }, {
|
8311 | key: 'start',
|
8312 | value: function start(target) {
|
8313 | var _this = this;
|
8314 |
|
8315 | if (typeof target === 'string') {
|
8316 | target = document.querySelector(target);
|
8317 | }
|
8318 |
|
8319 | this.vm = new __WEBPACK_IMPORTED_MODULE_1_vue__["a" ]({
|
8320 | el: target,
|
8321 | render: function render(h) {
|
8322 | return h(__WEBPACK_IMPORTED_MODULE_4__Aimer_vue__["a" ], {
|
8323 | props: {
|
8324 | Adapter: _this.Adapter,
|
8325 | stories: _this.stories,
|
8326 | config: _this.config
|
8327 | }
|
8328 | });
|
8329 | }
|
8330 | });
|
8331 |
|
8332 | return this.vm;
|
8333 | }
|
8334 | }]);
|
8335 |
|
8336 | return Aimer;
|
8337 | }();
|
8338 |
|
8339 | __webpack_exports__["default"] = (Aimer);
|
8340 |
|
8341 | }),
|
8342 |
|
8343 |
|
8344 |
|
8345 |
|
8346 |
|
8347 | (function(module, exports, __webpack_require__) {
|
8348 |
|
8349 | Object.assign = Object.assign || __webpack_require__( 8);
|
8350 |
|
8351 | }),
|
8352 |
|
8353 |
|
8354 |
|
8355 |
|
8356 |
|
8357 |
|
8358 | (function(module, exports, __webpack_require__) {
|
8359 |
|
8360 | "use strict";
|
8361 |
|
8362 |
|
8363 |
|
8364 |
|
8365 |
|
8366 |
|
8367 |
|
8368 | var index = function(obj) {
|
8369 | var arguments$1 = arguments;
|
8370 |
|
8371 | for (var i = 1; i < arguments.length; i++) {
|
8372 |
|
8373 | for (var p in arguments[i]) { obj[p] = arguments$1[i][p]; }
|
8374 | }
|
8375 | return obj
|
8376 | };
|
8377 |
|
8378 | module.exports = index;
|
8379 |
|
8380 |
|
8381 | }),
|
8382 |
|
8383 |
|
8384 |
|
8385 |
|
8386 |
|
8387 |
|
8388 | (function(module, exports, __webpack_require__) {
|
8389 |
|
8390 | var apply = Function.prototype.apply;
|
8391 |
|
8392 |
|
8393 |
|
8394 | exports.setTimeout = function() {
|
8395 | return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
|
8396 | };
|
8397 | exports.setInterval = function() {
|
8398 | return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
|
8399 | };
|
8400 | exports.clearTimeout =
|
8401 | exports.clearInterval = function(timeout) {
|
8402 | if (timeout) {
|
8403 | timeout.close();
|
8404 | }
|
8405 | };
|
8406 |
|
8407 | function Timeout(id, clearFn) {
|
8408 | this._id = id;
|
8409 | this._clearFn = clearFn;
|
8410 | }
|
8411 | Timeout.prototype.unref = Timeout.prototype.ref = function() {};
|
8412 | Timeout.prototype.close = function() {
|
8413 | this._clearFn.call(window, this._id);
|
8414 | };
|
8415 |
|
8416 |
|
8417 | exports.enroll = function(item, msecs) {
|
8418 | clearTimeout(item._idleTimeoutId);
|
8419 | item._idleTimeout = msecs;
|
8420 | };
|
8421 |
|
8422 | exports.unenroll = function(item) {
|
8423 | clearTimeout(item._idleTimeoutId);
|
8424 | item._idleTimeout = -1;
|
8425 | };
|
8426 |
|
8427 | exports._unrefActive = exports.active = function(item) {
|
8428 | clearTimeout(item._idleTimeoutId);
|
8429 |
|
8430 | var msecs = item._idleTimeout;
|
8431 | if (msecs >= 0) {
|
8432 | item._idleTimeoutId = setTimeout(function onTimeout() {
|
8433 | if (item._onTimeout)
|
8434 | item._onTimeout();
|
8435 | }, msecs);
|
8436 | }
|
8437 | };
|
8438 |
|
8439 |
|
8440 | __webpack_require__( 10);
|
8441 | exports.setImmediate = setImmediate;
|
8442 | exports.clearImmediate = clearImmediate;
|
8443 |
|
8444 |
|
8445 | }),
|
8446 |
|
8447 |
|
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 | (function(module, exports, __webpack_require__) {
|
8453 |
|
8454 | (function(global, process) {(function (global, undefined) {
|
8455 | "use strict";
|
8456 |
|
8457 | if (global.setImmediate) {
|
8458 | return;
|
8459 | }
|
8460 |
|
8461 | var nextHandle = 1;
|
8462 | var tasksByHandle = {};
|
8463 | var currentlyRunningATask = false;
|
8464 | var doc = global.document;
|
8465 | var registerImmediate;
|
8466 |
|
8467 | function setImmediate(callback) {
|
8468 |
|
8469 | if (typeof callback !== "function") {
|
8470 | callback = new Function("" + callback);
|
8471 | }
|
8472 |
|
8473 | var args = new Array(arguments.length - 1);
|
8474 | for (var i = 0; i < args.length; i++) {
|
8475 | args[i] = arguments[i + 1];
|
8476 | }
|
8477 |
|
8478 | var task = { callback: callback, args: args };
|
8479 | tasksByHandle[nextHandle] = task;
|
8480 | registerImmediate(nextHandle);
|
8481 | return nextHandle++;
|
8482 | }
|
8483 |
|
8484 | function clearImmediate(handle) {
|
8485 | delete tasksByHandle[handle];
|
8486 | }
|
8487 |
|
8488 | function run(task) {
|
8489 | var callback = task.callback;
|
8490 | var args = task.args;
|
8491 | switch (args.length) {
|
8492 | case 0:
|
8493 | callback();
|
8494 | break;
|
8495 | case 1:
|
8496 | callback(args[0]);
|
8497 | break;
|
8498 | case 2:
|
8499 | callback(args[0], args[1]);
|
8500 | break;
|
8501 | case 3:
|
8502 | callback(args[0], args[1], args[2]);
|
8503 | break;
|
8504 | default:
|
8505 | callback.apply(undefined, args);
|
8506 | break;
|
8507 | }
|
8508 | }
|
8509 |
|
8510 | function runIfPresent(handle) {
|
8511 |
|
8512 |
|
8513 | if (currentlyRunningATask) {
|
8514 |
|
8515 |
|
8516 | setTimeout(runIfPresent, 0, handle);
|
8517 | } else {
|
8518 | var task = tasksByHandle[handle];
|
8519 | if (task) {
|
8520 | currentlyRunningATask = true;
|
8521 | try {
|
8522 | run(task);
|
8523 | } finally {
|
8524 | clearImmediate(handle);
|
8525 | currentlyRunningATask = false;
|
8526 | }
|
8527 | }
|
8528 | }
|
8529 | }
|
8530 |
|
8531 | function installNextTickImplementation() {
|
8532 | registerImmediate = function(handle) {
|
8533 | process.nextTick(function () { runIfPresent(handle); });
|
8534 | };
|
8535 | }
|
8536 |
|
8537 | function canUsePostMessage() {
|
8538 |
|
8539 |
|
8540 | if (global.postMessage && !global.importScripts) {
|
8541 | var postMessageIsAsynchronous = true;
|
8542 | var oldOnMessage = global.onmessage;
|
8543 | global.onmessage = function() {
|
8544 | postMessageIsAsynchronous = false;
|
8545 | };
|
8546 | global.postMessage("", "*");
|
8547 | global.onmessage = oldOnMessage;
|
8548 | return postMessageIsAsynchronous;
|
8549 | }
|
8550 | }
|
8551 |
|
8552 | function installPostMessageImplementation() {
|
8553 |
|
8554 |
|
8555 |
|
8556 |
|
8557 | var messagePrefix = "setImmediate$" + Math.random() + "$";
|
8558 | var onGlobalMessage = function(event) {
|
8559 | if (event.source === global &&
|
8560 | typeof event.data === "string" &&
|
8561 | event.data.indexOf(messagePrefix) === 0) {
|
8562 | runIfPresent(+event.data.slice(messagePrefix.length));
|
8563 | }
|
8564 | };
|
8565 |
|
8566 | if (global.addEventListener) {
|
8567 | global.addEventListener("message", onGlobalMessage, false);
|
8568 | } else {
|
8569 | global.attachEvent("onmessage", onGlobalMessage);
|
8570 | }
|
8571 |
|
8572 | registerImmediate = function(handle) {
|
8573 | global.postMessage(messagePrefix + handle, "*");
|
8574 | };
|
8575 | }
|
8576 |
|
8577 | function installMessageChannelImplementation() {
|
8578 | var channel = new MessageChannel();
|
8579 | channel.port1.onmessage = function(event) {
|
8580 | var handle = event.data;
|
8581 | runIfPresent(handle);
|
8582 | };
|
8583 |
|
8584 | registerImmediate = function(handle) {
|
8585 | channel.port2.postMessage(handle);
|
8586 | };
|
8587 | }
|
8588 |
|
8589 | function installReadyStateChangeImplementation() {
|
8590 | var html = doc.documentElement;
|
8591 | registerImmediate = function(handle) {
|
8592 |
|
8593 |
|
8594 | var script = doc.createElement("script");
|
8595 | script.onreadystatechange = function () {
|
8596 | runIfPresent(handle);
|
8597 | script.onreadystatechange = null;
|
8598 | html.removeChild(script);
|
8599 | script = null;
|
8600 | };
|
8601 | html.appendChild(script);
|
8602 | };
|
8603 | }
|
8604 |
|
8605 | function installSetTimeoutImplementation() {
|
8606 | registerImmediate = function(handle) {
|
8607 | setTimeout(runIfPresent, 0, handle);
|
8608 | };
|
8609 | }
|
8610 |
|
8611 |
|
8612 | var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
|
8613 | attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
|
8614 |
|
8615 |
|
8616 | if ({}.toString.call(global.process) === "[object process]") {
|
8617 |
|
8618 | installNextTickImplementation();
|
8619 |
|
8620 | } else if (canUsePostMessage()) {
|
8621 |
|
8622 | installPostMessageImplementation();
|
8623 |
|
8624 | } else if (global.MessageChannel) {
|
8625 |
|
8626 | installMessageChannelImplementation();
|
8627 |
|
8628 | } else if (doc && "onreadystatechange" in doc.createElement("script")) {
|
8629 |
|
8630 | installReadyStateChangeImplementation();
|
8631 |
|
8632 | } else {
|
8633 |
|
8634 | installSetTimeoutImplementation();
|
8635 | }
|
8636 |
|
8637 | attachTo.setImmediate = setImmediate;
|
8638 | attachTo.clearImmediate = clearImmediate;
|
8639 | }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
|
8640 |
|
8641 | }.call(exports, __webpack_require__( 0), __webpack_require__( 2)))
|
8642 |
|
8643 | }),
|
8644 |
|
8645 |
|
8646 |
|
8647 |
|
8648 |
|
8649 |
|
8650 | (function(module, exports, __webpack_require__) {
|
8651 |
|
8652 | (function (global, factory) {
|
8653 | true ? module.exports = factory() :
|
8654 | typeof define === 'function' && define.amd ? define(factory) :
|
8655 | (global.slugo = factory());
|
8656 | }(this, (function () { 'use strict';
|
8657 |
|
8658 | var index = function (input) {
|
8659 | return input
|
8660 |
|
8661 | .replace(/<(?:.|\n)*?>/gm, '')
|
8662 |
|
8663 | .replace(/[!\"#$%&'\(\)\*\+,\/:;<=>\?\@\[\\\]\^`\{\|\}~]/g, '')
|
8664 |
|
8665 | .replace(/(\s|\.)/g, '-')
|
8666 |
|
8667 | .toLowerCase()
|
8668 | };
|
8669 |
|
8670 | return index;
|
8671 |
|
8672 | })));
|
8673 |
|
8674 |
|
8675 | }),
|
8676 |
|
8677 |
|
8678 |
|
8679 |
|
8680 |
|
8681 |
|
8682 | (function(module, __webpack_exports__, __webpack_require__) {
|
8683 |
|
8684 | "use strict";
|
8685 | var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__( 1);
|
8686 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
8687 |
|
8688 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8689 |
|
8690 |
|
8691 |
|
8692 | var AimerVue = function () {
|
8693 | function AimerVue() {
|
8694 | _classCallCheck(this, AimerVue);
|
8695 | }
|
8696 |
|
8697 | _createClass(AimerVue, [{
|
8698 | key: 'mount',
|
8699 | value: function mount(component, target) {
|
8700 | this.$el = new __WEBPACK_IMPORTED_MODULE_0_vue__["a" ]({
|
8701 | el: target,
|
8702 | render: function render(h) {
|
8703 | return h(component);
|
8704 | }
|
8705 | });
|
8706 | return this;
|
8707 | }
|
8708 | }, {
|
8709 | key: 'unmount',
|
8710 | value: function unmount() {
|
8711 | this.$el.$destroy();
|
8712 | return this;
|
8713 | }
|
8714 | }, {
|
8715 | key: 'isMount',
|
8716 | value: function isMount() {
|
8717 | return this.$el;
|
8718 | }
|
8719 | }]);
|
8720 |
|
8721 | return AimerVue;
|
8722 | }();
|
8723 |
|
8724 | __webpack_exports__["a"] = (AimerVue);
|
8725 |
|
8726 | }),
|
8727 |
|
8728 |
|
8729 |
|
8730 |
|
8731 |
|
8732 |
|
8733 | (function(module, __webpack_exports__, __webpack_require__) {
|
8734 |
|
8735 | "use strict";
|
8736 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Aimer_vue__ = __webpack_require__( 16);
|
8737 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_96d8ad28_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Aimer_vue__ = __webpack_require__( 28);
|
8738 | function injectStyle (ssrContext) {
|
8739 | __webpack_require__( 14)
|
8740 | __webpack_require__( 15)
|
8741 | }
|
8742 | var normalizeComponent = __webpack_require__( 3)
|
8743 |
|
8744 |
|
8745 |
|
8746 |
|
8747 |
|
8748 | var __vue_template_functional__ = false
|
8749 |
|
8750 | var __vue_styles__ = injectStyle
|
8751 |
|
8752 | var __vue_scopeId__ = null
|
8753 |
|
8754 | var __vue_module_identifier__ = null
|
8755 | var Component = normalizeComponent(
|
8756 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Aimer_vue__["a" ],
|
8757 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_96d8ad28_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Aimer_vue__["a" ],
|
8758 | __vue_template_functional__,
|
8759 | __vue_styles__,
|
8760 | __vue_scopeId__,
|
8761 | __vue_module_identifier__
|
8762 | )
|
8763 |
|
8764 | __webpack_exports__["a"] = (Component.exports);
|
8765 |
|
8766 |
|
8767 | }),
|
8768 |
|
8769 |
|
8770 |
|
8771 |
|
8772 |
|
8773 |
|
8774 | (function(module, exports) {
|
8775 |
|
8776 |
|
8777 |
|
8778 | }),
|
8779 |
|
8780 |
|
8781 |
|
8782 |
|
8783 |
|
8784 |
|
8785 | (function(module, exports) {
|
8786 |
|
8787 |
|
8788 |
|
8789 | }),
|
8790 |
|
8791 |
|
8792 |
|
8793 |
|
8794 |
|
8795 |
|
8796 | (function(module, __webpack_exports__, __webpack_require__) {
|
8797 |
|
8798 | "use strict";
|
8799 | var __WEBPACK_IMPORTED_MODULE_0_nanoquery__ = __webpack_require__( 17);
|
8800 | var __WEBPACK_IMPORTED_MODULE_0_nanoquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_nanoquery__);
|
8801 | var __WEBPACK_IMPORTED_MODULE_1__components_Icons_vue__ = __webpack_require__( 22);
|
8802 |
|
8803 |
|
8804 |
|
8805 |
|
8806 |
|
8807 |
|
8808 |
|
8809 |
|
8810 |
|
8811 |
|
8812 |
|
8813 |
|
8814 |
|
8815 |
|
8816 |
|
8817 |
|
8818 |
|
8819 |
|
8820 |
|
8821 |
|
8822 |
|
8823 |
|
8824 |
|
8825 |
|
8826 |
|
8827 |
|
8828 |
|
8829 |
|
8830 |
|
8831 |
|
8832 |
|
8833 |
|
8834 |
|
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 |
|
8841 |
|
8842 |
|
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 |
|
8857 |
|
8858 |
|
8859 |
|
8860 |
|
8861 |
|
8862 |
|
8863 |
|
8864 |
|
8865 |
|
8866 |
|
8867 |
|
8868 |
|
8869 | function getCurrentTab(_ref) {
|
8870 | var readme = _ref.readme;
|
8871 |
|
8872 | return readme ? 'readme' : 'example';
|
8873 | }
|
8874 |
|
8875 | function updateURL(_ref2) {
|
8876 | var title = _ref2.title,
|
8877 | story = _ref2.story;
|
8878 | var _window$location = window.location,
|
8879 | host = _window$location.host,
|
8880 | protocol = _window$location.protocol,
|
8881 | pathname = _window$location.pathname;
|
8882 |
|
8883 | var newUrl = protocol + '//' + host + pathname + '?story=' + story;
|
8884 |
|
8885 | window.history.pushState({
|
8886 | path: newUrl
|
8887 | }, title, newUrl);
|
8888 |
|
8889 | document.title = title;
|
8890 | }
|
8891 |
|
8892 | function mountComponent(adapter, targetWrapper, component) {
|
8893 | if (adapter.isMount()) {
|
8894 | adapter.unmount(targetWrapper.firstChild);
|
8895 | targetWrapper.removeChild(targetWrapper.firstChild);
|
8896 | }
|
8897 | var target = document.createElement('div');
|
8898 | targetWrapper.appendChild(target);
|
8899 | adapter.mount(component, target);
|
8900 | }
|
8901 |
|
8902 | function getStoryBySlug(stories, slug) {
|
8903 | return stories.filter(function (story) {
|
8904 | return story.slug === slug;
|
8905 | })[0];
|
8906 | }
|
8907 |
|
8908 | __webpack_exports__["a"] = ({
|
8909 | name: 'aimer',
|
8910 |
|
8911 | props: {
|
8912 | Adapter: {
|
8913 | type: Function,
|
8914 | required: true
|
8915 | },
|
8916 | stories: {
|
8917 | type: Array,
|
8918 | required: true
|
8919 | },
|
8920 | config: {
|
8921 | type: Object
|
8922 | }
|
8923 | },
|
8924 |
|
8925 | data: function data() {
|
8926 | var kv = __WEBPACK_IMPORTED_MODULE_0_nanoquery___default()(window.location.search);
|
8927 | var currentStorySlug = kv.story || this.stories[0].slug;
|
8928 | return {
|
8929 | currentTab: getCurrentTab(getStoryBySlug(this.stories, currentStorySlug)),
|
8930 | currentStorySlug: currentStorySlug
|
8931 | };
|
8932 | },
|
8933 |
|
8934 |
|
8935 | computed: {
|
8936 | currentStory: function currentStory() {
|
8937 | return getStoryBySlug(this.stories, this.currentStorySlug);
|
8938 | }
|
8939 | },
|
8940 |
|
8941 | watch: {
|
8942 | currentStory: function currentStory(story) {
|
8943 | this.currentTab = getCurrentTab(story);
|
8944 | }
|
8945 | },
|
8946 |
|
8947 | mounted: function mounted() {
|
8948 | this.adapter = new this.Adapter();
|
8949 | this.handleRender();
|
8950 | },
|
8951 |
|
8952 |
|
8953 | methods: {
|
8954 | handleRender: function handleRender() {
|
8955 | var targetWrapper = this.$refs.targetWrapper;
|
8956 | var component = this.currentStory.component;
|
8957 |
|
8958 | component = typeof component === 'function' ? component() : component;
|
8959 | mountComponent(this.adapter, targetWrapper, component);
|
8960 |
|
8961 | updateURL({
|
8962 | title: this.currentStory.title + ' - ' + (this.config.title || 'Aimer'),
|
8963 | story: this.currentStory.slug
|
8964 | });
|
8965 | },
|
8966 | chooseTab: function chooseTab(tab) {
|
8967 | this.currentTab = tab;
|
8968 | }
|
8969 | },
|
8970 |
|
8971 | components: {
|
8972 | Icons: __WEBPACK_IMPORTED_MODULE_1__components_Icons_vue__["a" ]
|
8973 | }
|
8974 | });
|
8975 |
|
8976 | }),
|
8977 |
|
8978 |
|
8979 |
|
8980 |
|
8981 |
|
8982 |
|
8983 | (function(module, exports, __webpack_require__) {
|
8984 |
|
8985 | var reg = new RegExp('([^?=&]+)(=([^&]*))?', 'g')
|
8986 | var assert = __webpack_require__( 18)
|
8987 |
|
8988 | module.exports = qs
|
8989 |
|
8990 | function qs (url) {
|
8991 | assert.equal(typeof url, 'string', 'nanoquery: url should be type string')
|
8992 | assert.ok(typeof window !== 'undefined', 'nanoquery: expected window to exist')
|
8993 |
|
8994 | var obj = {}
|
8995 | url.replace(/^.*\?/, '').replace(reg, function (a0, a1, a2, a3) {
|
8996 | obj[window.decodeURIComponent(a1)] = window.decodeURIComponent(a3)
|
8997 | })
|
8998 |
|
8999 | return obj
|
9000 | }
|
9001 |
|
9002 |
|
9003 | }),
|
9004 |
|
9005 |
|
9006 |
|
9007 |
|
9008 |
|
9009 |
|
9010 | (function(module, exports, __webpack_require__) {
|
9011 |
|
9012 | "use strict";
|
9013 | (function(global) {
|
9014 |
|
9015 |
|
9016 |
|
9017 |
|
9018 |
|
9019 |
|
9020 |
|
9021 |
|
9022 |
|
9023 |
|
9024 | function compare(a, b) {
|
9025 | if (a === b) {
|
9026 | return 0;
|
9027 | }
|
9028 |
|
9029 | var x = a.length;
|
9030 | var y = b.length;
|
9031 |
|
9032 | for (var i = 0, len = Math.min(x, y); i < len; ++i) {
|
9033 | if (a[i] !== b[i]) {
|
9034 | x = a[i];
|
9035 | y = b[i];
|
9036 | break;
|
9037 | }
|
9038 | }
|
9039 |
|
9040 | if (x < y) {
|
9041 | return -1;
|
9042 | }
|
9043 | if (y < x) {
|
9044 | return 1;
|
9045 | }
|
9046 | return 0;
|
9047 | }
|
9048 | function isBuffer(b) {
|
9049 | if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
|
9050 | return global.Buffer.isBuffer(b);
|
9051 | }
|
9052 | return !!(b != null && b._isBuffer);
|
9053 | }
|
9054 |
|
9055 |
|
9056 |
|
9057 |
|
9058 |
|
9059 |
|
9060 |
|
9061 |
|
9062 |
|
9063 |
|
9064 |
|
9065 |
|
9066 |
|
9067 |
|
9068 |
|
9069 |
|
9070 |
|
9071 |
|
9072 |
|
9073 |
|
9074 |
|
9075 |
|
9076 |
|
9077 |
|
9078 |
|
9079 |
|
9080 |
|
9081 | var util = __webpack_require__( 19);
|
9082 | var hasOwn = Object.prototype.hasOwnProperty;
|
9083 | var pSlice = Array.prototype.slice;
|
9084 | var functionsHaveNames = (function () {
|
9085 | return function foo() {}.name === 'foo';
|
9086 | }());
|
9087 | function pToString (obj) {
|
9088 | return Object.prototype.toString.call(obj);
|
9089 | }
|
9090 | function isView(arrbuf) {
|
9091 | if (isBuffer(arrbuf)) {
|
9092 | return false;
|
9093 | }
|
9094 | if (typeof global.ArrayBuffer !== 'function') {
|
9095 | return false;
|
9096 | }
|
9097 | if (typeof ArrayBuffer.isView === 'function') {
|
9098 | return ArrayBuffer.isView(arrbuf);
|
9099 | }
|
9100 | if (!arrbuf) {
|
9101 | return false;
|
9102 | }
|
9103 | if (arrbuf instanceof DataView) {
|
9104 | return true;
|
9105 | }
|
9106 | if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
|
9107 | return true;
|
9108 | }
|
9109 | return false;
|
9110 | }
|
9111 |
|
9112 |
|
9113 |
|
9114 |
|
9115 | var assert = module.exports = ok;
|
9116 |
|
9117 |
|
9118 |
|
9119 |
|
9120 |
|
9121 |
|
9122 | var regex = /\s*function\s+([^\(\s]*)\s*/;
|
9123 |
|
9124 | function getName(func) {
|
9125 | if (!util.isFunction(func)) {
|
9126 | return;
|
9127 | }
|
9128 | if (functionsHaveNames) {
|
9129 | return func.name;
|
9130 | }
|
9131 | var str = func.toString();
|
9132 | var match = str.match(regex);
|
9133 | return match && match[1];
|
9134 | }
|
9135 | assert.AssertionError = function AssertionError(options) {
|
9136 | this.name = 'AssertionError';
|
9137 | this.actual = options.actual;
|
9138 | this.expected = options.expected;
|
9139 | this.operator = options.operator;
|
9140 | if (options.message) {
|
9141 | this.message = options.message;
|
9142 | this.generatedMessage = false;
|
9143 | } else {
|
9144 | this.message = getMessage(this);
|
9145 | this.generatedMessage = true;
|
9146 | }
|
9147 | var stackStartFunction = options.stackStartFunction || fail;
|
9148 | if (Error.captureStackTrace) {
|
9149 | Error.captureStackTrace(this, stackStartFunction);
|
9150 | } else {
|
9151 |
|
9152 | var err = new Error();
|
9153 | if (err.stack) {
|
9154 | var out = err.stack;
|
9155 |
|
9156 |
|
9157 | var fn_name = getName(stackStartFunction);
|
9158 | var idx = out.indexOf('\n' + fn_name);
|
9159 | if (idx >= 0) {
|
9160 |
|
9161 |
|
9162 | var next_line = out.indexOf('\n', idx + 1);
|
9163 | out = out.substring(next_line + 1);
|
9164 | }
|
9165 |
|
9166 | this.stack = out;
|
9167 | }
|
9168 | }
|
9169 | };
|
9170 |
|
9171 |
|
9172 | util.inherits(assert.AssertionError, Error);
|
9173 |
|
9174 | function truncate(s, n) {
|
9175 | if (typeof s === 'string') {
|
9176 | return s.length < n ? s : s.slice(0, n);
|
9177 | } else {
|
9178 | return s;
|
9179 | }
|
9180 | }
|
9181 | function inspect(something) {
|
9182 | if (functionsHaveNames || !util.isFunction(something)) {
|
9183 | return util.inspect(something);
|
9184 | }
|
9185 | var rawname = getName(something);
|
9186 | var name = rawname ? ': ' + rawname : '';
|
9187 | return '[Function' + name + ']';
|
9188 | }
|
9189 | function getMessage(self) {
|
9190 | return truncate(inspect(self.actual), 128) + ' ' +
|
9191 | self.operator + ' ' +
|
9192 | truncate(inspect(self.expected), 128);
|
9193 | }
|
9194 |
|
9195 |
|
9196 |
|
9197 |
|
9198 |
|
9199 |
|
9200 |
|
9201 |
|
9202 |
|
9203 |
|
9204 |
|
9205 |
|
9206 | function fail(actual, expected, message, operator, stackStartFunction) {
|
9207 | throw new assert.AssertionError({
|
9208 | message: message,
|
9209 | actual: actual,
|
9210 | expected: expected,
|
9211 | operator: operator,
|
9212 | stackStartFunction: stackStartFunction
|
9213 | });
|
9214 | }
|
9215 |
|
9216 |
|
9217 | assert.fail = fail;
|
9218 |
|
9219 |
|
9220 |
|
9221 |
|
9222 |
|
9223 |
|
9224 |
|
9225 |
|
9226 | function ok(value, message) {
|
9227 | if (!value) fail(value, true, message, '==', assert.ok);
|
9228 | }
|
9229 | assert.ok = ok;
|
9230 |
|
9231 |
|
9232 |
|
9233 |
|
9234 |
|
9235 | assert.equal = function equal(actual, expected, message) {
|
9236 | if (actual != expected) fail(actual, expected, message, '==', assert.equal);
|
9237 | };
|
9238 |
|
9239 |
|
9240 |
|
9241 |
|
9242 | assert.notEqual = function notEqual(actual, expected, message) {
|
9243 | if (actual == expected) {
|
9244 | fail(actual, expected, message, '!=', assert.notEqual);
|
9245 | }
|
9246 | };
|
9247 |
|
9248 |
|
9249 |
|
9250 |
|
9251 | assert.deepEqual = function deepEqual(actual, expected, message) {
|
9252 | if (!_deepEqual(actual, expected, false)) {
|
9253 | fail(actual, expected, message, 'deepEqual', assert.deepEqual);
|
9254 | }
|
9255 | };
|
9256 |
|
9257 | assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
|
9258 | if (!_deepEqual(actual, expected, true)) {
|
9259 | fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
|
9260 | }
|
9261 | };
|
9262 |
|
9263 | function _deepEqual(actual, expected, strict, memos) {
|
9264 |
|
9265 | if (actual === expected) {
|
9266 | return true;
|
9267 | } else if (isBuffer(actual) && isBuffer(expected)) {
|
9268 | return compare(actual, expected) === 0;
|
9269 |
|
9270 |
|
9271 |
|
9272 | } else if (util.isDate(actual) && util.isDate(expected)) {
|
9273 | return actual.getTime() === expected.getTime();
|
9274 |
|
9275 |
|
9276 |
|
9277 |
|
9278 | } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
|
9279 | return actual.source === expected.source &&
|
9280 | actual.global === expected.global &&
|
9281 | actual.multiline === expected.multiline &&
|
9282 | actual.lastIndex === expected.lastIndex &&
|
9283 | actual.ignoreCase === expected.ignoreCase;
|
9284 |
|
9285 |
|
9286 |
|
9287 | } else if ((actual === null || typeof actual !== 'object') &&
|
9288 | (expected === null || typeof expected !== 'object')) {
|
9289 | return strict ? actual === expected : actual == expected;
|
9290 |
|
9291 |
|
9292 |
|
9293 |
|
9294 |
|
9295 |
|
9296 |
|
9297 | } else if (isView(actual) && isView(expected) &&
|
9298 | pToString(actual) === pToString(expected) &&
|
9299 | !(actual instanceof Float32Array ||
|
9300 | actual instanceof Float64Array)) {
|
9301 | return compare(new Uint8Array(actual.buffer),
|
9302 | new Uint8Array(expected.buffer)) === 0;
|
9303 |
|
9304 |
|
9305 |
|
9306 |
|
9307 |
|
9308 |
|
9309 |
|
9310 | } else if (isBuffer(actual) !== isBuffer(expected)) {
|
9311 | return false;
|
9312 | } else {
|
9313 | memos = memos || {actual: [], expected: []};
|
9314 |
|
9315 | var actualIndex = memos.actual.indexOf(actual);
|
9316 | if (actualIndex !== -1) {
|
9317 | if (actualIndex === memos.expected.indexOf(expected)) {
|
9318 | return true;
|
9319 | }
|
9320 | }
|
9321 |
|
9322 | memos.actual.push(actual);
|
9323 | memos.expected.push(expected);
|
9324 |
|
9325 | return objEquiv(actual, expected, strict, memos);
|
9326 | }
|
9327 | }
|
9328 |
|
9329 | function isArguments(object) {
|
9330 | return Object.prototype.toString.call(object) == '[object Arguments]';
|
9331 | }
|
9332 |
|
9333 | function objEquiv(a, b, strict, actualVisitedObjects) {
|
9334 | if (a === null || a === undefined || b === null || b === undefined)
|
9335 | return false;
|
9336 |
|
9337 | if (util.isPrimitive(a) || util.isPrimitive(b))
|
9338 | return a === b;
|
9339 | if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
|
9340 | return false;
|
9341 | var aIsArgs = isArguments(a);
|
9342 | var bIsArgs = isArguments(b);
|
9343 | if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
|
9344 | return false;
|
9345 | if (aIsArgs) {
|
9346 | a = pSlice.call(a);
|
9347 | b = pSlice.call(b);
|
9348 | return _deepEqual(a, b, strict);
|
9349 | }
|
9350 | var ka = objectKeys(a);
|
9351 | var kb = objectKeys(b);
|
9352 | var key, i;
|
9353 |
|
9354 |
|
9355 | if (ka.length !== kb.length)
|
9356 | return false;
|
9357 |
|
9358 | ka.sort();
|
9359 | kb.sort();
|
9360 |
|
9361 | for (i = ka.length - 1; i >= 0; i--) {
|
9362 | if (ka[i] !== kb[i])
|
9363 | return false;
|
9364 | }
|
9365 |
|
9366 |
|
9367 | for (i = ka.length - 1; i >= 0; i--) {
|
9368 | key = ka[i];
|
9369 | if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
|
9370 | return false;
|
9371 | }
|
9372 | return true;
|
9373 | }
|
9374 |
|
9375 |
|
9376 |
|
9377 |
|
9378 | assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
|
9379 | if (_deepEqual(actual, expected, false)) {
|
9380 | fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
|
9381 | }
|
9382 | };
|
9383 |
|
9384 | assert.notDeepStrictEqual = notDeepStrictEqual;
|
9385 | function notDeepStrictEqual(actual, expected, message) {
|
9386 | if (_deepEqual(actual, expected, true)) {
|
9387 | fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
|
9388 | }
|
9389 | }
|
9390 |
|
9391 |
|
9392 |
|
9393 |
|
9394 |
|
9395 | assert.strictEqual = function strictEqual(actual, expected, message) {
|
9396 | if (actual !== expected) {
|
9397 | fail(actual, expected, message, '===', assert.strictEqual);
|
9398 | }
|
9399 | };
|
9400 |
|
9401 |
|
9402 |
|
9403 |
|
9404 | assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
|
9405 | if (actual === expected) {
|
9406 | fail(actual, expected, message, '!==', assert.notStrictEqual);
|
9407 | }
|
9408 | };
|
9409 |
|
9410 | function expectedException(actual, expected) {
|
9411 | if (!actual || !expected) {
|
9412 | return false;
|
9413 | }
|
9414 |
|
9415 | if (Object.prototype.toString.call(expected) == '[object RegExp]') {
|
9416 | return expected.test(actual);
|
9417 | }
|
9418 |
|
9419 | try {
|
9420 | if (actual instanceof expected) {
|
9421 | return true;
|
9422 | }
|
9423 | } catch (e) {
|
9424 |
|
9425 | }
|
9426 |
|
9427 | if (Error.isPrototypeOf(expected)) {
|
9428 | return false;
|
9429 | }
|
9430 |
|
9431 | return expected.call({}, actual) === true;
|
9432 | }
|
9433 |
|
9434 | function _tryBlock(block) {
|
9435 | var error;
|
9436 | try {
|
9437 | block();
|
9438 | } catch (e) {
|
9439 | error = e;
|
9440 | }
|
9441 | return error;
|
9442 | }
|
9443 |
|
9444 | function _throws(shouldThrow, block, expected, message) {
|
9445 | var actual;
|
9446 |
|
9447 | if (typeof block !== 'function') {
|
9448 | throw new TypeError('"block" argument must be a function');
|
9449 | }
|
9450 |
|
9451 | if (typeof expected === 'string') {
|
9452 | message = expected;
|
9453 | expected = null;
|
9454 | }
|
9455 |
|
9456 | actual = _tryBlock(block);
|
9457 |
|
9458 | message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
|
9459 | (message ? ' ' + message : '.');
|
9460 |
|
9461 | if (shouldThrow && !actual) {
|
9462 | fail(actual, expected, 'Missing expected exception' + message);
|
9463 | }
|
9464 |
|
9465 | var userProvidedMessage = typeof message === 'string';
|
9466 | var isUnwantedException = !shouldThrow && util.isError(actual);
|
9467 | var isUnexpectedException = !shouldThrow && actual && !expected;
|
9468 |
|
9469 | if ((isUnwantedException &&
|
9470 | userProvidedMessage &&
|
9471 | expectedException(actual, expected)) ||
|
9472 | isUnexpectedException) {
|
9473 | fail(actual, expected, 'Got unwanted exception' + message);
|
9474 | }
|
9475 |
|
9476 | if ((shouldThrow && actual && expected &&
|
9477 | !expectedException(actual, expected)) || (!shouldThrow && actual)) {
|
9478 | throw actual;
|
9479 | }
|
9480 | }
|
9481 |
|
9482 |
|
9483 |
|
9484 |
|
9485 | assert.throws = function(block, /*optional*/error, /*optional*/message) {
|
9486 | _throws(true, block, error, message);
|
9487 | };
|
9488 |
|
9489 |
|
9490 | assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
|
9491 | _throws(false, block, error, message);
|
9492 | };
|
9493 |
|
9494 | assert.ifError = function(err) { if (err) throw err; };
|
9495 |
|
9496 | var objectKeys = Object.keys || function (obj) {
|
9497 | var keys = [];
|
9498 | for (var key in obj) {
|
9499 | if (hasOwn.call(obj, key)) keys.push(key);
|
9500 | }
|
9501 | return keys;
|
9502 | };
|
9503 |
|
9504 | }.call(exports, __webpack_require__( 0)))
|
9505 |
|
9506 | }),
|
9507 |
|
9508 |
|
9509 |
|
9510 |
|
9511 |
|
9512 |
|
9513 | (function(module, exports, __webpack_require__) {
|
9514 |
|
9515 | (function(global, process) {
|
9516 |
|
9517 |
|
9518 |
|
9519 |
|
9520 |
|
9521 |
|
9522 |
|
9523 |
|
9524 |
|
9525 |
|
9526 |
|
9527 |
|
9528 |
|
9529 |
|
9530 |
|
9531 |
|
9532 |
|
9533 |
|
9534 |
|
9535 |
|
9536 | var formatRegExp = /%[sdj%]/g;
|
9537 | exports.format = function(f) {
|
9538 | if (!isString(f)) {
|
9539 | var objects = [];
|
9540 | for (var i = 0; i < arguments.length; i++) {
|
9541 | objects.push(inspect(arguments[i]));
|
9542 | }
|
9543 | return objects.join(' ');
|
9544 | }
|
9545 |
|
9546 | var i = 1;
|
9547 | var args = arguments;
|
9548 | var len = args.length;
|
9549 | var str = String(f).replace(formatRegExp, function(x) {
|
9550 | if (x === '%%') return '%';
|
9551 | if (i >= len) return x;
|
9552 | switch (x) {
|
9553 | case '%s': return String(args[i++]);
|
9554 | case '%d': return Number(args[i++]);
|
9555 | case '%j':
|
9556 | try {
|
9557 | return JSON.stringify(args[i++]);
|
9558 | } catch (_) {
|
9559 | return '[Circular]';
|
9560 | }
|
9561 | default:
|
9562 | return x;
|
9563 | }
|
9564 | });
|
9565 | for (var x = args[i]; i < len; x = args[++i]) {
|
9566 | if (isNull(x) || !isObject(x)) {
|
9567 | str += ' ' + x;
|
9568 | } else {
|
9569 | str += ' ' + inspect(x);
|
9570 | }
|
9571 | }
|
9572 | return str;
|
9573 | };
|
9574 |
|
9575 |
|
9576 |
|
9577 |
|
9578 |
|
9579 | exports.deprecate = function(fn, msg) {
|
9580 |
|
9581 | if (isUndefined(global.process)) {
|
9582 | return function() {
|
9583 | return exports.deprecate(fn, msg).apply(this, arguments);
|
9584 | };
|
9585 | }
|
9586 |
|
9587 | if (process.noDeprecation === true) {
|
9588 | return fn;
|
9589 | }
|
9590 |
|
9591 | var warned = false;
|
9592 | function deprecated() {
|
9593 | if (!warned) {
|
9594 | if (process.throwDeprecation) {
|
9595 | throw new Error(msg);
|
9596 | } else if (process.traceDeprecation) {
|
9597 | console.trace(msg);
|
9598 | } else {
|
9599 | console.error(msg);
|
9600 | }
|
9601 | warned = true;
|
9602 | }
|
9603 | return fn.apply(this, arguments);
|
9604 | }
|
9605 |
|
9606 | return deprecated;
|
9607 | };
|
9608 |
|
9609 |
|
9610 | var debugs = {};
|
9611 | var debugEnviron;
|
9612 | exports.debuglog = function(set) {
|
9613 | if (isUndefined(debugEnviron))
|
9614 | debugEnviron = process.env.NODE_DEBUG || '';
|
9615 | set = set.toUpperCase();
|
9616 | if (!debugs[set]) {
|
9617 | if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
|
9618 | var pid = process.pid;
|
9619 | debugs[set] = function() {
|
9620 | var msg = exports.format.apply(exports, arguments);
|
9621 | console.error('%s %d: %s', set, pid, msg);
|
9622 | };
|
9623 | } else {
|
9624 | debugs[set] = function() {};
|
9625 | }
|
9626 | }
|
9627 | return debugs[set];
|
9628 | };
|
9629 |
|
9630 |
|
9631 | /**
|
9632 | * Echos the value of a value. Trys to print the value out
|
9633 | * in the best way possible given the different types.
|
9634 | *
|
9635 | * @param {Object} obj The object to print out.
|
9636 | * @param {Object} opts Optional options object that alters the output.
|
9637 | */
|
9638 |
|
9639 | function inspect(obj, opts) {
|
9640 |
|
9641 | var ctx = {
|
9642 | seen: [],
|
9643 | stylize: stylizeNoColor
|
9644 | };
|
9645 |
|
9646 | if (arguments.length >= 3) ctx.depth = arguments[2];
|
9647 | if (arguments.length >= 4) ctx.colors = arguments[3];
|
9648 | if (isBoolean(opts)) {
|
9649 |
|
9650 | ctx.showHidden = opts;
|
9651 | } else if (opts) {
|
9652 |
|
9653 | exports._extend(ctx, opts);
|
9654 | }
|
9655 |
|
9656 | if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
|
9657 | if (isUndefined(ctx.depth)) ctx.depth = 2;
|
9658 | if (isUndefined(ctx.colors)) ctx.colors = false;
|
9659 | if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
|
9660 | if (ctx.colors) ctx.stylize = stylizeWithColor;
|
9661 | return formatValue(ctx, obj, ctx.depth);
|
9662 | }
|
9663 | exports.inspect = inspect;
|
9664 |
|
9665 |
|
9666 |
|
9667 | inspect.colors = {
|
9668 | 'bold' : [1, 22],
|
9669 | 'italic' : [3, 23],
|
9670 | 'underline' : [4, 24],
|
9671 | 'inverse' : [7, 27],
|
9672 | 'white' : [37, 39],
|
9673 | 'grey' : [90, 39],
|
9674 | 'black' : [30, 39],
|
9675 | 'blue' : [34, 39],
|
9676 | 'cyan' : [36, 39],
|
9677 | 'green' : [32, 39],
|
9678 | 'magenta' : [35, 39],
|
9679 | 'red' : [31, 39],
|
9680 | 'yellow' : [33, 39]
|
9681 | };
|
9682 |
|
9683 |
|
9684 | inspect.styles = {
|
9685 | 'special': 'cyan',
|
9686 | 'number': 'yellow',
|
9687 | 'boolean': 'yellow',
|
9688 | 'undefined': 'grey',
|
9689 | 'null': 'bold',
|
9690 | 'string': 'green',
|
9691 | 'date': 'magenta',
|
9692 |
|
9693 | 'regexp': 'red'
|
9694 | };
|
9695 |
|
9696 |
|
9697 | function stylizeWithColor(str, styleType) {
|
9698 | var style = inspect.styles[styleType];
|
9699 |
|
9700 | if (style) {
|
9701 | return '\u001b[' + inspect.colors[style][0] + 'm' + str +
|
9702 | '\u001b[' + inspect.colors[style][1] + 'm';
|
9703 | } else {
|
9704 | return str;
|
9705 | }
|
9706 | }
|
9707 |
|
9708 |
|
9709 | function stylizeNoColor(str, styleType) {
|
9710 | return str;
|
9711 | }
|
9712 |
|
9713 |
|
9714 | function arrayToHash(array) {
|
9715 | var hash = {};
|
9716 |
|
9717 | array.forEach(function(val, idx) {
|
9718 | hash[val] = true;
|
9719 | });
|
9720 |
|
9721 | return hash;
|
9722 | }
|
9723 |
|
9724 |
|
9725 | function formatValue(ctx, value, recurseTimes) {
|
9726 |
|
9727 |
|
9728 | if (ctx.customInspect &&
|
9729 | value &&
|
9730 | isFunction(value.inspect) &&
|
9731 |
|
9732 | value.inspect !== exports.inspect &&
|
9733 |
|
9734 | !(value.constructor && value.constructor.prototype === value)) {
|
9735 | var ret = value.inspect(recurseTimes, ctx);
|
9736 | if (!isString(ret)) {
|
9737 | ret = formatValue(ctx, ret, recurseTimes);
|
9738 | }
|
9739 | return ret;
|
9740 | }
|
9741 |
|
9742 |
|
9743 | var primitive = formatPrimitive(ctx, value);
|
9744 | if (primitive) {
|
9745 | return primitive;
|
9746 | }
|
9747 |
|
9748 |
|
9749 | var keys = Object.keys(value);
|
9750 | var visibleKeys = arrayToHash(keys);
|
9751 |
|
9752 | if (ctx.showHidden) {
|
9753 | keys = Object.getOwnPropertyNames(value);
|
9754 | }
|
9755 |
|
9756 |
|
9757 |
|
9758 | if (isError(value)
|
9759 | && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
|
9760 | return formatError(value);
|
9761 | }
|
9762 |
|
9763 |
|
9764 | if (keys.length === 0) {
|
9765 | if (isFunction(value)) {
|
9766 | var name = value.name ? ': ' + value.name : '';
|
9767 | return ctx.stylize('[Function' + name + ']', 'special');
|
9768 | }
|
9769 | if (isRegExp(value)) {
|
9770 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
9771 | }
|
9772 | if (isDate(value)) {
|
9773 | return ctx.stylize(Date.prototype.toString.call(value), 'date');
|
9774 | }
|
9775 | if (isError(value)) {
|
9776 | return formatError(value);
|
9777 | }
|
9778 | }
|
9779 |
|
9780 | var base = '', array = false, braces = ['{', '}'];
|
9781 |
|
9782 |
|
9783 | if (isArray(value)) {
|
9784 | array = true;
|
9785 | braces = ['[', ']'];
|
9786 | }
|
9787 |
|
9788 |
|
9789 | if (isFunction(value)) {
|
9790 | var n = value.name ? ': ' + value.name : '';
|
9791 | base = ' [Function' + n + ']';
|
9792 | }
|
9793 |
|
9794 |
|
9795 | if (isRegExp(value)) {
|
9796 | base = ' ' + RegExp.prototype.toString.call(value);
|
9797 | }
|
9798 |
|
9799 |
|
9800 | if (isDate(value)) {
|
9801 | base = ' ' + Date.prototype.toUTCString.call(value);
|
9802 | }
|
9803 |
|
9804 |
|
9805 | if (isError(value)) {
|
9806 | base = ' ' + formatError(value);
|
9807 | }
|
9808 |
|
9809 | if (keys.length === 0 && (!array || value.length == 0)) {
|
9810 | return braces[0] + base + braces[1];
|
9811 | }
|
9812 |
|
9813 | if (recurseTimes < 0) {
|
9814 | if (isRegExp(value)) {
|
9815 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
9816 | } else {
|
9817 | return ctx.stylize('[Object]', 'special');
|
9818 | }
|
9819 | }
|
9820 |
|
9821 | ctx.seen.push(value);
|
9822 |
|
9823 | var output;
|
9824 | if (array) {
|
9825 | output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
|
9826 | } else {
|
9827 | output = keys.map(function(key) {
|
9828 | return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
|
9829 | });
|
9830 | }
|
9831 |
|
9832 | ctx.seen.pop();
|
9833 |
|
9834 | return reduceToSingleString(output, base, braces);
|
9835 | }
|
9836 |
|
9837 |
|
9838 | function formatPrimitive(ctx, value) {
|
9839 | if (isUndefined(value))
|
9840 | return ctx.stylize('undefined', 'undefined');
|
9841 | if (isString(value)) {
|
9842 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
9843 | .replace(/'/g, "\\'")
|
9844 | .replace(/\\"/g, '"') + '\'';
|
9845 | return ctx.stylize(simple, 'string');
|
9846 | }
|
9847 | if (isNumber(value))
|
9848 | return ctx.stylize('' + value, 'number');
|
9849 | if (isBoolean(value))
|
9850 | return ctx.stylize('' + value, 'boolean');
|
9851 |
|
9852 | if (isNull(value))
|
9853 | return ctx.stylize('null', 'null');
|
9854 | }
|
9855 |
|
9856 |
|
9857 | function formatError(value) {
|
9858 | return '[' + Error.prototype.toString.call(value) + ']';
|
9859 | }
|
9860 |
|
9861 |
|
9862 | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
9863 | var output = [];
|
9864 | for (var i = 0, l = value.length; i < l; ++i) {
|
9865 | if (hasOwnProperty(value, String(i))) {
|
9866 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
9867 | String(i), true));
|
9868 | } else {
|
9869 | output.push('');
|
9870 | }
|
9871 | }
|
9872 | keys.forEach(function(key) {
|
9873 | if (!key.match(/^\d+$/)) {
|
9874 | output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
9875 | key, true));
|
9876 | }
|
9877 | });
|
9878 | return output;
|
9879 | }
|
9880 |
|
9881 |
|
9882 | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
9883 | var name, str, desc;
|
9884 | desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
|
9885 | if (desc.get) {
|
9886 | if (desc.set) {
|
9887 | str = ctx.stylize('[Getter/Setter]', 'special');
|
9888 | } else {
|
9889 | str = ctx.stylize('[Getter]', 'special');
|
9890 | }
|
9891 | } else {
|
9892 | if (desc.set) {
|
9893 | str = ctx.stylize('[Setter]', 'special');
|
9894 | }
|
9895 | }
|
9896 | if (!hasOwnProperty(visibleKeys, key)) {
|
9897 | name = '[' + key + ']';
|
9898 | }
|
9899 | if (!str) {
|
9900 | if (ctx.seen.indexOf(desc.value) < 0) {
|
9901 | if (isNull(recurseTimes)) {
|
9902 | str = formatValue(ctx, desc.value, null);
|
9903 | } else {
|
9904 | str = formatValue(ctx, desc.value, recurseTimes - 1);
|
9905 | }
|
9906 | if (str.indexOf('\n') > -1) {
|
9907 | if (array) {
|
9908 | str = str.split('\n').map(function(line) {
|
9909 | return ' ' + line;
|
9910 | }).join('\n').substr(2);
|
9911 | } else {
|
9912 | str = '\n' + str.split('\n').map(function(line) {
|
9913 | return ' ' + line;
|
9914 | }).join('\n');
|
9915 | }
|
9916 | }
|
9917 | } else {
|
9918 | str = ctx.stylize('[Circular]', 'special');
|
9919 | }
|
9920 | }
|
9921 | if (isUndefined(name)) {
|
9922 | if (array && key.match(/^\d+$/)) {
|
9923 | return str;
|
9924 | }
|
9925 | name = JSON.stringify('' + key);
|
9926 | if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
9927 | name = name.substr(1, name.length - 2);
|
9928 | name = ctx.stylize(name, 'name');
|
9929 | } else {
|
9930 | name = name.replace(/'/g, "\\'")
|
9931 | .replace(/\\"/g, '"')
|
9932 | .replace(/(^"|"$)/g, "'");
|
9933 | name = ctx.stylize(name, 'string');
|
9934 | }
|
9935 | }
|
9936 |
|
9937 | return name + ': ' + str;
|
9938 | }
|
9939 |
|
9940 |
|
9941 | function reduceToSingleString(output, base, braces) {
|
9942 | var numLinesEst = 0;
|
9943 | var length = output.reduce(function(prev, cur) {
|
9944 | numLinesEst++;
|
9945 | if (cur.indexOf('\n') >= 0) numLinesEst++;
|
9946 | return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
|
9947 | }, 0);
|
9948 |
|
9949 | if (length > 60) {
|
9950 | return braces[0] +
|
9951 | (base === '' ? '' : base + '\n ') +
|
9952 | ' ' +
|
9953 | output.join(',\n ') +
|
9954 | ' ' +
|
9955 | braces[1];
|
9956 | }
|
9957 |
|
9958 | return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
9959 | }
|
9960 |
|
9961 |
|
9962 |
|
9963 |
|
9964 | function isArray(ar) {
|
9965 | return Array.isArray(ar);
|
9966 | }
|
9967 | exports.isArray = isArray;
|
9968 |
|
9969 | function isBoolean(arg) {
|
9970 | return typeof arg === 'boolean';
|
9971 | }
|
9972 | exports.isBoolean = isBoolean;
|
9973 |
|
9974 | function isNull(arg) {
|
9975 | return arg === null;
|
9976 | }
|
9977 | exports.isNull = isNull;
|
9978 |
|
9979 | function isNullOrUndefined(arg) {
|
9980 | return arg == null;
|
9981 | }
|
9982 | exports.isNullOrUndefined = isNullOrUndefined;
|
9983 |
|
9984 | function isNumber(arg) {
|
9985 | return typeof arg === 'number';
|
9986 | }
|
9987 | exports.isNumber = isNumber;
|
9988 |
|
9989 | function isString(arg) {
|
9990 | return typeof arg === 'string';
|
9991 | }
|
9992 | exports.isString = isString;
|
9993 |
|
9994 | function isSymbol(arg) {
|
9995 | return typeof arg === 'symbol';
|
9996 | }
|
9997 | exports.isSymbol = isSymbol;
|
9998 |
|
9999 | function isUndefined(arg) {
|
10000 | return arg === void 0;
|
10001 | }
|
10002 | exports.isUndefined = isUndefined;
|
10003 |
|
10004 | function isRegExp(re) {
|
10005 | return isObject(re) && objectToString(re) === '[object RegExp]';
|
10006 | }
|
10007 | exports.isRegExp = isRegExp;
|
10008 |
|
10009 | function isObject(arg) {
|
10010 | return typeof arg === 'object' && arg !== null;
|
10011 | }
|
10012 | exports.isObject = isObject;
|
10013 |
|
10014 | function isDate(d) {
|
10015 | return isObject(d) && objectToString(d) === '[object Date]';
|
10016 | }
|
10017 | exports.isDate = isDate;
|
10018 |
|
10019 | function isError(e) {
|
10020 | return isObject(e) &&
|
10021 | (objectToString(e) === '[object Error]' || e instanceof Error);
|
10022 | }
|
10023 | exports.isError = isError;
|
10024 |
|
10025 | function isFunction(arg) {
|
10026 | return typeof arg === 'function';
|
10027 | }
|
10028 | exports.isFunction = isFunction;
|
10029 |
|
10030 | function isPrimitive(arg) {
|
10031 | return arg === null ||
|
10032 | typeof arg === 'boolean' ||
|
10033 | typeof arg === 'number' ||
|
10034 | typeof arg === 'string' ||
|
10035 | typeof arg === 'symbol' ||
|
10036 | typeof arg === 'undefined';
|
10037 | }
|
10038 | exports.isPrimitive = isPrimitive;
|
10039 |
|
10040 | exports.isBuffer = __webpack_require__( 20);
|
10041 |
|
10042 | function objectToString(o) {
|
10043 | return Object.prototype.toString.call(o);
|
10044 | }
|
10045 |
|
10046 |
|
10047 | function pad(n) {
|
10048 | return n < 10 ? '0' + n.toString(10) : n.toString(10);
|
10049 | }
|
10050 |
|
10051 |
|
10052 | var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
|
10053 | 'Oct', 'Nov', 'Dec'];
|
10054 |
|
10055 |
|
10056 | function timestamp() {
|
10057 | var d = new Date();
|
10058 | var time = [pad(d.getHours()),
|
10059 | pad(d.getMinutes()),
|
10060 | pad(d.getSeconds())].join(':');
|
10061 | return [d.getDate(), months[d.getMonth()], time].join(' ');
|
10062 | }
|
10063 |
|
10064 |
|
10065 |
|
10066 | exports.log = function() {
|
10067 | console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
|
10068 | };
|
10069 |
|
10070 |
|
10071 |
|
10072 |
|
10073 |
|
10074 |
|
10075 |
|
10076 |
|
10077 |
|
10078 |
|
10079 |
|
10080 |
|
10081 |
|
10082 |
|
10083 |
|
10084 | exports.inherits = __webpack_require__( 21);
|
10085 |
|
10086 | exports._extend = function(origin, add) {
|
10087 |
|
10088 | if (!add || !isObject(add)) return origin;
|
10089 |
|
10090 | var keys = Object.keys(add);
|
10091 | var i = keys.length;
|
10092 | while (i--) {
|
10093 | origin[keys[i]] = add[keys[i]];
|
10094 | }
|
10095 | return origin;
|
10096 | };
|
10097 |
|
10098 | function hasOwnProperty(obj, prop) {
|
10099 | return Object.prototype.hasOwnProperty.call(obj, prop);
|
10100 | }
|
10101 |
|
10102 | }.call(exports, __webpack_require__( 0), __webpack_require__( 2)))
|
10103 |
|
10104 | }),
|
10105 |
|
10106 |
|
10107 |
|
10108 |
|
10109 |
|
10110 |
|
10111 | (function(module, exports) {
|
10112 |
|
10113 | module.exports = function isBuffer(arg) {
|
10114 | return arg && typeof arg === 'object'
|
10115 | && typeof arg.copy === 'function'
|
10116 | && typeof arg.fill === 'function'
|
10117 | && typeof arg.readUInt8 === 'function';
|
10118 | }
|
10119 |
|
10120 | }),
|
10121 |
|
10122 |
|
10123 |
|
10124 |
|
10125 |
|
10126 |
|
10127 | (function(module, exports) {
|
10128 |
|
10129 | if (typeof Object.create === 'function') {
|
10130 |
|
10131 | module.exports = function inherits(ctor, superCtor) {
|
10132 | ctor.super_ = superCtor
|
10133 | ctor.prototype = Object.create(superCtor.prototype, {
|
10134 | constructor: {
|
10135 | value: ctor,
|
10136 | enumerable: false,
|
10137 | writable: true,
|
10138 | configurable: true
|
10139 | }
|
10140 | });
|
10141 | };
|
10142 | } else {
|
10143 |
|
10144 | module.exports = function inherits(ctor, superCtor) {
|
10145 | ctor.super_ = superCtor
|
10146 | var TempCtor = function () {}
|
10147 | TempCtor.prototype = superCtor.prototype
|
10148 | ctor.prototype = new TempCtor()
|
10149 | ctor.prototype.constructor = ctor
|
10150 | }
|
10151 | }
|
10152 |
|
10153 |
|
10154 | }),
|
10155 |
|
10156 |
|
10157 |
|
10158 |
|
10159 |
|
10160 |
|
10161 | (function(module, __webpack_exports__, __webpack_require__) {
|
10162 |
|
10163 | "use strict";
|
10164 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Icons_vue__ = __webpack_require__( 24);
|
10165 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_15140f52_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Icons_vue__ = __webpack_require__( 27);
|
10166 | function injectStyle (ssrContext) {
|
10167 | __webpack_require__( 23)
|
10168 | }
|
10169 | var normalizeComponent = __webpack_require__( 3)
|
10170 |
|
10171 |
|
10172 |
|
10173 |
|
10174 |
|
10175 | var __vue_template_functional__ = false
|
10176 |
|
10177 | var __vue_styles__ = injectStyle
|
10178 |
|
10179 | var __vue_scopeId__ = null
|
10180 |
|
10181 | var __vue_module_identifier__ = null
|
10182 | var Component = normalizeComponent(
|
10183 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Icons_vue__["a" ],
|
10184 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_15140f52_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Icons_vue__["a" ],
|
10185 | __vue_template_functional__,
|
10186 | __vue_styles__,
|
10187 | __vue_scopeId__,
|
10188 | __vue_module_identifier__
|
10189 | )
|
10190 |
|
10191 | __webpack_exports__["a"] = (Component.exports);
|
10192 |
|
10193 |
|
10194 | }),
|
10195 |
|
10196 |
|
10197 |
|
10198 |
|
10199 |
|
10200 |
|
10201 | (function(module, exports) {
|
10202 |
|
10203 |
|
10204 |
|
10205 | }),
|
10206 |
|
10207 |
|
10208 |
|
10209 |
|
10210 |
|
10211 |
|
10212 | (function(module, __webpack_exports__, __webpack_require__) {
|
10213 |
|
10214 | "use strict";
|
10215 | var __WEBPACK_IMPORTED_MODULE_0__svg_to_component_loader_svg_github_svg__ = __webpack_require__( 25);
|
10216 | var __WEBPACK_IMPORTED_MODULE_1__svg_to_component_loader_svg_twitter_svg__ = __webpack_require__( 26);
|
10217 |
|
10218 |
|
10219 |
|
10220 |
|
10221 |
|
10222 |
|
10223 |
|
10224 |
|
10225 |
|
10226 |
|
10227 |
|
10228 |
|
10229 |
|
10230 |
|
10231 |
|
10232 | __webpack_exports__["a"] = ({
|
10233 | props: {
|
10234 | github: String,
|
10235 | twitter: String
|
10236 | },
|
10237 |
|
10238 | methods: {
|
10239 | getUrl: function getUrl(url, domain) {
|
10240 | return (/^https?:/.test(url) ? url : 'https://' + domain + '/' + url
|
10241 | );
|
10242 | }
|
10243 | },
|
10244 |
|
10245 | components: {
|
10246 | GitHub: __WEBPACK_IMPORTED_MODULE_0__svg_to_component_loader_svg_github_svg__["a" ],
|
10247 | Twitter: __WEBPACK_IMPORTED_MODULE_1__svg_to_component_loader_svg_twitter_svg__["a" ]
|
10248 | }
|
10249 | });
|
10250 |
|
10251 | }),
|
10252 |
|
10253 |
|
10254 |
|
10255 |
|
10256 |
|
10257 |
|
10258 | (function(module, __webpack_exports__, __webpack_require__) {
|
10259 |
|
10260 | "use strict";
|
10261 | var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__ = __webpack_require__( 4);
|
10262 | var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__);
|
10263 |
|
10264 | __webpack_exports__["a"] = ({
|
10265 | name: 'Github',
|
10266 | functional: true,
|
10267 | render: function (h, ctx) {
|
10268 | return h(
|
10269 | "svg",
|
10270 | __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default()([{
|
10271 | attrs: { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
10272 | "class": "feather feather-github" }, ctx.data]),
|
10273 | [h(
|
10274 | "path",
|
10275 | {
|
10276 | attrs: { d: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" }
|
10277 | },
|
10278 | []
|
10279 | )]
|
10280 | );
|
10281 | }
|
10282 | });
|
10283 |
|
10284 | }),
|
10285 |
|
10286 |
|
10287 |
|
10288 |
|
10289 |
|
10290 |
|
10291 | (function(module, __webpack_exports__, __webpack_require__) {
|
10292 |
|
10293 | "use strict";
|
10294 | var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__ = __webpack_require__( 4);
|
10295 | var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__);
|
10296 |
|
10297 | __webpack_exports__["a"] = ({
|
10298 | name: 'Twitter',
|
10299 | functional: true,
|
10300 | render: function (h, ctx) {
|
10301 | return h(
|
10302 | "svg",
|
10303 | __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default()([{
|
10304 | attrs: { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" },
|
10305 | "class": "feather feather-twitter" }, ctx.data]),
|
10306 | [h(
|
10307 | "path",
|
10308 | {
|
10309 | attrs: { d: "M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z" }
|
10310 | },
|
10311 | []
|
10312 | )]
|
10313 | );
|
10314 | }
|
10315 | });
|
10316 |
|
10317 | }),
|
10318 |
|
10319 |
|
10320 |
|
10321 |
|
10322 |
|
10323 |
|
10324 | (function(module, __webpack_exports__, __webpack_require__) {
|
10325 |
|
10326 | "use strict";
|
10327 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"aimer-icons"},[(_vm.github)?_c('a',{staticClass:"aimer-icon",attrs:{"target":"_blank","href":_vm.getUrl(_vm.github, 'github.com')}},[_c('git-hub')],1):_vm._e(),_vm._v(" "),(_vm.twitter)?_c('a',{staticClass:"aimer-icon",attrs:{"target":"_blank","href":_vm.getUrl(_vm.twitter, 'twitter.com')}},[_c('twitter')],1):_vm._e()])}
|
10328 | var staticRenderFns = []
|
10329 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
10330 | __webpack_exports__["a"] = (esExports);
|
10331 |
|
10332 | }),
|
10333 |
|
10334 |
|
10335 |
|
10336 |
|
10337 |
|
10338 |
|
10339 | (function(module, __webpack_exports__, __webpack_require__) {
|
10340 |
|
10341 | "use strict";
|
10342 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"aimer"}},[_c('header',{staticClass:"aimer-header"},[_c('div',{staticClass:"aimer-header__left"},[(!_vm.config.title)?_c('a',{attrs:{"href":"https://github.com/egoist/aimer","target":"_blank"}},[_c('h1',{staticClass:"aimer-brand"},[_vm._v("\n Aimer\n ")])]):_c('h1',{staticClass:"aimer-title"},[_c('a',{attrs:{"href":"./"}},[_vm._v(_vm._s(_vm.config.title))])]),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentStorySlug),expression:"currentStorySlug"}],on:{"change":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentStorySlug=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},_vm.handleRender]}},_vm._l((_vm.stories),function(story,index){return _c('option',{key:story.title,domProps:{"value":story.slug}},[_vm._v("\n "+_vm._s(story.title)+"\n ")])}))]),_vm._v(" "),_c('div',{staticClass:"aimer-header__right"},[_c('icons',{attrs:{"github":_vm.config.github,"twitter":_vm.config.twitter}})],1)]),_vm._v(" "),_c('section',{staticClass:"aimer-main"},[_c('div',{staticClass:"aimer-cell aimer-component"},[_c('div',{ref:"targetWrapper",staticClass:"aimer-target-wrapper"})]),_vm._v(" "),(_vm.currentStory.example)?_c('div',{staticClass:"aimer-cell aimer-tabs"},[_c('div',{staticClass:"aimer-tab-headers"},[(_vm.currentStory.readme)?_c('div',{staticClass:"aimer-tab-header",class:{'aimer-tab-header__active': _vm.currentTab === 'readme'},on:{"click":function($event){_vm.chooseTab('readme')}}},[_vm._v("\n README\n ")]):_vm._e(),_vm._v(" "),(_vm.currentStory.example)?_c('div',{staticClass:"aimer-tab-header",class:{'aimer-tab-header__active': _vm.currentTab === 'example'},on:{"click":function($event){_vm.chooseTab('example')}}},[_vm._v("\n Example\n ")]):_vm._e()]),_vm._v(" "),(_vm.currentStory.readme && _vm.currentTab === 'readme')?_c('div',{staticClass:"aimer-tab-readme markdown-body",domProps:{"innerHTML":_vm._s(_vm.currentStory.readme)}}):_vm._e(),_vm._v(" "),(_vm.currentStory.example && _vm.currentTab === 'example')?_c('div',{staticClass:"aimer-tab-example"},[_c('pre',[_c('code',[_vm._v(_vm._s(_vm.currentStory.example))])])]):_vm._e()]):_vm._e()])])}
|
10343 | var staticRenderFns = []
|
10344 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
10345 | __webpack_exports__["a"] = (esExports);
|
10346 |
|
10347 | })
|
10348 | ]);
|
10349 | }); |
\ | No newline at end of file |