diff --git a/CHANGELOG.md b/CHANGELOG.md index 4894ca8..62a0360 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,17 @@ - Option to configure the poll interval (defaults to 1500ms) - Show spinner on running project - Show badge (passed/failed) for each project -- Button to run all tests on all projects +- Button to run all tests on all (filtered) projects +- Added AVA tester +- Test state to log modal +- Option to run test from the log modal +- Option to reset state of all projects ### Changed - Allow better configuration of editor's binary - Moved Laravel related classes out from Vendor\Laravel - Completely restructure package directory - License is now MIT +- Improved regex matcher of editable source files (and lines) ### Fixed - Abending when tester used in suite does not exists - Piper script not being diff --git a/package.json b/package.json index ea4c016..427f589 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,7 @@ "vuex": "^2.4.0", "webpack-livereload-plugin": "^0.11.0" }, - "dependencies": {} + "dependencies": { + "csspin": "^1.1.4" + } } diff --git a/src/package/Data/Repositories/Support/Helpers.php b/src/package/Data/Repositories/Support/Helpers.php index 546cffa..ce7b7fa 100644 --- a/src/package/Data/Repositories/Support/Helpers.php +++ b/src/package/Data/Repositories/Support/Helpers.php @@ -128,15 +128,17 @@ public function getAnsiConverter() } /** - * Get the default editor binary. + * Get the default editor. + * + * @return array */ - protected function getDefaultEditorBinary() + protected function getDefaultEditor() { if (is_null($default = collect(config('ci.editors'))->where('default', true)->first())) { die('FATAL ERROR: default editor not configured'); } - return $default['bin']; + return $default; } /** @@ -148,11 +150,23 @@ protected function getDefaultEditorBinary() */ protected function getEditorBinary($suite) { - if (empty($suite) || is_null($bin = config("ci.editors.{$suite->editor}.bin"))) { - return $this->getDefaultEditorBinary(); + return $this->getEditor($suite)['bin']; + } + + /** + * Get the editor. + * + * @param $suite + * + * @return array + */ + protected function getEditor($suite) + { + if (empty($suite) || is_null($editor = config("ci.editors.{$suite->editor}"))) { + return $this->getDefaultEditor(); } - return $bin; + return $editor; } /** diff --git a/src/package/Data/Repositories/Support/Tests.php b/src/package/Data/Repositories/Support/Tests.php index 3e3cb3a..8b38f00 100644 --- a/src/package/Data/Repositories/Support/Tests.php +++ b/src/package/Data/Repositories/Support/Tests.php @@ -74,6 +74,7 @@ protected function getTestInfo($test) 'updated_at' => $test->updated_at->diffForHumans(), 'state' => $test->state, 'enabled' => $test->enabled, + 'editor_name' => $this->getEditor($test->suite)['name'], 'run' => $run, 'notified_at' => is_null($run) ? null : $run->notified_at, diff --git a/src/package/Http/Controllers/Projects.php b/src/package/Http/Controllers/Projects.php index 72abc21..920ea31 100644 --- a/src/package/Http/Controllers/Projects.php +++ b/src/package/Http/Controllers/Projects.php @@ -46,4 +46,17 @@ public function run(Request $request) return $this->success(); } + + /** + * Reset projects tests states. + * + * @param Request $request + * @return mixed + */ + public function reset(Request $request) + { + $this->dataRepository->reset($request->get('projects')); + + return $this->success(); + } } diff --git a/src/public/css/app.css b/src/public/css/app.css index 46727f7..84248e3 100644 --- a/src/public/css/app.css +++ b/src/public/css/app.css @@ -9191,10 +9191,1147 @@ a.text-dark:hover { visibility: hidden !important; } +.cp-spinner { + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + position: relative; +} + +.cp-round:before { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px #bababa; + border-right: solid 6px #bababa; + border-bottom: solid 6px #bababa; + border-left: solid 6px #bababa; + position: absolute; + top: 0; + left: 0; +} + +.cp-round:after { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px #f56151; + border-right: solid 6px transparent; + border-bottom: solid 6px transparent; + border-left: solid 6px transparent; + position: absolute; + top: 0; + left: 0; + -webkit-animation: cp-round-animate 1s ease-in-out infinite; + animation: cp-round-animate 1s ease-in-out infinite; +} + +@-webkit-keyframes cp-round-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes cp-round-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +.cp-pinwheel { + border-radius: 50%; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 24px #0fd6ff; + border-right: solid 24px #58bd55; + border-bottom: solid 24px #eb68a1; + border-left: solid 24px #f3d53f; + -webkit-animation: cp-pinwheel-animate 1s linear infinite; + animation: cp-pinwheel-animate 1s linear infinite; +} + +@-webkit-keyframes cp-pinwheel-animate { + 0% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 25% { + border-top-color: #eb68a1; + border-right-color: #f3d53f; + border-bottom-color: #0fd6ff; + border-left-color: #58bd55; + } + + 50% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + } + + 75% { + border-top-color: #eb68a1; + border-right-color: #f3d53f; + border-bottom-color: #0fd6ff; + border-left-color: #58bd55; + } + + 100% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes cp-pinwheel-animate { + 0% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 25% { + border-top-color: #eb68a1; + border-right-color: #f3d53f; + border-bottom-color: #0fd6ff; + border-left-color: #58bd55; + } + + 50% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + } + + 75% { + border-top-color: #eb68a1; + border-right-color: #f3d53f; + border-bottom-color: #0fd6ff; + border-left-color: #58bd55; + } + + 100% { + border-top-color: #0fd6ff; + border-right-color: #58bd55; + border-bottom-color: #eb68a1; + border-left-color: #f3d53f; + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +.cp-balls { + -webkit-animation: cp-balls-animate 1s linear infinite; + animation: cp-balls-animate 1s linear infinite; +} + +.cp-balls:before { + border-radius: 50%; + content: " "; + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #0fd6ff; + position: absolute; + top: 0; + left: 0; + -webkit-animation: cp-balls-animate-before 1s ease-in-out infinite; + animation: cp-balls-animate-before 1s ease-in-out infinite; +} + +.cp-balls:after { + border-radius: 50%; + content: " "; + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #eb68a1; + position: absolute; + bottom: 0; + right: 0; + -webkit-animation: cp-balls-animate-after 1s ease-in-out infinite; + animation: cp-balls-animate-after 1s ease-in-out infinite; +} + +@-webkit-keyframes cp-balls-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes cp-balls-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-webkit-keyframes cp-balls-animate-before { + 0% { + -webkit-transform: translate(-5px, -5px); + transform: translate(-5px, -5px); + } + + 50% { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); + } + + 100% { + -webkit-transform: translate(-5px, -5px); + transform: translate(-5px, -5px); + } +} + +@keyframes cp-balls-animate-before { + 0% { + -webkit-transform: translate(-5px, -5px); + transform: translate(-5px, -5px); + } + + 50% { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); + } + + 100% { + -webkit-transform: translate(-5px, -5px); + transform: translate(-5px, -5px); + } +} + +@-webkit-keyframes cp-balls-animate-after { + 0% { + -webkit-transform: translate(5px, 5px); + transform: translate(5px, 5px); + } + + 50% { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); + } + + 100% { + -webkit-transform: translate(5px, 5px); + transform: translate(5px, 5px); + } +} + +@keyframes cp-balls-animate-after { + 0% { + -webkit-transform: translate(5px, 5px); + transform: translate(5px, 5px); + } + + 50% { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); + } + + 100% { + -webkit-transform: translate(5px, 5px); + transform: translate(5px, 5px); + } +} + +.cp-bubble { + border-radius: 50%; + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #58bd55; + -webkit-animation: cp-bubble-animate 1s linear infinite; + animation: cp-bubble-animate 1s linear infinite; +} + +.cp-bubble:before { + border-radius: 50%; + content: " "; + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #58bd55; + position: absolute; + left: -30px; + -webkit-animation: cp-bubble-animate-before 1s ease-in-out infinite; + animation: cp-bubble-animate-before 1s ease-in-out infinite; +} + +.cp-bubble:after { + border-radius: 50%; + content: " "; + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #58bd55; + position: absolute; + right: -30px; + -webkit-animation: cp-bubble-animate-after 1s ease-in-out infinite; + animation: cp-bubble-animate-after 1s ease-in-out infinite; +} + +@-webkit-keyframes cp-bubble-animate { + 0% { + opacity: .5; + -webkit-transform: scale(1) translateX(0); + transform: scale(1) translateX(0); + } + + 25% { + opacity: 1; + -webkit-transform: scale(1.1) translateX(-15px); + transform: scale(1.1) translateX(-15px); + } + + 50% { + opacity: 1; + -webkit-transform: scale(1.2) translateX(15px); + transform: scale(1.2) translateX(15px); + } + + 100% { + opacity: .5; + -webkit-transform: scale(1) translateX(0); + transform: scale(1) translateX(0); + } +} + +@keyframes cp-bubble-animate { + 0% { + opacity: .5; + -webkit-transform: scale(1) translateX(0); + transform: scale(1) translateX(0); + } + + 25% { + opacity: 1; + -webkit-transform: scale(1.1) translateX(-15px); + transform: scale(1.1) translateX(-15px); + } + + 50% { + opacity: 1; + -webkit-transform: scale(1.2) translateX(15px); + transform: scale(1.2) translateX(15px); + } + + 100% { + opacity: .5; + -webkit-transform: scale(1) translateX(0); + transform: scale(1) translateX(0); + } +} + +@-webkit-keyframes cp-bubble-animate-before { + 0% { + opacity: .5; + -webkit-transform: scale(1); + transform: scale(1); + } + + 25% { + -webkit-transform: scale(1.1); + transform: scale(1.1); + } + + 100%, 50% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes cp-bubble-animate-before { + 0% { + opacity: .5; + -webkit-transform: scale(1); + transform: scale(1); + } + + 25% { + -webkit-transform: scale(1.1); + transform: scale(1.1); + } + + 100%, 50% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@-webkit-keyframes cp-bubble-animate-after { + 0%, 50% { + opacity: .5; + -webkit-transform: scale(1); + transform: scale(1); + } + + 50% { + -webkit-transform: scale(1.1); + transform: scale(1.1); + } + + 100%, 75% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes cp-bubble-animate-after { + 0%, 50% { + opacity: .5; + -webkit-transform: scale(1); + transform: scale(1); + } + + 50% { + -webkit-transform: scale(1.1); + transform: scale(1.1); + } + + 100%, 75% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +.cp-flip { + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-perspective: 10em; + perspective: 10em; +} + +.cp-flip:before { + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #f56151; + content: " "; + position: absolute; + top: 0; + left: 0; + -webkit-animation: cp-flip-animate-before 2s linear infinite; + animation: cp-flip-animate-before 2s linear infinite; +} + +@-webkit-keyframes cp-flip-animate-before { + 0% { + -webkit-transform: rotateY(0) rotateX(0); + transform: rotateY(0) rotateX(0); + } + + 25% { + -webkit-transform: rotateY(360deg) rotateX(0); + transform: rotateY(360deg) rotateX(0); + } + + 50% { + -webkit-transform: rotateY(360deg) rotateX(360deg); + transform: rotateY(360deg) rotateX(360deg); + } + + 75% { + -webkit-transform: rotateY(0) rotateX(360deg); + transform: rotateY(0) rotateX(360deg); + } + + 100% { + -webkit-transform: rotateY(0) rotateX(0); + transform: rotateY(0) rotateX(0); + } +} + +@keyframes cp-flip-animate-before { + 0% { + -webkit-transform: rotateY(0) rotateX(0); + transform: rotateY(0) rotateX(0); + } + + 25% { + -webkit-transform: rotateY(360deg) rotateX(0); + transform: rotateY(360deg) rotateX(0); + } + + 50% { + -webkit-transform: rotateY(360deg) rotateX(360deg); + transform: rotateY(360deg) rotateX(360deg); + } + + 75% { + -webkit-transform: rotateY(0) rotateX(360deg); + transform: rotateY(0) rotateX(360deg); + } + + 100% { + -webkit-transform: rotateY(0) rotateX(0); + transform: rotateY(0) rotateX(0); + } +} + +.cp-hue { + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #f56151; + border-radius: 50%; + -webkit-animation: cp-hue-animate 1s ease-in-out infinite; + animation: cp-hue-animate 1s ease-in-out infinite; +} + +.cp-hue:before { + border-radius: 0 12px 12px 0; + content: " "; + width: 12px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #fff; + position: absolute; + top: 0; + right: 0; + -webkit-animation: cp-hue-animate-before 1s ease-in-out infinite; + animation: cp-hue-animate-before 1s ease-in-out infinite; +} + +@-webkit-keyframes cp-hue-animate { + 0% { + background: #f56151; + } + + 25% { + background: #58bd55; + } + + 50% { + background: #eb68a1; + } + + 75% { + background: #f3d53f; + } + + 100% { + background: #f56151; + } +} + +@keyframes cp-hue-animate { + 0% { + background: #f56151; + } + + 25% { + background: #58bd55; + } + + 50% { + background: #eb68a1; + } + + 75% { + background: #f3d53f; + } + + 100% { + background: #f56151; + } +} + +@-webkit-keyframes cp-hue-animate-before { + 0% { + -webkit-transform: rotateY(0); + transform: rotateY(0); + -webkit-transform-origin: left center; + transform-origin: left center; + opacity: .5; + } + + 30%, 70% { + -webkit-transform: rotateY(180deg); + transform: rotateY(180deg); + -webkit-transform-origin: left center; + transform-origin: left center; + opacity: .2; + } + + 100% { + -webkit-transform: rotateY(0); + transform: rotateY(0); + opacity: .5; + } +} + +@keyframes cp-hue-animate-before { + 0% { + -webkit-transform: rotateY(0); + transform: rotateY(0); + -webkit-transform-origin: left center; + transform-origin: left center; + opacity: .5; + } + + 30%, 70% { + -webkit-transform: rotateY(180deg); + transform: rotateY(180deg); + -webkit-transform-origin: left center; + transform-origin: left center; + opacity: .2; + } + + 100% { + -webkit-transform: rotateY(0); + transform: rotateY(0); + opacity: .5; + } +} + +.cp-skeleton { + border-radius: 50%; + border-top: solid 6px #f56151; + border-right: solid 6px transparent; + border-bottom: solid 6px transparent; + border-left: solid 6px transparent; + -webkit-animation: cp-skeleton-animate 1s linear infinite; + animation: cp-skeleton-animate 1s linear infinite; +} + +.cp-skeleton:before { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px transparent; + border-right: solid 6px transparent; + border-bottom: solid 6px transparent; + border-left: solid 6px #f56151; + position: absolute; + top: -6px; + left: -6px; + -webkit-transform: rotateZ(-30deg); + transform: rotateZ(-30deg); +} + +.cp-skeleton:after { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px transparent; + border-right: solid 6px #f56151; + border-bottom: solid 6px transparent; + border-left: solid 6px transparent; + position: absolute; + top: -6px; + right: -6px; + -webkit-transform: rotateZ(30deg); + transform: rotateZ(30deg); +} + +@-webkit-keyframes cp-skeleton-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + opacity: 1; + } + + 50% { + opacity: .7; + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + opacity: 1; + } +} + +@keyframes cp-skeleton-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + opacity: 1; + } + + 50% { + opacity: .7; + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + opacity: 1; + } +} + +.cp-eclipse { + width: 12px; + height: 12px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-radius: 50%; + background: #f3d53f; + margin: 12px; + -webkit-animation: cp-eclipse-animate 1s ease-out infinite; + animation: cp-eclipse-animate 1s ease-out infinite; +} + +.cp-eclipse:before { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px transparent; + border-right: solid 6px #f3d53f; + border-bottom: solid 6px transparent; + border-left: solid 6px transparent; + position: absolute; + top: -18px; + left: -18px; +} + +.cp-eclipse:after { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px transparent; + border-right: solid 6px transparent; + border-bottom: solid 6px transparent; + border-left: solid 6px #f3d53f; + position: absolute; + top: -18px; + right: -18px; +} + +@-webkit-keyframes cp-eclipse-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes cp-eclipse-animate { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +.cp-boxes:before { + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + content: " "; + background: #58bd55; + position: absolute; + top: 12px; + left: 0; + -webkit-animation: cp-boxes-animate-before 1s ease-in-out infinite; + animation: cp-boxes-animate-before 1s ease-in-out infinite; +} + +.cp-boxes:after { + width: 24px; + height: 24px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + content: " "; + background: #58bd55; + position: absolute; + top: 12px; + right: 0; + -webkit-animation: cp-boxes-animate-after 1s ease-in-out infinite; + animation: cp-boxes-animate-after 1s ease-in-out infinite; +} + +@-webkit-keyframes cp-boxes-animate-before { + 0% { + -webkit-transform: translateX(-24px) rotate(45deg); + transform: translateX(-24px) rotate(45deg); + } + + 50% { + -webkit-transform: translateX(-8px) rotate(225deg); + transform: translateX(-8px) rotate(225deg); + } + + 100% { + -webkit-transform: translateX(-24px) rotate(45deg); + transform: translateX(-24px) rotate(45deg); + } +} + +@keyframes cp-boxes-animate-before { + 0% { + -webkit-transform: translateX(-24px) rotate(45deg); + transform: translateX(-24px) rotate(45deg); + } + + 50% { + -webkit-transform: translateX(-8px) rotate(225deg); + transform: translateX(-8px) rotate(225deg); + } + + 100% { + -webkit-transform: translateX(-24px) rotate(45deg); + transform: translateX(-24px) rotate(45deg); + } +} + +@-webkit-keyframes cp-boxes-animate-after { + 0% { + -webkit-transform: translateX(24px) rotate(45deg); + transform: translateX(24px) rotate(45deg); + } + + 50% { + -webkit-transform: translateX(8px) rotate(-225deg); + transform: translateX(8px) rotate(-225deg); + } + + 100% { + -webkit-transform: translateX(24px) rotate(45deg); + transform: translateX(24px) rotate(45deg); + } +} + +@keyframes cp-boxes-animate-after { + 0% { + -webkit-transform: translateX(24px) rotate(45deg); + transform: translateX(24px) rotate(45deg); + } + + 50% { + -webkit-transform: translateX(8px) rotate(-225deg); + transform: translateX(8px) rotate(-225deg); + } + + 100% { + -webkit-transform: translateX(24px) rotate(45deg); + transform: translateX(24px) rotate(45deg); + } +} + +.cp-morph { + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #0fd6ff; + -webkit-animation: cp-morph-animate 1s linear infinite; + animation: cp-morph-animate 1s linear infinite; +} + +@-webkit-keyframes cp-morph-animate { + 0% { + -webkit-transform: rotate(0) scale(1); + transform: rotate(0) scale(1); + border-radius: 0; + background: #f3d53f; + } + + 25%, 75% { + -webkit-transform: rotate(180deg) scale(0.4); + transform: rotate(180deg) scale(0.4); + border-radius: 50%; + background: #0fd6ff; + } + + 100% { + -webkit-transform: rotate(360deg) scale(1); + transform: rotate(360deg) scale(1); + border-radius: 0; + background: #f3d53f; + } +} + +@keyframes cp-morph-animate { + 0% { + -webkit-transform: rotate(0) scale(1); + transform: rotate(0) scale(1); + border-radius: 0; + background: #f3d53f; + } + + 25%, 75% { + -webkit-transform: rotate(180deg) scale(0.4); + transform: rotate(180deg) scale(0.4); + border-radius: 50%; + background: #0fd6ff; + } + + 100% { + -webkit-transform: rotate(360deg) scale(1); + transform: rotate(360deg) scale(1); + border-radius: 0; + background: #f3d53f; + } +} + +.cp-heart { + -webkit-animation: cp-heart-animate 2s ease-in-out infinite; + animation: cp-heart-animate 2s ease-in-out infinite; +} + +.cp-heart:before { + border-radius: 12px 12px 0 0; + content: " "; + width: 24px; + height: 35px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #eb68a1; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + position: absolute; + top: 0; + left: 8px; +} + +.cp-heart:after { + border-radius: 12px 12px 0 0; + content: " "; + width: 24px; + height: 35px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #eb68a1; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + top: 0; + right: 8px; +} + +@-webkit-keyframes cp-heart-animate { + 0% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } + + 15% { + -webkit-transform: scale(1.4); + transform: scale(1.4); + -webkit-transform-origin: center; + transform-origin: center; + } + + 30% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } + + 45% { + -webkit-transform: scale(1.4); + transform: scale(1.4); + -webkit-transform-origin: center; + transform-origin: center; + } + + 100%, 60% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } +} + +@keyframes cp-heart-animate { + 0% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } + + 15% { + -webkit-transform: scale(1.4); + transform: scale(1.4); + -webkit-transform-origin: center; + transform-origin: center; + } + + 30% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } + + 45% { + -webkit-transform: scale(1.4); + transform: scale(1.4); + -webkit-transform-origin: center; + transform-origin: center; + } + + 100%, 60% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + -webkit-transform-origin: center; + transform-origin: center; + } +} + +.cp-meter { + border-radius: 50%; + border-top: solid 6px #0fd6ff; + border-right: solid 6px #0fd6ff; + border-bottom: solid 6px #0fd6ff; + border-left: solid 6px #0fd6ff; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.cp-meter:before { + border-radius: 3px; + content: " "; + width: 6px; + height: 12px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background-color: #0fd6ff; + position: absolute; + top: 5px; + left: 16px; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + -webkit-animation: cp-meter-animate-before 1s linear infinite; + animation: cp-meter-animate-before 1s linear infinite; +} + +@-webkit-keyframes cp-meter-animate-before { + 0% { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + + 100% { + -webkit-transform: rotate(315deg); + transform: rotate(315deg); + } +} + +@keyframes cp-meter-animate-before { + 0% { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + + 100% { + -webkit-transform: rotate(315deg); + transform: rotate(315deg); + } +} + body { color: #444444; - font-family: 'Arsenal'; - font-weight: 800; + font-family: 'Arial'; + font-weight: 500; } /* @@ -9222,11 +10359,11 @@ body { .table-header { vertical-align: middle; margin-bottom: 15px; + font-weight: 800; } .table-header .title { font-size: 1.8em; - font-weight: 800; } .dim { @@ -9252,7 +10389,6 @@ body { } th { - font-weight: 800; font-size: 1.3em; } @@ -9279,10 +10415,10 @@ a:hover.file { .project-title { color: #fdfdfd; text-transform: lowercase; - font-weight: 800; font-size: 1.8em; margin-top: -7px; margin-bottom: 7px; + font-weight: 800; } .search-project { @@ -9309,7 +10445,6 @@ a:hover.file { .list-group-item { cursor: pointer; - font-weight: 800; border: 1px solid rgba(0, 0, 0, 0.125); } @@ -9351,12 +10486,6 @@ list-group-item, background-color: #000000; } -h1, -h2, -h3 { - font-weight: 800; -} - /* * Buttons */ @@ -9510,6 +10639,7 @@ h3 { } .table-test-path { + font-size: 0.7rem; font-weight: 100 !important; color: #ccd3d8; } @@ -9529,3 +10659,13 @@ h3 { margin-right: 5px; } +.cursor-pointer { + cursor: pointer; +} + +h1, +h2, +h3 { + font-weight: 800; +} + diff --git a/src/public/img/ring-spinner.svg b/src/public/img/ring-spinner.svg new file mode 100644 index 0000000..a5b1ab3 --- /dev/null +++ b/src/public/img/ring-spinner.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/public/js/app.js b/src/public/js/app.js index 41eeeeb..573d1bd 100644 --- a/src/public/js/app.js +++ b/src/public/js/app.js @@ -387,7 +387,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; }); /** - * vuex v2.4.1 + * vuex v2.5.0 * (c) 2017 Evan You * @license MIT */ @@ -632,26 +632,44 @@ function update (path, targetModule, newModule) { } } +var functionAssert = { + assert: function (value) { return typeof value === 'function'; }, + expected: 'function' +}; + +var objectAssert = { + assert: function (value) { return typeof value === 'function' || + (typeof value === 'object' && typeof value.handler === 'function'); }, + expected: 'function or object with "handler" function' +}; + +var assertTypes = { + getters: functionAssert, + mutations: functionAssert, + actions: objectAssert +}; + function assertRawModule (path, rawModule) { - ['getters', 'actions', 'mutations'].forEach(function (key) { + Object.keys(assertTypes).forEach(function (key) { if (!rawModule[key]) { return } + var assertOptions = assertTypes[key]; + forEachValue(rawModule[key], function (value, type) { assert( - typeof value === 'function', - makeAssertionMessage(path, key, type, value) + assertOptions.assert(value), + makeAssertionMessage(path, key, type, value, assertOptions.expected) ); }); }); } -function makeAssertionMessage (path, key, type, value) { - var buf = key + " should be function but \"" + key + "." + type + "\""; +function makeAssertionMessage (path, key, type, value, expected) { + var buf = key + " should be " + expected + " but \"" + key + "." + type + "\""; if (path.length > 0) { buf += " in module \"" + (path.join('.')) + "\""; } buf += " is " + (JSON.stringify(value)) + "."; - return buf } @@ -679,12 +697,13 @@ var Store = function Store (options) { var state = options.state; if ( state === void 0 ) state = {}; if (typeof state === 'function') { - state = state(); + state = state() || {}; } // store internal state this._committing = false; this._actions = Object.create(null); + this._actionSubscribers = []; this._mutations = Object.create(null); this._wrappedGetters = Object.create(null); this._modules = new ModuleCollection(options); @@ -772,11 +791,14 @@ Store.prototype.commit = function commit (_type, _payload, _options) { }; Store.prototype.dispatch = function dispatch (_type, _payload) { + var this$1 = this; + // check object-style dispatch var ref = unifyObjectStyle(_type, _payload); var type = ref.type; var payload = ref.payload; + var action = { type: type, payload: payload }; var entry = this._actions[type]; if (!entry) { if (true) { @@ -784,22 +806,20 @@ Store.prototype.dispatch = function dispatch (_type, _payload) { } return } + + this._actionSubscribers.forEach(function (sub) { return sub(action, this$1.state); }); + return entry.length > 1 ? Promise.all(entry.map(function (handler) { return handler(payload); })) : entry[0](payload) }; Store.prototype.subscribe = function subscribe (fn) { - var subs = this._subscribers; - if (subs.indexOf(fn) < 0) { - subs.push(fn); - } - return function () { - var i = subs.indexOf(fn); - if (i > -1) { - subs.splice(i, 1); - } - } + return genericSubscribe(fn, this._subscribers) +}; + +Store.prototype.subscribeAction = function subscribeAction (fn) { + return genericSubscribe(fn, this._actionSubscribers) }; Store.prototype.watch = function watch (getter, cb, options) { @@ -819,7 +839,9 @@ Store.prototype.replaceState = function replaceState (state) { }); }; -Store.prototype.registerModule = function registerModule (path, rawModule) { +Store.prototype.registerModule = function registerModule (path, rawModule, options) { + if ( options === void 0 ) options = {}; + if (typeof path === 'string') { path = [path]; } if (true) { @@ -828,7 +850,7 @@ Store.prototype.registerModule = function registerModule (path, rawModule) { } this._modules.register(path, rawModule); - installModule(this, this.state, path, this._modules.get(path)); + installModule(this, this.state, path, this._modules.get(path), options.preserveState); // reset store to update getters... resetStoreVM(this, this.state); }; @@ -864,6 +886,18 @@ Store.prototype._withCommit = function _withCommit (fn) { Object.defineProperties( Store.prototype, prototypeAccessors ); +function genericSubscribe (fn, subs) { + if (subs.indexOf(fn) < 0) { + subs.push(fn); + } + return function () { + var i = subs.indexOf(fn); + if (i > -1) { + subs.splice(i, 1); + } + } +} + function resetStore (store, hot) { store._actions = Object.create(null); store._mutations = Object.create(null); @@ -948,8 +982,9 @@ function installModule (store, rootState, path, module, hot) { }); module.forEachAction(function (action, key) { - var namespacedType = namespace + key; - registerAction(store, namespacedType, action, local); + var type = action.root ? key : namespace + key; + var handler = action.handler || action; + registerAction(store, type, handler, local); }); module.forEachGetter(function (getter, key) { @@ -1272,7 +1307,7 @@ function getModuleByNamespace (store, helper, namespace) { var index_esm = { Store: Store, install: install, - version: '2.4.1', + version: '2.5.0', mapState: mapState, mapMutations: mapMutations, mapGetters: mapGetters, @@ -1290,12 +1325,14 @@ var index_esm = { /* globals __VUE_SSR_CONTEXT__ */ -// this module is a runtime utility for cleaner component module output and will -// be included in the final webpack user bundle +// IMPORTANT: Do NOT use ES2015 features in this file. +// This module is a runtime utility for cleaner component module output and will +// be included in the final webpack user bundle. module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, + functionalTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ @@ -1319,6 +1356,12 @@ module.exports = function normalizeComponent ( if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns + options._compiled = true + } + + // functional template + if (functionalTemplate) { + options.functional = true } // scopedId @@ -1359,12 +1402,16 @@ module.exports = function normalizeComponent ( var existing = functional ? options.render : options.beforeCreate + if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { + // for template-only hot-reload because in that case the render fn doesn't + // go through the normalizer + options._injectStyles = hook // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) @@ -36628,8 +36675,8 @@ module.exports = function spread(callback) { /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! - * Vue.js v2.4.4 +/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! + * Vue.js v2.5.2 * (c) 2014-2017 Evan You * Released under the MIT License. */ @@ -36675,8 +36722,15 @@ function isObject (obj) { return obj !== null && typeof obj === 'object' } +/** + * Get the raw type string of a value e.g. [object Object] + */ var _toString = Object.prototype.toString; +function toRawType (value) { + return _toString.call(value).slice(8, -1) +} + /** * Strict object type check. Only returns true * for plain JavaScript objects. @@ -36693,7 +36747,7 @@ function isRegExp (v) { * Check if val is a valid array index. */ function isValidArrayIndex (val) { - var n = parseFloat(val); + var n = parseFloat(String(val)); return n >= 0 && Math.floor(n) === n && isFinite(val) } @@ -36743,7 +36797,7 @@ var isBuiltInTag = makeMap('slot,component', true); /** * Check if a attribute is a reserved attribute. */ -var isReservedAttribute = makeMap('key,ref,slot,is'); +var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); /** * Remove an item from an array @@ -36953,7 +37007,8 @@ var LIFECYCLE_HOOKS = [ 'beforeDestroy', 'destroyed', 'activated', - 'deactivated' + 'deactivated', + 'errorCaptured' ]; /* */ @@ -37088,120 +37143,6 @@ function parsePath (path) { /* */ -var warn = noop; -var tip = noop; -var formatComponentName = (null); // work around flow check - -if (true) { - var hasConsole = typeof console !== 'undefined'; - var classifyRE = /(?:^|[-_])(\w)/g; - var classify = function (str) { return str - .replace(classifyRE, function (c) { return c.toUpperCase(); }) - .replace(/[-_]/g, ''); }; - - warn = function (msg, vm) { - var trace = vm ? generateComponentTrace(vm) : ''; - - if (config.warnHandler) { - config.warnHandler.call(null, msg, vm, trace); - } else if (hasConsole && (!config.silent)) { - console.error(("[Vue warn]: " + msg + trace)); - } - }; - - tip = function (msg, vm) { - if (hasConsole && (!config.silent)) { - console.warn("[Vue tip]: " + msg + ( - vm ? generateComponentTrace(vm) : '' - )); - } - }; - - formatComponentName = function (vm, includeFile) { - if (vm.$root === vm) { - return '' - } - var name = typeof vm === 'string' - ? vm - : typeof vm === 'function' && vm.options - ? vm.options.name - : vm._isVue - ? vm.$options.name || vm.$options._componentTag - : vm.name; - - var file = vm._isVue && vm.$options.__file; - if (!name && file) { - var match = file.match(/([^/\\]+)\.vue$/); - name = match && match[1]; - } - - return ( - (name ? ("<" + (classify(name)) + ">") : "") + - (file && includeFile !== false ? (" at " + file) : '') - ) - }; - - var repeat = function (str, n) { - var res = ''; - while (n) { - if (n % 2 === 1) { res += str; } - if (n > 1) { str += str; } - n >>= 1; - } - return res - }; - - var generateComponentTrace = function (vm) { - if (vm._isVue && vm.$parent) { - var tree = []; - var currentRecursiveSequence = 0; - while (vm) { - if (tree.length > 0) { - var last = tree[tree.length - 1]; - if (last.constructor === vm.constructor) { - currentRecursiveSequence++; - vm = vm.$parent; - continue - } else if (currentRecursiveSequence > 0) { - tree[tree.length - 1] = [last, currentRecursiveSequence]; - currentRecursiveSequence = 0; - } - } - tree.push(vm); - vm = vm.$parent; - } - return '\n\nfound in\n\n' + tree - .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) - ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") - : formatComponentName(vm))); }) - .join('\n') - } else { - return ("\n\n(found in " + (formatComponentName(vm)) + ")") - } - }; -} - -/* */ - -function handleError (err, vm, info) { - if (config.errorHandler) { - config.errorHandler.call(null, err, vm, info); - } else { - if (true) { - warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); - } - /* istanbul ignore else */ - if (inBrowser && typeof console !== 'undefined') { - console.error(err); - } else { - throw err - } - } -} - -/* */ -/* globals MutationObserver */ - // can we use __proto__? var hasProto = '__proto__' in {}; @@ -37261,94 +37202,8 @@ var hasSymbol = typeof Symbol !== 'undefined' && isNative(Symbol) && typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); -/** - * Defer a task to execute it asynchronously. - */ -var nextTick = (function () { - var callbacks = []; - var pending = false; - var timerFunc; - - function nextTickHandler () { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - for (var i = 0; i < copies.length; i++) { - copies[i](); - } - } - - // the nextTick behavior leverages the microtask queue, which can be accessed - // via either native Promise.then or MutationObserver. - // MutationObserver has wider support, however it is seriously bugged in - // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It - // completely stops working after triggering a few times... so, if native - // Promise is available, we will use it: - /* istanbul ignore if */ - if (typeof Promise !== 'undefined' && isNative(Promise)) { - var p = Promise.resolve(); - var logError = function (err) { console.error(err); }; - timerFunc = function () { - p.then(nextTickHandler).catch(logError); - // in problematic UIWebViews, Promise.then doesn't completely break, but - // it can get stuck in a weird state where callbacks are pushed into the - // microtask queue but the queue isn't being flushed, until the browser - // needs to do some other work, e.g. handle a timer. Therefore we can - // "force" the microtask queue to be flushed by adding an empty timer. - if (isIOS) { setTimeout(noop); } - }; - } else if (!isIE && typeof MutationObserver !== 'undefined' && ( - isNative(MutationObserver) || - // PhantomJS and iOS 7.x - MutationObserver.toString() === '[object MutationObserverConstructor]' - )) { - // use MutationObserver where native Promise is not available, - // e.g. PhantomJS, iOS7, Android 4.4 - var counter = 1; - var observer = new MutationObserver(nextTickHandler); - var textNode = document.createTextNode(String(counter)); - observer.observe(textNode, { - characterData: true - }); - timerFunc = function () { - counter = (counter + 1) % 2; - textNode.data = String(counter); - }; - } else { - // fallback to setTimeout - /* istanbul ignore next */ - timerFunc = function () { - setTimeout(nextTickHandler, 0); - }; - } - - return function queueNextTick (cb, ctx) { - var _resolve; - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - handleError(e, ctx, 'nextTick'); - } - } else if (_resolve) { - _resolve(ctx); - } - }); - if (!pending) { - pending = true; - timerFunc(); - } - if (!cb && typeof Promise !== 'undefined') { - return new Promise(function (resolve, reject) { - _resolve = resolve; - }) - } - } -})(); - var _Set; -/* istanbul ignore if */ +/* istanbul ignore if */ // $flow-disable-line if (typeof Set !== 'undefined' && isNative(Set)) { // use native Set when available. _Set = Set; @@ -37374,6 +37229,100 @@ if (typeof Set !== 'undefined' && isNative(Set)) { /* */ +var warn = noop; +var tip = noop; +var generateComponentTrace = (noop); // work around flow check +var formatComponentName = (noop); + +if (true) { + var hasConsole = typeof console !== 'undefined'; + var classifyRE = /(?:^|[-_])(\w)/g; + var classify = function (str) { return str + .replace(classifyRE, function (c) { return c.toUpperCase(); }) + .replace(/[-_]/g, ''); }; + + warn = function (msg, vm) { + var trace = vm ? generateComponentTrace(vm) : ''; + + if (config.warnHandler) { + config.warnHandler.call(null, msg, vm, trace); + } else if (hasConsole && (!config.silent)) { + console.error(("[Vue warn]: " + msg + trace)); + } + }; + + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + ( + vm ? generateComponentTrace(vm) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { + if (vm.$root === vm) { + return '' + } + var options = typeof vm === 'function' && vm.cid != null + ? vm.options + : vm._isVue + ? vm.$options || vm.constructor.options + : vm || {}; + var name = options.name || options._componentTag; + var file = options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + + return ( + (name ? ("<" + (classify(name)) + ">") : "") + + (file && includeFile !== false ? (" at " + file) : '') + ) + }; + + var repeat = function (str, n) { + var res = ''; + while (n) { + if (n % 2 === 1) { res += str; } + if (n > 1) { str += str; } + n >>= 1; + } + return res + }; + + generateComponentTrace = function (vm) { + if (vm._isVue && vm.$parent) { + var tree = []; + var currentRecursiveSequence = 0; + while (vm) { + if (tree.length > 0) { + var last = tree[tree.length - 1]; + if (last.constructor === vm.constructor) { + currentRecursiveSequence++; + vm = vm.$parent; + continue + } else if (currentRecursiveSequence > 0) { + tree[tree.length - 1] = [last, currentRecursiveSequence]; + currentRecursiveSequence = 0; + } + } + tree.push(vm); + vm = vm.$parent; + } + return '\n\nfound in\n\n' + tree + .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) + ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") + : formatComponentName(vm))); }) + .join('\n') + } else { + return ("\n\n(found in " + (formatComponentName(vm)) + ")") + } + }; +} + +/* */ + var uid = 0; @@ -37423,6 +37372,101 @@ function popTarget () { Dep.target = targetStack.pop(); } +/* */ + +var VNode = function VNode ( + tag, + data, + children, + text, + elm, + context, + componentOptions, + asyncFactory +) { + this.tag = tag; + this.data = data; + this.children = children; + this.text = text; + this.elm = elm; + this.ns = undefined; + this.context = context; + this.functionalContext = undefined; + this.functionalOptions = undefined; + this.functionalScopeId = undefined; + this.key = data && data.key; + this.componentOptions = componentOptions; + this.componentInstance = undefined; + this.parent = undefined; + this.raw = false; + this.isStatic = false; + this.isRootInsert = true; + this.isComment = false; + this.isCloned = false; + this.isOnce = false; + this.asyncFactory = asyncFactory; + this.asyncMeta = undefined; + this.isAsyncPlaceholder = false; +}; + +var prototypeAccessors = { child: { configurable: true } }; + +// DEPRECATED: alias for componentInstance for backwards compat. +/* istanbul ignore next */ +prototypeAccessors.child.get = function () { + return this.componentInstance +}; + +Object.defineProperties( VNode.prototype, prototypeAccessors ); + +var createEmptyVNode = function (text) { + if ( text === void 0 ) text = ''; + + var node = new VNode(); + node.text = text; + node.isComment = true; + return node +}; + +function createTextVNode (val) { + return new VNode(undefined, undefined, undefined, String(val)) +} + +// optimized shallow clone +// used for static nodes and slot nodes because they may be reused across +// multiple renders, cloning them avoids errors when DOM manipulations rely +// on their elm reference. +function cloneVNode (vnode, deep) { + var cloned = new VNode( + vnode.tag, + vnode.data, + vnode.children, + vnode.text, + vnode.elm, + vnode.context, + vnode.componentOptions, + vnode.asyncFactory + ); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.isCloned = true; + if (deep && vnode.children) { + cloned.children = cloneVNodes(vnode.children); + } + return cloned +} + +function cloneVNodes (vnodes, deep) { + var len = vnodes.length; + var res = new Array(len); + for (var i = 0; i < len; i++) { + res[i] = cloneVNode(vnodes[i], deep); + } + return res +} + /* * not type checking this file because flow doesn't play well with * dynamically accessing methods on Array prototype @@ -37508,7 +37552,7 @@ var Observer = function Observer (value) { Observer.prototype.walk = function walk (obj) { var keys = Object.keys(obj); for (var i = 0; i < keys.length; i++) { - defineReactive$$1(obj, keys[i], obj[keys[i]]); + defineReactive(obj, keys[i], obj[keys[i]]); } }; @@ -37551,7 +37595,7 @@ function copyAugment (target, src, keys) { * or the existing observer if the value already has one. */ function observe (value, asRootData) { - if (!isObject(value)) { + if (!isObject(value) || value instanceof VNode) { return } var ob; @@ -37575,7 +37619,7 @@ function observe (value, asRootData) { /** * Define a reactive property on an Object. */ -function defineReactive$$1 ( +function defineReactive ( obj, key, val, @@ -37658,7 +37702,7 @@ function set (target, key, val) { target[key] = val; return val } - defineReactive$$1(ob.value, key, val); + defineReactive(ob.value, key, val); ob.dep.notify(); return val } @@ -37841,11 +37885,19 @@ LIFECYCLE_HOOKS.forEach(function (hook) { * a three-way merge between constructor options, instance * options and parent options. */ -function mergeAssets (parentVal, childVal) { +function mergeAssets ( + parentVal, + childVal, + vm, + key +) { var res = Object.create(parentVal || null); - return childVal - ? extend(res, childVal) - : res + if (childVal) { + "development" !== 'production' && assertObjectType(key, childVal, vm); + return extend(res, childVal) + } else { + return res + } } ASSET_TYPES.forEach(function (type) { @@ -37858,22 +37910,30 @@ ASSET_TYPES.forEach(function (type) { * Watchers hashes should not overwrite one * another, so we merge them as arrays. */ -strats.watch = function (parentVal, childVal) { +strats.watch = function ( + parentVal, + childVal, + vm, + key +) { // work around Firefox's Object.prototype.watch... if (parentVal === nativeWatch) { parentVal = undefined; } if (childVal === nativeWatch) { childVal = undefined; } /* istanbul ignore if */ if (!childVal) { return Object.create(parentVal || null) } + if (true) { + assertObjectType(key, childVal, vm); + } if (!parentVal) { return childVal } var ret = {}; extend(ret, parentVal); - for (var key in childVal) { - var parent = ret[key]; - var child = childVal[key]; + for (var key$1 in childVal) { + var parent = ret[key$1]; + var child = childVal[key$1]; if (parent && !Array.isArray(parent)) { parent = [parent]; } - ret[key] = parent + ret[key$1] = parent ? parent.concat(child) : Array.isArray(child) ? child : [child]; } @@ -37886,7 +37946,15 @@ strats.watch = function (parentVal, childVal) { strats.props = strats.methods = strats.inject = -strats.computed = function (parentVal, childVal) { +strats.computed = function ( + parentVal, + childVal, + vm, + key +) { + if (childVal && "development" !== 'production') { + assertObjectType(key, childVal, vm); + } if (!parentVal) { return childVal } var ret = Object.create(null); extend(ret, parentVal); @@ -37923,7 +37991,7 @@ function checkComponents (options) { * Ensure all props option syntax are normalized into the * Object-based format. */ -function normalizeProps (options) { +function normalizeProps (options, vm) { var props = options.props; if (!props) { return } var res = {}; @@ -37947,6 +38015,12 @@ function normalizeProps (options) { ? val : { type: val }; } + } else if (true) { + warn( + "Invalid value for option \"props\": expected an Array or an Object, " + + "but got " + (toRawType(props)) + ".", + vm + ); } options.props = res; } @@ -37954,13 +38028,26 @@ function normalizeProps (options) { /** * Normalize all injections into Object-based format */ -function normalizeInject (options) { +function normalizeInject (options, vm) { var inject = options.inject; + var normalized = options.inject = {}; if (Array.isArray(inject)) { - var normalized = options.inject = {}; for (var i = 0; i < inject.length; i++) { - normalized[inject[i]] = inject[i]; + normalized[inject[i]] = { from: inject[i] }; } + } else if (isPlainObject(inject)) { + for (var key in inject) { + var val = inject[key]; + normalized[key] = isPlainObject(val) + ? extend({ from: key }, val) + : { from: val }; + } + } else if ("development" !== 'production' && inject) { + warn( + "Invalid value for option \"inject\": expected an Array or an Object, " + + "but got " + (toRawType(inject)) + ".", + vm + ); } } @@ -37979,6 +38066,16 @@ function normalizeDirectives (options) { } } +function assertObjectType (name, value, vm) { + if (!isPlainObject(value)) { + warn( + "Invalid value for option \"" + name + "\": expected an Object, " + + "but got " + (toRawType(value)) + ".", + vm + ); + } +} + /** * Merge two option objects into a new one. * Core utility used in both instantiation and inheritance. @@ -37996,8 +38093,8 @@ function mergeOptions ( child = child.options; } - normalizeProps(child); - normalizeInject(child); + normalizeProps(child, vm); + normalizeInject(child, vm); normalizeDirectives(child); var extendsFrom = child.extends; if (extendsFrom) { @@ -38161,9 +38258,9 @@ function assertProp ( } if (!valid) { warn( - 'Invalid prop: type check failed for prop "' + name + '".' + - ' Expected ' + expectedTypes.map(capitalize).join(', ') + - ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', + "Invalid prop: type check failed for prop \"" + name + "\"." + + " Expected " + (expectedTypes.map(capitalize).join(', ')) + + ", got " + (toRawType(value)) + ".", vm ); return @@ -38229,6 +38326,165 @@ function isType (type, fn) { /* */ +function handleError (err, vm, info) { + if (vm) { + var cur = vm; + while ((cur = cur.$parent)) { + var hooks = cur.$options.errorCaptured; + if (hooks) { + for (var i = 0; i < hooks.length; i++) { + try { + var capture = hooks[i].call(cur, err, vm, info) === false; + if (capture) { return } + } catch (e) { + globalHandleError(e, cur, 'errorCaptured hook'); + } + } + } + } + } + globalHandleError(err, vm, info); +} + +function globalHandleError (err, vm, info) { + if (config.errorHandler) { + try { + return config.errorHandler.call(null, err, vm, info) + } catch (e) { + logError(e, null, 'config.errorHandler'); + } + } + logError(err, vm, info); +} + +function logError (err, vm, info) { + if (true) { + warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); + } + /* istanbul ignore else */ + if (inBrowser && typeof console !== 'undefined') { + console.error(err); + } else { + throw err + } +} + +/* */ +/* globals MessageChannel */ + +var callbacks = []; +var pending = false; + +function flushCallbacks () { + pending = false; + var copies = callbacks.slice(0); + callbacks.length = 0; + for (var i = 0; i < copies.length; i++) { + copies[i](); + } +} + +// Here we have async deferring wrappers using both micro and macro tasks. +// In < 2.4 we used micro tasks everywhere, but there are some scenarios where +// micro tasks have too high a priority and fires in between supposedly +// sequential events (e.g. #4521, #6690) or even between bubbling of the same +// event (#6566). However, using macro tasks everywhere also has subtle problems +// when state is changed right before repaint (e.g. #6813, out-in transitions). +// Here we use micro task by default, but expose a way to force macro task when +// needed (e.g. in event handlers attached by v-on). +var microTimerFunc; +var macroTimerFunc; +var useMacroTask = false; + +// Determine (macro) Task defer implementation. +// Technically setImmediate should be the ideal choice, but it's only available +// in IE. The only polyfill that consistently queues the callback after all DOM +// events triggered in the same loop is by using MessageChannel. +/* istanbul ignore if */ +if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { + macroTimerFunc = function () { + setImmediate(flushCallbacks); + }; +} else if (typeof MessageChannel !== 'undefined' && ( + isNative(MessageChannel) || + // PhantomJS + MessageChannel.toString() === '[object MessageChannelConstructor]' +)) { + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = flushCallbacks; + macroTimerFunc = function () { + port.postMessage(1); + }; +} else { + /* istanbul ignore next */ + macroTimerFunc = function () { + setTimeout(flushCallbacks, 0); + }; +} + +// Determine MicroTask defer implementation. +/* istanbul ignore next, $flow-disable-line */ +if (typeof Promise !== 'undefined' && isNative(Promise)) { + var p = Promise.resolve(); + microTimerFunc = function () { + p.then(flushCallbacks); + // in problematic UIWebViews, Promise.then doesn't completely break, but + // it can get stuck in a weird state where callbacks are pushed into the + // microtask queue but the queue isn't being flushed, until the browser + // needs to do some other work, e.g. handle a timer. Therefore we can + // "force" the microtask queue to be flushed by adding an empty timer. + if (isIOS) { setTimeout(noop); } + }; +} else { + // fallback to macro + microTimerFunc = macroTimerFunc; +} + +/** + * Wrap a function so that if any code inside triggers state change, + * the changes are queued using a Task instead of a MicroTask. + */ +function withMacroTask (fn) { + return fn._withTask || (fn._withTask = function () { + useMacroTask = true; + var res = fn.apply(null, arguments); + useMacroTask = false; + return res + }) +} + +function nextTick (cb, ctx) { + var _resolve; + callbacks.push(function () { + if (cb) { + try { + cb.call(ctx); + } catch (e) { + handleError(e, ctx, 'nextTick'); + } + } else if (_resolve) { + _resolve(ctx); + } + }); + if (!pending) { + pending = true; + if (useMacroTask) { + macroTimerFunc(); + } else { + microTimerFunc(); + } + } + // $flow-disable-line + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve; + }) + } +} + +/* */ + var mark; var measure; @@ -38267,8 +38523,10 @@ if (true) { var warnNonPresent = function (target, key) { warn( "Property or method \"" + key + "\" is not defined on the instance but " + - "referenced during render. Make sure to declare reactive data " + - "properties in the data option.", + 'referenced during render. Make sure that this property is reactive, ' + + 'either in the data option, or for class-based components, by ' + + 'initializing the property. ' + + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target ); }; @@ -38278,7 +38536,7 @@ if (true) { Proxy.toString().match(/native code/); if (hasProxy) { - var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta'); + var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); config.keyCodes = new Proxy(config.keyCodes, { set: function set (target, key, value) { if (isBuiltInModifier(key)) { @@ -38328,99 +38586,6 @@ if (true) { /* */ -var VNode = function VNode ( - tag, - data, - children, - text, - elm, - context, - componentOptions, - asyncFactory -) { - this.tag = tag; - this.data = data; - this.children = children; - this.text = text; - this.elm = elm; - this.ns = undefined; - this.context = context; - this.functionalContext = undefined; - this.key = data && data.key; - this.componentOptions = componentOptions; - this.componentInstance = undefined; - this.parent = undefined; - this.raw = false; - this.isStatic = false; - this.isRootInsert = true; - this.isComment = false; - this.isCloned = false; - this.isOnce = false; - this.asyncFactory = asyncFactory; - this.asyncMeta = undefined; - this.isAsyncPlaceholder = false; -}; - -var prototypeAccessors = { child: {} }; - -// DEPRECATED: alias for componentInstance for backwards compat. -/* istanbul ignore next */ -prototypeAccessors.child.get = function () { - return this.componentInstance -}; - -Object.defineProperties( VNode.prototype, prototypeAccessors ); - -var createEmptyVNode = function (text) { - if ( text === void 0 ) text = ''; - - var node = new VNode(); - node.text = text; - node.isComment = true; - return node -}; - -function createTextVNode (val) { - return new VNode(undefined, undefined, undefined, String(val)) -} - -// optimized shallow clone -// used for static nodes and slot nodes because they may be reused across -// multiple renders, cloning them avoids errors when DOM manipulations rely -// on their elm reference. -function cloneVNode (vnode, deep) { - var cloned = new VNode( - vnode.tag, - vnode.data, - vnode.children, - vnode.text, - vnode.elm, - vnode.context, - vnode.componentOptions, - vnode.asyncFactory - ); - cloned.ns = vnode.ns; - cloned.isStatic = vnode.isStatic; - cloned.key = vnode.key; - cloned.isComment = vnode.isComment; - cloned.isCloned = true; - if (deep && vnode.children) { - cloned.children = cloneVNodes(vnode.children); - } - return cloned -} - -function cloneVNodes (vnodes, deep) { - var len = vnodes.length; - var res = new Array(len); - for (var i = 0; i < len; i++) { - res[i] = cloneVNode(vnodes[i], deep); - } - return res -} - -/* */ - var normalizeEvent = cached(function (name) { var passive = name.charAt(0) === '&'; name = passive ? name.slice(1) : name; @@ -38428,10 +38593,8 @@ var normalizeEvent = cached(function (name) { name = once$$1 ? name.slice(1) : name; var capture = name.charAt(0) === '!'; name = capture ? name.slice(1) : name; - var plain = !(passive || once$$1 || capture); return { name: name, - plain: plain, once: once$$1, capture: capture, passive: passive @@ -38457,11 +38620,6 @@ function createFnInvoker (fns) { return invoker } -// #6552 -function prioritizePlainEvents (a, b) { - return a.plain ? -1 : b.plain ? 1 : 0 -} - function updateListeners ( on, oldOn, @@ -38470,13 +38628,10 @@ function updateListeners ( vm ) { var name, cur, old, event; - var toAdd = []; - var hasModifier = false; for (name in on) { cur = on[name]; old = oldOn[name]; event = normalizeEvent(name); - if (!event.plain) { hasModifier = true; } if (isUndef(cur)) { "development" !== 'production' && warn( "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), @@ -38486,20 +38641,12 @@ function updateListeners ( if (isUndef(cur.fns)) { cur = on[name] = createFnInvoker(cur); } - event.handler = cur; - toAdd.push(event); + add(event.name, cur, event.once, event.capture, event.passive); } else if (cur !== old) { old.fns = cur; on[name] = old; } } - if (toAdd.length) { - if (hasModifier) { toAdd.sort(prioritizePlainEvents); } - for (var i = 0; i < toAdd.length; i++) { - var event$1 = toAdd[i]; - add(event$1.name, event$1.handler, event$1.once, event$1.capture, event$1.passive); - } - } for (name in oldOn) { if (isUndef(on[name])) { event = normalizeEvent(name); @@ -38649,20 +38796,29 @@ function isTextNode (node) { function normalizeArrayChildren (children, nestedIndex) { var res = []; - var i, c, last; + var i, c, lastIndex, last; for (i = 0; i < children.length; i++) { c = children[i]; if (isUndef(c) || typeof c === 'boolean') { continue } - last = res[res.length - 1]; + lastIndex = res.length - 1; + last = res[lastIndex]; // nested if (Array.isArray(c)) { - res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i))); + if (c.length > 0) { + c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); + // merge adjacent text nodes + if (isTextNode(c[0]) && isTextNode(last)) { + res[lastIndex] = createTextVNode(last.text + (c[0]).text); + c.shift(); + } + res.push.apply(res, c); + } } else if (isPrimitive(c)) { if (isTextNode(last)) { // merge adjacent text nodes // this is necessary for SSR hydration because text nodes are // essentially merged when rendered to HTML strings - (last).text += String(c); + res[lastIndex] = createTextVNode(last.text + c); } else if (c !== '') { // convert primitive to vnode res.push(createTextVNode(c)); @@ -38670,7 +38826,7 @@ function normalizeArrayChildren (children, nestedIndex) { } else { if (isTextNode(c) && isTextNode(last)) { // merge adjacent text nodes - res[res.length - 1] = createTextVNode(last.text + c.text); + res[lastIndex] = createTextVNode(last.text + c.text); } else { // default key for nested array children (likely generated by v-for) if (isTrue(children._isVList) && @@ -38689,7 +38845,10 @@ function normalizeArrayChildren (children, nestedIndex) { /* */ function ensureCtor (comp, base) { - if (comp.__esModule && comp.default) { + if ( + comp.__esModule || + (hasSymbol && comp[Symbol.toStringTag] === 'Module') + ) { comp = comp.default; } return isObject(comp) @@ -38847,8 +39006,8 @@ function initEvents (vm) { var target; -function add (event, fn, once$$1) { - if (once$$1) { +function add (event, fn, once) { + if (once) { target.$once(event, fn); } else { target.$on(event, fn); @@ -39151,6 +39310,10 @@ function lifecycleMixin (Vue) { if (vm.$el) { vm.$el.__vue__ = null; } + // release circular reference (#6759) + if (vm.$vnode) { + vm.$vnode.parent = null; + } }; } @@ -39194,12 +39357,12 @@ function mountComponent ( mark(startTag); var vnode = vm._render(); mark(endTag); - measure((name + " render"), startTag, endTag); + measure(("vue " + name + " render"), startTag, endTag); mark(startTag); vm._update(vnode, hydrating); mark(endTag); - measure((name + " patch"), startTag, endTag); + measure(("vue " + name + " patch"), startTag, endTag); }; } else { updateComponent = function () { @@ -39759,16 +39922,6 @@ function initState (vm) { } } -function checkOptionType (vm, name) { - var option = vm.$options[name]; - if (!isPlainObject(option)) { - warn( - ("component option \"" + name + "\" should be an object."), - vm - ); - } -} - function initProps (vm, propsOptions) { var propsData = vm.$options.propsData || {}; var props = vm._props = {}; @@ -39783,13 +39936,15 @@ function initProps (vm, propsOptions) { var value = validateProp(key, propsOptions, propsData, vm); /* istanbul ignore else */ if (true) { - if (isReservedAttribute(key) || config.isReservedAttr(key)) { + var hyphenatedKey = hyphenate(key); + if (isReservedAttribute(hyphenatedKey) || + config.isReservedAttr(hyphenatedKey)) { warn( - ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."), + ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), vm ); } - defineReactive$$1(props, key, value, function () { + defineReactive(props, key, value, function () { if (vm.$parent && !isUpdatingChildComponent) { warn( "Avoid mutating a prop directly since the value will be " + @@ -39801,7 +39956,7 @@ function initProps (vm, propsOptions) { } }); } else { - defineReactive$$1(props, key, value); + defineReactive(props, key, value); } // static props are already proxied on the component's prototype // during Vue.extend(). We only need to proxy props defined at @@ -39859,7 +40014,7 @@ function initData (vm) { function getData (data, vm) { try { - return data.call(vm) + return data.call(vm, vm) } catch (e) { handleError(e, vm, "data()"); return {} @@ -39869,7 +40024,6 @@ function getData (data, vm) { var computedWatcherOptions = { lazy: true }; function initComputed (vm, computed) { - "development" !== 'production' && checkOptionType(vm, 'computed'); var watchers = vm._computedWatchers = Object.create(null); // computed properties are just getters during SSR var isSSR = isServerRendering(); @@ -39958,7 +40112,6 @@ function createComputedGetter (key) { } function initMethods (vm, methods) { - "development" !== 'production' && checkOptionType(vm, 'methods'); var props = vm.$options.props; for (var key in methods) { if (true) { @@ -39987,7 +40140,6 @@ function initMethods (vm, methods) { } function initWatch (vm, watch) { - "development" !== 'production' && checkOptionType(vm, 'watch'); for (var key in watch) { var handler = watch[key]; if (Array.isArray(handler)) { @@ -40081,7 +40233,7 @@ function initInjections (vm) { Object.keys(result).forEach(function (key) { /* istanbul ignore else */ if (true) { - defineReactive$$1(vm, key, result[key], function () { + defineReactive(vm, key, result[key], function () { warn( "Avoid mutating an injected value directly since the changes will be " + "overwritten whenever the provided component re-renders. " + @@ -40090,7 +40242,7 @@ function initInjections (vm) { ); }); } else { - defineReactive$$1(vm, key, result[key]); + defineReactive(vm, key, result[key]); } }); observerState.shouldConvert = true; @@ -40110,7 +40262,7 @@ function resolveInject (inject, vm) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; - var provideKey = inject[key]; + var provideKey = inject[key].from; var source = vm; while (source) { if (source._provided && provideKey in source._provided) { @@ -40119,8 +40271,15 @@ function resolveInject (inject, vm) { } source = source.$parent; } - if ("development" !== 'production' && !source) { - warn(("Injection \"" + key + "\" not found"), vm); + if (!source) { + if ('default' in inject[key]) { + var provideDefault = inject[key].default; + result[key] = typeof provideDefault === 'function' + ? provideDefault.call(vm) + : provideDefault; + } else if (true) { + warn(("Injection \"" + key + "\" not found"), vm); + } } } return result @@ -40129,15 +40288,327 @@ function resolveInject (inject, vm) { /* */ +/** + * Runtime helper for rendering v-for lists. + */ +function renderList ( + val, + render +) { + var ret, i, l, keys, key; + if (Array.isArray(val) || typeof val === 'string') { + ret = new Array(val.length); + for (i = 0, l = val.length; i < l; i++) { + ret[i] = render(val[i], i); + } + } else if (typeof val === 'number') { + ret = new Array(val); + for (i = 0; i < val; i++) { + ret[i] = render(i + 1, i); + } + } else if (isObject(val)) { + keys = Object.keys(val); + ret = new Array(keys.length); + for (i = 0, l = keys.length; i < l; i++) { + key = keys[i]; + ret[i] = render(val[key], key, i); + } + } + if (isDef(ret)) { + (ret)._isVList = true; + } + return ret +} + +/* */ + +/** + * Runtime helper for rendering + */ +function renderSlot ( + name, + fallback, + props, + bindObject +) { + var scopedSlotFn = this.$scopedSlots[name]; + if (scopedSlotFn) { // scoped slot + props = props || {}; + if (bindObject) { + if ("development" !== 'production' && !isObject(bindObject)) { + warn( + 'slot v-bind without argument expects an Object', + this + ); + } + props = extend(extend({}, bindObject), props); + } + return scopedSlotFn(props) || fallback + } else { + var slotNodes = this.$slots[name]; + // warn duplicate slot usage + if (slotNodes && "development" !== 'production') { + slotNodes._rendered && warn( + "Duplicate presence of slot \"" + name + "\" found in the same render tree " + + "- this will likely cause render errors.", + this + ); + slotNodes._rendered = true; + } + return slotNodes || fallback + } +} + +/* */ + +/** + * Runtime helper for resolving filters + */ +function resolveFilter (id) { + return resolveAsset(this.$options, 'filters', id, true) || identity +} + +/* */ + +/** + * Runtime helper for checking keyCodes from config. + * exposed as Vue.prototype._k + * passing in eventKeyName as last argument separately for backwards compat + */ +function checkKeyCodes ( + eventKeyCode, + key, + builtInAlias, + eventKeyName +) { + var keyCodes = config.keyCodes[key] || builtInAlias; + if (keyCodes) { + if (Array.isArray(keyCodes)) { + return keyCodes.indexOf(eventKeyCode) === -1 + } else { + return keyCodes !== eventKeyCode + } + } else if (eventKeyName) { + return hyphenate(eventKeyName) !== key + } +} + +/* */ + +/** + * Runtime helper for merging v-bind="object" into a VNode's data. + */ +function bindObjectProps ( + data, + tag, + value, + asProp, + isSync +) { + if (value) { + if (!isObject(value)) { + "development" !== 'production' && warn( + 'v-bind without argument expects an Object or Array value', + this + ); + } else { + if (Array.isArray(value)) { + value = toObject(value); + } + var hash; + var loop = function ( key ) { + if ( + key === 'class' || + key === 'style' || + isReservedAttribute(key) + ) { + hash = data; + } else { + var type = data.attrs && data.attrs.type; + hash = asProp || config.mustUseProp(tag, type, key) + ? data.domProps || (data.domProps = {}) + : data.attrs || (data.attrs = {}); + } + if (!(key in hash)) { + hash[key] = value[key]; + + if (isSync) { + var on = data.on || (data.on = {}); + on[("update:" + key)] = function ($event) { + value[key] = $event; + }; + } + } + }; + + for (var key in value) loop( key ); + } + } + return data +} + +/* */ + +/** + * Runtime helper for rendering static trees. + */ +function renderStatic ( + index, + isInFor +) { + // static trees can be rendered once and cached on the contructor options + // so every instance shares the same cached trees + var renderFns = this.$options.staticRenderFns; + var cached = renderFns.cached || (renderFns.cached = []); + var tree = cached[index]; + // if has already-rendered static tree and not inside v-for, + // we can reuse the same tree by doing a shallow clone. + if (tree && !isInFor) { + return Array.isArray(tree) + ? cloneVNodes(tree) + : cloneVNode(tree) + } + // otherwise, render a fresh tree. + tree = cached[index] = renderFns[index].call(this._renderProxy, null, this); + markStatic(tree, ("__static__" + index), false); + return tree +} + +/** + * Runtime helper for v-once. + * Effectively it means marking the node as static with a unique key. + */ +function markOnce ( + tree, + index, + key +) { + markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); + return tree +} + +function markStatic ( + tree, + key, + isOnce +) { + if (Array.isArray(tree)) { + for (var i = 0; i < tree.length; i++) { + if (tree[i] && typeof tree[i] !== 'string') { + markStaticNode(tree[i], (key + "_" + i), isOnce); + } + } + } else { + markStaticNode(tree, key, isOnce); + } +} + +function markStaticNode (node, key, isOnce) { + node.isStatic = true; + node.key = key; + node.isOnce = isOnce; +} + +/* */ + +function bindObjectListeners (data, value) { + if (value) { + if (!isPlainObject(value)) { + "development" !== 'production' && warn( + 'v-on without argument expects an Object value', + this + ); + } else { + var on = data.on = data.on ? extend({}, data.on) : {}; + for (var key in value) { + var existing = on[key]; + var ours = value[key]; + on[key] = existing ? [].concat(existing, ours) : ours; + } + } + } + return data +} + +/* */ + +function installRenderHelpers (target) { + target._o = markOnce; + target._n = toNumber; + target._s = toString; + target._l = renderList; + target._t = renderSlot; + target._q = looseEqual; + target._i = looseIndexOf; + target._m = renderStatic; + target._f = resolveFilter; + target._k = checkKeyCodes; + target._b = bindObjectProps; + target._v = createTextVNode; + target._e = createEmptyVNode; + target._u = resolveScopedSlots; + target._g = bindObjectListeners; +} + +/* */ + +function FunctionalRenderContext ( + data, + props, + children, + parent, + Ctor +) { + var options = Ctor.options; + this.data = data; + this.props = props; + this.children = children; + this.parent = parent; + this.listeners = data.on || emptyObject; + this.injections = resolveInject(options.inject, parent); + this.slots = function () { return resolveSlots(children, parent); }; + + // ensure the createElement function in functional components + // gets a unique context - this is necessary for correct named slot check + var contextVm = Object.create(parent); + var isCompiled = isTrue(options._compiled); + var needNormalization = !isCompiled; + + // support for compiled functional template + if (isCompiled) { + // exposing $options for renderStatic() + this.$options = options; + // pre-resolve slots for renderSlot() + this.$slots = this.slots(); + this.$scopedSlots = data.scopedSlots || emptyObject; + } + + if (options._scopeId) { + this._c = function (a, b, c, d) { + var vnode = createElement(contextVm, a, b, c, d, needNormalization); + if (vnode) { + vnode.functionalScopeId = options._scopeId; + vnode.functionalContext = parent; + } + return vnode + }; + } else { + this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; + } +} + +installRenderHelpers(FunctionalRenderContext.prototype); + function createFunctionalComponent ( Ctor, propsData, data, - context, + contextVm, children ) { + var options = Ctor.options; var props = {}; - var propOptions = Ctor.options.props; + var propOptions = options.props; if (isDef(propOptions)) { for (var key in propOptions) { props[key] = validateProp(key, propOptions, propsData || emptyObject); @@ -40146,26 +40617,25 @@ function createFunctionalComponent ( if (isDef(data.attrs)) { mergeProps(props, data.attrs); } if (isDef(data.props)) { mergeProps(props, data.props); } } - // ensure the createElement function in functional components - // gets a unique context - this is necessary for correct named slot check - var _context = Object.create(context); - var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); }; - var vnode = Ctor.options.render.call(null, h, { - data: data, - props: props, - children: children, - parent: context, - listeners: data.on || emptyObject, - injections: resolveInject(Ctor.options.inject, context), - slots: function () { return resolveSlots(children, context); } - }); + + var renderContext = new FunctionalRenderContext( + data, + props, + children, + contextVm, + Ctor + ); + + var vnode = options.render.call(null, renderContext._c, renderContext); + if (vnode instanceof VNode) { - vnode.functionalContext = context; - vnode.functionalOptions = Ctor.options; + vnode.functionalContext = contextVm; + vnode.functionalOptions = options; if (data.slot) { (vnode.data || (vnode.data = {})).slot = data.slot; } } + return vnode } @@ -40510,17 +40980,18 @@ function _createElement ( } } -function applyNS (vnode, ns) { +function applyNS (vnode, ns, force) { vnode.ns = ns; if (vnode.tag === 'foreignObject') { // use default namespace inside foreignObject - return + ns = undefined; + force = true; } if (isDef(vnode.children)) { for (var i = 0, l = vnode.children.length; i < l; i++) { var child = vnode.children[i]; - if (isDef(child.tag) && isUndef(child.ns)) { - applyNS(child, ns); + if (isDef(child.tag) && (isUndef(child.ns) || isTrue(force))) { + applyNS(child, ns, force); } } } @@ -40528,240 +40999,12 @@ function applyNS (vnode, ns) { /* */ -/** - * Runtime helper for rendering v-for lists. - */ -function renderList ( - val, - render -) { - var ret, i, l, keys, key; - if (Array.isArray(val) || typeof val === 'string') { - ret = new Array(val.length); - for (i = 0, l = val.length; i < l; i++) { - ret[i] = render(val[i], i); - } - } else if (typeof val === 'number') { - ret = new Array(val); - for (i = 0; i < val; i++) { - ret[i] = render(i + 1, i); - } - } else if (isObject(val)) { - keys = Object.keys(val); - ret = new Array(keys.length); - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - ret[i] = render(val[key], key, i); - } - } - if (isDef(ret)) { - (ret)._isVList = true; - } - return ret -} - -/* */ - -/** - * Runtime helper for rendering - */ -function renderSlot ( - name, - fallback, - props, - bindObject -) { - var scopedSlotFn = this.$scopedSlots[name]; - if (scopedSlotFn) { // scoped slot - props = props || {}; - if (bindObject) { - props = extend(extend({}, bindObject), props); - } - return scopedSlotFn(props) || fallback - } else { - var slotNodes = this.$slots[name]; - // warn duplicate slot usage - if (slotNodes && "development" !== 'production') { - slotNodes._rendered && warn( - "Duplicate presence of slot \"" + name + "\" found in the same render tree " + - "- this will likely cause render errors.", - this - ); - slotNodes._rendered = true; - } - return slotNodes || fallback - } -} - -/* */ - -/** - * Runtime helper for resolving filters - */ -function resolveFilter (id) { - return resolveAsset(this.$options, 'filters', id, true) || identity -} - -/* */ - -/** - * Runtime helper for checking keyCodes from config. - */ -function checkKeyCodes ( - eventKeyCode, - key, - builtInAlias -) { - var keyCodes = config.keyCodes[key] || builtInAlias; - if (Array.isArray(keyCodes)) { - return keyCodes.indexOf(eventKeyCode) === -1 - } else { - return keyCodes !== eventKeyCode - } -} - -/* */ - -/** - * Runtime helper for merging v-bind="object" into a VNode's data. - */ -function bindObjectProps ( - data, - tag, - value, - asProp, - isSync -) { - if (value) { - if (!isObject(value)) { - "development" !== 'production' && warn( - 'v-bind without argument expects an Object or Array value', - this - ); - } else { - if (Array.isArray(value)) { - value = toObject(value); - } - var hash; - var loop = function ( key ) { - if ( - key === 'class' || - key === 'style' || - isReservedAttribute(key) - ) { - hash = data; - } else { - var type = data.attrs && data.attrs.type; - hash = asProp || config.mustUseProp(tag, type, key) - ? data.domProps || (data.domProps = {}) - : data.attrs || (data.attrs = {}); - } - if (!(key in hash)) { - hash[key] = value[key]; - - if (isSync) { - var on = data.on || (data.on = {}); - on[("update:" + key)] = function ($event) { - value[key] = $event; - }; - } - } - }; - - for (var key in value) loop( key ); - } - } - return data -} - -/* */ - -/** - * Runtime helper for rendering static trees. - */ -function renderStatic ( - index, - isInFor -) { - var tree = this._staticTrees[index]; - // if has already-rendered static tree and not inside v-for, - // we can reuse the same tree by doing a shallow clone. - if (tree && !isInFor) { - return Array.isArray(tree) - ? cloneVNodes(tree) - : cloneVNode(tree) - } - // otherwise, render a fresh tree. - tree = this._staticTrees[index] = - this.$options.staticRenderFns[index].call(this._renderProxy); - markStatic(tree, ("__static__" + index), false); - return tree -} - -/** - * Runtime helper for v-once. - * Effectively it means marking the node as static with a unique key. - */ -function markOnce ( - tree, - index, - key -) { - markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); - return tree -} - -function markStatic ( - tree, - key, - isOnce -) { - if (Array.isArray(tree)) { - for (var i = 0; i < tree.length; i++) { - if (tree[i] && typeof tree[i] !== 'string') { - markStaticNode(tree[i], (key + "_" + i), isOnce); - } - } - } else { - markStaticNode(tree, key, isOnce); - } -} - -function markStaticNode (node, key, isOnce) { - node.isStatic = true; - node.key = key; - node.isOnce = isOnce; -} - -/* */ - -function bindObjectListeners (data, value) { - if (value) { - if (!isPlainObject(value)) { - "development" !== 'production' && warn( - 'v-on without argument expects an Object value', - this - ); - } else { - var on = data.on = data.on ? extend({}, data.on) : {}; - for (var key in value) { - var existing = on[key]; - var ours = value[key]; - on[key] = existing ? [].concat(ours, existing) : ours; - } - } - } - return data -} - -/* */ - function initRender (vm) { vm._vnode = null; // the root of the child tree - vm._staticTrees = null; - var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree + var options = vm.$options; + var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree var renderContext = parentVnode && parentVnode.context; - vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext); + vm.$slots = resolveSlots(options._renderChildren, renderContext); vm.$scopedSlots = emptyObject; // bind the createElement fn to this instance // so that we get proper render context inside it. @@ -40778,19 +41021,22 @@ function initRender (vm) { /* istanbul ignore else */ if (true) { - defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { + defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { !isUpdatingChildComponent && warn("$attrs is readonly.", vm); }, true); - defineReactive$$1(vm, '$listeners', vm.$options._parentListeners || emptyObject, function () { + defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () { !isUpdatingChildComponent && warn("$listeners is readonly.", vm); }, true); } else { - defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true); - defineReactive$$1(vm, '$listeners', vm.$options._parentListeners || emptyObject, null, true); + defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true); + defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true); } } function renderMixin (Vue) { + // install runtime convenience helpers + installRenderHelpers(Vue.prototype); + Vue.prototype.$nextTick = function (fn) { return nextTick(fn, this) }; @@ -40799,7 +41045,6 @@ function renderMixin (Vue) { var vm = this; var ref = vm.$options; var render = ref.render; - var staticRenderFns = ref.staticRenderFns; var _parentVnode = ref._parentVnode; if (vm._isMounted) { @@ -40815,9 +41060,6 @@ function renderMixin (Vue) { vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject; - if (staticRenderFns && !vm._staticTrees) { - vm._staticTrees = []; - } // set parent vnode. this allows render functions to have access // to the data on the placeholder node. vm.$vnode = _parentVnode; @@ -40826,14 +41068,21 @@ function renderMixin (Vue) { try { vnode = render.call(vm._renderProxy, vm.$createElement); } catch (e) { - handleError(e, vm, "render function"); + handleError(e, vm, "render"); // return error render result, // or previous vnode to prevent render error causing blank component /* istanbul ignore else */ if (true) { - vnode = vm.$options.renderError - ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e) - : vm._vnode; + if (vm.$options.renderError) { + try { + vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); + } catch (e) { + handleError(e, vm, "renderError"); + vnode = vm._vnode; + } + } else { + vnode = vm._vnode; + } } else { vnode = vm._vnode; } @@ -40853,25 +41102,6 @@ function renderMixin (Vue) { vnode.parent = _parentVnode; return vnode }; - - // internal render helpers. - // these are exposed on the instance prototype to reduce generated render - // code size. - Vue.prototype._o = markOnce; - Vue.prototype._n = toNumber; - Vue.prototype._s = toString; - Vue.prototype._l = renderList; - Vue.prototype._t = renderSlot; - Vue.prototype._q = looseEqual; - Vue.prototype._i = looseIndexOf; - Vue.prototype._m = renderStatic; - Vue.prototype._f = resolveFilter; - Vue.prototype._k = checkKeyCodes; - Vue.prototype._b = bindObjectProps; - Vue.prototype._v = createTextVNode; - Vue.prototype._e = createEmptyVNode; - Vue.prototype._u = resolveScopedSlots; - Vue.prototype._g = bindObjectListeners; } /* */ @@ -40887,7 +41117,7 @@ function initMixin (Vue) { var startTag, endTag; /* istanbul ignore if */ if ("development" !== 'production' && config.performance && mark) { - startTag = "vue-perf-init:" + (vm._uid); + startTag = "vue-perf-start:" + (vm._uid); endTag = "vue-perf-end:" + (vm._uid); mark(startTag); } @@ -40928,7 +41158,7 @@ function initMixin (Vue) { if ("development" !== 'production' && config.performance && mark) { vm._name = formatComponentName(vm, false); mark(endTag); - measure(((vm._name) + " init"), startTag, endTag); + measure(("vue " + (vm._name) + " init"), startTag, endTag); } if (vm.$options.el) { @@ -41194,8 +41424,6 @@ function initAssetRegisters (Vue) { /* */ -var patternTypes = [String, RegExp, Array]; - function getComponentName (opts) { return opts && (opts.Ctor.options.name || opts.tag) } @@ -41212,54 +41440,66 @@ function matches (pattern, name) { return false } -function pruneCache (cache, current, filter) { +function pruneCache (keepAliveInstance, filter) { + var cache = keepAliveInstance.cache; + var keys = keepAliveInstance.keys; + var _vnode = keepAliveInstance._vnode; for (var key in cache) { var cachedNode = cache[key]; if (cachedNode) { var name = getComponentName(cachedNode.componentOptions); if (name && !filter(name)) { - if (cachedNode !== current) { - pruneCacheEntry(cachedNode); - } - cache[key] = null; + pruneCacheEntry(cache, key, keys, _vnode); } } } } -function pruneCacheEntry (vnode) { - if (vnode) { - vnode.componentInstance.$destroy(); +function pruneCacheEntry ( + cache, + key, + keys, + current +) { + var cached$$1 = cache[key]; + if (cached$$1 && cached$$1 !== current) { + cached$$1.componentInstance.$destroy(); } + cache[key] = null; + remove(keys, key); } +var patternTypes = [String, RegExp, Array]; + var KeepAlive = { name: 'keep-alive', abstract: true, props: { include: patternTypes, - exclude: patternTypes + exclude: patternTypes, + max: [String, Number] }, created: function created () { this.cache = Object.create(null); + this.keys = []; }, destroyed: function destroyed () { var this$1 = this; for (var key in this$1.cache) { - pruneCacheEntry(this$1.cache[key]); + pruneCacheEntry(this$1.cache, key, this$1.keys); } }, watch: { include: function include (val) { - pruneCache(this.cache, this._vnode, function (name) { return matches(val, name); }); + pruneCache(this, function (name) { return matches(val, name); }); }, exclude: function exclude (val) { - pruneCache(this.cache, this._vnode, function (name) { return !matches(val, name); }); + pruneCache(this, function (name) { return !matches(val, name); }); } }, @@ -41275,16 +41515,29 @@ var KeepAlive = { )) { return vnode } + + var ref = this; + var cache = ref.cache; + var keys = ref.keys; var key = vnode.key == null // same constructor may get registered as different local components // so cid alone is not enough (#3269) ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') : vnode.key; - if (this.cache[key]) { - vnode.componentInstance = this.cache[key].componentInstance; + if (cache[key]) { + vnode.componentInstance = cache[key].componentInstance; + // make current key freshest + remove(keys, key); + keys.push(key); } else { - this.cache[key] = vnode; + cache[key] = vnode; + keys.push(key); + // prune oldest entry + if (this.max && keys.length > parseInt(this.max)) { + pruneCacheEntry(cache, keys[0], keys, this._vnode); + } } + vnode.data.keepAlive = true; } return vnode @@ -41317,7 +41570,7 @@ function initGlobalAPI (Vue) { warn: warn, extend: extend, mergeOptions: mergeOptions, - defineReactive: defineReactive$$1 + defineReactive: defineReactive }; Vue.set = set; @@ -41354,7 +41607,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', { } }); -Vue$3.version = '2.4.4'; +Vue$3.version = '2.5.2'; /* */ @@ -41764,13 +42017,13 @@ function createPatchFunction (backend) { } function createRmCb (childElm, listeners) { - function remove$$1 () { - if (--remove$$1.listeners === 0) { + function remove () { + if (--remove.listeners === 0) { removeNode(childElm); } } - remove$$1.listeners = listeners; - return remove$$1 + remove.listeners = listeners; + return remove } function removeNode (el) { @@ -41799,7 +42052,14 @@ function createPatchFunction (backend) { if ( !inPre && !vnode.ns && - !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) && + !( + config.ignoredElements.length && + config.ignoredElements.some(function (ignore) { + return isRegExp(ignore) + ? ignore.test(tag) + : ignore === tag + }) + ) && config.isUnknownElement(tag) ) { warn( @@ -41942,16 +42202,21 @@ function createPatchFunction (backend) { // of going through the normal attribute patching process. function setScope (vnode) { var i; - var ancestor = vnode; - while (ancestor) { - if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { - nodeOps.setAttribute(vnode.elm, i, ''); + if (isDef(i = vnode.functionalScopeId)) { + nodeOps.setAttribute(vnode.elm, i, ''); + } else { + var ancestor = vnode; + while (ancestor) { + if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { + nodeOps.setAttribute(vnode.elm, i, ''); + } + ancestor = ancestor.parent; } - ancestor = ancestor.parent; } // for slot content they should also get the scopeId from the host instance. if (isDef(i = activeInstance) && i !== vnode.context && + i !== vnode.functionalContext && isDef(i = i.$options._scopeId) ) { nodeOps.setAttribute(vnode.elm, i, ''); @@ -42030,7 +42295,7 @@ function createPatchFunction (backend) { var newEndIdx = newCh.length - 1; var newStartVnode = newCh[0]; var newEndVnode = newCh[newEndIdx]; - var oldKeyToIdx, idxInOld, elmToMove, refElm; + var oldKeyToIdx, idxInOld, vnodeToMove, refElm; // removeOnly is a special flag used only by // to ensure removed elements stay in correct relative positions @@ -42068,18 +42333,18 @@ function createPatchFunction (backend) { if (isUndef(idxInOld)) { // New element createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm); } else { - elmToMove = oldCh[idxInOld]; + vnodeToMove = oldCh[idxInOld]; /* istanbul ignore if */ - if ("development" !== 'production' && !elmToMove) { + if ("development" !== 'production' && !vnodeToMove) { warn( 'It seems there are duplicate keys that is causing an update error. ' + 'Make sure each v-for item has a unique key.' ); } - if (sameVnode(elmToMove, newStartVnode)) { - patchVnode(elmToMove, newStartVnode, insertedVnodeQueue); + if (sameVnode(vnodeToMove, newStartVnode)) { + patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue); oldCh[idxInOld] = undefined; - canMove && nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); + canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); } else { // same key but different element. treat as new element createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm); @@ -42360,6 +42625,8 @@ function createPatchFunction (backend) { insert.fns[i$2](); } } + } else { + registerRef(ancestor); } ancestor = ancestor.parent; } @@ -42523,8 +42790,9 @@ function updateAttrs (oldVnode, vnode) { } } // #4391: in IE9, setting type can reset value for input[type=radio] + // #6666: IE/Edge forces progress value down to 1 before setting a max /* istanbul ignore if */ - if (isIE9 && attrs.value !== oldAttrs.value) { + if ((isIE9 || isEdge) && attrs.value !== oldAttrs.value) { setAttr(elm, 'value', attrs.value); } for (key in oldAttrs) { @@ -42814,7 +43082,15 @@ function getBindingAttr ( } } -function getAndRemoveAttr (el, name) { +// note: this only removes the attr from the Array (attrsList) so that it +// doesn't get processed by processAttrs. +// By default it does NOT remove it from the map (attrsMap) because the map is +// needed during codegen. +function getAndRemoveAttr ( + el, + name, + removeFromMap +) { var val; if ((val = el.attrsMap[name]) != null) { var list = el.attrsList; @@ -42825,6 +43101,9 @@ function getAndRemoveAttr (el, name) { } } } + if (removeFromMap) { + delete el.attrsMap[name]; + } return val } @@ -42869,25 +43148,26 @@ function genAssignmentCode ( value, assignment ) { - var modelRs = parseModel(value); - if (modelRs.idx === null) { + var res = parseModel(value); + if (res.key === null) { return (value + "=" + assignment) } else { - return ("$set(" + (modelRs.exp) + ", " + (modelRs.idx) + ", " + assignment + ")") + return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") } } /** - * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val) + * Parse a v-model expression into a base path and a final key segment. + * Handles both dot-path and possible square brackets. * - * for loop possible cases: + * Possible cases: * * - test - * - test[idx] - * - test[test1[idx]] - * - test["a"][idx] - * - xxx.test[a[a].test1[idx]] - * - test.xxx.a["asa"][test1[idx]] + * - test[key] + * - test[test1[key]] + * - test["a"][key] + * - xxx.test[a[a].test1[key]] + * - test.xxx.a["asa"][test1[key]] * */ @@ -42898,18 +43178,29 @@ var index$1; var expressionPos; var expressionEndPos; + + function parseModel (val) { - str = val; - len = str.length; - index$1 = expressionPos = expressionEndPos = 0; + len = val.length; if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { - return { - exp: val, - idx: null + index$1 = val.lastIndexOf('.'); + if (index$1 > -1) { + return { + exp: val.slice(0, index$1), + key: '"' + val.slice(index$1 + 1) + '"' + } + } else { + return { + exp: val, + key: null + } } } + str = val; + index$1 = expressionPos = expressionEndPos = 0; + while (!eof()) { chr = next(); /* istanbul ignore if */ @@ -42921,8 +43212,8 @@ function parseModel (val) { } return { - exp: val.substring(0, expressionPos), - idx: val.substring(expressionPos + 1, expressionEndPos) + exp: val.slice(0, expressionPos), + key: val.slice(expressionPos + 1, expressionEndPos) } } @@ -42987,13 +43278,6 @@ function model ( var type = el.attrsMap.type; if (true) { - var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; - if (tag === 'input' && dynamicType) { - warn$1( - ":\n" + - "v-model does not support dynamic input types. Use v-if branches instead." - ); - } // inputs with type="file" are read only and setting the input's // value will throw an error. if (tag === 'input' && type === 'file') { @@ -43050,7 +43334,7 @@ function genCheckboxModel ( : (":_q(" + value + "," + trueValueBinding + ")") ) ); - addHandler(el, CHECKBOX_RADIO_TOKEN, + addHandler(el, 'change', "var $$a=" + value + "," + '$$el=$event.target,' + "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + @@ -43073,7 +43357,7 @@ function genRadioModel ( var valueBinding = getBindingAttr(el, 'value') || 'null'; valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); - addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true); + addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); } function genSelect ( @@ -43137,24 +43421,34 @@ function genDefaultModel ( // the whole point is ensuring the v-model callback gets called before // user-attached handlers. function normalizeEvents (on) { - var event; /* istanbul ignore if */ if (isDef(on[RANGE_TOKEN])) { // IE input[type=range] only supports `change` event - event = isIE ? 'change' : 'input'; + var event = isIE ? 'change' : 'input'; on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); delete on[RANGE_TOKEN]; } + // This was originally intended to fix #4521 but no longer necessary + // after 2.5. Keeping it for backwards compat with generated code from < 2.4 + /* istanbul ignore if */ if (isDef(on[CHECKBOX_RADIO_TOKEN])) { - // Chrome fires microtasks in between click/change, leads to #4521 - event = isChrome ? 'click' : 'change'; - on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []); + on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); delete on[CHECKBOX_RADIO_TOKEN]; } } var target$1; +function createOnceHandler (handler, event, capture) { + var _target = target$1; // save current target element in closure + return function onceHandler () { + var res = handler.apply(null, arguments); + if (res !== null) { + remove$2(event, onceHandler, capture, _target); + } + } +} + function add$1 ( event, handler, @@ -43162,18 +43456,8 @@ function add$1 ( capture, passive ) { - if (once$$1) { - var oldHandler = handler; - var _target = target$1; // save current target element in closure - handler = function (ev) { - var res = arguments.length === 1 - ? oldHandler(ev) - : oldHandler.apply(null, arguments); - if (res !== null) { - remove$2(event, handler, capture, _target); - } - }; - } + handler = withMacroTask(handler); + if (once$$1) { handler = createOnceHandler(handler, event, capture); } target$1.addEventListener( event, handler, @@ -43189,7 +43473,11 @@ function remove$2 ( capture, _target ) { - (_target || target$1).removeEventListener(event, handler, capture); + (_target || target$1).removeEventListener( + event, + handler._withTask || handler, + capture + ); } function updateDOMListeners (oldVnode, vnode) { @@ -43236,6 +43524,11 @@ function updateDOMProps (oldVnode, vnode) { if (key === 'textContent' || key === 'innerHTML') { if (vnode.children) { vnode.children.length = 0; } if (cur === oldProps[key]) { continue } + // #6601 work around Chrome version <= 55 bug where single textNode + // replaced by innerHTML/textContent retains its parentNode property + if (elm.childNodes.length === 1) { + elm.removeChild(elm.childNodes[0]); + } } if (key === 'value') { @@ -43244,7 +43537,7 @@ function updateDOMProps (oldVnode, vnode) { elm._value = cur; // avoid resetting cursor position when value is the same var strCur = isUndef(cur) ? '' : String(cur); - if (shouldUpdateValue(elm, vnode, strCur)) { + if (shouldUpdateValue(elm, strCur)) { elm.value = strCur; } } else { @@ -43256,13 +43549,9 @@ function updateDOMProps (oldVnode, vnode) { // check platforms/web/util/attrs.js acceptValue -function shouldUpdateValue ( - elm, - vnode, - checkVal -) { +function shouldUpdateValue (elm, checkVal) { return (!elm.composing && ( - vnode.tag === 'option' || + elm.tagName === 'OPTION' || isDirty(elm, checkVal) || isInputChanged(elm, checkVal) )) @@ -43517,20 +43806,20 @@ function removeClass (el, cls) { /* */ -function resolveTransition (def$$1) { - if (!def$$1) { +function resolveTransition (def) { + if (!def) { return } /* istanbul ignore else */ - if (typeof def$$1 === 'object') { + if (typeof def === 'object') { var res = {}; - if (def$$1.css !== false) { - extend(res, autoCssTransition(def$$1.name || 'v')); + if (def.css !== false) { + extend(res, autoCssTransition(def.name || 'v')); } - extend(res, def$$1); + extend(res, def); return res - } else if (typeof def$$1 === 'string') { - return autoCssTransition(def$$1) + } else if (typeof def === 'string') { + return autoCssTransition(def) } } @@ -43571,9 +43860,11 @@ if (hasTransition) { } // binding to window is necessary to make hot reload work in IE in strict mode -var raf = inBrowser && window.requestAnimationFrame - ? window.requestAnimationFrame.bind(window) - : setTimeout; +var raf = inBrowser + ? window.requestAnimationFrame + ? window.requestAnimationFrame.bind(window) + : setTimeout + : /* istanbul ignore next */ function (fn) { return fn(); }; function nextFrame (fn) { raf(function () { @@ -44389,7 +44680,7 @@ var Transition = { ) { // replace old child transition data with fresh one // important for dynamic transitions! - var oldData = oldChild && (oldChild.data.transition = extend({}, data)); + var oldData = oldChild.data.transition = extend({}, data); // handle transition mode if (mode === 'out-in') { // return placeholder node and queue update when leave finishes @@ -44506,8 +44797,9 @@ var TransitionGroup = { children.forEach(applyTranslation); // force reflow to put everything in position - var body = document.body; - var f = body.offsetHeight; // eslint-disable-line + // assign to this to avoid being removed in tree-shaking + // $flow-disable-line + this._reflow = document.body.offsetHeight; children.forEach(function (c) { if (c.data.moved) { @@ -44615,7 +44907,7 @@ Vue$3.prototype.$mount = function ( // devtools global hook /* istanbul ignore next */ -setTimeout(function () { +Vue$3.nextTick(function () { if (config.devtools) { if (devtools) { devtools.emit('init', Vue$3); @@ -44776,31 +45068,16 @@ var style$1 = { genData: genData$1 }; -var modules$1 = [ - klass$1, - style$1 -]; - /* */ -function text (el, dir) { - if (dir.value) { - addProp(el, 'textContent', ("_s(" + (dir.value) + ")")); - } -} - -/* */ +var decoder; -function html (el, dir) { - if (dir.value) { - addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")")); +var he = { + decode: function decode (html) { + decoder = decoder || document.createElement('div'); + decoder.innerHTML = html; + return decoder.textContent } -} - -var directives$1 = { - model: model, - text: text, - html: html }; /* */ @@ -44826,33 +45103,6 @@ var isNonPhrasingTag = makeMap( 'title,tr,track' ); -/* */ - -var baseOptions = { - expectHTML: true, - modules: modules$1, - directives: directives$1, - isPreTag: isPreTag, - isUnaryTag: isUnaryTag, - mustUseProp: mustUseProp, - canBeLeftOpenTag: canBeLeftOpenTag, - isReservedTag: isReservedTag, - getTagNamespace: getTagNamespace, - staticKeys: genStaticKeys(modules$1) -}; - -/* */ - -var decoder; - -var he = { - decode: function decode (html) { - decoder = decoder || document.createElement('div'); - decoder.innerHTML = html; - return decoder.textContent - } -}; - /** * Not type-checking this file because it's mostly vendor code. */ @@ -45182,6 +45432,23 @@ var platformIsPreTag; var platformMustUseProp; var platformGetTagNamespace; + + +function createASTElement ( + tag, + attrs, + parent +) { + return { + type: 1, + tag: tag, + attrsList: attrs, + attrsMap: makeAttrsMap(attrs), + parent: parent, + children: [] + } +} + /** * Convert HTML string to AST. */ @@ -45244,14 +45511,7 @@ function parse ( attrs = guardIESVGBug(attrs); } - var element = { - type: 1, - tag: tag, - attrsList: attrs, - attrsMap: makeAttrsMap(attrs), - parent: currentParent, - children: [] - }; + var element = createASTElement(tag, attrs, currentParent); if (ns) { element.ns = ns; } @@ -45267,7 +45527,7 @@ function parse ( // apply pre-transforms for (var i = 0; i < preTransforms.length; i++) { - preTransforms[i](element, options); + element = preTransforms[i](element, options) || element; } if (!inVPre) { @@ -45281,23 +45541,13 @@ function parse ( } if (inVPre) { processRawAttrs(element); - } else { + } else if (!element.processed) { + // structural directives processFor(element); processIf(element); processOnce(element); - processKey(element); - - // determine whether this is a plain element after - // removing structural attributes - element.plain = !element.key && !attrs.length; - - processRef(element); - processSlot(element); - processComponent(element); - for (var i$1 = 0; i$1 < transforms.length; i$1++) { - transforms[i$1](element, options); - } - processAttrs(element); + // element-scope stuff + processElement(element, options); } function checkRootConstraints (el) { @@ -45355,8 +45605,8 @@ function parse ( endPre(element); } // apply post-transforms - for (var i$2 = 0; i$2 < postTransforms.length; i$2++) { - postTransforms[i$2](element, options); + for (var i$1 = 0; i$1 < postTransforms.length; i$1++) { + postTransforms[i$1](element, options); } }, @@ -45450,6 +45700,22 @@ function processRawAttrs (el) { } } +function processElement (element, options) { + processKey(element); + + // determine whether this is a plain element after + // removing structural attributes + element.plain = !element.key && !element.attrsList.length; + + processRef(element); + processSlot(element); + processComponent(element); + for (var i = 0; i < transforms.length; i++) { + element = transforms[i](element, options) || element; + } + processAttrs(element); +} + function processKey (el) { var exp = getBindingAttr(el, 'key'); if (exp) { @@ -45569,14 +45835,31 @@ function processSlot (el) { ); } } else { + var slotScope; + if (el.tag === 'template') { + slotScope = getAndRemoveAttr(el, 'scope'); + /* istanbul ignore if */ + if ("development" !== 'production' && slotScope) { + warn$2( + "the \"scope\" attribute for scoped slots have been deprecated and " + + "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + + "can also be used on plain elements in addition to