}
],
"require": {
- "php": ">=5.5.0",
+ "php": ">=5.6.0",
"slim/slim": "^3.1",
- "symfony/expression-language": "^3.4",
- "fxp/composer-asset-plugin": "~1.3",
- "bower-asset/vue": "^2.5",
- "bower-asset/vue-resource": "^1.5"
+ "symfony/expression-language": "^3.4"
},
"license": "3-clause BSD license",
"minimum-stability": "stable",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "ac524148018bc5ba29d74e49492be515",
+ "content-hash": "d0e3662dd9d910ffe4f71d325bc39319",
"packages": [
- {
- "name": "bower-asset/vue",
- "version": "v2.5.16",
- "source": {
- "type": "git",
- "url": "https://github.com/vuejs/vue.git",
- "reference": "25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/vuejs/vue/zipball/25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6",
- "reference": "25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6",
- "shasum": ""
- },
- "type": "bower-asset-library"
- },
- {
- "name": "bower-asset/vue-resource",
- "version": "1.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/pagekit/vue-resource.git",
- "reference": "9a34f881f56f64b923572541d1753cb6cdd63d40"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/pagekit/vue-resource/zipball/9a34f881f56f64b923572541d1753cb6cdd63d40",
- "reference": "9a34f881f56f64b923572541d1753cb6cdd63d40",
- "shasum": ""
- },
- "type": "bower-asset-library",
- "extra": {
- "bower-asset-main": "dist/vue-resource.js",
- "bower-asset-ignore": [
- ".*",
- "build",
- "docs",
- "package.json"
- ]
- },
- "license": [
- "MIT"
- ],
- "description": "The HTTP client for Vue.js",
- "keywords": [
- "ajax",
- "http",
- "vue",
- "xhr"
- ],
- "time": "2018-03-03T07:42:38+00:00"
- },
{
"name": "container-interop/container-interop",
"version": "1.2.0",
"homepage": "https://github.com/container-interop/container-interop",
"time": "2017-02-14T19:40:03+00:00"
},
- {
- "name": "fxp/composer-asset-plugin",
- "version": "v1.4.2",
- "source": {
- "type": "git",
- "url": "https://github.com/fxpio/composer-asset-plugin.git",
- "reference": "61352d99940d2b2392a5d2db83b8c0ef5faf222a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fxpio/composer-asset-plugin/zipball/61352d99940d2b2392a5d2db83b8c0ef5faf222a",
- "reference": "61352d99940d2b2392a5d2db83b8c0ef5faf222a",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^1.0",
- "php": ">=5.3.3"
- },
- "require-dev": {
- "composer/composer": "^1.4.0"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin",
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Fxp\\Composer\\AssetPlugin\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "François Pluchino",
- "email": "francois.pluchino@gmail.com"
- }
- ],
- "description": "NPM/Bower Dependency Manager for Composer",
- "homepage": "https://github.com/fxpio/composer-asset-plugin",
- "keywords": [
- "asset",
- "bower",
- "composer",
- "dependency manager",
- "nodejs",
- "npm",
- "package"
- ],
- "time": "2017-10-20T06:53:56+00:00"
- },
{
"name": "nikic/fast-route",
"version": "v1.3.0",
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=5.5.0"
+ "php": ">=5.6.0"
},
"platform-dev": []
}
+++ /dev/null
-The MIT License (MIT)
-
-Copyright (c) 2015-2017 steffans
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+++ /dev/null
-# vue-resource [![Build](https://img.shields.io/circleci/project/pagekit/vue-resource/develop.svg)](https://circleci.com/gh/pagekit/vue-resource) [![Downloads](https://img.shields.io/npm/dm/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/vue-resource/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vue-resource) [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)
-
-The plugin for [Vue.js](http://vuejs.org) provides services for making web requests and handle responses using a [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or JSONP.
-
-## Features
-
-- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API and [URI Templates](https://medialize.github.io/URI.js/uri-template.html)
-- Supports [interceptors](docs/http.md#interceptors) for request and response
-- Supports latest Firefox, Chrome, Safari, Opera and IE9+
-- Supports Vue 1.0 & Vue 2.0
-- Compact size 14KB (5.3KB gzipped)
-
-## Installation
-You can install it via [yarn](https://yarnpkg.com/) or [NPM](http://npmjs.org/).
-```
-$ yarn add vue-resource
-$ npm install vue-resource
-```
-
-### CDN
-Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.5.0), [unpkg](https://unpkg.com/vue-resource@1.5.0) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
-```html
-<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.0"></script>
-```
-
-## Example
-```js
-{
- // GET /someUrl
- this.$http.get('/someUrl').then(response => {
-
- // get body data
- this.someData = response.body;
-
- }, response => {
- // error callback
- });
-}
-```
-
-## Documentation
-
-- [Configuration](docs/config.md)
-- [HTTP Requests/Response](docs/http.md)
-- [Creating Resources](docs/resource.md)
-- [Code Recipes](docs/recipes.md)
-- [API Reference](docs/api.md)
-
-## Changelog
-
-Details changes for each release are documented in the [release notes](https://github.com/pagekit/vue-resource/releases).
-
-## Contribution
-
-If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/pagekit/vue-resource/issues) or a [pull request](https://github.com/pagekit/vue-resource/pulls).
-
-## License
-
-[MIT](http://opensource.org/licenses/MIT)
+++ /dev/null
-{
- "name": "vue-resource",
- "main": "dist/vue-resource.js",
- "version": "1.5.0",
- "description": "The HTTP client for Vue.js",
- "homepage": "https://github.com/pagekit/vue-resource",
- "license": "MIT",
- "keywords": [
- "vue",
- "xhr",
- "http",
- "ajax"
- ],
- "ignore": [
- ".*",
- "build",
- "docs",
- "package.json"
- ]
-}
\ No newline at end of file
+++ /dev/null
-# NOTE!
-
-The `dist` folder contains the standalone build for vue-resource, however files here are only checked-in when a release happens. If you are on the `dev` branch, files here are **NOT** up to date. Only the `master` branch contains the built files for the latest stable version.
+++ /dev/null
-/*!
- * vue-resource v1.5.0
- * https://github.com/pagekit/vue-resource
- * Released under the MIT License.
- */
-
-'use strict';
-
-/**
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
- */
-
-var RESOLVED = 0;
-var REJECTED = 1;
-var PENDING = 2;
-
-function Promise$1(executor) {
-
- this.state = PENDING;
- this.value = undefined;
- this.deferred = [];
-
- var promise = this;
-
- try {
- executor(function (x) {
- promise.resolve(x);
- }, function (r) {
- promise.reject(r);
- });
- } catch (e) {
- promise.reject(e);
- }
-}
-
-Promise$1.reject = function (r) {
- return new Promise$1(function (resolve, reject) {
- reject(r);
- });
-};
-
-Promise$1.resolve = function (x) {
- return new Promise$1(function (resolve, reject) {
- resolve(x);
- });
-};
-
-Promise$1.all = function all(iterable) {
- return new Promise$1(function (resolve, reject) {
- var count = 0, result = [];
-
- if (iterable.length === 0) {
- resolve(result);
- }
-
- function resolver(i) {
- return function (x) {
- result[i] = x;
- count += 1;
-
- if (count === iterable.length) {
- resolve(result);
- }
- };
- }
-
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolver(i), reject);
- }
- });
-};
-
-Promise$1.race = function race(iterable) {
- return new Promise$1(function (resolve, reject) {
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolve, reject);
- }
- });
-};
-
-var p = Promise$1.prototype;
-
-p.resolve = function resolve(x) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (x === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- var called = false;
-
- try {
- var then = x && x['then'];
-
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
- then.call(x, function (x) {
- if (!called) {
- promise.resolve(x);
- }
- called = true;
-
- }, function (r) {
- if (!called) {
- promise.reject(r);
- }
- called = true;
- });
- return;
- }
- } catch (e) {
- if (!called) {
- promise.reject(e);
- }
- return;
- }
-
- promise.state = RESOLVED;
- promise.value = x;
- promise.notify();
- }
-};
-
-p.reject = function reject(reason) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (reason === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- promise.state = REJECTED;
- promise.value = reason;
- promise.notify();
- }
-};
-
-p.notify = function notify() {
- var promise = this;
-
- nextTick(function () {
- if (promise.state !== PENDING) {
- while (promise.deferred.length) {
- var deferred = promise.deferred.shift(),
- onResolved = deferred[0],
- onRejected = deferred[1],
- resolve = deferred[2],
- reject = deferred[3];
-
- try {
- if (promise.state === RESOLVED) {
- if (typeof onResolved === 'function') {
- resolve(onResolved.call(undefined, promise.value));
- } else {
- resolve(promise.value);
- }
- } else if (promise.state === REJECTED) {
- if (typeof onRejected === 'function') {
- resolve(onRejected.call(undefined, promise.value));
- } else {
- reject(promise.value);
- }
- }
- } catch (e) {
- reject(e);
- }
- }
- }
- });
-};
-
-p.then = function then(onResolved, onRejected) {
- var promise = this;
-
- return new Promise$1(function (resolve, reject) {
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
- promise.notify();
- });
-};
-
-p.catch = function (onRejected) {
- return this.then(undefined, onRejected);
-};
-
-/**
- * Promise adapter.
- */
-
-if (typeof Promise === 'undefined') {
- window.Promise = Promise$1;
-}
-
-function PromiseObj(executor, context) {
-
- if (executor instanceof Promise) {
- this.promise = executor;
- } else {
- this.promise = new Promise(executor.bind(context));
- }
-
- this.context = context;
-}
-
-PromiseObj.all = function (iterable, context) {
- return new PromiseObj(Promise.all(iterable), context);
-};
-
-PromiseObj.resolve = function (value, context) {
- return new PromiseObj(Promise.resolve(value), context);
-};
-
-PromiseObj.reject = function (reason, context) {
- return new PromiseObj(Promise.reject(reason), context);
-};
-
-PromiseObj.race = function (iterable, context) {
- return new PromiseObj(Promise.race(iterable), context);
-};
-
-var p$1 = PromiseObj.prototype;
-
-p$1.bind = function (context) {
- this.context = context;
- return this;
-};
-
-p$1.then = function (fulfilled, rejected) {
-
- if (fulfilled && fulfilled.bind && this.context) {
- fulfilled = fulfilled.bind(this.context);
- }
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
-};
-
-p$1.catch = function (rejected) {
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.catch(rejected), this.context);
-};
-
-p$1.finally = function (callback) {
-
- return this.then(function (value) {
- callback.call(this);
- return value;
- }, function (reason) {
- callback.call(this);
- return Promise.reject(reason);
- }
- );
-};
-
-/**
- * Utility functions.
- */
-
-var ref = {};
-var hasOwnProperty = ref.hasOwnProperty;
-var ref$1 = [];
-var slice = ref$1.slice;
-var debug = false, ntick;
-
-var inBrowser = typeof window !== 'undefined';
-
-function Util (ref) {
- var config = ref.config;
- var nextTick = ref.nextTick;
-
- ntick = nextTick;
- debug = config.debug || !config.silent;
-}
-
-function warn(msg) {
- if (typeof console !== 'undefined' && debug) {
- console.warn('[VueResource warn]: ' + msg);
- }
-}
-
-function error(msg) {
- if (typeof console !== 'undefined') {
- console.error(msg);
- }
-}
-
-function nextTick(cb, ctx) {
- return ntick(cb, ctx);
-}
-
-function trim(str) {
- return str ? str.replace(/^\s*|\s*$/g, '') : '';
-}
-
-function trimEnd(str, chars) {
-
- if (str && chars === undefined) {
- return str.replace(/\s+$/, '');
- }
-
- if (!str || !chars) {
- return str;
- }
-
- return str.replace(new RegExp(("[" + chars + "]+$")), '');
-}
-
-function toLower(str) {
- return str ? str.toLowerCase() : '';
-}
-
-function toUpper(str) {
- return str ? str.toUpperCase() : '';
-}
-
-var isArray = Array.isArray;
-
-function isString(val) {
- return typeof val === 'string';
-}
-
-function isFunction(val) {
- return typeof val === 'function';
-}
-
-function isObject(obj) {
- return obj !== null && typeof obj === 'object';
-}
-
-function isPlainObject(obj) {
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
-}
-
-function isBlob(obj) {
- return typeof Blob !== 'undefined' && obj instanceof Blob;
-}
-
-function isFormData(obj) {
- return typeof FormData !== 'undefined' && obj instanceof FormData;
-}
-
-function when(value, fulfilled, rejected) {
-
- var promise = PromiseObj.resolve(value);
-
- if (arguments.length < 2) {
- return promise;
- }
-
- return promise.then(fulfilled, rejected);
-}
-
-function options(fn, obj, opts) {
-
- opts = opts || {};
-
- if (isFunction(opts)) {
- opts = opts.call(obj);
- }
-
- return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
-}
-
-function each(obj, iterator) {
-
- var i, key;
-
- if (isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- iterator.call(obj[i], obj[i], i);
- }
- } else if (isObject(obj)) {
- for (key in obj) {
- if (hasOwnProperty.call(obj, key)) {
- iterator.call(obj[key], obj[key], key);
- }
- }
- }
-
- return obj;
-}
-
-var assign = Object.assign || _assign;
-
-function merge(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source, true);
- });
-
- return target;
-}
-
-function defaults(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
-
- for (var key in source) {
- if (target[key] === undefined) {
- target[key] = source[key];
- }
- }
-
- });
-
- return target;
-}
-
-function _assign(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source);
- });
-
- return target;
-}
-
-function _merge(target, source, deep) {
- for (var key in source) {
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
- target[key] = {};
- }
- if (isArray(source[key]) && !isArray(target[key])) {
- target[key] = [];
- }
- _merge(target[key], source[key], deep);
- } else if (source[key] !== undefined) {
- target[key] = source[key];
- }
- }
-}
-
-/**
- * Root Prefix Transform.
- */
-
-function root (options$$1, next) {
-
- var url = next(options$$1);
-
- if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
- url = trimEnd(options$$1.root, '/') + '/' + url;
- }
-
- return url;
-}
-
-/**
- * Query Parameter Transform.
- */
-
-function query (options$$1, next) {
-
- var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);
-
- each(options$$1.params, function (value, key) {
- if (urlParams.indexOf(key) === -1) {
- query[key] = value;
- }
- });
-
- query = Url.params(query);
-
- if (query) {
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
- }
-
- return url;
-}
-
-/**
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
- */
-
-function expand(url, params, variables) {
-
- var tmpl = parse(url), expanded = tmpl.expand(params);
-
- if (variables) {
- variables.push.apply(variables, tmpl.vars);
- }
-
- return expanded;
-}
-
-function parse(template) {
-
- var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
-
- return {
- vars: variables,
- expand: function expand(context) {
- return template.replace(/\{([^{}]+)\}|([^{}]+)/g, function (_, expression, literal) {
- if (expression) {
-
- var operator = null, values = [];
-
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
-
- expression.split(/,/g).forEach(function (variable) {
- var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- variables.push(tmp[1]);
- });
-
- if (operator && operator !== '+') {
-
- var separator = ',';
-
- if (operator === '?') {
- separator = '&';
- } else if (operator !== '#') {
- separator = operator;
- }
-
- return (values.length !== 0 ? operator : '') + values.join(separator);
- } else {
- return values.join(',');
- }
-
- } else {
- return encodeReserved(literal);
- }
- });
- }
- };
-}
-
-function getValues(context, operator, key, modifier) {
-
- var value = context[key], result = [];
-
- if (isDefined(value) && value !== '') {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
- value = value.toString();
-
- if (modifier && modifier !== '*') {
- value = value.substring(0, parseInt(modifier, 10));
- }
-
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- } else {
- if (modifier === '*') {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- var tmp = [];
-
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- tmp.push(encodeValue(operator, value));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- tmp.push(encodeURIComponent(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
-
- if (isKeyOperator(operator)) {
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(','));
- }
- }
- }
- } else {
- if (operator === ';') {
- result.push(encodeURIComponent(key));
- } else if (value === '' && (operator === '&' || operator === '?')) {
- result.push(encodeURIComponent(key) + '=');
- } else if (value === '') {
- result.push('');
- }
- }
-
- return result;
-}
-
-function isDefined(value) {
- return value !== undefined && value !== null;
-}
-
-function isKeyOperator(operator) {
- return operator === ';' || operator === '&' || operator === '?';
-}
-
-function encodeValue(operator, value, key) {
-
- value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
-
- if (key) {
- return encodeURIComponent(key) + '=' + value;
- } else {
- return value;
- }
-}
-
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part);
- }
- return part;
- }).join('');
-}
-
-/**
- * URL Template (RFC 6570) Transform.
- */
-
-function template (options) {
-
- var variables = [], url = expand(options.url, options.params, variables);
-
- variables.forEach(function (key) {
- delete options.params[key];
- });
-
- return url;
-}
-
-/**
- * Service for URL templating.
- */
-
-function Url(url, params) {
-
- var self = this || {}, options$$1 = url, transform;
-
- if (isString(url)) {
- options$$1 = {url: url, params: params};
- }
-
- options$$1 = merge({}, Url.options, self.$options, options$$1);
-
- Url.transforms.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Url.transform[handler];
- }
-
- if (isFunction(handler)) {
- transform = factory(handler, transform, self.$vm);
- }
-
- });
-
- return transform(options$$1);
-}
-
-/**
- * Url options.
- */
-
-Url.options = {
- url: '',
- root: null,
- params: {}
-};
-
-/**
- * Url transforms.
- */
-
-Url.transform = {template: template, query: query, root: root};
-Url.transforms = ['template', 'query', 'root'];
-
-/**
- * Encodes a Url parameter string.
- *
- * @param {Object} obj
- */
-
-Url.params = function (obj) {
-
- var params = [], escape = encodeURIComponent;
-
- params.add = function (key, value) {
-
- if (isFunction(value)) {
- value = value();
- }
-
- if (value === null) {
- value = '';
- }
-
- this.push(escape(key) + '=' + escape(value));
- };
-
- serialize(params, obj);
-
- return params.join('&').replace(/%20/g, '+');
-};
-
-/**
- * Parse a URL and return its components.
- *
- * @param {String} url
- */
-
-Url.parse = function (url) {
-
- var el = document.createElement('a');
-
- if (document.documentMode) {
- el.href = url;
- url = el.href;
- }
-
- el.href = url;
-
- return {
- href: el.href,
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
- port: el.port,
- host: el.host,
- hostname: el.hostname,
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
- search: el.search ? el.search.replace(/^\?/, '') : '',
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
- };
-};
-
-function factory(handler, next, vm) {
- return function (options$$1) {
- return handler.call(vm, options$$1, next);
- };
-}
-
-function serialize(params, obj, scope) {
-
- var array = isArray(obj), plain = isPlainObject(obj), hash;
-
- each(obj, function (value, key) {
-
- hash = isObject(value) || isArray(value);
-
- if (scope) {
- key = scope + '[' + (plain || hash ? key : '') + ']';
- }
-
- if (!scope && array) {
- params.add(value.name, value.value);
- } else if (hash) {
- serialize(params, value, key);
- } else {
- params.add(key, value);
- }
- });
-}
-
-/**
- * XDomain client (Internet Explorer).
- */
-
-function xdrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xdr = new XDomainRequest(), handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load') {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- resolve(request.respondWith(xdr.responseText, {status: status}));
- };
-
- request.abort = function () { return xdr.abort(); };
-
- xdr.open(request.method, request.getUrl());
-
- if (request.timeout) {
- xdr.timeout = request.timeout;
- }
-
- xdr.onload = handler;
- xdr.onabort = handler;
- xdr.onerror = handler;
- xdr.ontimeout = handler;
- xdr.onprogress = function () {};
- xdr.send(request.getBody());
- });
-}
-
-/**
- * CORS Interceptor.
- */
-
-var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
-
-function cors (request) {
-
- if (inBrowser) {
-
- var orgUrl = Url.parse(location.href);
- var reqUrl = Url.parse(request.getUrl());
-
- if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
-
- request.crossOrigin = true;
- request.emulateHTTP = false;
-
- if (!SUPPORTS_CORS) {
- request.client = xdrClient;
- }
- }
- }
-
-}
-
-/**
- * Form data Interceptor.
- */
-
-function form (request) {
-
- if (isFormData(request.body)) {
- request.headers.delete('Content-Type');
- } else if (isObject(request.body) && request.emulateJSON) {
- request.body = Url.params(request.body);
- request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
- }
-
-}
-
-/**
- * JSON Interceptor.
- */
-
-function json (request) {
-
- var type = request.headers.get('Content-Type') || '';
-
- if (isObject(request.body) && type.indexOf('application/json') === 0) {
- request.body = JSON.stringify(request.body);
- }
-
- return function (response) {
-
- return response.bodyText ? when(response.text(), function (text) {
-
- var type = response.headers.get('Content-Type') || '';
-
- if (type.indexOf('application/json') === 0 || isJson(text)) {
-
- try {
- response.body = JSON.parse(text);
- } catch (e) {
- response.body = null;
- }
-
- } else {
- response.body = text;
- }
-
- return response;
-
- }) : response;
-
- };
-}
-
-function isJson(str) {
-
- var start = str.match(/^\s*(\[|\{)/);
- var end = {'[': /]\s*$/, '{': /}\s*$/};
-
- return start && end[start[1]].test(str);
-}
-
-/**
- * JSONP client (Browser).
- */
-
-function jsonpClient (request) {
- return new PromiseObj(function (resolve) {
-
- var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
-
- handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load' && body !== null) {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- if (status && window[callback]) {
- delete window[callback];
- document.body.removeChild(script);
- }
-
- resolve(request.respondWith(body, {status: status}));
- };
-
- window[callback] = function (result) {
- body = JSON.stringify(result);
- };
-
- request.abort = function () {
- handler({type: 'abort'});
- };
-
- request.params[name] = callback;
-
- if (request.timeout) {
- setTimeout(request.abort, request.timeout);
- }
-
- script = document.createElement('script');
- script.src = request.getUrl();
- script.type = 'text/javascript';
- script.async = true;
- script.onload = handler;
- script.onerror = handler;
-
- document.body.appendChild(script);
- });
-}
-
-/**
- * JSONP Interceptor.
- */
-
-function jsonp (request) {
-
- if (request.method == 'JSONP') {
- request.client = jsonpClient;
- }
-
-}
-
-/**
- * Before Interceptor.
- */
-
-function before (request) {
-
- if (isFunction(request.before)) {
- request.before.call(this, request);
- }
-
-}
-
-/**
- * HTTP method override Interceptor.
- */
-
-function method (request) {
-
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
- request.headers.set('X-HTTP-Method-Override', request.method);
- request.method = 'POST';
- }
-
-}
-
-/**
- * Header Interceptor.
- */
-
-function header (request) {
-
- var headers = assign({}, Http.headers.common,
- !request.crossOrigin ? Http.headers.custom : {},
- Http.headers[toLower(request.method)]
- );
-
- each(headers, function (value, name) {
- if (!request.headers.has(name)) {
- request.headers.set(name, value);
- }
- });
-
-}
-
-/**
- * XMLHttp client (Browser).
- */
-
-function xhrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xhr = new XMLHttpRequest(), handler = function (event) {
-
- var response = request.respondWith(
- 'response' in xhr ? xhr.response : xhr.responseText, {
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
- });
-
- each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
- response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
- });
-
- resolve(response);
- };
-
- request.abort = function () { return xhr.abort(); };
-
- xhr.open(request.method, request.getUrl(), true);
-
- if (request.timeout) {
- xhr.timeout = request.timeout;
- }
-
- if (request.responseType && 'responseType' in xhr) {
- xhr.responseType = request.responseType;
- }
-
- if (request.withCredentials || request.credentials) {
- xhr.withCredentials = true;
- }
-
- if (!request.crossOrigin) {
- request.headers.set('X-Requested-With', 'XMLHttpRequest');
- }
-
- // deprecated use downloadProgress
- if (isFunction(request.progress) && request.method === 'GET') {
- xhr.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.downloadProgress)) {
- xhr.addEventListener('progress', request.downloadProgress);
- }
-
- // deprecated use uploadProgress
- if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
- xhr.upload.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.uploadProgress) && xhr.upload) {
- xhr.upload.addEventListener('progress', request.uploadProgress);
- }
-
- request.headers.forEach(function (value, name) {
- xhr.setRequestHeader(name, value);
- });
-
- xhr.onload = handler;
- xhr.onabort = handler;
- xhr.onerror = handler;
- xhr.ontimeout = handler;
- xhr.send(request.getBody());
- });
-}
-
-/**
- * Http client (Node).
- */
-
-function nodeClient (request) {
-
- var client = require('got');
-
- return new PromiseObj(function (resolve) {
-
- var url = request.getUrl();
- var body = request.getBody();
- var method = request.method;
- var headers = {}, handler;
-
- request.headers.forEach(function (value, name) {
- headers[name] = value;
- });
-
- client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {
-
- var response = request.respondWith(resp.body, {
- status: resp.statusCode,
- statusText: trim(resp.statusMessage)
- });
-
- each(resp.headers, function (value, name) {
- response.headers.set(name, value);
- });
-
- resolve(response);
-
- }, function (error$$1) { return handler(error$$1.response); });
- });
-}
-
-/**
- * Base client.
- */
-
-function Client (context) {
-
- var reqHandlers = [sendRequest], resHandlers = [];
-
- if (!isObject(context)) {
- context = null;
- }
-
- function Client(request) {
- while (reqHandlers.length) {
-
- var handler = reqHandlers.pop();
-
- if (isFunction(handler)) {
-
- var response = (void 0), next = (void 0);
-
- response = handler.call(context, request, function (val) { return next = val; }) || next;
-
- if (isObject(response)) {
- return new PromiseObj(function (resolve, reject) {
-
- resHandlers.forEach(function (handler) {
- response = when(response, function (response) {
- return handler.call(context, response) || response;
- }, reject);
- });
-
- when(response, resolve, reject);
-
- }, context);
- }
-
- if (isFunction(response)) {
- resHandlers.unshift(response);
- }
-
- } else {
- warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
- }
- }
- }
-
- Client.use = function (handler) {
- reqHandlers.push(handler);
- };
-
- return Client;
-}
-
-function sendRequest(request) {
-
- var client = request.client || (inBrowser ? xhrClient : nodeClient);
-
- return client(request);
-}
-
-/**
- * HTTP Headers.
- */
-
-var Headers = function Headers(headers) {
- var this$1 = this;
-
-
- this.map = {};
-
- each(headers, function (value, name) { return this$1.append(name, value); });
-};
-
-Headers.prototype.has = function has (name) {
- return getName(this.map, name) !== null;
-};
-
-Headers.prototype.get = function get (name) {
-
- var list = this.map[getName(this.map, name)];
-
- return list ? list.join() : null;
-};
-
-Headers.prototype.getAll = function getAll (name) {
- return this.map[getName(this.map, name)] || [];
-};
-
-Headers.prototype.set = function set (name, value) {
- this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
-};
-
-Headers.prototype.append = function append (name, value) {
-
- var list = this.map[getName(this.map, name)];
-
- if (list) {
- list.push(trim(value));
- } else {
- this.set(name, value);
- }
-};
-
-Headers.prototype.delete = function delete$1 (name) {
- delete this.map[getName(this.map, name)];
-};
-
-Headers.prototype.deleteAll = function deleteAll () {
- this.map = {};
-};
-
-Headers.prototype.forEach = function forEach (callback, thisArg) {
- var this$1 = this;
-
- each(this.map, function (list, name) {
- each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
- });
-};
-
-function getName(map, name) {
- return Object.keys(map).reduce(function (prev, curr) {
- return toLower(name) === toLower(curr) ? curr : prev;
- }, null);
-}
-
-function normalizeName(name) {
-
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name');
- }
-
- return trim(name);
-}
-
-/**
- * HTTP Response.
- */
-
-var Response = function Response(body, ref) {
- var url = ref.url;
- var headers = ref.headers;
- var status = ref.status;
- var statusText = ref.statusText;
-
-
- this.url = url;
- this.ok = status >= 200 && status < 300;
- this.status = status || 0;
- this.statusText = statusText || '';
- this.headers = new Headers(headers);
- this.body = body;
-
- if (isString(body)) {
-
- this.bodyText = body;
-
- } else if (isBlob(body)) {
-
- this.bodyBlob = body;
-
- if (isBlobText(body)) {
- this.bodyText = blobText(body);
- }
- }
-};
-
-Response.prototype.blob = function blob () {
- return when(this.bodyBlob);
-};
-
-Response.prototype.text = function text () {
- return when(this.bodyText);
-};
-
-Response.prototype.json = function json () {
- return when(this.text(), function (text) { return JSON.parse(text); });
-};
-
-Object.defineProperty(Response.prototype, 'data', {
-
- get: function get() {
- return this.body;
- },
-
- set: function set(body) {
- this.body = body;
- }
-
-});
-
-function blobText(body) {
- return new PromiseObj(function (resolve) {
-
- var reader = new FileReader();
-
- reader.readAsText(body);
- reader.onload = function () {
- resolve(reader.result);
- };
-
- });
-}
-
-function isBlobText(body) {
- return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
-}
-
-/**
- * HTTP Request.
- */
-
-var Request = function Request(options$$1) {
-
- this.body = null;
- this.params = {};
-
- assign(this, options$$1, {
- method: toUpper(options$$1.method || 'GET')
- });
-
- if (!(this.headers instanceof Headers)) {
- this.headers = new Headers(this.headers);
- }
-};
-
-Request.prototype.getUrl = function getUrl () {
- return Url(this);
-};
-
-Request.prototype.getBody = function getBody () {
- return this.body;
-};
-
-Request.prototype.respondWith = function respondWith (body, options$$1) {
- return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
-};
-
-/**
- * Service for sending network requests.
- */
-
-var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
-var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
-
-function Http(options$$1) {
-
- var self = this || {}, client = Client(self.$vm);
-
- defaults(options$$1 || {}, self.$options, Http.options);
-
- Http.interceptors.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Http.interceptor[handler];
- }
-
- if (isFunction(handler)) {
- client.use(handler);
- }
-
- });
-
- return client(new Request(options$$1)).then(function (response) {
-
- return response.ok ? response : PromiseObj.reject(response);
-
- }, function (response) {
-
- if (response instanceof Error) {
- error(response);
- }
-
- return PromiseObj.reject(response);
- });
-}
-
-Http.options = {};
-
-Http.headers = {
- put: JSON_CONTENT_TYPE,
- post: JSON_CONTENT_TYPE,
- patch: JSON_CONTENT_TYPE,
- delete: JSON_CONTENT_TYPE,
- common: COMMON_HEADERS,
- custom: {}
-};
-
-Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
-Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
-
-['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1}));
- };
-
-});
-
-['post', 'put', 'patch'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, body, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
- };
-
-});
-
-/**
- * Service for interacting with RESTful services.
- */
-
-function Resource(url, params, actions, options$$1) {
-
- var self = this || {}, resource = {};
-
- actions = assign({},
- Resource.actions,
- actions
- );
-
- each(actions, function (action, name) {
-
- action = merge({url: url, params: assign({}, params)}, options$$1, action);
-
- resource[name] = function () {
- return (self.$http || Http)(opts(action, arguments));
- };
- });
-
- return resource;
-}
-
-function opts(action, args) {
-
- var options$$1 = assign({}, action), params = {}, body;
-
- switch (args.length) {
-
- case 2:
-
- params = args[0];
- body = args[1];
-
- break;
-
- case 1:
-
- if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
- body = args[0];
- } else {
- params = args[0];
- }
-
- break;
-
- case 0:
-
- break;
-
- default:
-
- throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
- }
-
- options$$1.body = body;
- options$$1.params = assign({}, options$$1.params, params);
-
- return options$$1;
-}
-
-Resource.actions = {
-
- get: {method: 'GET'},
- save: {method: 'POST'},
- query: {method: 'GET'},
- update: {method: 'PUT'},
- remove: {method: 'DELETE'},
- delete: {method: 'DELETE'}
-
-};
-
-/**
- * Install plugin.
- */
-
-function plugin(Vue) {
-
- if (plugin.installed) {
- return;
- }
-
- Util(Vue);
-
- Vue.url = Url;
- Vue.http = Http;
- Vue.resource = Resource;
- Vue.Promise = PromiseObj;
-
- Object.defineProperties(Vue.prototype, {
-
- $url: {
- get: function get() {
- return options(Vue.url, this, this.$options.url);
- }
- },
-
- $http: {
- get: function get() {
- return options(Vue.http, this, this.$options.http);
- }
- },
-
- $resource: {
- get: function get() {
- return Vue.resource.bind(this);
- }
- },
-
- $promise: {
- get: function get() {
- var this$1 = this;
-
- return function (executor) { return new Vue.Promise(executor, this$1); };
- }
- }
-
- });
-}
-
-if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(plugin);
-}
-
-module.exports = plugin;
+++ /dev/null
-/*!
- * vue-resource v1.5.0
- * https://github.com/pagekit/vue-resource
- * Released under the MIT License.
- */
-
-/**
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
- */
-
-var RESOLVED = 0;
-var REJECTED = 1;
-var PENDING = 2;
-
-function Promise$1(executor) {
-
- this.state = PENDING;
- this.value = undefined;
- this.deferred = [];
-
- var promise = this;
-
- try {
- executor(function (x) {
- promise.resolve(x);
- }, function (r) {
- promise.reject(r);
- });
- } catch (e) {
- promise.reject(e);
- }
-}
-
-Promise$1.reject = function (r) {
- return new Promise$1(function (resolve, reject) {
- reject(r);
- });
-};
-
-Promise$1.resolve = function (x) {
- return new Promise$1(function (resolve, reject) {
- resolve(x);
- });
-};
-
-Promise$1.all = function all(iterable) {
- return new Promise$1(function (resolve, reject) {
- var count = 0, result = [];
-
- if (iterable.length === 0) {
- resolve(result);
- }
-
- function resolver(i) {
- return function (x) {
- result[i] = x;
- count += 1;
-
- if (count === iterable.length) {
- resolve(result);
- }
- };
- }
-
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolver(i), reject);
- }
- });
-};
-
-Promise$1.race = function race(iterable) {
- return new Promise$1(function (resolve, reject) {
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolve, reject);
- }
- });
-};
-
-var p = Promise$1.prototype;
-
-p.resolve = function resolve(x) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (x === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- var called = false;
-
- try {
- var then = x && x['then'];
-
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
- then.call(x, function (x) {
- if (!called) {
- promise.resolve(x);
- }
- called = true;
-
- }, function (r) {
- if (!called) {
- promise.reject(r);
- }
- called = true;
- });
- return;
- }
- } catch (e) {
- if (!called) {
- promise.reject(e);
- }
- return;
- }
-
- promise.state = RESOLVED;
- promise.value = x;
- promise.notify();
- }
-};
-
-p.reject = function reject(reason) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (reason === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- promise.state = REJECTED;
- promise.value = reason;
- promise.notify();
- }
-};
-
-p.notify = function notify() {
- var promise = this;
-
- nextTick(function () {
- if (promise.state !== PENDING) {
- while (promise.deferred.length) {
- var deferred = promise.deferred.shift(),
- onResolved = deferred[0],
- onRejected = deferred[1],
- resolve = deferred[2],
- reject = deferred[3];
-
- try {
- if (promise.state === RESOLVED) {
- if (typeof onResolved === 'function') {
- resolve(onResolved.call(undefined, promise.value));
- } else {
- resolve(promise.value);
- }
- } else if (promise.state === REJECTED) {
- if (typeof onRejected === 'function') {
- resolve(onRejected.call(undefined, promise.value));
- } else {
- reject(promise.value);
- }
- }
- } catch (e) {
- reject(e);
- }
- }
- }
- });
-};
-
-p.then = function then(onResolved, onRejected) {
- var promise = this;
-
- return new Promise$1(function (resolve, reject) {
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
- promise.notify();
- });
-};
-
-p.catch = function (onRejected) {
- return this.then(undefined, onRejected);
-};
-
-/**
- * Promise adapter.
- */
-
-if (typeof Promise === 'undefined') {
- window.Promise = Promise$1;
-}
-
-function PromiseObj(executor, context) {
-
- if (executor instanceof Promise) {
- this.promise = executor;
- } else {
- this.promise = new Promise(executor.bind(context));
- }
-
- this.context = context;
-}
-
-PromiseObj.all = function (iterable, context) {
- return new PromiseObj(Promise.all(iterable), context);
-};
-
-PromiseObj.resolve = function (value, context) {
- return new PromiseObj(Promise.resolve(value), context);
-};
-
-PromiseObj.reject = function (reason, context) {
- return new PromiseObj(Promise.reject(reason), context);
-};
-
-PromiseObj.race = function (iterable, context) {
- return new PromiseObj(Promise.race(iterable), context);
-};
-
-var p$1 = PromiseObj.prototype;
-
-p$1.bind = function (context) {
- this.context = context;
- return this;
-};
-
-p$1.then = function (fulfilled, rejected) {
-
- if (fulfilled && fulfilled.bind && this.context) {
- fulfilled = fulfilled.bind(this.context);
- }
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
-};
-
-p$1.catch = function (rejected) {
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.catch(rejected), this.context);
-};
-
-p$1.finally = function (callback) {
-
- return this.then(function (value) {
- callback.call(this);
- return value;
- }, function (reason) {
- callback.call(this);
- return Promise.reject(reason);
- }
- );
-};
-
-/**
- * Utility functions.
- */
-
-var ref = {};
-var hasOwnProperty = ref.hasOwnProperty;
-var ref$1 = [];
-var slice = ref$1.slice;
-var debug = false, ntick;
-
-var inBrowser = typeof window !== 'undefined';
-
-function Util (ref) {
- var config = ref.config;
- var nextTick = ref.nextTick;
-
- ntick = nextTick;
- debug = config.debug || !config.silent;
-}
-
-function warn(msg) {
- if (typeof console !== 'undefined' && debug) {
- console.warn('[VueResource warn]: ' + msg);
- }
-}
-
-function error(msg) {
- if (typeof console !== 'undefined') {
- console.error(msg);
- }
-}
-
-function nextTick(cb, ctx) {
- return ntick(cb, ctx);
-}
-
-function trim(str) {
- return str ? str.replace(/^\s*|\s*$/g, '') : '';
-}
-
-function trimEnd(str, chars) {
-
- if (str && chars === undefined) {
- return str.replace(/\s+$/, '');
- }
-
- if (!str || !chars) {
- return str;
- }
-
- return str.replace(new RegExp(("[" + chars + "]+$")), '');
-}
-
-function toLower(str) {
- return str ? str.toLowerCase() : '';
-}
-
-function toUpper(str) {
- return str ? str.toUpperCase() : '';
-}
-
-var isArray = Array.isArray;
-
-function isString(val) {
- return typeof val === 'string';
-}
-
-function isFunction(val) {
- return typeof val === 'function';
-}
-
-function isObject(obj) {
- return obj !== null && typeof obj === 'object';
-}
-
-function isPlainObject(obj) {
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
-}
-
-function isBlob(obj) {
- return typeof Blob !== 'undefined' && obj instanceof Blob;
-}
-
-function isFormData(obj) {
- return typeof FormData !== 'undefined' && obj instanceof FormData;
-}
-
-function when(value, fulfilled, rejected) {
-
- var promise = PromiseObj.resolve(value);
-
- if (arguments.length < 2) {
- return promise;
- }
-
- return promise.then(fulfilled, rejected);
-}
-
-function options(fn, obj, opts) {
-
- opts = opts || {};
-
- if (isFunction(opts)) {
- opts = opts.call(obj);
- }
-
- return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
-}
-
-function each(obj, iterator) {
-
- var i, key;
-
- if (isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- iterator.call(obj[i], obj[i], i);
- }
- } else if (isObject(obj)) {
- for (key in obj) {
- if (hasOwnProperty.call(obj, key)) {
- iterator.call(obj[key], obj[key], key);
- }
- }
- }
-
- return obj;
-}
-
-var assign = Object.assign || _assign;
-
-function merge(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source, true);
- });
-
- return target;
-}
-
-function defaults(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
-
- for (var key in source) {
- if (target[key] === undefined) {
- target[key] = source[key];
- }
- }
-
- });
-
- return target;
-}
-
-function _assign(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source);
- });
-
- return target;
-}
-
-function _merge(target, source, deep) {
- for (var key in source) {
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
- target[key] = {};
- }
- if (isArray(source[key]) && !isArray(target[key])) {
- target[key] = [];
- }
- _merge(target[key], source[key], deep);
- } else if (source[key] !== undefined) {
- target[key] = source[key];
- }
- }
-}
-
-/**
- * Root Prefix Transform.
- */
-
-function root (options$$1, next) {
-
- var url = next(options$$1);
-
- if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
- url = trimEnd(options$$1.root, '/') + '/' + url;
- }
-
- return url;
-}
-
-/**
- * Query Parameter Transform.
- */
-
-function query (options$$1, next) {
-
- var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);
-
- each(options$$1.params, function (value, key) {
- if (urlParams.indexOf(key) === -1) {
- query[key] = value;
- }
- });
-
- query = Url.params(query);
-
- if (query) {
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
- }
-
- return url;
-}
-
-/**
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
- */
-
-function expand(url, params, variables) {
-
- var tmpl = parse(url), expanded = tmpl.expand(params);
-
- if (variables) {
- variables.push.apply(variables, tmpl.vars);
- }
-
- return expanded;
-}
-
-function parse(template) {
-
- var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
-
- return {
- vars: variables,
- expand: function expand(context) {
- return template.replace(/\{([^{}]+)\}|([^{}]+)/g, function (_, expression, literal) {
- if (expression) {
-
- var operator = null, values = [];
-
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
-
- expression.split(/,/g).forEach(function (variable) {
- var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- variables.push(tmp[1]);
- });
-
- if (operator && operator !== '+') {
-
- var separator = ',';
-
- if (operator === '?') {
- separator = '&';
- } else if (operator !== '#') {
- separator = operator;
- }
-
- return (values.length !== 0 ? operator : '') + values.join(separator);
- } else {
- return values.join(',');
- }
-
- } else {
- return encodeReserved(literal);
- }
- });
- }
- };
-}
-
-function getValues(context, operator, key, modifier) {
-
- var value = context[key], result = [];
-
- if (isDefined(value) && value !== '') {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
- value = value.toString();
-
- if (modifier && modifier !== '*') {
- value = value.substring(0, parseInt(modifier, 10));
- }
-
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- } else {
- if (modifier === '*') {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- var tmp = [];
-
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- tmp.push(encodeValue(operator, value));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- tmp.push(encodeURIComponent(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
-
- if (isKeyOperator(operator)) {
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(','));
- }
- }
- }
- } else {
- if (operator === ';') {
- result.push(encodeURIComponent(key));
- } else if (value === '' && (operator === '&' || operator === '?')) {
- result.push(encodeURIComponent(key) + '=');
- } else if (value === '') {
- result.push('');
- }
- }
-
- return result;
-}
-
-function isDefined(value) {
- return value !== undefined && value !== null;
-}
-
-function isKeyOperator(operator) {
- return operator === ';' || operator === '&' || operator === '?';
-}
-
-function encodeValue(operator, value, key) {
-
- value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
-
- if (key) {
- return encodeURIComponent(key) + '=' + value;
- } else {
- return value;
- }
-}
-
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part);
- }
- return part;
- }).join('');
-}
-
-/**
- * URL Template (RFC 6570) Transform.
- */
-
-function template (options) {
-
- var variables = [], url = expand(options.url, options.params, variables);
-
- variables.forEach(function (key) {
- delete options.params[key];
- });
-
- return url;
-}
-
-/**
- * Service for URL templating.
- */
-
-function Url(url, params) {
-
- var self = this || {}, options$$1 = url, transform;
-
- if (isString(url)) {
- options$$1 = {url: url, params: params};
- }
-
- options$$1 = merge({}, Url.options, self.$options, options$$1);
-
- Url.transforms.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Url.transform[handler];
- }
-
- if (isFunction(handler)) {
- transform = factory(handler, transform, self.$vm);
- }
-
- });
-
- return transform(options$$1);
-}
-
-/**
- * Url options.
- */
-
-Url.options = {
- url: '',
- root: null,
- params: {}
-};
-
-/**
- * Url transforms.
- */
-
-Url.transform = {template: template, query: query, root: root};
-Url.transforms = ['template', 'query', 'root'];
-
-/**
- * Encodes a Url parameter string.
- *
- * @param {Object} obj
- */
-
-Url.params = function (obj) {
-
- var params = [], escape = encodeURIComponent;
-
- params.add = function (key, value) {
-
- if (isFunction(value)) {
- value = value();
- }
-
- if (value === null) {
- value = '';
- }
-
- this.push(escape(key) + '=' + escape(value));
- };
-
- serialize(params, obj);
-
- return params.join('&').replace(/%20/g, '+');
-};
-
-/**
- * Parse a URL and return its components.
- *
- * @param {String} url
- */
-
-Url.parse = function (url) {
-
- var el = document.createElement('a');
-
- if (document.documentMode) {
- el.href = url;
- url = el.href;
- }
-
- el.href = url;
-
- return {
- href: el.href,
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
- port: el.port,
- host: el.host,
- hostname: el.hostname,
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
- search: el.search ? el.search.replace(/^\?/, '') : '',
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
- };
-};
-
-function factory(handler, next, vm) {
- return function (options$$1) {
- return handler.call(vm, options$$1, next);
- };
-}
-
-function serialize(params, obj, scope) {
-
- var array = isArray(obj), plain = isPlainObject(obj), hash;
-
- each(obj, function (value, key) {
-
- hash = isObject(value) || isArray(value);
-
- if (scope) {
- key = scope + '[' + (plain || hash ? key : '') + ']';
- }
-
- if (!scope && array) {
- params.add(value.name, value.value);
- } else if (hash) {
- serialize(params, value, key);
- } else {
- params.add(key, value);
- }
- });
-}
-
-/**
- * XDomain client (Internet Explorer).
- */
-
-function xdrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xdr = new XDomainRequest(), handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load') {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- resolve(request.respondWith(xdr.responseText, {status: status}));
- };
-
- request.abort = function () { return xdr.abort(); };
-
- xdr.open(request.method, request.getUrl());
-
- if (request.timeout) {
- xdr.timeout = request.timeout;
- }
-
- xdr.onload = handler;
- xdr.onabort = handler;
- xdr.onerror = handler;
- xdr.ontimeout = handler;
- xdr.onprogress = function () {};
- xdr.send(request.getBody());
- });
-}
-
-/**
- * CORS Interceptor.
- */
-
-var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
-
-function cors (request) {
-
- if (inBrowser) {
-
- var orgUrl = Url.parse(location.href);
- var reqUrl = Url.parse(request.getUrl());
-
- if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
-
- request.crossOrigin = true;
- request.emulateHTTP = false;
-
- if (!SUPPORTS_CORS) {
- request.client = xdrClient;
- }
- }
- }
-
-}
-
-/**
- * Form data Interceptor.
- */
-
-function form (request) {
-
- if (isFormData(request.body)) {
- request.headers.delete('Content-Type');
- } else if (isObject(request.body) && request.emulateJSON) {
- request.body = Url.params(request.body);
- request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
- }
-
-}
-
-/**
- * JSON Interceptor.
- */
-
-function json (request) {
-
- var type = request.headers.get('Content-Type') || '';
-
- if (isObject(request.body) && type.indexOf('application/json') === 0) {
- request.body = JSON.stringify(request.body);
- }
-
- return function (response) {
-
- return response.bodyText ? when(response.text(), function (text) {
-
- var type = response.headers.get('Content-Type') || '';
-
- if (type.indexOf('application/json') === 0 || isJson(text)) {
-
- try {
- response.body = JSON.parse(text);
- } catch (e) {
- response.body = null;
- }
-
- } else {
- response.body = text;
- }
-
- return response;
-
- }) : response;
-
- };
-}
-
-function isJson(str) {
-
- var start = str.match(/^\s*(\[|\{)/);
- var end = {'[': /]\s*$/, '{': /}\s*$/};
-
- return start && end[start[1]].test(str);
-}
-
-/**
- * JSONP client (Browser).
- */
-
-function jsonpClient (request) {
- return new PromiseObj(function (resolve) {
-
- var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
-
- handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load' && body !== null) {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- if (status && window[callback]) {
- delete window[callback];
- document.body.removeChild(script);
- }
-
- resolve(request.respondWith(body, {status: status}));
- };
-
- window[callback] = function (result) {
- body = JSON.stringify(result);
- };
-
- request.abort = function () {
- handler({type: 'abort'});
- };
-
- request.params[name] = callback;
-
- if (request.timeout) {
- setTimeout(request.abort, request.timeout);
- }
-
- script = document.createElement('script');
- script.src = request.getUrl();
- script.type = 'text/javascript';
- script.async = true;
- script.onload = handler;
- script.onerror = handler;
-
- document.body.appendChild(script);
- });
-}
-
-/**
- * JSONP Interceptor.
- */
-
-function jsonp (request) {
-
- if (request.method == 'JSONP') {
- request.client = jsonpClient;
- }
-
-}
-
-/**
- * Before Interceptor.
- */
-
-function before (request) {
-
- if (isFunction(request.before)) {
- request.before.call(this, request);
- }
-
-}
-
-/**
- * HTTP method override Interceptor.
- */
-
-function method (request) {
-
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
- request.headers.set('X-HTTP-Method-Override', request.method);
- request.method = 'POST';
- }
-
-}
-
-/**
- * Header Interceptor.
- */
-
-function header (request) {
-
- var headers = assign({}, Http.headers.common,
- !request.crossOrigin ? Http.headers.custom : {},
- Http.headers[toLower(request.method)]
- );
-
- each(headers, function (value, name) {
- if (!request.headers.has(name)) {
- request.headers.set(name, value);
- }
- });
-
-}
-
-/**
- * XMLHttp client (Browser).
- */
-
-function xhrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xhr = new XMLHttpRequest(), handler = function (event) {
-
- var response = request.respondWith(
- 'response' in xhr ? xhr.response : xhr.responseText, {
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
- });
-
- each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
- response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
- });
-
- resolve(response);
- };
-
- request.abort = function () { return xhr.abort(); };
-
- xhr.open(request.method, request.getUrl(), true);
-
- if (request.timeout) {
- xhr.timeout = request.timeout;
- }
-
- if (request.responseType && 'responseType' in xhr) {
- xhr.responseType = request.responseType;
- }
-
- if (request.withCredentials || request.credentials) {
- xhr.withCredentials = true;
- }
-
- if (!request.crossOrigin) {
- request.headers.set('X-Requested-With', 'XMLHttpRequest');
- }
-
- // deprecated use downloadProgress
- if (isFunction(request.progress) && request.method === 'GET') {
- xhr.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.downloadProgress)) {
- xhr.addEventListener('progress', request.downloadProgress);
- }
-
- // deprecated use uploadProgress
- if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
- xhr.upload.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.uploadProgress) && xhr.upload) {
- xhr.upload.addEventListener('progress', request.uploadProgress);
- }
-
- request.headers.forEach(function (value, name) {
- xhr.setRequestHeader(name, value);
- });
-
- xhr.onload = handler;
- xhr.onabort = handler;
- xhr.onerror = handler;
- xhr.ontimeout = handler;
- xhr.send(request.getBody());
- });
-}
-
-/**
- * Http client (Node).
- */
-
-function nodeClient (request) {
-
- var client = require('got');
-
- return new PromiseObj(function (resolve) {
-
- var url = request.getUrl();
- var body = request.getBody();
- var method = request.method;
- var headers = {}, handler;
-
- request.headers.forEach(function (value, name) {
- headers[name] = value;
- });
-
- client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {
-
- var response = request.respondWith(resp.body, {
- status: resp.statusCode,
- statusText: trim(resp.statusMessage)
- });
-
- each(resp.headers, function (value, name) {
- response.headers.set(name, value);
- });
-
- resolve(response);
-
- }, function (error$$1) { return handler(error$$1.response); });
- });
-}
-
-/**
- * Base client.
- */
-
-function Client (context) {
-
- var reqHandlers = [sendRequest], resHandlers = [];
-
- if (!isObject(context)) {
- context = null;
- }
-
- function Client(request) {
- while (reqHandlers.length) {
-
- var handler = reqHandlers.pop();
-
- if (isFunction(handler)) {
-
- var response = (void 0), next = (void 0);
-
- response = handler.call(context, request, function (val) { return next = val; }) || next;
-
- if (isObject(response)) {
- return new PromiseObj(function (resolve, reject) {
-
- resHandlers.forEach(function (handler) {
- response = when(response, function (response) {
- return handler.call(context, response) || response;
- }, reject);
- });
-
- when(response, resolve, reject);
-
- }, context);
- }
-
- if (isFunction(response)) {
- resHandlers.unshift(response);
- }
-
- } else {
- warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
- }
- }
- }
-
- Client.use = function (handler) {
- reqHandlers.push(handler);
- };
-
- return Client;
-}
-
-function sendRequest(request) {
-
- var client = request.client || (inBrowser ? xhrClient : nodeClient);
-
- return client(request);
-}
-
-/**
- * HTTP Headers.
- */
-
-var Headers = function Headers(headers) {
- var this$1 = this;
-
-
- this.map = {};
-
- each(headers, function (value, name) { return this$1.append(name, value); });
-};
-
-Headers.prototype.has = function has (name) {
- return getName(this.map, name) !== null;
-};
-
-Headers.prototype.get = function get (name) {
-
- var list = this.map[getName(this.map, name)];
-
- return list ? list.join() : null;
-};
-
-Headers.prototype.getAll = function getAll (name) {
- return this.map[getName(this.map, name)] || [];
-};
-
-Headers.prototype.set = function set (name, value) {
- this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
-};
-
-Headers.prototype.append = function append (name, value) {
-
- var list = this.map[getName(this.map, name)];
-
- if (list) {
- list.push(trim(value));
- } else {
- this.set(name, value);
- }
-};
-
-Headers.prototype.delete = function delete$1 (name) {
- delete this.map[getName(this.map, name)];
-};
-
-Headers.prototype.deleteAll = function deleteAll () {
- this.map = {};
-};
-
-Headers.prototype.forEach = function forEach (callback, thisArg) {
- var this$1 = this;
-
- each(this.map, function (list, name) {
- each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
- });
-};
-
-function getName(map, name) {
- return Object.keys(map).reduce(function (prev, curr) {
- return toLower(name) === toLower(curr) ? curr : prev;
- }, null);
-}
-
-function normalizeName(name) {
-
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name');
- }
-
- return trim(name);
-}
-
-/**
- * HTTP Response.
- */
-
-var Response = function Response(body, ref) {
- var url = ref.url;
- var headers = ref.headers;
- var status = ref.status;
- var statusText = ref.statusText;
-
-
- this.url = url;
- this.ok = status >= 200 && status < 300;
- this.status = status || 0;
- this.statusText = statusText || '';
- this.headers = new Headers(headers);
- this.body = body;
-
- if (isString(body)) {
-
- this.bodyText = body;
-
- } else if (isBlob(body)) {
-
- this.bodyBlob = body;
-
- if (isBlobText(body)) {
- this.bodyText = blobText(body);
- }
- }
-};
-
-Response.prototype.blob = function blob () {
- return when(this.bodyBlob);
-};
-
-Response.prototype.text = function text () {
- return when(this.bodyText);
-};
-
-Response.prototype.json = function json () {
- return when(this.text(), function (text) { return JSON.parse(text); });
-};
-
-Object.defineProperty(Response.prototype, 'data', {
-
- get: function get() {
- return this.body;
- },
-
- set: function set(body) {
- this.body = body;
- }
-
-});
-
-function blobText(body) {
- return new PromiseObj(function (resolve) {
-
- var reader = new FileReader();
-
- reader.readAsText(body);
- reader.onload = function () {
- resolve(reader.result);
- };
-
- });
-}
-
-function isBlobText(body) {
- return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
-}
-
-/**
- * HTTP Request.
- */
-
-var Request = function Request(options$$1) {
-
- this.body = null;
- this.params = {};
-
- assign(this, options$$1, {
- method: toUpper(options$$1.method || 'GET')
- });
-
- if (!(this.headers instanceof Headers)) {
- this.headers = new Headers(this.headers);
- }
-};
-
-Request.prototype.getUrl = function getUrl () {
- return Url(this);
-};
-
-Request.prototype.getBody = function getBody () {
- return this.body;
-};
-
-Request.prototype.respondWith = function respondWith (body, options$$1) {
- return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
-};
-
-/**
- * Service for sending network requests.
- */
-
-var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
-var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
-
-function Http(options$$1) {
-
- var self = this || {}, client = Client(self.$vm);
-
- defaults(options$$1 || {}, self.$options, Http.options);
-
- Http.interceptors.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Http.interceptor[handler];
- }
-
- if (isFunction(handler)) {
- client.use(handler);
- }
-
- });
-
- return client(new Request(options$$1)).then(function (response) {
-
- return response.ok ? response : PromiseObj.reject(response);
-
- }, function (response) {
-
- if (response instanceof Error) {
- error(response);
- }
-
- return PromiseObj.reject(response);
- });
-}
-
-Http.options = {};
-
-Http.headers = {
- put: JSON_CONTENT_TYPE,
- post: JSON_CONTENT_TYPE,
- patch: JSON_CONTENT_TYPE,
- delete: JSON_CONTENT_TYPE,
- common: COMMON_HEADERS,
- custom: {}
-};
-
-Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
-Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
-
-['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1}));
- };
-
-});
-
-['post', 'put', 'patch'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, body, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
- };
-
-});
-
-/**
- * Service for interacting with RESTful services.
- */
-
-function Resource(url, params, actions, options$$1) {
-
- var self = this || {}, resource = {};
-
- actions = assign({},
- Resource.actions,
- actions
- );
-
- each(actions, function (action, name) {
-
- action = merge({url: url, params: assign({}, params)}, options$$1, action);
-
- resource[name] = function () {
- return (self.$http || Http)(opts(action, arguments));
- };
- });
-
- return resource;
-}
-
-function opts(action, args) {
-
- var options$$1 = assign({}, action), params = {}, body;
-
- switch (args.length) {
-
- case 2:
-
- params = args[0];
- body = args[1];
-
- break;
-
- case 1:
-
- if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
- body = args[0];
- } else {
- params = args[0];
- }
-
- break;
-
- case 0:
-
- break;
-
- default:
-
- throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
- }
-
- options$$1.body = body;
- options$$1.params = assign({}, options$$1.params, params);
-
- return options$$1;
-}
-
-Resource.actions = {
-
- get: {method: 'GET'},
- save: {method: 'POST'},
- query: {method: 'GET'},
- update: {method: 'PUT'},
- remove: {method: 'DELETE'},
- delete: {method: 'DELETE'}
-
-};
-
-/**
- * Install plugin.
- */
-
-function plugin(Vue) {
-
- if (plugin.installed) {
- return;
- }
-
- Util(Vue);
-
- Vue.url = Url;
- Vue.http = Http;
- Vue.resource = Resource;
- Vue.Promise = PromiseObj;
-
- Object.defineProperties(Vue.prototype, {
-
- $url: {
- get: function get() {
- return options(Vue.url, this, this.$options.url);
- }
- },
-
- $http: {
- get: function get() {
- return options(Vue.http, this, this.$options.http);
- }
- },
-
- $resource: {
- get: function get() {
- return Vue.resource.bind(this);
- }
- },
-
- $promise: {
- get: function get() {
- var this$1 = this;
-
- return function (executor) { return new Vue.Promise(executor, this$1); };
- }
- }
-
- });
-}
-
-if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(plugin);
-}
-
-export default plugin;
-export { Url, Http, Resource };
+++ /dev/null
-/*!
- * vue-resource v1.5.0
- * https://github.com/pagekit/vue-resource
- * Released under the MIT License.
- */
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.VueResource = factory());
-}(this, (function () { 'use strict';
-
-/**
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
- */
-
-var RESOLVED = 0;
-var REJECTED = 1;
-var PENDING = 2;
-
-function Promise$1(executor) {
-
- this.state = PENDING;
- this.value = undefined;
- this.deferred = [];
-
- var promise = this;
-
- try {
- executor(function (x) {
- promise.resolve(x);
- }, function (r) {
- promise.reject(r);
- });
- } catch (e) {
- promise.reject(e);
- }
-}
-
-Promise$1.reject = function (r) {
- return new Promise$1(function (resolve, reject) {
- reject(r);
- });
-};
-
-Promise$1.resolve = function (x) {
- return new Promise$1(function (resolve, reject) {
- resolve(x);
- });
-};
-
-Promise$1.all = function all(iterable) {
- return new Promise$1(function (resolve, reject) {
- var count = 0, result = [];
-
- if (iterable.length === 0) {
- resolve(result);
- }
-
- function resolver(i) {
- return function (x) {
- result[i] = x;
- count += 1;
-
- if (count === iterable.length) {
- resolve(result);
- }
- };
- }
-
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolver(i), reject);
- }
- });
-};
-
-Promise$1.race = function race(iterable) {
- return new Promise$1(function (resolve, reject) {
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$1.resolve(iterable[i]).then(resolve, reject);
- }
- });
-};
-
-var p = Promise$1.prototype;
-
-p.resolve = function resolve(x) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (x === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- var called = false;
-
- try {
- var then = x && x['then'];
-
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
- then.call(x, function (x) {
- if (!called) {
- promise.resolve(x);
- }
- called = true;
-
- }, function (r) {
- if (!called) {
- promise.reject(r);
- }
- called = true;
- });
- return;
- }
- } catch (e) {
- if (!called) {
- promise.reject(e);
- }
- return;
- }
-
- promise.state = RESOLVED;
- promise.value = x;
- promise.notify();
- }
-};
-
-p.reject = function reject(reason) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (reason === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- promise.state = REJECTED;
- promise.value = reason;
- promise.notify();
- }
-};
-
-p.notify = function notify() {
- var promise = this;
-
- nextTick(function () {
- if (promise.state !== PENDING) {
- while (promise.deferred.length) {
- var deferred = promise.deferred.shift(),
- onResolved = deferred[0],
- onRejected = deferred[1],
- resolve = deferred[2],
- reject = deferred[3];
-
- try {
- if (promise.state === RESOLVED) {
- if (typeof onResolved === 'function') {
- resolve(onResolved.call(undefined, promise.value));
- } else {
- resolve(promise.value);
- }
- } else if (promise.state === REJECTED) {
- if (typeof onRejected === 'function') {
- resolve(onRejected.call(undefined, promise.value));
- } else {
- reject(promise.value);
- }
- }
- } catch (e) {
- reject(e);
- }
- }
- }
- });
-};
-
-p.then = function then(onResolved, onRejected) {
- var promise = this;
-
- return new Promise$1(function (resolve, reject) {
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
- promise.notify();
- });
-};
-
-p.catch = function (onRejected) {
- return this.then(undefined, onRejected);
-};
-
-/**
- * Promise adapter.
- */
-
-if (typeof Promise === 'undefined') {
- window.Promise = Promise$1;
-}
-
-function PromiseObj(executor, context) {
-
- if (executor instanceof Promise) {
- this.promise = executor;
- } else {
- this.promise = new Promise(executor.bind(context));
- }
-
- this.context = context;
-}
-
-PromiseObj.all = function (iterable, context) {
- return new PromiseObj(Promise.all(iterable), context);
-};
-
-PromiseObj.resolve = function (value, context) {
- return new PromiseObj(Promise.resolve(value), context);
-};
-
-PromiseObj.reject = function (reason, context) {
- return new PromiseObj(Promise.reject(reason), context);
-};
-
-PromiseObj.race = function (iterable, context) {
- return new PromiseObj(Promise.race(iterable), context);
-};
-
-var p$1 = PromiseObj.prototype;
-
-p$1.bind = function (context) {
- this.context = context;
- return this;
-};
-
-p$1.then = function (fulfilled, rejected) {
-
- if (fulfilled && fulfilled.bind && this.context) {
- fulfilled = fulfilled.bind(this.context);
- }
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
-};
-
-p$1.catch = function (rejected) {
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.catch(rejected), this.context);
-};
-
-p$1.finally = function (callback) {
-
- return this.then(function (value) {
- callback.call(this);
- return value;
- }, function (reason) {
- callback.call(this);
- return Promise.reject(reason);
- }
- );
-};
-
-/**
- * Utility functions.
- */
-
-var ref = {};
-var hasOwnProperty = ref.hasOwnProperty;
-var ref$1 = [];
-var slice = ref$1.slice;
-var debug = false, ntick;
-
-var inBrowser = typeof window !== 'undefined';
-
-function Util (ref) {
- var config = ref.config;
- var nextTick = ref.nextTick;
-
- ntick = nextTick;
- debug = config.debug || !config.silent;
-}
-
-function warn(msg) {
- if (typeof console !== 'undefined' && debug) {
- console.warn('[VueResource warn]: ' + msg);
- }
-}
-
-function error(msg) {
- if (typeof console !== 'undefined') {
- console.error(msg);
- }
-}
-
-function nextTick(cb, ctx) {
- return ntick(cb, ctx);
-}
-
-function trim(str) {
- return str ? str.replace(/^\s*|\s*$/g, '') : '';
-}
-
-function trimEnd(str, chars) {
-
- if (str && chars === undefined) {
- return str.replace(/\s+$/, '');
- }
-
- if (!str || !chars) {
- return str;
- }
-
- return str.replace(new RegExp(("[" + chars + "]+$")), '');
-}
-
-function toLower(str) {
- return str ? str.toLowerCase() : '';
-}
-
-function toUpper(str) {
- return str ? str.toUpperCase() : '';
-}
-
-var isArray = Array.isArray;
-
-function isString(val) {
- return typeof val === 'string';
-}
-
-function isFunction(val) {
- return typeof val === 'function';
-}
-
-function isObject(obj) {
- return obj !== null && typeof obj === 'object';
-}
-
-function isPlainObject(obj) {
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
-}
-
-function isBlob(obj) {
- return typeof Blob !== 'undefined' && obj instanceof Blob;
-}
-
-function isFormData(obj) {
- return typeof FormData !== 'undefined' && obj instanceof FormData;
-}
-
-function when(value, fulfilled, rejected) {
-
- var promise = PromiseObj.resolve(value);
-
- if (arguments.length < 2) {
- return promise;
- }
-
- return promise.then(fulfilled, rejected);
-}
-
-function options(fn, obj, opts) {
-
- opts = opts || {};
-
- if (isFunction(opts)) {
- opts = opts.call(obj);
- }
-
- return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
-}
-
-function each(obj, iterator) {
-
- var i, key;
-
- if (isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- iterator.call(obj[i], obj[i], i);
- }
- } else if (isObject(obj)) {
- for (key in obj) {
- if (hasOwnProperty.call(obj, key)) {
- iterator.call(obj[key], obj[key], key);
- }
- }
- }
-
- return obj;
-}
-
-var assign = Object.assign || _assign;
-
-function merge(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source, true);
- });
-
- return target;
-}
-
-function defaults(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
-
- for (var key in source) {
- if (target[key] === undefined) {
- target[key] = source[key];
- }
- }
-
- });
-
- return target;
-}
-
-function _assign(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source);
- });
-
- return target;
-}
-
-function _merge(target, source, deep) {
- for (var key in source) {
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
- target[key] = {};
- }
- if (isArray(source[key]) && !isArray(target[key])) {
- target[key] = [];
- }
- _merge(target[key], source[key], deep);
- } else if (source[key] !== undefined) {
- target[key] = source[key];
- }
- }
-}
-
-/**
- * Root Prefix Transform.
- */
-
-function root (options$$1, next) {
-
- var url = next(options$$1);
-
- if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
- url = trimEnd(options$$1.root, '/') + '/' + url;
- }
-
- return url;
-}
-
-/**
- * Query Parameter Transform.
- */
-
-function query (options$$1, next) {
-
- var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);
-
- each(options$$1.params, function (value, key) {
- if (urlParams.indexOf(key) === -1) {
- query[key] = value;
- }
- });
-
- query = Url.params(query);
-
- if (query) {
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
- }
-
- return url;
-}
-
-/**
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
- */
-
-function expand(url, params, variables) {
-
- var tmpl = parse(url), expanded = tmpl.expand(params);
-
- if (variables) {
- variables.push.apply(variables, tmpl.vars);
- }
-
- return expanded;
-}
-
-function parse(template) {
-
- var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
-
- return {
- vars: variables,
- expand: function expand(context) {
- return template.replace(/\{([^{}]+)\}|([^{}]+)/g, function (_, expression, literal) {
- if (expression) {
-
- var operator = null, values = [];
-
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
-
- expression.split(/,/g).forEach(function (variable) {
- var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- variables.push(tmp[1]);
- });
-
- if (operator && operator !== '+') {
-
- var separator = ',';
-
- if (operator === '?') {
- separator = '&';
- } else if (operator !== '#') {
- separator = operator;
- }
-
- return (values.length !== 0 ? operator : '') + values.join(separator);
- } else {
- return values.join(',');
- }
-
- } else {
- return encodeReserved(literal);
- }
- });
- }
- };
-}
-
-function getValues(context, operator, key, modifier) {
-
- var value = context[key], result = [];
-
- if (isDefined(value) && value !== '') {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
- value = value.toString();
-
- if (modifier && modifier !== '*') {
- value = value.substring(0, parseInt(modifier, 10));
- }
-
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- } else {
- if (modifier === '*') {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- var tmp = [];
-
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- tmp.push(encodeValue(operator, value));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- tmp.push(encodeURIComponent(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
-
- if (isKeyOperator(operator)) {
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(','));
- }
- }
- }
- } else {
- if (operator === ';') {
- result.push(encodeURIComponent(key));
- } else if (value === '' && (operator === '&' || operator === '?')) {
- result.push(encodeURIComponent(key) + '=');
- } else if (value === '') {
- result.push('');
- }
- }
-
- return result;
-}
-
-function isDefined(value) {
- return value !== undefined && value !== null;
-}
-
-function isKeyOperator(operator) {
- return operator === ';' || operator === '&' || operator === '?';
-}
-
-function encodeValue(operator, value, key) {
-
- value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
-
- if (key) {
- return encodeURIComponent(key) + '=' + value;
- } else {
- return value;
- }
-}
-
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part);
- }
- return part;
- }).join('');
-}
-
-/**
- * URL Template (RFC 6570) Transform.
- */
-
-function template (options) {
-
- var variables = [], url = expand(options.url, options.params, variables);
-
- variables.forEach(function (key) {
- delete options.params[key];
- });
-
- return url;
-}
-
-/**
- * Service for URL templating.
- */
-
-function Url(url, params) {
-
- var self = this || {}, options$$1 = url, transform;
-
- if (isString(url)) {
- options$$1 = {url: url, params: params};
- }
-
- options$$1 = merge({}, Url.options, self.$options, options$$1);
-
- Url.transforms.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Url.transform[handler];
- }
-
- if (isFunction(handler)) {
- transform = factory(handler, transform, self.$vm);
- }
-
- });
-
- return transform(options$$1);
-}
-
-/**
- * Url options.
- */
-
-Url.options = {
- url: '',
- root: null,
- params: {}
-};
-
-/**
- * Url transforms.
- */
-
-Url.transform = {template: template, query: query, root: root};
-Url.transforms = ['template', 'query', 'root'];
-
-/**
- * Encodes a Url parameter string.
- *
- * @param {Object} obj
- */
-
-Url.params = function (obj) {
-
- var params = [], escape = encodeURIComponent;
-
- params.add = function (key, value) {
-
- if (isFunction(value)) {
- value = value();
- }
-
- if (value === null) {
- value = '';
- }
-
- this.push(escape(key) + '=' + escape(value));
- };
-
- serialize(params, obj);
-
- return params.join('&').replace(/%20/g, '+');
-};
-
-/**
- * Parse a URL and return its components.
- *
- * @param {String} url
- */
-
-Url.parse = function (url) {
-
- var el = document.createElement('a');
-
- if (document.documentMode) {
- el.href = url;
- url = el.href;
- }
-
- el.href = url;
-
- return {
- href: el.href,
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
- port: el.port,
- host: el.host,
- hostname: el.hostname,
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
- search: el.search ? el.search.replace(/^\?/, '') : '',
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
- };
-};
-
-function factory(handler, next, vm) {
- return function (options$$1) {
- return handler.call(vm, options$$1, next);
- };
-}
-
-function serialize(params, obj, scope) {
-
- var array = isArray(obj), plain = isPlainObject(obj), hash;
-
- each(obj, function (value, key) {
-
- hash = isObject(value) || isArray(value);
-
- if (scope) {
- key = scope + '[' + (plain || hash ? key : '') + ']';
- }
-
- if (!scope && array) {
- params.add(value.name, value.value);
- } else if (hash) {
- serialize(params, value, key);
- } else {
- params.add(key, value);
- }
- });
-}
-
-/**
- * XDomain client (Internet Explorer).
- */
-
-function xdrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xdr = new XDomainRequest(), handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load') {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- resolve(request.respondWith(xdr.responseText, {status: status}));
- };
-
- request.abort = function () { return xdr.abort(); };
-
- xdr.open(request.method, request.getUrl());
-
- if (request.timeout) {
- xdr.timeout = request.timeout;
- }
-
- xdr.onload = handler;
- xdr.onabort = handler;
- xdr.onerror = handler;
- xdr.ontimeout = handler;
- xdr.onprogress = function () {};
- xdr.send(request.getBody());
- });
-}
-
-/**
- * CORS Interceptor.
- */
-
-var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
-
-function cors (request) {
-
- if (inBrowser) {
-
- var orgUrl = Url.parse(location.href);
- var reqUrl = Url.parse(request.getUrl());
-
- if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
-
- request.crossOrigin = true;
- request.emulateHTTP = false;
-
- if (!SUPPORTS_CORS) {
- request.client = xdrClient;
- }
- }
- }
-
-}
-
-/**
- * Form data Interceptor.
- */
-
-function form (request) {
-
- if (isFormData(request.body)) {
- request.headers.delete('Content-Type');
- } else if (isObject(request.body) && request.emulateJSON) {
- request.body = Url.params(request.body);
- request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
- }
-
-}
-
-/**
- * JSON Interceptor.
- */
-
-function json (request) {
-
- var type = request.headers.get('Content-Type') || '';
-
- if (isObject(request.body) && type.indexOf('application/json') === 0) {
- request.body = JSON.stringify(request.body);
- }
-
- return function (response) {
-
- return response.bodyText ? when(response.text(), function (text) {
-
- var type = response.headers.get('Content-Type') || '';
-
- if (type.indexOf('application/json') === 0 || isJson(text)) {
-
- try {
- response.body = JSON.parse(text);
- } catch (e) {
- response.body = null;
- }
-
- } else {
- response.body = text;
- }
-
- return response;
-
- }) : response;
-
- };
-}
-
-function isJson(str) {
-
- var start = str.match(/^\s*(\[|\{)/);
- var end = {'[': /]\s*$/, '{': /}\s*$/};
-
- return start && end[start[1]].test(str);
-}
-
-/**
- * JSONP client (Browser).
- */
-
-function jsonpClient (request) {
- return new PromiseObj(function (resolve) {
-
- var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
-
- handler = function (ref) {
- var type = ref.type;
-
-
- var status = 0;
-
- if (type === 'load' && body !== null) {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- if (status && window[callback]) {
- delete window[callback];
- document.body.removeChild(script);
- }
-
- resolve(request.respondWith(body, {status: status}));
- };
-
- window[callback] = function (result) {
- body = JSON.stringify(result);
- };
-
- request.abort = function () {
- handler({type: 'abort'});
- };
-
- request.params[name] = callback;
-
- if (request.timeout) {
- setTimeout(request.abort, request.timeout);
- }
-
- script = document.createElement('script');
- script.src = request.getUrl();
- script.type = 'text/javascript';
- script.async = true;
- script.onload = handler;
- script.onerror = handler;
-
- document.body.appendChild(script);
- });
-}
-
-/**
- * JSONP Interceptor.
- */
-
-function jsonp (request) {
-
- if (request.method == 'JSONP') {
- request.client = jsonpClient;
- }
-
-}
-
-/**
- * Before Interceptor.
- */
-
-function before (request) {
-
- if (isFunction(request.before)) {
- request.before.call(this, request);
- }
-
-}
-
-/**
- * HTTP method override Interceptor.
- */
-
-function method (request) {
-
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
- request.headers.set('X-HTTP-Method-Override', request.method);
- request.method = 'POST';
- }
-
-}
-
-/**
- * Header Interceptor.
- */
-
-function header (request) {
-
- var headers = assign({}, Http.headers.common,
- !request.crossOrigin ? Http.headers.custom : {},
- Http.headers[toLower(request.method)]
- );
-
- each(headers, function (value, name) {
- if (!request.headers.has(name)) {
- request.headers.set(name, value);
- }
- });
-
-}
-
-/**
- * XMLHttp client (Browser).
- */
-
-function xhrClient (request) {
- return new PromiseObj(function (resolve) {
-
- var xhr = new XMLHttpRequest(), handler = function (event) {
-
- var response = request.respondWith(
- 'response' in xhr ? xhr.response : xhr.responseText, {
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
- });
-
- each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
- response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
- });
-
- resolve(response);
- };
-
- request.abort = function () { return xhr.abort(); };
-
- xhr.open(request.method, request.getUrl(), true);
-
- if (request.timeout) {
- xhr.timeout = request.timeout;
- }
-
- if (request.responseType && 'responseType' in xhr) {
- xhr.responseType = request.responseType;
- }
-
- if (request.withCredentials || request.credentials) {
- xhr.withCredentials = true;
- }
-
- if (!request.crossOrigin) {
- request.headers.set('X-Requested-With', 'XMLHttpRequest');
- }
-
- // deprecated use downloadProgress
- if (isFunction(request.progress) && request.method === 'GET') {
- xhr.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.downloadProgress)) {
- xhr.addEventListener('progress', request.downloadProgress);
- }
-
- // deprecated use uploadProgress
- if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
- xhr.upload.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.uploadProgress) && xhr.upload) {
- xhr.upload.addEventListener('progress', request.uploadProgress);
- }
-
- request.headers.forEach(function (value, name) {
- xhr.setRequestHeader(name, value);
- });
-
- xhr.onload = handler;
- xhr.onabort = handler;
- xhr.onerror = handler;
- xhr.ontimeout = handler;
- xhr.send(request.getBody());
- });
-}
-
-/**
- * Http client (Node).
- */
-
-function nodeClient (request) {
-
- var client = require('got');
-
- return new PromiseObj(function (resolve) {
-
- var url = request.getUrl();
- var body = request.getBody();
- var method = request.method;
- var headers = {}, handler;
-
- request.headers.forEach(function (value, name) {
- headers[name] = value;
- });
-
- client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {
-
- var response = request.respondWith(resp.body, {
- status: resp.statusCode,
- statusText: trim(resp.statusMessage)
- });
-
- each(resp.headers, function (value, name) {
- response.headers.set(name, value);
- });
-
- resolve(response);
-
- }, function (error$$1) { return handler(error$$1.response); });
- });
-}
-
-/**
- * Base client.
- */
-
-function Client (context) {
-
- var reqHandlers = [sendRequest], resHandlers = [];
-
- if (!isObject(context)) {
- context = null;
- }
-
- function Client(request) {
- while (reqHandlers.length) {
-
- var handler = reqHandlers.pop();
-
- if (isFunction(handler)) {
-
- var response = (void 0), next = (void 0);
-
- response = handler.call(context, request, function (val) { return next = val; }) || next;
-
- if (isObject(response)) {
- return new PromiseObj(function (resolve, reject) {
-
- resHandlers.forEach(function (handler) {
- response = when(response, function (response) {
- return handler.call(context, response) || response;
- }, reject);
- });
-
- when(response, resolve, reject);
-
- }, context);
- }
-
- if (isFunction(response)) {
- resHandlers.unshift(response);
- }
-
- } else {
- warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
- }
- }
- }
-
- Client.use = function (handler) {
- reqHandlers.push(handler);
- };
-
- return Client;
-}
-
-function sendRequest(request) {
-
- var client = request.client || (inBrowser ? xhrClient : nodeClient);
-
- return client(request);
-}
-
-/**
- * HTTP Headers.
- */
-
-var Headers = function Headers(headers) {
- var this$1 = this;
-
-
- this.map = {};
-
- each(headers, function (value, name) { return this$1.append(name, value); });
-};
-
-Headers.prototype.has = function has (name) {
- return getName(this.map, name) !== null;
-};
-
-Headers.prototype.get = function get (name) {
-
- var list = this.map[getName(this.map, name)];
-
- return list ? list.join() : null;
-};
-
-Headers.prototype.getAll = function getAll (name) {
- return this.map[getName(this.map, name)] || [];
-};
-
-Headers.prototype.set = function set (name, value) {
- this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
-};
-
-Headers.prototype.append = function append (name, value) {
-
- var list = this.map[getName(this.map, name)];
-
- if (list) {
- list.push(trim(value));
- } else {
- this.set(name, value);
- }
-};
-
-Headers.prototype.delete = function delete$1 (name) {
- delete this.map[getName(this.map, name)];
-};
-
-Headers.prototype.deleteAll = function deleteAll () {
- this.map = {};
-};
-
-Headers.prototype.forEach = function forEach (callback, thisArg) {
- var this$1 = this;
-
- each(this.map, function (list, name) {
- each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
- });
-};
-
-function getName(map, name) {
- return Object.keys(map).reduce(function (prev, curr) {
- return toLower(name) === toLower(curr) ? curr : prev;
- }, null);
-}
-
-function normalizeName(name) {
-
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name');
- }
-
- return trim(name);
-}
-
-/**
- * HTTP Response.
- */
-
-var Response = function Response(body, ref) {
- var url = ref.url;
- var headers = ref.headers;
- var status = ref.status;
- var statusText = ref.statusText;
-
-
- this.url = url;
- this.ok = status >= 200 && status < 300;
- this.status = status || 0;
- this.statusText = statusText || '';
- this.headers = new Headers(headers);
- this.body = body;
-
- if (isString(body)) {
-
- this.bodyText = body;
-
- } else if (isBlob(body)) {
-
- this.bodyBlob = body;
-
- if (isBlobText(body)) {
- this.bodyText = blobText(body);
- }
- }
-};
-
-Response.prototype.blob = function blob () {
- return when(this.bodyBlob);
-};
-
-Response.prototype.text = function text () {
- return when(this.bodyText);
-};
-
-Response.prototype.json = function json () {
- return when(this.text(), function (text) { return JSON.parse(text); });
-};
-
-Object.defineProperty(Response.prototype, 'data', {
-
- get: function get() {
- return this.body;
- },
-
- set: function set(body) {
- this.body = body;
- }
-
-});
-
-function blobText(body) {
- return new PromiseObj(function (resolve) {
-
- var reader = new FileReader();
-
- reader.readAsText(body);
- reader.onload = function () {
- resolve(reader.result);
- };
-
- });
-}
-
-function isBlobText(body) {
- return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
-}
-
-/**
- * HTTP Request.
- */
-
-var Request = function Request(options$$1) {
-
- this.body = null;
- this.params = {};
-
- assign(this, options$$1, {
- method: toUpper(options$$1.method || 'GET')
- });
-
- if (!(this.headers instanceof Headers)) {
- this.headers = new Headers(this.headers);
- }
-};
-
-Request.prototype.getUrl = function getUrl () {
- return Url(this);
-};
-
-Request.prototype.getBody = function getBody () {
- return this.body;
-};
-
-Request.prototype.respondWith = function respondWith (body, options$$1) {
- return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
-};
-
-/**
- * Service for sending network requests.
- */
-
-var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
-var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
-
-function Http(options$$1) {
-
- var self = this || {}, client = Client(self.$vm);
-
- defaults(options$$1 || {}, self.$options, Http.options);
-
- Http.interceptors.forEach(function (handler) {
-
- if (isString(handler)) {
- handler = Http.interceptor[handler];
- }
-
- if (isFunction(handler)) {
- client.use(handler);
- }
-
- });
-
- return client(new Request(options$$1)).then(function (response) {
-
- return response.ok ? response : PromiseObj.reject(response);
-
- }, function (response) {
-
- if (response instanceof Error) {
- error(response);
- }
-
- return PromiseObj.reject(response);
- });
-}
-
-Http.options = {};
-
-Http.headers = {
- put: JSON_CONTENT_TYPE,
- post: JSON_CONTENT_TYPE,
- patch: JSON_CONTENT_TYPE,
- delete: JSON_CONTENT_TYPE,
- common: COMMON_HEADERS,
- custom: {}
-};
-
-Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
-Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
-
-['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1}));
- };
-
-});
-
-['post', 'put', 'patch'].forEach(function (method$$1) {
-
- Http[method$$1] = function (url, body, options$$1) {
- return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
- };
-
-});
-
-/**
- * Service for interacting with RESTful services.
- */
-
-function Resource(url, params, actions, options$$1) {
-
- var self = this || {}, resource = {};
-
- actions = assign({},
- Resource.actions,
- actions
- );
-
- each(actions, function (action, name) {
-
- action = merge({url: url, params: assign({}, params)}, options$$1, action);
-
- resource[name] = function () {
- return (self.$http || Http)(opts(action, arguments));
- };
- });
-
- return resource;
-}
-
-function opts(action, args) {
-
- var options$$1 = assign({}, action), params = {}, body;
-
- switch (args.length) {
-
- case 2:
-
- params = args[0];
- body = args[1];
-
- break;
-
- case 1:
-
- if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
- body = args[0];
- } else {
- params = args[0];
- }
-
- break;
-
- case 0:
-
- break;
-
- default:
-
- throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
- }
-
- options$$1.body = body;
- options$$1.params = assign({}, options$$1.params, params);
-
- return options$$1;
-}
-
-Resource.actions = {
-
- get: {method: 'GET'},
- save: {method: 'POST'},
- query: {method: 'GET'},
- update: {method: 'PUT'},
- remove: {method: 'DELETE'},
- delete: {method: 'DELETE'}
-
-};
-
-/**
- * Install plugin.
- */
-
-function plugin(Vue) {
-
- if (plugin.installed) {
- return;
- }
-
- Util(Vue);
-
- Vue.url = Url;
- Vue.http = Http;
- Vue.resource = Resource;
- Vue.Promise = PromiseObj;
-
- Object.defineProperties(Vue.prototype, {
-
- $url: {
- get: function get() {
- return options(Vue.url, this, this.$options.url);
- }
- },
-
- $http: {
- get: function get() {
- return options(Vue.http, this, this.$options.http);
- }
- },
-
- $resource: {
- get: function get() {
- return Vue.resource.bind(this);
- }
- },
-
- $promise: {
- get: function get() {
- var this$1 = this;
-
- return function (executor) { return new Vue.Promise(executor, this$1); };
- }
- }
-
- });
-}
-
-if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(plugin);
-}
-
-return plugin;
-
-})));
+++ /dev/null
-/*!
- * vue-resource v1.5.0
- * https://github.com/pagekit/vue-resource
- * Released under the MIT License.
- */
-
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueResource=e()}(this,function(){"use strict";var t=2;function e(e){this.state=t,this.value=void 0,this.deferred=[];var n=this;try{e(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(t){n.reject(t)}}e.reject=function(t){return new e(function(e,n){n(t)})},e.resolve=function(t){return new e(function(e,n){e(t)})},e.all=function(t){return new e(function(n,o){var r=0,i=[];function s(e){return function(o){i[e]=o,(r+=1)===t.length&&n(i)}}0===t.length&&n(i);for(var u=0;u<t.length;u+=1)e.resolve(t[u]).then(s(u),o)})},e.race=function(t){return new e(function(n,o){for(var r=0;r<t.length;r+=1)e.resolve(t[r]).then(n,o)})};var n=e.prototype;function o(t,e){t instanceof Promise?this.promise=t:this.promise=new Promise(t.bind(e)),this.context=e}n.resolve=function(e){var n=this;if(n.state===t){if(e===n)throw new TypeError("Promise settled with itself.");var o=!1;try{var r=e&&e.then;if(null!==e&&"object"==typeof e&&"function"==typeof r)return void r.call(e,function(t){o||n.resolve(t),o=!0},function(t){o||n.reject(t),o=!0})}catch(t){return void(o||n.reject(t))}n.state=0,n.value=e,n.notify()}},n.reject=function(e){var n=this;if(n.state===t){if(e===n)throw new TypeError("Promise settled with itself.");n.state=1,n.value=e,n.notify()}},n.notify=function(){var e,n=this;i(function(){if(n.state!==t)for(;n.deferred.length;){var e=n.deferred.shift(),o=e[0],r=e[1],i=e[2],s=e[3];try{0===n.state?i("function"==typeof o?o.call(void 0,n.value):n.value):1===n.state&&("function"==typeof r?i(r.call(void 0,n.value)):s(n.value))}catch(t){s(t)}}},e)},n.then=function(t,n){var o=this;return new e(function(e,r){o.deferred.push([t,n,e,r]),o.notify()})},n.catch=function(t){return this.then(void 0,t)},"undefined"==typeof Promise&&(window.Promise=e),o.all=function(t,e){return new o(Promise.all(t),e)},o.resolve=function(t,e){return new o(Promise.resolve(t),e)},o.reject=function(t,e){return new o(Promise.reject(t),e)},o.race=function(t,e){return new o(Promise.race(t),e)};var r=o.prototype;r.bind=function(t){return this.context=t,this},r.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),new o(this.promise.then(t,e),this.context)},r.catch=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),new o(this.promise.catch(t),this.context)},r.finally=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),Promise.reject(e)})};var i,s={}.hasOwnProperty,u=[].slice,a=!1,c="undefined"!=typeof window;function f(t){return t?t.replace(/^\s*|\s*$/g,""):""}function p(t){return t?t.toLowerCase():""}var h=Array.isArray;function d(t){return"string"==typeof t}function l(t){return"function"==typeof t}function m(t){return null!==t&&"object"==typeof t}function y(t){return m(t)&&Object.getPrototypeOf(t)==Object.prototype}function v(t,e,n){var r=o.resolve(t);return arguments.length<2?r:r.then(e,n)}function b(t,e,n){return l(n=n||{})&&(n=n.call(e)),T(t.bind({$vm:e,$options:n}),t,{$options:n})}function g(t,e){var n,o;if(h(t))for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(m(t))for(o in t)s.call(t,o)&&e.call(t[o],t[o],o);return t}var w=Object.assign||function(t){return u.call(arguments,1).forEach(function(e){x(t,e)}),t};function T(t){return u.call(arguments,1).forEach(function(e){x(t,e,!0)}),t}function x(t,e,n){for(var o in e)n&&(y(e[o])||h(e[o]))?(y(e[o])&&!y(t[o])&&(t[o]={}),h(e[o])&&!h(t[o])&&(t[o]=[]),x(t[o],e[o],n)):void 0!==e[o]&&(t[o]=e[o])}function j(t,e,n){var o,r,i,s=(o=t,r=["+","#",".","/",";","?","&"],{vars:i=[],expand:function(t){return o.replace(/\{([^{}]+)\}|([^{}]+)/g,function(e,n,o){if(n){var s=null,u=[];if(-1!==r.indexOf(n.charAt(0))&&(s=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(e){var n=/([^:*]*)(?::(\d+)|(\*))?/.exec(e);u.push.apply(u,function(t,e,n,o){var r=t[n],i=[];if(E(r)&&""!==r)if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)r=r.toString(),o&&"*"!==o&&(r=r.substring(0,parseInt(o,10))),i.push(O(e,r,P(e)?n:null));else if("*"===o)Array.isArray(r)?r.filter(E).forEach(function(t){i.push(O(e,t,P(e)?n:null))}):Object.keys(r).forEach(function(t){E(r[t])&&i.push(O(e,r[t],t))});else{var s=[];Array.isArray(r)?r.filter(E).forEach(function(t){s.push(O(e,t))}):Object.keys(r).forEach(function(t){E(r[t])&&(s.push(encodeURIComponent(t)),s.push(O(e,r[t].toString())))}),P(e)?i.push(encodeURIComponent(n)+"="+s.join(",")):0!==s.length&&i.push(s.join(","))}else";"===e?i.push(encodeURIComponent(n)):""!==r||"&"!==e&&"?"!==e?""===r&&i.push(""):i.push(encodeURIComponent(n)+"=");return i}(t,s,n[1],n[2]||n[3])),i.push(n[1])}),s&&"+"!==s){var a=",";return"?"===s?a="&":"#"!==s&&(a=s),(0!==u.length?s:"")+u.join(a)}return u.join(",")}return C(o)})}}),u=s.expand(e);return n&&n.push.apply(n,s.vars),u}function E(t){return null!=t}function P(t){return";"===t||"&"===t||"?"===t}function O(t,e,n){return e="+"===t||"#"===t?C(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e}function C(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}function $(t,e){var n,o=this||{},r=t;return d(t)&&(r={url:t,params:e}),r=T({},$.options,o.$options,r),$.transforms.forEach(function(t){var e,r,i;d(t)&&(t=$.transform[t]),l(t)&&(e=t,r=n,i=o.$vm,n=function(t){return e.call(i,t,r)})}),n(r)}function U(t){return new o(function(e){var n=new XDomainRequest,o=function(o){var r=o.type,i=0;"load"===r?i=200:"error"===r&&(i=500),e(t.respondWith(n.responseText,{status:i}))};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl()),t.timeout&&(n.timeout=t.timeout),n.onload=o,n.onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){},n.send(t.getBody())})}$.options={url:"",root:null,params:{}},$.transform={template:function(t){var e=[],n=j(t.url,t.params,e);return e.forEach(function(e){delete t.params[e]}),n},query:function(t,e){var n=Object.keys($.options.params),o={},r=e(t);return g(t.params,function(t,e){-1===n.indexOf(e)&&(o[e]=t)}),(o=$.params(o))&&(r+=(-1==r.indexOf("?")?"?":"&")+o),r},root:function(t,e){var n,o,r=e(t);return d(t.root)&&!/^(https?:)?\//.test(r)&&(n=t.root,o="/",r=(n&&void 0===o?n.replace(/\s+$/,""):n&&o?n.replace(new RegExp("["+o+"]+$"),""):n)+"/"+r),r}},$.transforms=["template","query","root"],$.params=function(t){var e=[],n=encodeURIComponent;return e.add=function(t,e){l(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},function t(e,n,o){var r,i=h(n),s=y(n);g(n,function(n,u){r=m(n)||h(n),o&&(u=o+"["+(s||r?u:"")+"]"),!o&&i?e.add(n.name,n.value):r?t(e,n,u):e.add(u,n)})}(e,t),e.join("&").replace(/%20/g,"+")},$.parse=function(t){var e=document.createElement("a");return document.documentMode&&(e.href=t,t=e.href),e.href=t,{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",port:e.port,host:e.host,hostname:e.hostname,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):""}};var R=c&&"withCredentials"in new XMLHttpRequest;function A(t){return new o(function(e){var n,o,r=t.jsonp||"callback",i=t.jsonpCallback||"_jsonp"+Math.random().toString(36).substr(2),s=null;n=function(n){var r=n.type,u=0;"load"===r&&null!==s?u=200:"error"===r&&(u=500),u&&window[i]&&(delete window[i],document.body.removeChild(o)),e(t.respondWith(s,{status:u}))},window[i]=function(t){s=JSON.stringify(t)},t.abort=function(){n({type:"abort"})},t.params[r]=i,t.timeout&&setTimeout(t.abort,t.timeout),(o=document.createElement("script")).src=t.getUrl(),o.type="text/javascript",o.async=!0,o.onload=n,o.onerror=n,document.body.appendChild(o)})}function S(t){return new o(function(e){var n=new XMLHttpRequest,o=function(o){var r=t.respondWith("response"in n?n.response:n.responseText,{status:1223===n.status?204:n.status,statusText:1223===n.status?"No Content":f(n.statusText)});g(f(n.getAllResponseHeaders()).split("\n"),function(t){r.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),e(r)};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl(),!0),t.timeout&&(n.timeout=t.timeout),t.responseType&&"responseType"in n&&(n.responseType=t.responseType),(t.withCredentials||t.credentials)&&(n.withCredentials=!0),t.crossOrigin||t.headers.set("X-Requested-With","XMLHttpRequest"),l(t.progress)&&"GET"===t.method&&n.addEventListener("progress",t.progress),l(t.downloadProgress)&&n.addEventListener("progress",t.downloadProgress),l(t.progress)&&/^(POST|PUT)$/i.test(t.method)&&n.upload.addEventListener("progress",t.progress),l(t.uploadProgress)&&n.upload&&n.upload.addEventListener("progress",t.uploadProgress),t.headers.forEach(function(t,e){n.setRequestHeader(e,t)}),n.onload=o,n.onabort=o,n.onerror=o,n.ontimeout=o,n.send(t.getBody())})}function k(t){var e=require("got");return new o(function(n){var o,r=t.getUrl(),i=t.getBody(),s=t.method,u={};t.headers.forEach(function(t,e){u[e]=t}),e(r,{body:i,method:s,headers:u}).then(o=function(e){var o=t.respondWith(e.body,{status:e.statusCode,statusText:f(e.statusMessage)});g(e.headers,function(t,e){o.headers.set(e,t)}),n(o)},function(t){return o(t.response)})})}function I(t){return(t.client||(c?S:k))(t)}var L=function(t){var e=this;this.map={},g(t,function(t,n){return e.append(n,t)})};function q(t,e){return Object.keys(t).reduce(function(t,n){return p(e)===p(n)?n:t},null)}L.prototype.has=function(t){return null!==q(this.map,t)},L.prototype.get=function(t){var e=this.map[q(this.map,t)];return e?e.join():null},L.prototype.getAll=function(t){return this.map[q(this.map,t)]||[]},L.prototype.set=function(t,e){this.map[function(t){if(/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return f(t)}(q(this.map,t)||t)]=[f(e)]},L.prototype.append=function(t,e){var n=this.map[q(this.map,t)];n?n.push(f(e)):this.set(t,e)},L.prototype.delete=function(t){delete this.map[q(this.map,t)]},L.prototype.deleteAll=function(){this.map={}},L.prototype.forEach=function(t,e){var n=this;g(this.map,function(o,r){g(o,function(o){return t.call(e,o,r,n)})})};var H=function(t,e){var n,r,i,s=e.url,u=e.headers,a=e.status,c=e.statusText;this.url=s,this.ok=a>=200&&a<300,this.status=a||0,this.statusText=c||"",this.headers=new L(u),this.body=t,d(t)?this.bodyText=t:(i=t,"undefined"!=typeof Blob&&i instanceof Blob&&(this.bodyBlob=t,(0===(r=t).type.indexOf("text")||-1!==r.type.indexOf("json"))&&(this.bodyText=(n=t,new o(function(t){var e=new FileReader;e.readAsText(n),e.onload=function(){t(e.result)}})))))};H.prototype.blob=function(){return v(this.bodyBlob)},H.prototype.text=function(){return v(this.bodyText)},H.prototype.json=function(){return v(this.text(),function(t){return JSON.parse(t)})},Object.defineProperty(H.prototype,"data",{get:function(){return this.body},set:function(t){this.body=t}});var B=function(t){var e;this.body=null,this.params={},w(this,t,{method:(e=t.method||"GET",e?e.toUpperCase():"")}),this.headers instanceof L||(this.headers=new L(this.headers))};B.prototype.getUrl=function(){return $(this)},B.prototype.getBody=function(){return this.body},B.prototype.respondWith=function(t,e){return new H(t,w(e||{},{url:this.getUrl()}))};var M={"Content-Type":"application/json;charset=utf-8"};function N(t){var e=this||{},n=function(t){var e=[I],n=[];function r(r){for(;e.length;){var i=e.pop();if(l(i)){var s=void 0,u=void 0;if(m(s=i.call(t,r,function(t){return u=t})||u))return new o(function(e,o){n.forEach(function(e){s=v(s,function(n){return e.call(t,n)||n},o)}),v(s,e,o)},t);l(s)&&n.unshift(s)}else c="Invalid interceptor of type "+typeof i+", must be a function","undefined"!=typeof console&&a&&console.warn("[VueResource warn]: "+c)}var c}return m(t)||(t=null),r.use=function(t){e.push(t)},r}(e.$vm);return function(t){u.call(arguments,1).forEach(function(e){for(var n in e)void 0===t[n]&&(t[n]=e[n])})}(t||{},e.$options,N.options),N.interceptors.forEach(function(t){d(t)&&(t=N.interceptor[t]),l(t)&&n.use(t)}),n(new B(t)).then(function(t){return t.ok?t:o.reject(t)},function(t){var e;return t instanceof Error&&(e=t,"undefined"!=typeof console&&console.error(e)),o.reject(t)})}function D(t,e,n,o){var r=this||{},i={};return g(n=w({},D.actions,n),function(n,s){n=T({url:t,params:w({},e)},o,n),i[s]=function(){return(r.$http||N)(function(t,e){var n,o=w({},t),r={};switch(e.length){case 2:r=e[0],n=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(o.method)?n=e[0]:r=e[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}return o.body=n,o.params=w({},o.params,r),o}(n,arguments))}}),i}function J(t){var e,n,r;J.installed||(n=(e=t).config,r=e.nextTick,i=r,a=n.debug||!n.silent,t.url=$,t.http=N,t.resource=D,t.Promise=o,Object.defineProperties(t.prototype,{$url:{get:function(){return b(t.url,this,this.$options.url)}},$http:{get:function(){return b(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(n){return new t.Promise(n,e)}}}}))}return N.options={},N.headers={put:M,post:M,patch:M,delete:M,common:{Accept:"application/json, text/plain, */*"},custom:{}},N.interceptor={before:function(t){l(t.before)&&t.before.call(this,t)},method:function(t){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST")},jsonp:function(t){"JSONP"==t.method&&(t.client=A)},json:function(t){var e=t.headers.get("Content-Type")||"";return m(t.body)&&0===e.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),function(t){return t.bodyText?v(t.text(),function(e){var n,o;if(0===(t.headers.get("Content-Type")||"").indexOf("application/json")||(o=(n=e).match(/^\s*(\[|\{)/))&&{"[":/]\s*$/,"{":/}\s*$/}[o[1]].test(n))try{t.body=JSON.parse(e)}catch(e){t.body=null}else t.body=e;return t}):t}},form:function(t){var e;e=t.body,"undefined"!=typeof FormData&&e instanceof FormData?t.headers.delete("Content-Type"):m(t.body)&&t.emulateJSON&&(t.body=$.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded"))},header:function(t){g(w({},N.headers.common,t.crossOrigin?{}:N.headers.custom,N.headers[p(t.method)]),function(e,n){t.headers.has(n)||t.headers.set(n,e)})},cors:function(t){if(c){var e=$.parse(location.href),n=$.parse(t.getUrl());n.protocol===e.protocol&&n.host===e.host||(t.crossOrigin=!0,t.emulateHTTP=!1,R||(t.client=U))}}},N.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach(function(t){N[t]=function(e,n){return this(w(n||{},{url:e,method:t}))}}),["post","put","patch"].forEach(function(t){N[t]=function(e,n,o){return this(w(o||{},{url:e,method:t,body:n}))}}),D.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(J),J});
\ No newline at end of file
+++ /dev/null
-/**
- * Base client.
- */
-
-import Promise from '../../promise';
-import xhrClient from './xhr';
-import nodeClient from './node';
-import {warn, when, isObject, isFunction, inBrowser} from '../../util';
-
-export default function (context) {
-
- const reqHandlers = [sendRequest], resHandlers = [];
-
- if (!isObject(context)) {
- context = null;
- }
-
- function Client(request) {
- while (reqHandlers.length) {
-
- const handler = reqHandlers.pop();
-
- if (isFunction(handler)) {
-
- let response, next;
-
- response = handler.call(context, request, val => next = val) || next;
-
- if (isObject(response)) {
- return new Promise((resolve, reject) => {
-
- resHandlers.forEach(handler => {
- response = when(response, response => {
- return handler.call(context, response) || response;
- }, reject);
- });
-
- when(response, resolve, reject);
-
- }, context);
- }
-
- if (isFunction(response)) {
- resHandlers.unshift(response);
- }
-
- } else {
- warn(`Invalid interceptor of type ${typeof handler}, must be a function`);
- }
- }
- }
-
- Client.use = handler => {
- reqHandlers.push(handler);
- };
-
- return Client;
-}
-
-function sendRequest(request) {
-
- const client = request.client || (inBrowser ? xhrClient : nodeClient);
-
- return client(request);
-}
+++ /dev/null
-/**
- * JSONP client (Browser).
- */
-
-import Promise from '../../promise';
-
-export default function (request) {
- return new Promise(resolve => {
-
- var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
-
- handler = ({type}) => {
-
- var status = 0;
-
- if (type === 'load' && body !== null) {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- if (status && window[callback]) {
- delete window[callback];
- document.body.removeChild(script);
- }
-
- resolve(request.respondWith(body, {status}));
- };
-
- window[callback] = result => {
- body = JSON.stringify(result);
- };
-
- request.abort = () => {
- handler({type: 'abort'});
- };
-
- request.params[name] = callback;
-
- if (request.timeout) {
- setTimeout(request.abort, request.timeout);
- }
-
- script = document.createElement('script');
- script.src = request.getUrl();
- script.type = 'text/javascript';
- script.async = true;
- script.onload = handler;
- script.onerror = handler;
-
- document.body.appendChild(script);
- });
-}
+++ /dev/null
-/**
- * Http client (Node).
- */
-
-import Promise from '../../promise';
-import {each, trim} from '../../util';
-
-export default function (request) {
-
- const client = require('got');
-
- return new Promise(resolve => {
-
- var url = request.getUrl();
- var body = request.getBody();
- var method = request.method;
- var headers = {}, handler;
-
- request.headers.forEach((value, name) => {
- headers[name] = value;
- });
-
- client(url, {body, method, headers}).then(handler = (resp) => {
-
- var response = request.respondWith(resp.body, {
- status: resp.statusCode,
- statusText: trim(resp.statusMessage)
- });
-
- each(resp.headers, (value, name) => {
- response.headers.set(name, value);
- });
-
- resolve(response);
-
- }, error => handler(error.response));
- });
-}
+++ /dev/null
-/**
- * XDomain client (Internet Explorer).
- */
-
-import Promise from '../../promise';
-
-export default function (request) {
- return new Promise(resolve => {
-
- var xdr = new XDomainRequest(), handler = ({type}) => {
-
- var status = 0;
-
- if (type === 'load') {
- status = 200;
- } else if (type === 'error') {
- status = 500;
- }
-
- resolve(request.respondWith(xdr.responseText, {status}));
- };
-
- request.abort = () => xdr.abort();
-
- xdr.open(request.method, request.getUrl());
-
- if (request.timeout) {
- xdr.timeout = request.timeout;
- }
-
- xdr.onload = handler;
- xdr.onabort = handler;
- xdr.onerror = handler;
- xdr.ontimeout = handler;
- xdr.onprogress = () => {};
- xdr.send(request.getBody());
- });
-}
+++ /dev/null
-/**
- * XMLHttp client (Browser).
- */
-
-import Promise from '../../promise';
-import {each, trim, isFunction} from '../../util';
-
-export default function (request) {
- return new Promise(resolve => {
-
- var xhr = new XMLHttpRequest(), handler = (event) => {
-
- var response = request.respondWith(
- 'response' in xhr ? xhr.response : xhr.responseText, {
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
- });
-
- each(trim(xhr.getAllResponseHeaders()).split('\n'), row => {
- response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
- });
-
- resolve(response);
- };
-
- request.abort = () => xhr.abort();
-
- xhr.open(request.method, request.getUrl(), true);
-
- if (request.timeout) {
- xhr.timeout = request.timeout;
- }
-
- if (request.responseType && 'responseType' in xhr) {
- xhr.responseType = request.responseType;
- }
-
- if (request.withCredentials || request.credentials) {
- xhr.withCredentials = true;
- }
-
- if (!request.crossOrigin) {
- request.headers.set('X-Requested-With', 'XMLHttpRequest');
- }
-
- // deprecated use downloadProgress
- if (isFunction(request.progress) && request.method === 'GET') {
- xhr.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.downloadProgress)) {
- xhr.addEventListener('progress', request.downloadProgress);
- }
-
- // deprecated use uploadProgress
- if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
- xhr.upload.addEventListener('progress', request.progress);
- }
-
- if (isFunction(request.uploadProgress) && xhr.upload) {
- xhr.upload.addEventListener('progress', request.uploadProgress);
- }
-
- request.headers.forEach((value, name) => {
- xhr.setRequestHeader(name, value);
- });
-
- xhr.onload = handler;
- xhr.onabort = handler;
- xhr.onerror = handler;
- xhr.ontimeout = handler;
- xhr.send(request.getBody());
- });
-}
+++ /dev/null
-/**
- * HTTP Headers.
- */
-
-import {each, trim, toLower} from '../util';
-
-export default class Headers {
-
- constructor(headers) {
-
- this.map = {};
-
- each(headers, (value, name) => this.append(name, value));
- }
-
- has(name) {
- return getName(this.map, name) !== null;
- }
-
- get(name) {
-
- var list = this.map[getName(this.map, name)];
-
- return list ? list.join() : null;
- }
-
- getAll(name) {
- return this.map[getName(this.map, name)] || [];
- }
-
- set(name, value) {
- this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
- }
-
- append(name, value) {
-
- var list = this.map[getName(this.map, name)];
-
- if (list) {
- list.push(trim(value));
- } else {
- this.set(name, value);
- }
- }
-
- delete(name) {
- delete this.map[getName(this.map, name)];
- }
-
- deleteAll() {
- this.map = {};
- }
-
- forEach(callback, thisArg) {
- each(this.map, (list, name) => {
- each(list, value => callback.call(thisArg, value, name, this));
- });
- }
-
-}
-
-function getName(map, name) {
- return Object.keys(map).reduce((prev, curr) => {
- return toLower(name) === toLower(curr) ? curr : prev;
- }, null);
-}
-
-function normalizeName(name) {
-
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name');
- }
-
- return trim(name);
-}
+++ /dev/null
-/**
- * Service for sending network requests.
- */
-
-const COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
-const JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
-
-import cors from './interceptor/cors';
-import form from './interceptor/form';
-import json from './interceptor/json';
-import jsonp from './interceptor/jsonp';
-import before from './interceptor/before';
-import method from './interceptor/method';
-import header from './interceptor/header';
-import Client from './client/index';
-import Request from './request';
-import Promise from '../promise';
-import {assign, defaults, error, isString, isFunction} from '../util';
-
-export default function Http(options) {
-
- var self = this || {}, client = Client(self.$vm);
-
- defaults(options || {}, self.$options, Http.options);
-
- Http.interceptors.forEach(handler => {
-
- if (isString(handler)) {
- handler = Http.interceptor[handler];
- }
-
- if (isFunction(handler)) {
- client.use(handler);
- }
-
- });
-
- return client(new Request(options)).then(response => {
-
- return response.ok ? response : Promise.reject(response);
-
- }, response => {
-
- if (response instanceof Error) {
- error(response);
- }
-
- return Promise.reject(response);
- });
-}
-
-Http.options = {};
-
-Http.headers = {
- put: JSON_CONTENT_TYPE,
- post: JSON_CONTENT_TYPE,
- patch: JSON_CONTENT_TYPE,
- delete: JSON_CONTENT_TYPE,
- common: COMMON_HEADERS,
- custom: {}
-};
-
-Http.interceptor = {before, method, jsonp, json, form, header, cors};
-Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
-
-['get', 'delete', 'head', 'jsonp'].forEach(method => {
-
- Http[method] = function (url, options) {
- return this(assign(options || {}, {url, method}));
- };
-
-});
-
-['post', 'put', 'patch'].forEach(method => {
-
- Http[method] = function (url, body, options) {
- return this(assign(options || {}, {url, method, body}));
- };
-
-});
+++ /dev/null
-/**
- * Before Interceptor.
- */
-
-import {isFunction} from '../../util';
-
-export default function (request) {
-
- if (isFunction(request.before)) {
- request.before.call(this, request);
- }
-
-}
+++ /dev/null
-/**
- * CORS Interceptor.
- */
-
-import Url from '../../url/index';
-import xdrClient from '../client/xdr';
-import {inBrowser} from '../../util';
-
-const SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
-
-export default function (request) {
-
- if (inBrowser) {
-
- const orgUrl = Url.parse(location.href);
- const reqUrl = Url.parse(request.getUrl());
-
- if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
-
- request.crossOrigin = true;
- request.emulateHTTP = false;
-
- if (!SUPPORTS_CORS) {
- request.client = xdrClient;
- }
- }
- }
-
-}
+++ /dev/null
-/**
- * Form data Interceptor.
- */
-
-import Url from '../../url/index';
-import {isObject, isFormData} from '../../util';
-
-export default function (request) {
-
- if (isFormData(request.body)) {
- request.headers.delete('Content-Type');
- } else if (isObject(request.body) && request.emulateJSON) {
- request.body = Url.params(request.body);
- request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
- }
-
-}
+++ /dev/null
-/**
- * Header Interceptor.
- */
-
-import Http from '../index';
-import {assign, each, toLower} from '../../util';
-
-export default function (request) {
-
- const headers = assign({}, Http.headers.common,
- !request.crossOrigin ? Http.headers.custom : {},
- Http.headers[toLower(request.method)]
- );
-
- each(headers, (value, name) => {
- if (!request.headers.has(name)) {
- request.headers.set(name, value);
- }
- });
-
-}
+++ /dev/null
-/**
- * JSON Interceptor.
- */
-
-import {when, isObject} from '../../util';
-
-export default function (request) {
-
- const type = request.headers.get('Content-Type') || '';
-
- if (isObject(request.body) && type.indexOf('application/json') === 0) {
- request.body = JSON.stringify(request.body);
- }
-
- return response => {
-
- return response.bodyText ? when(response.text(), text => {
-
- const type = response.headers.get('Content-Type') || '';
-
- if (type.indexOf('application/json') === 0 || isJson(text)) {
-
- try {
- response.body = JSON.parse(text);
- } catch (e) {
- response.body = null;
- }
-
- } else {
- response.body = text;
- }
-
- return response;
-
- }) : response;
-
- };
-}
-
-function isJson(str) {
-
- const start = str.match(/^\s*(\[|\{)/);
- const end = {'[': /]\s*$/, '{': /}\s*$/};
-
- return start && end[start[1]].test(str);
-}
+++ /dev/null
-/**
- * JSONP Interceptor.
- */
-
-import jsonpClient from '../client/jsonp';
-
-export default function (request) {
-
- if (request.method == 'JSONP') {
- request.client = jsonpClient;
- }
-
-}
+++ /dev/null
-/**
- * HTTP method override Interceptor.
- */
-
-export default function (request) {
-
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
- request.headers.set('X-HTTP-Method-Override', request.method);
- request.method = 'POST';
- }
-
-}
+++ /dev/null
-/**
- * HTTP Request.
- */
-
-import Url from '../url/index';
-import Headers from './headers';
-import Response from './response';
-import {assign, toUpper} from '../util';
-
-export default class Request {
-
- constructor(options) {
-
- this.body = null;
- this.params = {};
-
- assign(this, options, {
- method: toUpper(options.method || 'GET')
- });
-
- if (!(this.headers instanceof Headers)) {
- this.headers = new Headers(this.headers);
- }
- }
-
- getUrl() {
- return Url(this);
- }
-
- getBody() {
- return this.body;
- }
-
- respondWith(body, options) {
- return new Response(body, assign(options || {}, {url: this.getUrl()}));
- }
-
-}
+++ /dev/null
-/**
- * HTTP Response.
- */
-
-import Headers from './headers';
-import Promise from '../promise';
-import {when, isBlob, isString} from '../util';
-
-export default class Response {
-
- constructor(body, {url, headers, status, statusText}) {
-
- this.url = url;
- this.ok = status >= 200 && status < 300;
- this.status = status || 0;
- this.statusText = statusText || '';
- this.headers = new Headers(headers);
- this.body = body;
-
- if (isString(body)) {
-
- this.bodyText = body;
-
- } else if (isBlob(body)) {
-
- this.bodyBlob = body;
-
- if (isBlobText(body)) {
- this.bodyText = blobText(body);
- }
- }
- }
-
- blob() {
- return when(this.bodyBlob);
- }
-
- text() {
- return when(this.bodyText);
- }
-
- json() {
- return when(this.text(), text => JSON.parse(text));
- }
-
-}
-
-Object.defineProperty(Response.prototype, 'data', {
-
- get() {
- return this.body;
- },
-
- set(body) {
- this.body = body;
- }
-
-});
-
-function blobText(body) {
- return new Promise((resolve) => {
-
- var reader = new FileReader();
-
- reader.readAsText(body);
- reader.onload = () => {
- resolve(reader.result);
- };
-
- });
-}
-
-function isBlobText(body) {
- return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
-}
+++ /dev/null
-/**
- * Install plugin.
- */
-
-import Url from './url/index';
-import Http from './http/index';
-import Promise from './promise';
-import Resource from './resource';
-import Util, {options} from './util';
-
-function plugin(Vue) {
-
- if (plugin.installed) {
- return;
- }
-
- Util(Vue);
-
- Vue.url = Url;
- Vue.http = Http;
- Vue.resource = Resource;
- Vue.Promise = Promise;
-
- Object.defineProperties(Vue.prototype, {
-
- $url: {
- get() {
- return options(Vue.url, this, this.$options.url);
- }
- },
-
- $http: {
- get() {
- return options(Vue.http, this, this.$options.http);
- }
- },
-
- $resource: {
- get() {
- return Vue.resource.bind(this);
- }
- },
-
- $promise: {
- get() {
- return (executor) => new Vue.Promise(executor, this);
- }
- }
-
- });
-}
-
-if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(plugin);
-}
-
-export default plugin;
+++ /dev/null
-/**
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
- */
-
-const RESOLVED = 0;
-const REJECTED = 1;
-const PENDING = 2;
-
-import {nextTick} from '../util';
-
-export default function Promise(executor) {
-
- this.state = PENDING;
- this.value = undefined;
- this.deferred = [];
-
- var promise = this;
-
- try {
- executor(function (x) {
- promise.resolve(x);
- }, function (r) {
- promise.reject(r);
- });
- } catch (e) {
- promise.reject(e);
- }
-}
-
-Promise.reject = function (r) {
- return new Promise(function (resolve, reject) {
- reject(r);
- });
-};
-
-Promise.resolve = function (x) {
- return new Promise(function (resolve, reject) {
- resolve(x);
- });
-};
-
-Promise.all = function all(iterable) {
- return new Promise(function (resolve, reject) {
- var count = 0, result = [];
-
- if (iterable.length === 0) {
- resolve(result);
- }
-
- function resolver(i) {
- return function (x) {
- result[i] = x;
- count += 1;
-
- if (count === iterable.length) {
- resolve(result);
- }
- };
- }
-
- for (var i = 0; i < iterable.length; i += 1) {
- Promise.resolve(iterable[i]).then(resolver(i), reject);
- }
- });
-};
-
-Promise.race = function race(iterable) {
- return new Promise(function (resolve, reject) {
- for (var i = 0; i < iterable.length; i += 1) {
- Promise.resolve(iterable[i]).then(resolve, reject);
- }
- });
-};
-
-var p = Promise.prototype;
-
-p.resolve = function resolve(x) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (x === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- var called = false;
-
- try {
- var then = x && x['then'];
-
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
- then.call(x, function (x) {
- if (!called) {
- promise.resolve(x);
- }
- called = true;
-
- }, function (r) {
- if (!called) {
- promise.reject(r);
- }
- called = true;
- });
- return;
- }
- } catch (e) {
- if (!called) {
- promise.reject(e);
- }
- return;
- }
-
- promise.state = RESOLVED;
- promise.value = x;
- promise.notify();
- }
-};
-
-p.reject = function reject(reason) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (reason === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- promise.state = REJECTED;
- promise.value = reason;
- promise.notify();
- }
-};
-
-p.notify = function notify() {
- var promise = this;
-
- nextTick(function () {
- if (promise.state !== PENDING) {
- while (promise.deferred.length) {
- var deferred = promise.deferred.shift(),
- onResolved = deferred[0],
- onRejected = deferred[1],
- resolve = deferred[2],
- reject = deferred[3];
-
- try {
- if (promise.state === RESOLVED) {
- if (typeof onResolved === 'function') {
- resolve(onResolved.call(undefined, promise.value));
- } else {
- resolve(promise.value);
- }
- } else if (promise.state === REJECTED) {
- if (typeof onRejected === 'function') {
- resolve(onRejected.call(undefined, promise.value));
- } else {
- reject(promise.value);
- }
- }
- } catch (e) {
- reject(e);
- }
- }
- }
- });
-};
-
-p.then = function then(onResolved, onRejected) {
- var promise = this;
-
- return new Promise(function (resolve, reject) {
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
- promise.notify();
- });
-};
-
-p.catch = function (onRejected) {
- return this.then(undefined, onRejected);
-};
+++ /dev/null
-/**
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
- */
-
-export function expand(url, params, variables) {
-
- var tmpl = parse(url), expanded = tmpl.expand(params);
-
- if (variables) {
- variables.push.apply(variables, tmpl.vars);
- }
-
- return expanded;
-}
-
-export function parse(template) {
-
- var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
-
- return {
- vars: variables,
- expand(context) {
- return template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expression, literal) => {
- if (expression) {
-
- var operator = null, values = [];
-
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
-
- expression.split(/,/g).forEach((variable) => {
- var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- variables.push(tmp[1]);
- });
-
- if (operator && operator !== '+') {
-
- var separator = ',';
-
- if (operator === '?') {
- separator = '&';
- } else if (operator !== '#') {
- separator = operator;
- }
-
- return (values.length !== 0 ? operator : '') + values.join(separator);
- } else {
- return values.join(',');
- }
-
- } else {
- return encodeReserved(literal);
- }
- });
- }
- };
-}
-
-function getValues(context, operator, key, modifier) {
-
- var value = context[key], result = [];
-
- if (isDefined(value) && value !== '') {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
- value = value.toString();
-
- if (modifier && modifier !== '*') {
- value = value.substring(0, parseInt(modifier, 10));
- }
-
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- } else {
- if (modifier === '*') {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach((value) => {
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- });
- } else {
- Object.keys(value).forEach((k) => {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- var tmp = [];
-
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach((value) => {
- tmp.push(encodeValue(operator, value));
- });
- } else {
- Object.keys(value).forEach((k) => {
- if (isDefined(value[k])) {
- tmp.push(encodeURIComponent(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
-
- if (isKeyOperator(operator)) {
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(','));
- }
- }
- }
- } else {
- if (operator === ';') {
- result.push(encodeURIComponent(key));
- } else if (value === '' && (operator === '&' || operator === '?')) {
- result.push(encodeURIComponent(key) + '=');
- } else if (value === '') {
- result.push('');
- }
- }
-
- return result;
-}
-
-function isDefined(value) {
- return value !== undefined && value !== null;
-}
-
-function isKeyOperator(operator) {
- return operator === ';' || operator === '&' || operator === '?';
-}
-
-function encodeValue(operator, value, key) {
-
- value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
-
- if (key) {
- return encodeURIComponent(key) + '=' + value;
- } else {
- return value;
- }
-}
-
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map((part) => {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part);
- }
- return part;
- }).join('');
-}
+++ /dev/null
-/**
- * Promise adapter.
- */
-
-import PromiseLib from './lib/promise';
-
-if (typeof Promise === 'undefined') {
- window.Promise = PromiseLib;
-}
-
-export default function PromiseObj(executor, context) {
-
- if (executor instanceof Promise) {
- this.promise = executor;
- } else {
- this.promise = new Promise(executor.bind(context));
- }
-
- this.context = context;
-}
-
-PromiseObj.all = function (iterable, context) {
- return new PromiseObj(Promise.all(iterable), context);
-};
-
-PromiseObj.resolve = function (value, context) {
- return new PromiseObj(Promise.resolve(value), context);
-};
-
-PromiseObj.reject = function (reason, context) {
- return new PromiseObj(Promise.reject(reason), context);
-};
-
-PromiseObj.race = function (iterable, context) {
- return new PromiseObj(Promise.race(iterable), context);
-};
-
-var p = PromiseObj.prototype;
-
-p.bind = function (context) {
- this.context = context;
- return this;
-};
-
-p.then = function (fulfilled, rejected) {
-
- if (fulfilled && fulfilled.bind && this.context) {
- fulfilled = fulfilled.bind(this.context);
- }
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
-};
-
-p.catch = function (rejected) {
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new PromiseObj(this.promise.catch(rejected), this.context);
-};
-
-p.finally = function (callback) {
-
- return this.then(function (value) {
- callback.call(this);
- return value;
- }, function (reason) {
- callback.call(this);
- return Promise.reject(reason);
- }
- );
-};
+++ /dev/null
-/**
- * Service for interacting with RESTful services.
- */
-
-import Http from './http/index';
-import {assign, each, merge} from './util';
-
-export default function Resource(url, params, actions, options) {
-
- var self = this || {}, resource = {};
-
- actions = assign({},
- Resource.actions,
- actions
- );
-
- each(actions, (action, name) => {
-
- action = merge({url, params: assign({}, params)}, options, action);
-
- resource[name] = function () {
- return (self.$http || Http)(opts(action, arguments));
- };
- });
-
- return resource;
-}
-
-function opts(action, args) {
-
- var options = assign({}, action), params = {}, body;
-
- switch (args.length) {
-
- case 2:
-
- params = args[0];
- body = args[1];
-
- break;
-
- case 1:
-
- if (/^(POST|PUT|PATCH)$/i.test(options.method)) {
- body = args[0];
- } else {
- params = args[0];
- }
-
- break;
-
- case 0:
-
- break;
-
- default:
-
- throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
- }
-
- options.body = body;
- options.params = assign({}, options.params, params);
-
- return options;
-}
-
-Resource.actions = {
-
- get: {method: 'GET'},
- save: {method: 'POST'},
- query: {method: 'GET'},
- update: {method: 'PUT'},
- remove: {method: 'DELETE'},
- delete: {method: 'DELETE'}
-
-};
+++ /dev/null
-/**
- * Service for URL templating.
- */
-
-import root from './root';
-import query from './query';
-import template from './template';
-import {each, merge, isArray, isFunction, isObject, isPlainObject, isString} from '../util';
-
-export default function Url(url, params) {
-
- var self = this || {}, options = url, transform;
-
- if (isString(url)) {
- options = {url, params};
- }
-
- options = merge({}, Url.options, self.$options, options);
-
- Url.transforms.forEach(handler => {
-
- if (isString(handler)) {
- handler = Url.transform[handler];
- }
-
- if (isFunction(handler)) {
- transform = factory(handler, transform, self.$vm);
- }
-
- });
-
- return transform(options);
-}
-
-/**
- * Url options.
- */
-
-Url.options = {
- url: '',
- root: null,
- params: {}
-};
-
-/**
- * Url transforms.
- */
-
-Url.transform = {template, query, root};
-Url.transforms = ['template', 'query', 'root'];
-
-/**
- * Encodes a Url parameter string.
- *
- * @param {Object} obj
- */
-
-Url.params = function (obj) {
-
- var params = [], escape = encodeURIComponent;
-
- params.add = function (key, value) {
-
- if (isFunction(value)) {
- value = value();
- }
-
- if (value === null) {
- value = '';
- }
-
- this.push(escape(key) + '=' + escape(value));
- };
-
- serialize(params, obj);
-
- return params.join('&').replace(/%20/g, '+');
-};
-
-/**
- * Parse a URL and return its components.
- *
- * @param {String} url
- */
-
-Url.parse = function (url) {
-
- var el = document.createElement('a');
-
- if (document.documentMode) {
- el.href = url;
- url = el.href;
- }
-
- el.href = url;
-
- return {
- href: el.href,
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
- port: el.port,
- host: el.host,
- hostname: el.hostname,
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
- search: el.search ? el.search.replace(/^\?/, '') : '',
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
- };
-};
-
-function factory(handler, next, vm) {
- return options => {
- return handler.call(vm, options, next);
- };
-}
-
-function serialize(params, obj, scope) {
-
- var array = isArray(obj), plain = isPlainObject(obj), hash;
-
- each(obj, (value, key) => {
-
- hash = isObject(value) || isArray(value);
-
- if (scope) {
- key = scope + '[' + (plain || hash ? key : '') + ']';
- }
-
- if (!scope && array) {
- params.add(value.name, value.value);
- } else if (hash) {
- serialize(params, value, key);
- } else {
- params.add(key, value);
- }
- });
-}
+++ /dev/null
-/**
- * Query Parameter Transform.
- */
-
-import Url from './index';
-import {each} from '../util';
-
-export default function (options, next) {
-
- var urlParams = Object.keys(Url.options.params), query = {}, url = next(options);
-
- each(options.params, (value, key) => {
- if (urlParams.indexOf(key) === -1) {
- query[key] = value;
- }
- });
-
- query = Url.params(query);
-
- if (query) {
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
- }
-
- return url;
-}
+++ /dev/null
-/**
- * Root Prefix Transform.
- */
-
-import {isString, trimEnd} from '../util';
-
-export default function (options, next) {
-
- var url = next(options);
-
- if (isString(options.root) && !/^(https?:)?\//.test(url)) {
- url = trimEnd(options.root, '/') + '/' + url;
- }
-
- return url;
-}
+++ /dev/null
-/**
- * URL Template (RFC 6570) Transform.
- */
-
-import {expand} from '../lib/url-template';
-
-export default function (options) {
-
- var variables = [], url = expand(options.url, options.params, variables);
-
- variables.forEach((key) => {
- delete options.params[key];
- });
-
- return url;
-}
+++ /dev/null
-/**
- * Utility functions.
- */
-
-import Promise from './promise';
-
-var {hasOwnProperty} = {}, {slice} = [], debug = false, ntick;
-
-export const inBrowser = typeof window !== 'undefined';
-
-export default function ({config, nextTick}) {
- ntick = nextTick;
- debug = config.debug || !config.silent;
-}
-
-export function warn(msg) {
- if (typeof console !== 'undefined' && debug) {
- console.warn('[VueResource warn]: ' + msg);
- }
-}
-
-export function error(msg) {
- if (typeof console !== 'undefined') {
- console.error(msg);
- }
-}
-
-export function nextTick(cb, ctx) {
- return ntick(cb, ctx);
-}
-
-export function trim(str) {
- return str ? str.replace(/^\s*|\s*$/g, '') : '';
-}
-
-export function trimEnd(str, chars) {
-
- if (str && chars === undefined) {
- return str.replace(/\s+$/, '');
- }
-
- if (!str || !chars) {
- return str;
- }
-
- return str.replace(new RegExp(`[${chars}]+$`), '');
-}
-
-export function toLower(str) {
- return str ? str.toLowerCase() : '';
-}
-
-export function toUpper(str) {
- return str ? str.toUpperCase() : '';
-}
-
-export const isArray = Array.isArray;
-
-export function isString(val) {
- return typeof val === 'string';
-}
-
-export function isBoolean(val) {
- return val === true || val === false;
-}
-
-export function isFunction(val) {
- return typeof val === 'function';
-}
-
-export function isObject(obj) {
- return obj !== null && typeof obj === 'object';
-}
-
-export function isPlainObject(obj) {
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
-}
-
-export function isBlob(obj) {
- return typeof Blob !== 'undefined' && obj instanceof Blob;
-}
-
-export function isFormData(obj) {
- return typeof FormData !== 'undefined' && obj instanceof FormData;
-}
-
-export function when(value, fulfilled, rejected) {
-
- var promise = Promise.resolve(value);
-
- if (arguments.length < 2) {
- return promise;
- }
-
- return promise.then(fulfilled, rejected);
-}
-
-export function options(fn, obj, opts) {
-
- opts = opts || {};
-
- if (isFunction(opts)) {
- opts = opts.call(obj);
- }
-
- return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
-}
-
-export function each(obj, iterator) {
-
- var i, key;
-
- if (isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- iterator.call(obj[i], obj[i], i);
- }
- } else if (isObject(obj)) {
- for (key in obj) {
- if (hasOwnProperty.call(obj, key)) {
- iterator.call(obj[key], obj[key], key);
- }
- }
- }
-
- return obj;
-}
-
-export const assign = Object.assign || _assign;
-
-export function merge(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(source => {
- _merge(target, source, true);
- });
-
- return target;
-}
-
-export function defaults(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(source => {
-
- for (var key in source) {
- if (target[key] === undefined) {
- target[key] = source[key];
- }
- }
-
- });
-
- return target;
-}
-
-function _assign(target) {
-
- var args = slice.call(arguments, 1);
-
- args.forEach(source => {
- _merge(target, source);
- });
-
- return target;
-}
-
-function _merge(target, source, deep) {
- for (var key in source) {
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
- target[key] = {};
- }
- if (isArray(source[key]) && !isArray(target[key])) {
- target[key] = [];
- }
- _merge(target[key], source[key], deep);
- } else if (source[key] !== undefined) {
- target[key] = source[key];
- }
- }
-}
+++ /dev/null
-invalid
\ No newline at end of file
+++ /dev/null
-text
\ No newline at end of file
+++ /dev/null
-{"foo": "bar"}
\ No newline at end of file
+++ /dev/null
-import Vue from 'vue';
-
-describe('Vue.http', function () {
-
- it('get("data/text.txt")', done => {
-
- Vue.http.get('data/text.txt').then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(res.body).toBe('text');
- expect(res.data).toBe(res.body);
- expect(res.headers.get('Content-Type')).toBe('text/plain');
-
- done();
- });
-
- });
-
- it('get("data/valid.json")', done => {
-
- Vue.http.get('data/valid.json').then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('object');
- expect(res.body.foo).toBe('bar');
-
- done();
- });
-
- });
-
- it('get("data/invalid.json")', done => {
-
- Vue.http.get('data/invalid.json').then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(res.body).toBeNull();
-
- done();
- });
-
- });
-
- it('get("github.com/avatar")', done => {
-
- Vue.http.get('https://avatars1.githubusercontent.com/u/6128107', {responseType: 'blob'}).then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(res.body instanceof Blob).toBe(true);
- expect(res.body.type).toBe('image/png');
-
- done();
- });
-
- });
-
- it('get("cors-api.appspot.com")', done => {
-
- Vue.http.get('http://server.cors-api.appspot.com/server?id=1&enable=true').then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('object');
- expect(res.body.shift().requestType).toBe('cors');
-
- if (res.headers.get('Content-Type')) {
- expect(res.headers.get('Content-Type')).toBe('application/json');
- }
-
- done();
- });
-
- });
-
- it('jsonp("jsfiddle.net/jsonp")', done => {
-
- Vue.http.jsonp('http://jsfiddle.net/echo/jsonp/', {params: {foo: 'bar'}}).then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('object');
- expect(res.body.foo).toBe('bar');
-
- done();
- });
-
- });
-
-});
-
-describe('this.$http', function () {
-
- it('get("data/valid.json")', done => {
-
- var vm = new Vue({
-
- created() {
-
- this.$http.get('data/valid.json').then(res => {
-
- expect(this).toBe(vm);
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('object');
- expect(res.body.foo).toBe('bar');
-
- done();
-
- });
-
- }
-
- });
-
- });
-
- it('get("data/valid.json") with timeout', done => {
-
- var vm = new Vue({
-
- created() {
-
- var random = Math.random().toString(36).substr(2);
-
- this.$http.get(`data/valid.json?${random}`, {timeout: 1}).then(res => {
-
- fail('Callback has been called');
-
- }, res => {
-
- expect(res.ok).toBe(false);
- expect(res.status).toBe(0);
-
- done();
-
- });
-
- }
-
- });
-
- });
-
- it('get("data/valid.json") with abort()', done => {
-
- var vm = new Vue({
-
- created() {
-
- var random = Math.random().toString(36).substr(2);
-
- this.$http.get(`data/valid.json?${random}`, {
-
- before(req) {
- setTimeout(() => {
-
- expect(typeof req.abort).toBe('function');
-
- req.abort();
-
- }, 0);
- }
-
- }).then(res => {
- fail('Callback has been called');
- }, res => {
- done();
- });
- }
-
- });
-
- });
-
- it('get("data/notfound.json") using catch()', done => {
-
- var vm = new Vue({
-
- created() {
-
- this.$http.get('data/notfound.json').catch(res => {
-
- expect(this).toBe(vm);
- expect(res.ok).toBe(false);
- expect(res.status).toBe(404);
-
- done();
- });
-
- }
-
- });
-
- });
-
-});
\ No newline at end of file
+++ /dev/null
-var Vue = require('vue');
-var VueResource = require('../dist/vue-resource.common.js');
-
-Vue.use(VueResource);
-
-describe('Vue.http', function () {
-
- it('post("jsfiddle.net/html")', () => {
-
- return Vue.http.post('http://jsfiddle.net/echo/html/', {html: 'text'}, {emulateJSON: true}).then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('string');
- expect(res.body).toBe('text');
-
- });
-
- });
-
- it('post("jsfiddle.net/json")', () => {
-
- return Vue.http.post('http://jsfiddle.net/echo/json/', {json: JSON.stringify({foo: 'bar'})}, {emulateJSON: true}).then(res => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(typeof res.body).toBe('object');
- expect(res.body.foo).toBe('bar');
-
- });
-
- });
-
-});
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Vue Resource - Jasmine</title>
-
- <link rel="shortcut icon" type="image/png" href="../node_modules/jasmine-core/images/jasmine_favicon.png">
- <link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
-
- <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
- <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
- <script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
- <script src="specs.js"></script>
-
-</head>
-<body>
-</body>
-</html>
+++ /dev/null
-import Vue from 'vue';
-import VueResource from '../src/index';
-
-Vue.use(VueResource);
-
-require('./url');
-require('./http');
-require('./resource');
-require('./promise');
+++ /dev/null
-module.exports = config => {
-
- config.set({
-
- basePath: __dirname,
-
- frameworks: ['jasmine'],
-
- browsers: ['Chrome', 'Safari', 'Firefox'],
-
- files: [
- 'index.js',
- {pattern: 'data/*', included: false},
- ],
-
- preprocessors: {
- 'index.js': ['webpack']
- },
-
- proxies: {
- '/data/': '/base/data/'
- },
-
- });
-
-};
+++ /dev/null
-import Promise from '../src/promise';
-
-describe('Vue.promise ' + (window.Promise !== undefined ? '(native)' : '(polyfill)'), function () {
-
- it('then fulfill', function (done) {
-
- Promise.resolve(1).then(function (value) {
- expect(value).toBe(1);
- done();
- });
-
- });
-
- it('then reject', function (done) {
-
- Promise.reject(1).then(undefined, function (value) {
- expect(value).toBe(1);
- done();
- });
-
- });
-
- it('catch', function (done) {
-
- Promise.reject(1).catch(function (value) {
- expect(value).toBe(1);
- done();
- });
-
- });
-
- it('finally fulfill', function (done) {
-
- Promise.resolve(1).finally(function (arg) {
- expect(arg).toBe(undefined);
- }).then(function (arg) {
- expect(arg).toBe(1);
- done();
- });
-
- });
-
- it('finally reject', function (done) {
-
- Promise.reject(1).finally(function (arg) {
- expect(arg).toBe(undefined);
- }).catch(function (arg) {
- expect(arg).toBe(1);
- done();
- });
-
- });
-
- it('all', function (done) {
-
- Promise.all([
-
- Promise.resolve(1),
- Promise.resolve(2)
-
- ]).then(function (values) {
- expect(values[0]).toBe(1);
- expect(values[1]).toBe(2);
- done();
- });
-
- });
-
- it('duplicate', function (done) {
-
- Promise.all([
-
- Promise.resolve(1).then(function (value) {
- expect(value).toBe(1);
- }),
-
- Promise.resolve(2).then(function (value) {
- expect(value).toBe(2);
- })
-
- ]).then(done);
-
- });
-
- it('context', function (done) {
-
- var context = {foo: 'bar'};
-
- Promise.resolve().bind(context).then(function () {
- expect(this).toBe(context);
- done();
- });
-
- });
-
- it('context chain fulfill', function (done) {
-
- var context = {foo: 'bar'};
-
- Promise.resolve().bind(context).catch(undefined).finally(function () {
- expect(this).toBe(context);
- }).then(function () {
- expect(this).toBe(context);
- done();
- });
-
- });
-
- it('context chain reject', function (done) {
-
- var context = {foo: 'bar'};
-
- Promise.reject().bind(context).catch(function () {
- expect(this).toBe(context);
- return Promise.reject();
- }).finally(function () {
- expect(this).toBe(context);
- }).catch(function () {
- expect(this).toBe(context);
- done();
- });
-
- });
-
-});
+++ /dev/null
-import Vue from 'vue';
-
-describe('this.$resource', function () {
-
- it('get({file: "valid.json"})', (done) => {
-
- var vm = new Vue({
-
- created() {
-
- var resource = this.$resource('data{/file}');
-
- resource.get({file: 'valid.json'}).then((res) => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(res.data.foo).toBe('bar');
-
- done();
- });
-
- }
-
- });
-
- });
-
- it('save({file: "valid.json"}, {foo: "bar"})', (done) => {
-
- var vm = new Vue({
-
- created() {
-
- var resource = this.$resource('data{/file}');
-
- resource.save({file: 'valid.json'}, {foo: 'bar'}).then((res) => {
-
- expect(res.ok).toBe(true);
- expect(res.status).toBe(200);
- expect(res.data.foo).toBe('bar');
-
- done();
- });
-
- }
-
- });
-
- });
-
-});
+++ /dev/null
-import Vue from 'vue';
-
-describe('Vue.url', function () {
-
- it('data{/id}', function () {
-
- expect(Vue.url('data{/id}')).toBe('data');
- expect(Vue.url('data{/id}', {id: 1})).toBe('data/1');
-
- });
-
- it('data{/array}', function () {
-
- expect(Vue.url('data{?array}')).toBe('data');
- expect(Vue.url('data{?array}', {array: [1,2,3]})).toBe('data?array=1,2,3');
-
- });
-
- it('{+path}data', function () {
-
- expect(Vue.url('{+path}data')).toBe('data');
- expect(Vue.url('{+path}data', {path: 'path1/path2/'})).toBe('path1/path2/data');
-
- });
-
- it('{+base}data', function () {
-
- Vue.url.options.params.base = 'base/path/';
- expect(Vue.url('{+base}data')).toBe('base/path/data');
-
- });
-
-});
+++ /dev/null
-var webpack = require('webpack');
-
-module.exports = {
- entry: __dirname + '/index.js',
- output: {
- path: __dirname + '/',
- filename: 'specs.js'
- },
- module: {
- loaders: [
- {test: /\.js$/, loader: 'buble-loader', exclude: /node_modules/}
- ]
- },
- plugins: [
- new webpack.optimize.ModuleConcatenationPlugin()
- ]
-};
+++ /dev/null
-import _Vue = require('vue');
-
-// augment typings of Vue.js
-import './vue';
-
-export interface HttpHeaders {
- put?: { [key: string]: string };
- post?: { [key: string]: string };
- patch?: { [key: string]: string };
- delete?: { [key: string]: string };
- common?: { [key: string]: string };
- custom?: { [key: string]: string };
- [key: string]: any;
-}
-
-export interface HttpResponse {
- data: any;
- ok: boolean;
- status: number;
- statusText: string;
- headers: Function;
- text():string;
- json():any;
- blob():Blob;
-}
-
-export interface HttpOptions {
- url?: string;
- method?: string;
- body?: any;
- params?: any;
- headers?: any;
- before?(request: any): any;
- progress?(event: any): any;
- credentials?:boolean;
- emulateHTTP?: boolean;
- emulateJSON?: boolean;
-}
-
-export interface $http {
- (url: string, data?: any, options?: HttpOptions): PromiseLike<HttpResponse>;
- (url: string, options?: HttpOptions): PromiseLike<HttpResponse>;
-}
-
-export interface HttpInterceptor {
- request?(request: HttpOptions): HttpOptions;
- response?(response: HttpResponse): HttpResponse;
-}
-
-export interface Http {
- options: HttpOptions & { root: string };
- headers: HttpHeaders;
- interceptors: (HttpInterceptor | (() => HttpInterceptor))[];
- get: $http;
- post: $http;
- put: $http;
- patch: $http;
- delete: $http;
- jsonp: $http;
-}
-
-export interface ResourceActions {
- get: { method: string };
- save: { method: string };
- query: { method: string };
- update: { method: string };
- remove: { method: string };
- delete: { method: string };
-}
-
-export interface ResourceMethod {
- (params: any, data?: any, success?: Function, error?: Function): PromiseLike<HttpResponse>;
- (params: any, success?: Function, error?: Function): PromiseLike<HttpResponse>;
- (success?: Function, error?: Function): PromiseLike<HttpResponse>;
-}
-
-export interface ResourceMethods {
- get: ResourceMethod;
- save: ResourceMethod;
- query: ResourceMethod;
- update: ResourceMethod;
- remove: ResourceMethod;
- delete: ResourceMethod;
-}
-
-export interface $resource {
- (url: string, params?: any, actions?: any, options?: HttpOptions): ResourceMethods;
-}
-
-export interface Resource extends $resource {
- actions: ResourceActions;
-}
-
-export declare function install(vue: typeof _Vue): void;
+++ /dev/null
-/**
- * Extends interfaces in Vue.js
- */
-
-import Vue from "vue";
-import { HttpHeaders, HttpOptions, HttpResponse, $http, $resource } from "./index";
-
-declare module "vue/types/options" {
- interface ComponentOptions<V extends Vue> {
- http?: (HttpOptions & { headers?: HttpHeaders } & { [key: string]: any })
- }
-}
-
-declare module "vue/types/vue" {
- interface Vue {
- $http: {
- (options: HttpOptions): PromiseLike<HttpResponse>;
- get: $http;
- post: $http;
- put: $http;
- patch: $http;
- delete: $http;
- jsonp: $http;
- };
- $resource: $resource;
- }
-}
+++ /dev/null
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
-"@babel/code-frame@^7.0.0-beta.35":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6"
- dependencies:
- "@babel/highlight" "7.0.0-beta.40"
-
-"@babel/highlight@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255"
- dependencies:
- chalk "^2.0.0"
- esutils "^2.0.2"
- js-tokens "^3.0.0"
-
-"@sindresorhus/is@^0.7.0":
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
-
-JSONStream@^1.0.3:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea"
- dependencies:
- jsonparse "^1.2.0"
- through ">=2.2.7 <3"
-
-abab@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
-
-abbrev@1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
-
-accepts@~1.3.4:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2"
- dependencies:
- mime-types "~2.1.18"
- negotiator "0.6.1"
-
-acorn-dynamic-import@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4"
- dependencies:
- acorn "^4.0.3"
-
-acorn-dynamic-import@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278"
- dependencies:
- acorn "^5.0.0"
-
-acorn-globals@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538"
- dependencies:
- acorn "^5.0.0"
-
-acorn-jsx@^3.0.0, acorn-jsx@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
- dependencies:
- acorn "^3.0.4"
-
-acorn-jsx@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e"
- dependencies:
- acorn "^5.0.3"
-
-acorn-node@^1.2.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b"
- dependencies:
- acorn "^5.4.1"
- xtend "^4.0.1"
-
-acorn-object-spread@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/acorn-object-spread/-/acorn-object-spread-1.0.0.tgz#48ead0f4a8eb16995a17a0db9ffc6acaada4ba68"
- dependencies:
- acorn "^3.1.0"
-
-acorn@^3.0.4, acorn@^3.1.0, acorn@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
-
-acorn@^4.0.3:
- version "4.0.13"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"
-
-acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1, acorn@^5.3.0, acorn@^5.4.0, acorn@^5.4.1:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298"
-
-addressparser@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746"
-
-after@0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
-
-agent-base@2:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
- dependencies:
- extend "~3.0.0"
- semver "~5.0.1"
-
-ajv-keywords@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"
-
-ajv-keywords@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be"
-
-ajv@^4.9.1:
- version "4.11.8"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
- dependencies:
- co "^4.6.0"
- json-stable-stringify "^1.0.1"
-
-ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0:
- version "5.5.2"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
- dependencies:
- co "^4.6.0"
- fast-deep-equal "^1.0.0"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.3.0"
-
-ajv@^6.1.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.0.tgz#afac295bbaa0152449e522742e4547c1ae9328d2"
- dependencies:
- fast-deep-equal "^1.0.0"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.3.0"
-
-align-text@^0.1.1, align-text@^0.1.3:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
- dependencies:
- kind-of "^3.0.2"
- longest "^1.0.1"
- repeat-string "^1.5.2"
-
-amdefine@>=0.0.4:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
-
-amqplib@^0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63"
- dependencies:
- bitsyntax "~0.0.4"
- bluebird "^3.4.6"
- buffer-more-ints "0.0.2"
- readable-stream "1.x >=1.1.9"
- safe-buffer "^5.0.1"
-
-ansi-escapes@^1.1.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
-
-ansi-escapes@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92"
-
-ansi-regex@^2.0.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
-
-ansi-regex@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
-
-ansi-styles@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
-
-ansi-styles@^3.2.0, ansi-styles@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
- dependencies:
- color-convert "^1.9.0"
-
-anymatch@^1.3.0:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
- dependencies:
- micromatch "^2.1.5"
- normalize-path "^2.0.0"
-
-anymatch@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
- dependencies:
- micromatch "^3.1.4"
- normalize-path "^2.1.1"
-
-append-transform@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991"
- dependencies:
- default-require-extensions "^1.0.0"
-
-aproba@^1.0.3, aproba@^1.1.1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
-
-are-we-there-yet@~1.1.2:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d"
- dependencies:
- delegates "^1.0.0"
- readable-stream "^2.0.6"
-
-argparse@^1.0.7:
- version "1.0.10"
- resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
- dependencies:
- sprintf-js "~1.0.2"
-
-arr-diff@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
- dependencies:
- arr-flatten "^1.0.1"
-
-arr-diff@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
-
-arr-flatten@^1.0.1, arr-flatten@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
-
-arr-union@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
-
-array-equal@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
-
-array-filter@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
-
-array-map@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662"
-
-array-reduce@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
-
-array-slice@^0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5"
-
-array-union@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
- dependencies:
- array-uniq "^1.0.1"
-
-array-uniq@^1.0.1:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
-
-array-unique@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
-
-array-unique@^0.3.2:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
-
-arraybuffer.slice@~0.0.7:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675"
-
-arrify@^1.0.0, arrify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
-
-asn1.js@^4.0.0:
- version "4.10.1"
- resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0"
- dependencies:
- bn.js "^4.0.0"
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
-
-asn1@~0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
-
-assert-plus@1.0.0, assert-plus@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
-
-assert-plus@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
-
-assert@^1.1.1, assert@^1.4.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91"
- dependencies:
- util "0.10.3"
-
-assign-symbols@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
-
-ast-types@0.x.x:
- version "0.11.2"
- resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.2.tgz#cc4e1d15a36b39979a1986fe1e91321cbfae7783"
-
-astral-regex@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
-
-astw@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917"
- dependencies:
- acorn "^4.0.3"
-
-async-each@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
-
-async-limiter@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
-
-async@^1.4.0:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
-
-async@^2.0.0, async@^2.1.2, async@^2.1.4:
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
- dependencies:
- lodash "^4.14.0"
-
-async@~2.1.2:
- version "2.1.5"
- resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
- dependencies:
- lodash "^4.14.0"
-
-asynckit@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
-
-atob@^2.0.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d"
-
-aws-sign2@~0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
-
-aws-sign2@~0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
-
-aws4@^1.2.1, aws4@^1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
-
-axios@^0.15.3:
- version "0.15.3"
- resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053"
- dependencies:
- follow-redirects "1.0.0"
-
-babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
- dependencies:
- chalk "^1.1.3"
- esutils "^2.0.2"
- js-tokens "^3.0.2"
-
-babel-core@^6.0.0, babel-core@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8"
- dependencies:
- babel-code-frame "^6.26.0"
- babel-generator "^6.26.0"
- babel-helpers "^6.24.1"
- babel-messages "^6.23.0"
- babel-register "^6.26.0"
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- convert-source-map "^1.5.0"
- debug "^2.6.8"
- json5 "^0.5.1"
- lodash "^4.17.4"
- minimatch "^3.0.4"
- path-is-absolute "^1.0.1"
- private "^0.1.7"
- slash "^1.0.0"
- source-map "^0.5.6"
-
-babel-generator@^6.18.0, babel-generator@^6.26.0:
- version "6.26.1"
- resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90"
- dependencies:
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- detect-indent "^4.0.0"
- jsesc "^1.3.0"
- lodash "^4.17.4"
- source-map "^0.5.7"
- trim-right "^1.0.1"
-
-babel-helpers@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
- dependencies:
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-jest@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.4.1.tgz#ff53ebca45957347f27ff4666a31499fbb4c4ddd"
- dependencies:
- babel-plugin-istanbul "^4.1.5"
- babel-preset-jest "^22.4.1"
-
-babel-messages@^6.23.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-istanbul@^4.1.5:
- version "4.1.5"
- resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e"
- dependencies:
- find-up "^2.1.0"
- istanbul-lib-instrument "^1.7.5"
- test-exclude "^4.1.1"
-
-babel-plugin-jest-hoist@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.1.tgz#d712fe5da8b6965f3191dacddbefdbdf4fb66d63"
-
-babel-plugin-syntax-object-rest-spread@^6.13.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
-
-babel-preset-jest@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.4.1.tgz#efa2e5f5334242a9457a068452d7d09735db172a"
- dependencies:
- babel-plugin-jest-hoist "^22.4.1"
- babel-plugin-syntax-object-rest-spread "^6.13.0"
-
-babel-register@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
- dependencies:
- babel-core "^6.26.0"
- babel-runtime "^6.26.0"
- core-js "^2.5.0"
- home-or-tmp "^2.0.0"
- lodash "^4.17.4"
- mkdirp "^0.5.1"
- source-map-support "^0.4.15"
-
-babel-runtime@^6.0.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
- dependencies:
- core-js "^2.4.0"
- regenerator-runtime "^0.11.0"
-
-babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
- dependencies:
- babel-runtime "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- lodash "^4.17.4"
-
-babel-traverse@^6.18.0, babel-traverse@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
- dependencies:
- babel-code-frame "^6.26.0"
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- debug "^2.6.8"
- globals "^9.18.0"
- invariant "^2.2.2"
- lodash "^4.17.4"
-
-babel-types@^6.18.0, babel-types@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
- dependencies:
- babel-runtime "^6.26.0"
- esutils "^2.0.2"
- lodash "^4.17.4"
- to-fast-properties "^1.0.3"
-
-babylon@^6.18.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
-
-backo2@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947"
-
-balanced-match@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
-
-base64-arraybuffer@0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8"
-
-base64-js@^1.0.2:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.3.tgz#fb13668233d9614cf5fb4bce95a9ba4096cdf801"
-
-base64id@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6"
-
-base@^0.11.1:
- version "0.11.2"
- resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
- dependencies:
- cache-base "^1.0.1"
- class-utils "^0.3.5"
- component-emitter "^1.2.1"
- define-property "^1.0.0"
- isobject "^3.0.1"
- mixin-deep "^1.2.0"
- pascalcase "^0.1.1"
-
-bcrypt-pbkdf@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
- dependencies:
- tweetnacl "^0.14.3"
-
-better-assert@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522"
- dependencies:
- callsite "1.0.0"
-
-big.js@^3.1.3:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
-
-binary-extensions@^1.0.0:
- version "1.11.0"
- resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205"
-
-bitsyntax@~0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82"
- dependencies:
- buffer-more-ints "0.0.2"
-
-bl@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398"
- dependencies:
- readable-stream "~2.0.5"
-
-blob@0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921"
-
-block-stream@*:
- version "0.0.9"
- resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
- dependencies:
- inherits "~2.0.0"
-
-bluebird@^3.3.0, bluebird@^3.4.6, bluebird@^3.5.0, bluebird@^3.5.1:
- version "3.5.1"
- resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
-
-bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
- version "4.11.8"
- resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
-
-body-parser@^1.16.1:
- version "1.18.2"
- resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
- dependencies:
- bytes "3.0.0"
- content-type "~1.0.4"
- debug "2.6.9"
- depd "~1.1.1"
- http-errors "~1.6.2"
- iconv-lite "0.4.19"
- on-finished "~2.3.0"
- qs "6.5.1"
- raw-body "2.3.2"
- type-is "~1.6.15"
-
-boom@2.x.x:
- version "2.10.1"
- resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
- dependencies:
- hoek "2.x.x"
-
-boom@4.x.x:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31"
- dependencies:
- hoek "4.x.x"
-
-boom@5.x.x:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02"
- dependencies:
- hoek "4.x.x"
-
-brace-expansion@^1.1.7:
- version "1.1.11"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
- dependencies:
- balanced-match "^1.0.0"
- concat-map "0.0.1"
-
-braces@^0.1.2:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6"
- dependencies:
- expand-range "^0.1.0"
-
-braces@^1.8.2:
- version "1.8.5"
- resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"
- dependencies:
- expand-range "^1.8.1"
- preserve "^0.2.0"
- repeat-element "^1.1.2"
-
-braces@^2.3.0, braces@^2.3.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb"
- dependencies:
- arr-flatten "^1.1.0"
- array-unique "^0.3.2"
- define-property "^1.0.0"
- extend-shallow "^2.0.1"
- fill-range "^4.0.0"
- isobject "^3.0.1"
- kind-of "^6.0.2"
- repeat-element "^1.1.2"
- snapdragon "^0.8.1"
- snapdragon-node "^2.0.1"
- split-string "^3.0.2"
- to-regex "^3.0.1"
-
-brorand@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
-
-browser-pack@^6.0.1:
- version "6.0.4"
- resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.4.tgz#9a73beb3b48f9e36868be007b64400102c04a99f"
- dependencies:
- JSONStream "^1.0.3"
- combine-source-map "~0.8.0"
- defined "^1.0.0"
- safe-buffer "^5.1.1"
- through2 "^2.0.0"
- umd "^3.0.0"
-
-browser-process-hrtime@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e"
-
-browser-resolve@^1.11.0, browser-resolve@^1.11.2, browser-resolve@^1.7.0:
- version "1.11.2"
- resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
- dependencies:
- resolve "1.1.7"
-
-browserify-aes@^1.0.0, browserify-aes@^1.0.4:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f"
- dependencies:
- buffer-xor "^1.0.3"
- cipher-base "^1.0.0"
- create-hash "^1.1.0"
- evp_bytestokey "^1.0.3"
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-browserify-cipher@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a"
- dependencies:
- browserify-aes "^1.0.4"
- browserify-des "^1.0.0"
- evp_bytestokey "^1.0.0"
-
-browserify-des@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd"
- dependencies:
- cipher-base "^1.0.1"
- des.js "^1.0.0"
- inherits "^2.0.1"
-
-browserify-rsa@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524"
- dependencies:
- bn.js "^4.1.0"
- randombytes "^2.0.1"
-
-browserify-sign@^4.0.0:
- version "4.0.4"
- resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298"
- dependencies:
- bn.js "^4.1.1"
- browserify-rsa "^4.0.0"
- create-hash "^1.1.0"
- create-hmac "^1.1.2"
- elliptic "^6.0.0"
- inherits "^2.0.1"
- parse-asn1 "^5.0.0"
-
-browserify-zlib@^0.2.0, browserify-zlib@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f"
- dependencies:
- pako "~1.0.5"
-
-browserify@^14.5.0:
- version "14.5.0"
- resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5"
- dependencies:
- JSONStream "^1.0.3"
- assert "^1.4.0"
- browser-pack "^6.0.1"
- browser-resolve "^1.11.0"
- browserify-zlib "~0.2.0"
- buffer "^5.0.2"
- cached-path-relative "^1.0.0"
- concat-stream "~1.5.1"
- console-browserify "^1.1.0"
- constants-browserify "~1.0.0"
- crypto-browserify "^3.0.0"
- defined "^1.0.0"
- deps-sort "^2.0.0"
- domain-browser "~1.1.0"
- duplexer2 "~0.1.2"
- events "~1.1.0"
- glob "^7.1.0"
- has "^1.0.0"
- htmlescape "^1.1.0"
- https-browserify "^1.0.0"
- inherits "~2.0.1"
- insert-module-globals "^7.0.0"
- labeled-stream-splicer "^2.0.0"
- module-deps "^4.0.8"
- os-browserify "~0.3.0"
- parents "^1.0.1"
- path-browserify "~0.0.0"
- process "~0.11.0"
- punycode "^1.3.2"
- querystring-es3 "~0.2.0"
- read-only-stream "^2.0.0"
- readable-stream "^2.0.2"
- resolve "^1.1.4"
- shasum "^1.0.0"
- shell-quote "^1.6.1"
- stream-browserify "^2.0.0"
- stream-http "^2.0.0"
- string_decoder "~1.0.0"
- subarg "^1.0.0"
- syntax-error "^1.1.1"
- through2 "^2.0.0"
- timers-browserify "^1.0.1"
- tty-browserify "~0.0.0"
- url "~0.11.0"
- util "~0.10.1"
- vm-browserify "~0.0.1"
- xtend "^4.0.0"
-
-bser@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
- dependencies:
- node-int64 "^0.4.0"
-
-buble-loader@^0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/buble-loader/-/buble-loader-0.4.1.tgz#45a4fe43ccc500835e99ae38ef17df4390ca66b9"
- dependencies:
- buble "^0.15.0"
- loader-utils "^0.2.15"
- webpack "*"
-
-buble@^0.15.0:
- version "0.15.2"
- resolved "https://registry.yarnpkg.com/buble/-/buble-0.15.2.tgz#547fc47483f8e5e8176d82aa5ebccb183b02d613"
- dependencies:
- acorn "^3.3.0"
- acorn-jsx "^3.0.1"
- acorn-object-spread "^1.0.0"
- chalk "^1.1.3"
- magic-string "^0.14.0"
- minimist "^1.2.0"
- os-homedir "^1.0.1"
-
-buble@^0.19.1, buble@^0.19.2:
- version "0.19.3"
- resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.3.tgz#01e9412062cff1da6f20342b6ecd72e7bf699d02"
- dependencies:
- acorn "^5.4.1"
- acorn-dynamic-import "^3.0.0"
- acorn-jsx "^4.1.1"
- chalk "^2.3.1"
- magic-string "^0.22.4"
- minimist "^1.2.0"
- os-homedir "^1.0.1"
- vlq "^1.0.0"
-
-buffer-more-ints@0.0.2:
- version "0.0.2"
- resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c"
-
-buffer-xor@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9"
-
-buffer@^4.3.0:
- version "4.9.1"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298"
- dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
- isarray "^1.0.0"
-
-buffer@^5.0.2:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe"
- dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
-
-buildmail@4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72"
- dependencies:
- addressparser "1.0.1"
- libbase64 "0.1.0"
- libmime "3.0.0"
- libqp "1.1.0"
- nodemailer-fetch "1.6.0"
- nodemailer-shared "1.1.0"
- punycode "1.4.1"
-
-builtin-modules@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
-
-builtin-status-codes@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
-
-bytes@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
-
-cacache@^10.0.1:
- version "10.0.4"
- resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460"
- dependencies:
- bluebird "^3.5.1"
- chownr "^1.0.1"
- glob "^7.1.2"
- graceful-fs "^4.1.11"
- lru-cache "^4.1.1"
- mississippi "^2.0.0"
- mkdirp "^0.5.1"
- move-concurrently "^1.0.1"
- promise-inflight "^1.0.1"
- rimraf "^2.6.2"
- ssri "^5.2.4"
- unique-filename "^1.1.0"
- y18n "^4.0.0"
-
-cache-base@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
- dependencies:
- collection-visit "^1.0.0"
- component-emitter "^1.2.1"
- get-value "^2.0.6"
- has-value "^1.0.0"
- isobject "^3.0.1"
- set-value "^2.0.0"
- to-object-path "^0.3.0"
- union-value "^1.0.0"
- unset-value "^1.0.0"
-
-cacheable-request@^2.1.1:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d"
- dependencies:
- clone-response "1.0.2"
- get-stream "3.0.0"
- http-cache-semantics "3.8.1"
- keyv "3.0.0"
- lowercase-keys "1.0.0"
- normalize-url "2.0.1"
- responselike "1.0.2"
-
-cached-path-relative@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7"
-
-caller-path@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
- dependencies:
- callsites "^0.2.0"
-
-callsite@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20"
-
-callsites@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
-
-callsites@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
-
-camelcase@^1.0.2:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
-
-camelcase@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
-
-caseless@~0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
-
-caseless@~0.12.0:
- version "0.12.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
-
-center-align@^0.1.1:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
- dependencies:
- align-text "^0.1.3"
- lazy-cache "^1.0.3"
-
-chalk@^1.1.1, chalk@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
- dependencies:
- ansi-styles "^2.2.1"
- escape-string-regexp "^1.0.2"
- has-ansi "^2.0.0"
- strip-ansi "^3.0.0"
- supports-color "^2.0.0"
-
-chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65"
- dependencies:
- ansi-styles "^3.2.1"
- escape-string-regexp "^1.0.5"
- supports-color "^5.3.0"
-
-chardet@^0.4.0:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
-
-chokidar@^1.4.1:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
- dependencies:
- anymatch "^1.3.0"
- async-each "^1.0.0"
- glob-parent "^2.0.0"
- inherits "^2.0.1"
- is-binary-path "^1.0.0"
- is-glob "^2.0.0"
- path-is-absolute "^1.0.0"
- readdirp "^2.0.0"
- optionalDependencies:
- fsevents "^1.0.0"
-
-chokidar@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7"
- dependencies:
- anymatch "^2.0.0"
- async-each "^1.0.0"
- braces "^2.3.0"
- glob-parent "^3.1.0"
- inherits "^2.0.1"
- is-binary-path "^1.0.0"
- is-glob "^4.0.0"
- normalize-path "^2.1.1"
- path-is-absolute "^1.0.0"
- readdirp "^2.0.0"
- upath "^1.0.0"
- optionalDependencies:
- fsevents "^1.0.0"
-
-chownr@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181"
-
-chrome-trace-event@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.2.tgz#90f36885d5345a50621332f0717b595883d5d982"
-
-ci-info@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4"
-
-cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-circular-json@^0.3.1:
- version "0.3.3"
- resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
-
-circular-json@^0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.1.tgz#b8942a09e535863dc21b04417a91971e1d9cd91f"
-
-class-utils@^0.3.5:
- version "0.3.6"
- resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
- dependencies:
- arr-union "^3.1.0"
- define-property "^0.2.5"
- isobject "^3.0.0"
- static-extend "^0.1.1"
-
-cli-cursor@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
- dependencies:
- restore-cursor "^2.0.0"
-
-cli-width@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
-
-cliui@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
- dependencies:
- center-align "^0.1.1"
- right-align "^0.1.1"
- wordwrap "0.0.2"
-
-cliui@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
- dependencies:
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
- wrap-ansi "^2.0.0"
-
-cliui@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc"
- dependencies:
- string-width "^2.1.1"
- strip-ansi "^4.0.0"
- wrap-ansi "^2.0.0"
-
-clone-response@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
- dependencies:
- mimic-response "^1.0.0"
-
-co@^4.6.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
-
-co@~3.0.6:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/co/-/co-3.0.6.tgz#1445f226c5eb956138e68c9ac30167ea7d2e6bda"
-
-code-point-at@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
-
-collection-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
- dependencies:
- map-visit "^1.0.0"
- object-visit "^1.0.0"
-
-color-convert@^1.9.0:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
- dependencies:
- color-name "^1.1.1"
-
-color-name@^1.1.1:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
-
-colors@^1.1.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
-
-combine-lists@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6"
- dependencies:
- lodash "^4.5.0"
-
-combine-source-map@~0.7.1:
- version "0.7.2"
- resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e"
- dependencies:
- convert-source-map "~1.1.0"
- inline-source-map "~0.6.0"
- lodash.memoize "~3.0.3"
- source-map "~0.5.3"
-
-combine-source-map@~0.8.0:
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b"
- dependencies:
- convert-source-map "~1.1.0"
- inline-source-map "~0.6.0"
- lodash.memoize "~3.0.3"
- source-map "~0.5.3"
-
-combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
- dependencies:
- delayed-stream "~1.0.0"
-
-commander@^2.9.0, commander@~2.14.1:
- version "2.14.1"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa"
-
-commander@~2.13.0:
- version "2.13.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
-
-commondir@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
-
-component-bind@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1"
-
-component-emitter@1.2.1, component-emitter@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
-
-component-inherit@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143"
-
-concat-map@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
-
-concat-stream@^1.5.0, concat-stream@^1.6.0:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26"
- dependencies:
- inherits "^2.0.3"
- readable-stream "^2.2.2"
- typedarray "^0.0.6"
-
-concat-stream@~1.5.0, concat-stream@~1.5.1:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266"
- dependencies:
- inherits "~2.0.1"
- readable-stream "~2.0.0"
- typedarray "~0.0.5"
-
-connect@^3.6.0:
- version "3.6.6"
- resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524"
- dependencies:
- debug "2.6.9"
- finalhandler "1.1.0"
- parseurl "~1.3.2"
- utils-merge "1.0.1"
-
-console-browserify@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
- dependencies:
- date-now "^0.1.4"
-
-console-control-strings@^1.0.0, console-control-strings@~1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
-
-constants-browserify@^1.0.0, constants-browserify@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
-
-content-type-parser@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7"
-
-content-type@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
-
-convert-source-map@^1.4.0, convert-source-map@^1.5.0:
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5"
-
-convert-source-map@~1.1.0:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
-
-cookie@0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
-
-copy-concurrently@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0"
- dependencies:
- aproba "^1.1.1"
- fs-write-stream-atomic "^1.0.8"
- iferr "^0.1.5"
- mkdirp "^0.5.1"
- rimraf "^2.5.4"
- run-queue "^1.0.0"
-
-copy-descriptor@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
-
-core-js@^2.2.0, core-js@^2.4.0, core-js@^2.5.0:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
-
-core-util-is@1.0.2, core-util-is@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
-
-create-ecdh@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d"
- dependencies:
- bn.js "^4.1.0"
- elliptic "^6.0.0"
-
-create-hash@^1.1.0, create-hash@^1.1.2:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd"
- dependencies:
- cipher-base "^1.0.1"
- inherits "^2.0.1"
- ripemd160 "^2.0.0"
- sha.js "^2.4.0"
-
-create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06"
- dependencies:
- cipher-base "^1.0.3"
- create-hash "^1.1.0"
- inherits "^2.0.1"
- ripemd160 "^2.0.0"
- safe-buffer "^5.0.1"
- sha.js "^2.4.8"
-
-cross-spawn@^5.0.1, cross-spawn@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
- dependencies:
- lru-cache "^4.0.1"
- shebang-command "^1.2.0"
- which "^1.2.9"
-
-cryptiles@2.x.x:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
- dependencies:
- boom "2.x.x"
-
-cryptiles@3.x.x:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
- dependencies:
- boom "5.x.x"
-
-crypto-browserify@^3.0.0, crypto-browserify@^3.11.0:
- version "3.12.0"
- resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
- dependencies:
- browserify-cipher "^1.0.0"
- browserify-sign "^4.0.0"
- create-ecdh "^4.0.0"
- create-hash "^1.1.0"
- create-hmac "^1.1.0"
- diffie-hellman "^5.0.0"
- inherits "^2.0.1"
- pbkdf2 "^3.0.3"
- public-encrypt "^4.0.0"
- randombytes "^2.0.0"
- randomfill "^1.0.3"
-
-cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b"
-
-"cssstyle@>= 0.2.37 < 0.3.0":
- version "0.2.37"
- resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54"
- dependencies:
- cssom "0.3.x"
-
-custom-event@~1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425"
-
-cyclist@~0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"
-
-d@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
- dependencies:
- es5-ext "^0.10.9"
-
-dashdash@^1.12.0:
- version "1.14.1"
- resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
- dependencies:
- assert-plus "^1.0.0"
-
-data-uri-to-buffer@1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835"
-
-date-format@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8"
-
-date-now@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
-
-debug@2, debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@~2.6.4, debug@~2.6.6:
- version "2.6.9"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
- dependencies:
- ms "2.0.0"
-
-debug@^3.1.0, debug@~3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
- dependencies:
- ms "2.0.0"
-
-debug@~2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
- dependencies:
- ms "0.7.1"
-
-decamelize@^1.0.0, decamelize@^1.1.1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
-
-decode-uri-component@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
-
-decompress-response@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
- dependencies:
- mimic-response "^1.0.0"
-
-deep-extend@~0.4.0:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f"
-
-deep-is@~0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
-
-default-require-extensions@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8"
- dependencies:
- strip-bom "^2.0.0"
-
-define-properties@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
- dependencies:
- foreach "^2.0.5"
- object-keys "^1.0.8"
-
-define-property@^0.2.5:
- version "0.2.5"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
- dependencies:
- is-descriptor "^0.1.0"
-
-define-property@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
- dependencies:
- is-descriptor "^1.0.0"
-
-define-property@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
- dependencies:
- is-descriptor "^1.0.2"
- isobject "^3.0.1"
-
-defined@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
-
-degenerator@~1.0.2:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095"
- dependencies:
- ast-types "0.x.x"
- escodegen "1.x.x"
- esprima "3.x.x"
-
-del@^2.0.2:
- version "2.2.2"
- resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
- dependencies:
- globby "^5.0.0"
- is-path-cwd "^1.0.0"
- is-path-in-cwd "^1.0.0"
- object-assign "^4.0.1"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
- rimraf "^2.2.8"
-
-delayed-stream@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
-
-delegates@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
-
-depd@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
-
-depd@~1.1.1:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
-
-deps-sort@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5"
- dependencies:
- JSONStream "^1.0.3"
- shasum "^1.0.0"
- subarg "^1.0.0"
- through2 "^2.0.0"
-
-des.js@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc"
- dependencies:
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
-
-detect-indent@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
- dependencies:
- repeating "^2.0.0"
-
-detect-libc@^1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
-
-detect-newline@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
-
-detective@^4.0.0:
- version "4.7.1"
- resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e"
- dependencies:
- acorn "^5.2.1"
- defined "^1.0.0"
-
-di@^0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"
-
-diff@^3.2.0:
- version "3.4.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
-
-diffie-hellman@^5.0.0:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
- dependencies:
- bn.js "^4.1.0"
- miller-rabin "^4.0.0"
- randombytes "^2.0.0"
-
-doctrine@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
- dependencies:
- esutils "^2.0.2"
-
-dom-serialize@^2.2.0:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b"
- dependencies:
- custom-event "~1.0.0"
- ent "~2.2.0"
- extend "^3.0.0"
- void-elements "^2.0.0"
-
-domain-browser@^1.1.1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
-
-domain-browser@~1.1.0:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc"
-
-domexception@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
- dependencies:
- webidl-conversions "^4.0.2"
-
-double-ended-queue@^2.1.0-0:
- version "2.1.0-0"
- resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c"
-
-duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
- dependencies:
- readable-stream "^2.0.2"
-
-duplexer3@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
-
-duplexify@^3.4.2, duplexify@^3.5.3:
- version "3.5.4"
- resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.4.tgz#4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4"
- dependencies:
- end-of-stream "^1.0.0"
- inherits "^2.0.1"
- readable-stream "^2.0.0"
- stream-shift "^1.0.0"
-
-ecc-jsbn@~0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
- dependencies:
- jsbn "~0.1.0"
-
-ee-first@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
-
-elliptic@^6.0.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df"
- dependencies:
- bn.js "^4.4.0"
- brorand "^1.0.1"
- hash.js "^1.0.0"
- hmac-drbg "^1.0.0"
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
- minimalistic-crypto-utils "^1.0.0"
-
-emojis-list@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
-
-encodeurl@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
-
-end-of-stream@^1.0.0, end-of-stream@^1.1.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
- dependencies:
- once "^1.4.0"
-
-engine.io-client@~3.1.0:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.5.tgz#85de17666560327ef1817978f6e3f8101ded2c47"
- dependencies:
- component-emitter "1.2.1"
- component-inherit "0.0.3"
- debug "~3.1.0"
- engine.io-parser "~2.1.1"
- has-cors "1.1.0"
- indexof "0.0.1"
- parseqs "0.0.5"
- parseuri "0.0.5"
- ws "~3.3.1"
- xmlhttprequest-ssl "~1.5.4"
- yeast "0.1.2"
-
-engine.io-parser@~2.1.0, engine.io-parser@~2.1.1:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196"
- dependencies:
- after "0.8.2"
- arraybuffer.slice "~0.0.7"
- base64-arraybuffer "0.1.5"
- blob "0.0.4"
- has-binary2 "~1.0.2"
-
-engine.io@~3.1.0:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845"
- dependencies:
- accepts "~1.3.4"
- base64id "1.0.0"
- cookie "0.3.1"
- debug "~3.1.0"
- engine.io-parser "~2.1.0"
- ws "~3.3.1"
- optionalDependencies:
- uws "~9.14.0"
-
-enhanced-resolve@^3.4.0:
- version "3.4.1"
- resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e"
- dependencies:
- graceful-fs "^4.1.2"
- memory-fs "^0.4.0"
- object-assign "^4.0.1"
- tapable "^0.2.7"
-
-enhanced-resolve@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a"
- dependencies:
- graceful-fs "^4.1.2"
- memory-fs "^0.4.0"
- tapable "^1.0.0"
-
-ent@~2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
-
-errno@^0.1.3, errno@~0.1.7:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
- dependencies:
- prr "~1.0.1"
-
-error-ex@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc"
- dependencies:
- is-arrayish "^0.2.1"
-
-es-abstract@^1.5.1:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
- dependencies:
- es-to-primitive "^1.1.1"
- function-bind "^1.1.1"
- has "^1.0.1"
- is-callable "^1.1.3"
- is-regex "^1.0.4"
-
-es-to-primitive@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
- dependencies:
- is-callable "^1.1.1"
- is-date-object "^1.0.1"
- is-symbol "^1.0.1"
-
-es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14:
- version "0.10.39"
- resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.39.tgz#fca21b67559277ca4ac1a1ed7048b107b6f76d87"
- dependencies:
- es6-iterator "~2.0.3"
- es6-symbol "~3.1.1"
-
-es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
- dependencies:
- d "1"
- es5-ext "^0.10.35"
- es6-symbol "^3.1.1"
-
-es6-map@^0.1.3:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
- es6-iterator "~2.0.1"
- es6-set "~0.1.5"
- es6-symbol "~3.1.1"
- event-emitter "~0.3.5"
-
-es6-set@~0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
- es6-iterator "~2.0.1"
- es6-symbol "3.1.1"
- event-emitter "~0.3.5"
-
-es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
-
-es6-weak-map@^2.0.1:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f"
- dependencies:
- d "1"
- es5-ext "^0.10.14"
- es6-iterator "^2.0.1"
- es6-symbol "^3.1.1"
-
-escape-html@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
-
-escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
-
-escodegen@1.x.x, escodegen@^1.9.0:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2"
- dependencies:
- esprima "^3.1.3"
- estraverse "^4.2.0"
- esutils "^2.0.2"
- optionator "^0.8.1"
- optionalDependencies:
- source-map "~0.6.1"
-
-escope@^3.6.0:
- version "3.6.0"
- resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3"
- dependencies:
- es6-map "^0.1.3"
- es6-weak-map "^2.0.1"
- esrecurse "^4.1.0"
- estraverse "^4.1.1"
-
-eslint-scope@^3.7.1:
- version "3.7.1"
- resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
- dependencies:
- esrecurse "^4.1.0"
- estraverse "^4.1.1"
-
-eslint-visitor-keys@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
-
-eslint@^4.17.0:
- version "4.18.2"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45"
- dependencies:
- ajv "^5.3.0"
- babel-code-frame "^6.22.0"
- chalk "^2.1.0"
- concat-stream "^1.6.0"
- cross-spawn "^5.1.0"
- debug "^3.1.0"
- doctrine "^2.1.0"
- eslint-scope "^3.7.1"
- eslint-visitor-keys "^1.0.0"
- espree "^3.5.2"
- esquery "^1.0.0"
- esutils "^2.0.2"
- file-entry-cache "^2.0.0"
- functional-red-black-tree "^1.0.1"
- glob "^7.1.2"
- globals "^11.0.1"
- ignore "^3.3.3"
- imurmurhash "^0.1.4"
- inquirer "^3.0.6"
- is-resolvable "^1.0.0"
- js-yaml "^3.9.1"
- json-stable-stringify-without-jsonify "^1.0.1"
- levn "^0.3.0"
- lodash "^4.17.4"
- minimatch "^3.0.2"
- mkdirp "^0.5.1"
- natural-compare "^1.4.0"
- optionator "^0.8.2"
- path-is-inside "^1.0.2"
- pluralize "^7.0.0"
- progress "^2.0.0"
- require-uncached "^1.0.3"
- semver "^5.3.0"
- strip-ansi "^4.0.0"
- strip-json-comments "~2.0.1"
- table "4.0.2"
- text-table "~0.2.0"
-
-espree@^3.5.2:
- version "3.5.3"
- resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6"
- dependencies:
- acorn "^5.4.0"
- acorn-jsx "^3.0.0"
-
-esprima@3.x.x, esprima@^3.1.3:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
-
-esprima@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
-
-esquery@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa"
- dependencies:
- estraverse "^4.0.0"
-
-esrecurse@^4.1.0:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
- dependencies:
- estraverse "^4.1.0"
-
-estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
-
-estree-walker@^0.3.0:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa"
-
-esutils@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
-
-event-emitter@~0.3.5:
- version "0.3.5"
- resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
-
-eventemitter3@1.x.x:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
-
-events@^1.0.0, events@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
-
-evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02"
- dependencies:
- md5.js "^1.3.4"
- safe-buffer "^5.1.1"
-
-exec-sh@^0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38"
- dependencies:
- merge "^1.1.3"
-
-execa@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
- dependencies:
- cross-spawn "^5.0.1"
- get-stream "^3.0.0"
- is-stream "^1.1.0"
- npm-run-path "^2.0.0"
- p-finally "^1.0.0"
- signal-exit "^3.0.0"
- strip-eof "^1.0.0"
-
-exists-sync@0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/exists-sync/-/exists-sync-0.0.4.tgz#9744c2c428cc03b01060db454d4b12f0ef3c8879"
-
-exit@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
-
-expand-braces@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea"
- dependencies:
- array-slice "^0.2.3"
- array-unique "^0.2.1"
- braces "^0.1.2"
-
-expand-brackets@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
- dependencies:
- is-posix-bracket "^0.1.0"
-
-expand-brackets@^2.1.4:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
- dependencies:
- debug "^2.3.3"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- posix-character-classes "^0.1.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-expand-range@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044"
- dependencies:
- is-number "^0.1.1"
- repeat-string "^0.2.2"
-
-expand-range@^1.8.1:
- version "1.8.2"
- resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337"
- dependencies:
- fill-range "^2.1.0"
-
-expect@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/expect/-/expect-22.4.0.tgz#371edf1ae15b83b5bf5ec34b42f1584660a36c16"
- dependencies:
- ansi-styles "^3.2.0"
- jest-diff "^22.4.0"
- jest-get-type "^22.1.0"
- jest-matcher-utils "^22.4.0"
- jest-message-util "^22.4.0"
- jest-regex-util "^22.1.0"
-
-extend-shallow@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
- dependencies:
- is-extendable "^0.1.0"
-
-extend-shallow@^3.0.0, extend-shallow@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
- dependencies:
- assign-symbols "^1.0.0"
- is-extendable "^1.0.1"
-
-extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
-
-external-editor@^2.0.4:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48"
- dependencies:
- chardet "^0.4.0"
- iconv-lite "^0.4.17"
- tmp "^0.0.33"
-
-extglob@^0.3.1:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
- dependencies:
- is-extglob "^1.0.0"
-
-extglob@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
- dependencies:
- array-unique "^0.3.2"
- define-property "^1.0.0"
- expand-brackets "^2.1.4"
- extend-shallow "^2.0.1"
- fragment-cache "^0.2.1"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-extsprintf@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
-
-extsprintf@^1.2.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
-
-fast-deep-equal@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
-
-fast-json-stable-stringify@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
-
-fast-levenshtein@~2.0.4:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
-
-fb-watchman@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58"
- dependencies:
- bser "^2.0.0"
-
-figures@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
- dependencies:
- escape-string-regexp "^1.0.5"
-
-file-entry-cache@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
- dependencies:
- flat-cache "^1.2.1"
- object-assign "^4.0.1"
-
-file-uri-to-path@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
-
-filename-regex@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
-
-fileset@^2.0.2:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0"
- dependencies:
- glob "^7.0.3"
- minimatch "^3.0.3"
-
-fill-range@^2.1.0:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723"
- dependencies:
- is-number "^2.1.0"
- isobject "^2.0.0"
- randomatic "^1.1.3"
- repeat-element "^1.1.2"
- repeat-string "^1.5.2"
-
-fill-range@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
- dependencies:
- extend-shallow "^2.0.1"
- is-number "^3.0.0"
- repeat-string "^1.6.1"
- to-regex-range "^2.1.0"
-
-finalhandler@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5"
- dependencies:
- debug "2.6.9"
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- on-finished "~2.3.0"
- parseurl "~1.3.2"
- statuses "~1.3.1"
- unpipe "~1.0.0"
-
-find-cache-dir@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f"
- dependencies:
- commondir "^1.0.1"
- make-dir "^1.0.0"
- pkg-dir "^2.0.0"
-
-find-up@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
- dependencies:
- path-exists "^2.0.0"
- pinkie-promise "^2.0.0"
-
-find-up@^2.0.0, find-up@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
- dependencies:
- locate-path "^2.0.0"
-
-flat-cache@^1.2.1:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481"
- dependencies:
- circular-json "^0.3.1"
- del "^2.0.2"
- graceful-fs "^4.1.2"
- write "^0.2.1"
-
-flush-write-stream@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417"
- dependencies:
- inherits "^2.0.1"
- readable-stream "^2.0.4"
-
-follow-redirects@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37"
- dependencies:
- debug "^2.2.0"
-
-for-in@^1.0.1, for-in@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
-
-for-own@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce"
- dependencies:
- for-in "^1.0.1"
-
-foreach@^2.0.5:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
-
-forever-agent@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
-
-form-data@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "^1.0.5"
- mime-types "^2.1.11"
-
-form-data@~2.1.1:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "^1.0.5"
- mime-types "^2.1.12"
-
-form-data@~2.3.1:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "1.0.6"
- mime-types "^2.1.12"
-
-fragment-cache@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
- dependencies:
- map-cache "^0.2.2"
-
-from2@^2.1.0, from2@^2.1.1:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af"
- dependencies:
- inherits "^2.0.1"
- readable-stream "^2.0.0"
-
-fs-access@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a"
- dependencies:
- null-check "^1.0.0"
-
-fs-write-stream-atomic@^1.0.8:
- version "1.0.10"
- resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
- dependencies:
- graceful-fs "^4.1.2"
- iferr "^0.1.5"
- imurmurhash "^0.1.4"
- readable-stream "1 || 2"
-
-fs.realpath@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
-
-fsevents@^1.0.0, fsevents@^1.1.1:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8"
- dependencies:
- nan "^2.3.0"
- node-pre-gyp "^0.6.39"
-
-fstream-ignore@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105"
- dependencies:
- fstream "^1.0.0"
- inherits "2"
- minimatch "^3.0.0"
-
-fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"
- dependencies:
- graceful-fs "^4.1.2"
- inherits "~2.0.0"
- mkdirp ">=0.5 0"
- rimraf "2"
-
-ftp@~0.3.10:
- version "0.3.10"
- resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d"
- dependencies:
- readable-stream "1.1.x"
- xregexp "2.0.0"
-
-function-bind@^1.0.2, function-bind@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
-
-functional-red-black-tree@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
-
-gauge@~2.7.3:
- version "2.7.4"
- resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
- dependencies:
- aproba "^1.0.3"
- console-control-strings "^1.0.0"
- has-unicode "^2.0.0"
- object-assign "^4.1.0"
- signal-exit "^3.0.0"
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
- wide-align "^1.1.0"
-
-generate-function@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
-
-generate-object-property@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
- dependencies:
- is-property "^1.0.0"
-
-generate-release@^0.14.0:
- version "0.14.0"
- resolved "https://registry.yarnpkg.com/generate-release/-/generate-release-0.14.0.tgz#22b2089b0ff4e0498d2c33fee94d2377199b996d"
- dependencies:
- bluebird "^3.5.0"
- exists-sync "0.0.4"
- glob "^7.1.2"
- iniparser "^1.0.5"
- inquirer "^3.3.0"
- minimist "^1.2.0"
- observatory "^1.0.0"
- rmdir "^1.2.0"
- temp "^0.8.3"
- xtend "^4.0.1"
-
-get-caller-file@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"
-
-get-stream@3.0.0, get-stream@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
-
-get-uri@2:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.1.tgz#dbdcacacd8c608a38316869368117697a1631c59"
- dependencies:
- data-uri-to-buffer "1"
- debug "2"
- extend "3"
- file-uri-to-path "1"
- ftp "~0.3.10"
- readable-stream "2"
-
-get-value@^2.0.3, get-value@^2.0.6:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
-
-getpass@^0.1.1:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
- dependencies:
- assert-plus "^1.0.0"
-
-glob-base@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
- dependencies:
- glob-parent "^2.0.0"
- is-glob "^2.0.0"
-
-glob-parent@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
- dependencies:
- is-glob "^2.0.0"
-
-glob-parent@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
- dependencies:
- is-glob "^3.1.0"
- path-dirname "^1.0.0"
-
-glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2:
- version "7.1.2"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-globals@^11.0.1:
- version "11.3.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0"
-
-globals@^9.18.0:
- version "9.18.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
-
-globby@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
- dependencies:
- array-union "^1.0.1"
- arrify "^1.0.0"
- glob "^7.0.3"
- object-assign "^4.0.1"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
-
-got@^8.0.3:
- version "8.2.0"
- resolved "https://registry.yarnpkg.com/got/-/got-8.2.0.tgz#0d11a071d05046348a2f5c0a5fa047fb687fdfc6"
- dependencies:
- "@sindresorhus/is" "^0.7.0"
- cacheable-request "^2.1.1"
- decompress-response "^3.3.0"
- duplexer3 "^0.1.4"
- get-stream "^3.0.0"
- into-stream "^3.1.0"
- is-retry-allowed "^1.1.0"
- isurl "^1.0.0-alpha5"
- lowercase-keys "^1.0.0"
- mimic-response "^1.0.0"
- p-cancelable "^0.3.0"
- p-timeout "^2.0.1"
- pify "^3.0.0"
- safe-buffer "^5.1.1"
- timed-out "^4.0.1"
- url-parse-lax "^3.0.0"
- url-to-options "^1.0.1"
-
-graceful-fs@^4.1.11, graceful-fs@^4.1.2:
- version "4.1.11"
- resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
-
-growly@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
-
-handlebars@^4.0.3:
- version "4.0.11"
- resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc"
- dependencies:
- async "^1.4.0"
- optimist "^0.6.1"
- source-map "^0.4.4"
- optionalDependencies:
- uglify-js "^2.6"
-
-har-schema@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
-
-har-schema@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
-
-har-validator@~2.0.6:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
- dependencies:
- chalk "^1.1.1"
- commander "^2.9.0"
- is-my-json-valid "^2.12.4"
- pinkie-promise "^2.0.0"
-
-har-validator@~4.2.1:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
- dependencies:
- ajv "^4.9.1"
- har-schema "^1.0.5"
-
-har-validator@~5.0.3:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
- dependencies:
- ajv "^5.1.0"
- har-schema "^2.0.0"
-
-has-ansi@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
- dependencies:
- ansi-regex "^2.0.0"
-
-has-binary2@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.2.tgz#e83dba49f0b9be4d026d27365350d9f03f54be98"
- dependencies:
- isarray "2.0.1"
-
-has-cors@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39"
-
-has-flag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
-
-has-flag@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
-
-has-flag@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
-
-has-symbol-support-x@^1.4.1:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455"
-
-has-to-string-tag-x@^1.2.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d"
- dependencies:
- has-symbol-support-x "^1.4.1"
-
-has-unicode@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
-
-has-value@^0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
- dependencies:
- get-value "^2.0.3"
- has-values "^0.1.4"
- isobject "^2.0.0"
-
-has-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
- dependencies:
- get-value "^2.0.6"
- has-values "^1.0.0"
- isobject "^3.0.0"
-
-has-values@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
-
-has-values@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
- dependencies:
- is-number "^3.0.0"
- kind-of "^4.0.0"
-
-has@^1.0.0, has@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
- dependencies:
- function-bind "^1.0.2"
-
-hash-base@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1"
- dependencies:
- inherits "^2.0.1"
-
-hash-base@^3.0.0:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-hash.js@^1.0.0, hash.js@^1.0.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846"
- dependencies:
- inherits "^2.0.3"
- minimalistic-assert "^1.0.0"
-
-hawk@3.1.3, hawk@~3.1.3:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
- dependencies:
- boom "2.x.x"
- cryptiles "2.x.x"
- hoek "2.x.x"
- sntp "1.x.x"
-
-hawk@~6.0.2:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"
- dependencies:
- boom "4.x.x"
- cryptiles "3.x.x"
- hoek "4.x.x"
- sntp "2.x.x"
-
-hipchat-notifier@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e"
- dependencies:
- lodash "^4.0.0"
- request "^2.0.0"
-
-hmac-drbg@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
- dependencies:
- hash.js "^1.0.3"
- minimalistic-assert "^1.0.0"
- minimalistic-crypto-utils "^1.0.1"
-
-hoek@2.x.x:
- version "2.16.3"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
-
-hoek@4.x.x:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
-
-home-or-tmp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
- dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.1"
-
-hosted-git-info@^2.1.4:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
-
-html-encoding-sniffer@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
- dependencies:
- whatwg-encoding "^1.0.1"
-
-htmlescape@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351"
-
-http-cache-semantics@3.8.1:
- version "3.8.1"
- resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2"
-
-http-errors@1.6.2, http-errors@~1.6.2:
- version "1.6.2"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736"
- dependencies:
- depd "1.1.1"
- inherits "2.0.3"
- setprototypeof "1.0.3"
- statuses ">= 1.3.1 < 2"
-
-http-proxy-agent@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz#cc1ce38e453bf984a0f7702d2dd59c73d081284a"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
-
-http-proxy@^1.13.0:
- version "1.16.2"
- resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
- dependencies:
- eventemitter3 "1.x.x"
- requires-port "1.x.x"
-
-http-signature@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
- dependencies:
- assert-plus "^0.2.0"
- jsprim "^1.2.2"
- sshpk "^1.7.0"
-
-http-signature@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
- dependencies:
- assert-plus "^1.0.0"
- jsprim "^1.2.2"
- sshpk "^1.7.0"
-
-httpntlm@1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2"
- dependencies:
- httpreq ">=0.4.22"
- underscore "~1.7.0"
-
-httpreq@>=0.4.22:
- version "0.4.24"
- resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f"
-
-https-browserify@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
-
-https-proxy-agent@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
-
-iconv-lite@0.4.15:
- version "0.4.15"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
-
-iconv-lite@0.4.19, iconv-lite@^0.4.17:
- version "0.4.19"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
-
-ieee754@^1.1.4:
- version "1.1.8"
- resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
-
-iferr@^0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
-
-ignore@^3.3.3:
- version "3.3.7"
- resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
-
-import-local@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc"
- dependencies:
- pkg-dir "^2.0.0"
- resolve-cwd "^2.0.0"
-
-imurmurhash@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
-
-indexof@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
-
-inflection@~1.10.0:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.10.0.tgz#5bffcb1197ad3e81050f8e17e21668087ee9eb2f"
-
-inflection@~1.3.0:
- version "1.3.8"
- resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e"
-
-inflight@^1.0.4:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
- dependencies:
- once "^1.3.0"
- wrappy "1"
-
-inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
-
-inherits@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
-
-ini@~1.3.0:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
-
-iniparser@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/iniparser/-/iniparser-1.0.5.tgz#836d6befe6dfbfcee0bccf1cf9f2acc7027f783d"
-
-inline-source-map@~0.6.0:
- version "0.6.2"
- resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5"
- dependencies:
- source-map "~0.5.3"
-
-inquirer@^3.0.6, inquirer@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
- dependencies:
- ansi-escapes "^3.0.0"
- chalk "^2.0.0"
- cli-cursor "^2.1.0"
- cli-width "^2.0.0"
- external-editor "^2.0.4"
- figures "^2.0.0"
- lodash "^4.3.0"
- mute-stream "0.0.7"
- run-async "^2.2.0"
- rx-lite "^4.0.8"
- rx-lite-aggregates "^4.0.8"
- string-width "^2.1.0"
- strip-ansi "^4.0.0"
- through "^2.3.6"
-
-insert-module-globals@^7.0.0:
- version "7.0.2"
- resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.2.tgz#012c56baa7d3307a8b417d4ec5270cf9741c18f4"
- dependencies:
- JSONStream "^1.0.3"
- combine-source-map "~0.7.1"
- concat-stream "~1.5.1"
- is-buffer "^1.1.0"
- lexical-scope "^1.2.0"
- process "~0.11.0"
- through2 "^2.0.0"
- xtend "^4.0.0"
-
-interpret@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
-
-into-stream@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6"
- dependencies:
- from2 "^2.1.1"
- p-is-promise "^1.1.0"
-
-invariant@^2.2.2:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.3.tgz#1a827dfde7dcbd7c323f0ca826be8fa7c5e9d688"
- dependencies:
- loose-envify "^1.0.0"
-
-invert-kv@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
-
-ip@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/ip/-/ip-1.0.1.tgz#c7e356cdea225ae71b36d70f2e71a92ba4e42590"
-
-ip@^1.1.2, ip@^1.1.4:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
-
-is-accessor-descriptor@^0.1.6:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
- dependencies:
- kind-of "^3.0.2"
-
-is-accessor-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
- dependencies:
- kind-of "^6.0.0"
-
-is-arrayish@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
-
-is-binary-path@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
- dependencies:
- binary-extensions "^1.0.0"
-
-is-buffer@^1.1.0, is-buffer@^1.1.5:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
-
-is-builtin-module@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
- dependencies:
- builtin-modules "^1.0.0"
-
-is-callable@^1.1.1, is-callable@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
-
-is-ci@^1.0.10:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5"
- dependencies:
- ci-info "^1.0.0"
-
-is-data-descriptor@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
- dependencies:
- kind-of "^3.0.2"
-
-is-data-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
- dependencies:
- kind-of "^6.0.0"
-
-is-date-object@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
-
-is-descriptor@^0.1.0:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
- dependencies:
- is-accessor-descriptor "^0.1.6"
- is-data-descriptor "^0.1.4"
- kind-of "^5.0.0"
-
-is-descriptor@^1.0.0, is-descriptor@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
- dependencies:
- is-accessor-descriptor "^1.0.0"
- is-data-descriptor "^1.0.0"
- kind-of "^6.0.2"
-
-is-dotfile@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"
-
-is-equal-shallow@^0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534"
- dependencies:
- is-primitive "^2.0.0"
-
-is-extendable@^0.1.0, is-extendable@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
-
-is-extendable@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
- dependencies:
- is-plain-object "^2.0.4"
-
-is-extglob@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
-
-is-extglob@^2.1.0, is-extglob@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
-
-is-finite@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
- dependencies:
- number-is-nan "^1.0.0"
-
-is-fullwidth-code-point@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
- dependencies:
- number-is-nan "^1.0.0"
-
-is-fullwidth-code-point@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
-
-is-generator-fn@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a"
-
-is-glob@^2.0.0, is-glob@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
- dependencies:
- is-extglob "^1.0.0"
-
-is-glob@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
- dependencies:
- is-extglob "^2.1.0"
-
-is-glob@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0"
- dependencies:
- is-extglob "^2.1.1"
-
-is-my-ip-valid@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824"
-
-is-my-json-valid@^2.12.4:
- version "2.17.2"
- resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c"
- dependencies:
- generate-function "^2.0.0"
- generate-object-property "^1.1.0"
- is-my-ip-valid "^1.0.0"
- jsonpointer "^4.0.0"
- xtend "^4.0.0"
-
-is-number@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806"
-
-is-number@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
- dependencies:
- kind-of "^3.0.2"
-
-is-number@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
- dependencies:
- kind-of "^3.0.2"
-
-is-number@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
-
-is-object@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470"
-
-is-odd@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24"
- dependencies:
- is-number "^4.0.0"
-
-is-path-cwd@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
-
-is-path-in-cwd@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc"
- dependencies:
- is-path-inside "^1.0.0"
-
-is-path-inside@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
- dependencies:
- path-is-inside "^1.0.1"
-
-is-plain-obj@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
-
-is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
- dependencies:
- isobject "^3.0.1"
-
-is-posix-bracket@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
-
-is-primitive@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
-
-is-promise@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
-
-is-property@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
-
-is-regex@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
- dependencies:
- has "^1.0.1"
-
-is-resolvable@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
-
-is-retry-allowed@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34"
-
-is-stream@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
-
-is-symbol@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
-
-is-typedarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
-
-is-utf8@^0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
-
-is-windows@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
-
-is@~0.2.6:
- version "0.2.7"
- resolved "https://registry.yarnpkg.com/is/-/is-0.2.7.tgz#3b34a2c48f359972f35042849193ae7264b63562"
-
-isarray@0.0.1, isarray@~0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
-
-isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
-
-isarray@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e"
-
-isbinaryfile@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621"
-
-isexe@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
-
-isobject@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
- dependencies:
- isarray "1.0.0"
-
-isobject@^3.0.0, isobject@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
-
-isstream@~0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
-
-istanbul-api@^1.1.14:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.2.2.tgz#e17cd519dd5ec4141197f246fdf380b75487f3b1"
- dependencies:
- async "^2.1.4"
- fileset "^2.0.2"
- istanbul-lib-coverage "^1.1.2"
- istanbul-lib-hook "^1.1.0"
- istanbul-lib-instrument "^1.9.2"
- istanbul-lib-report "^1.1.3"
- istanbul-lib-source-maps "^1.2.3"
- istanbul-reports "^1.1.4"
- js-yaml "^3.7.0"
- mkdirp "^0.5.1"
- once "^1.4.0"
-
-istanbul-lib-coverage@^1.1.1, istanbul-lib-coverage@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz#4113c8ff6b7a40a1ef7350b01016331f63afde14"
-
-istanbul-lib-hook@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b"
- dependencies:
- append-transform "^0.4.0"
-
-istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0, istanbul-lib-instrument@^1.9.2:
- version "1.9.2"
- resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz#84905bf47f7e0b401d6b840da7bad67086b4aab6"
- dependencies:
- babel-generator "^6.18.0"
- babel-template "^6.16.0"
- babel-traverse "^6.18.0"
- babel-types "^6.18.0"
- babylon "^6.18.0"
- istanbul-lib-coverage "^1.1.2"
- semver "^5.3.0"
-
-istanbul-lib-report@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz#2df12188c0fa77990c0d2176d2d0ba3394188259"
- dependencies:
- istanbul-lib-coverage "^1.1.2"
- mkdirp "^0.5.1"
- path-parse "^1.0.5"
- supports-color "^3.1.2"
-
-istanbul-lib-source-maps@^1.2.1, istanbul-lib-source-maps@^1.2.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz#20fb54b14e14b3fb6edb6aca3571fd2143db44e6"
- dependencies:
- debug "^3.1.0"
- istanbul-lib-coverage "^1.1.2"
- mkdirp "^0.5.1"
- rimraf "^2.6.1"
- source-map "^0.5.3"
-
-istanbul-reports@^1.1.4:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.4.tgz#5ccba5e22b7b5a5d91d5e0a830f89be334bf97bd"
- dependencies:
- handlebars "^4.0.3"
-
-isurl@^1.0.0-alpha5:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67"
- dependencies:
- has-to-string-tag-x "^1.2.0"
- is-object "^1.0.1"
-
-jasmine-core@^3.1.0, jasmine-core@~3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.1.0.tgz#a4785e135d5df65024dfc9224953df585bd2766c"
-
-jasmine@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.1.0.tgz#2bd59fd7ec6ec0e8acb64e09f45a68ed2ad1952a"
- dependencies:
- glob "^7.0.6"
- jasmine-core "~3.1.0"
-
-jest-changed-files@^22.2.0:
- version "22.2.0"
- resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.2.0.tgz#517610c4a8ca0925bdc88b0ca53bd678aa8d019e"
- dependencies:
- throat "^4.0.0"
-
-jest-cli@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-22.4.2.tgz#e6546dc651e13d164481aa3e76e53ac4f4edab06"
- dependencies:
- ansi-escapes "^3.0.0"
- chalk "^2.0.1"
- exit "^0.1.2"
- glob "^7.1.2"
- graceful-fs "^4.1.11"
- import-local "^1.0.0"
- is-ci "^1.0.10"
- istanbul-api "^1.1.14"
- istanbul-lib-coverage "^1.1.1"
- istanbul-lib-instrument "^1.8.0"
- istanbul-lib-source-maps "^1.2.1"
- jest-changed-files "^22.2.0"
- jest-config "^22.4.2"
- jest-environment-jsdom "^22.4.1"
- jest-get-type "^22.1.0"
- jest-haste-map "^22.4.2"
- jest-message-util "^22.4.0"
- jest-regex-util "^22.1.0"
- jest-resolve-dependencies "^22.1.0"
- jest-runner "^22.4.2"
- jest-runtime "^22.4.2"
- jest-snapshot "^22.4.0"
- jest-util "^22.4.1"
- jest-validate "^22.4.2"
- jest-worker "^22.2.2"
- micromatch "^2.3.11"
- node-notifier "^5.2.1"
- realpath-native "^1.0.0"
- rimraf "^2.5.4"
- slash "^1.0.0"
- string-length "^2.0.0"
- strip-ansi "^4.0.0"
- which "^1.2.12"
- yargs "^10.0.3"
-
-jest-config@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.4.2.tgz#580ba5819bf81a5e48f4fd470e8b81834f45c855"
- dependencies:
- chalk "^2.0.1"
- glob "^7.1.1"
- jest-environment-jsdom "^22.4.1"
- jest-environment-node "^22.4.1"
- jest-get-type "^22.1.0"
- jest-jasmine2 "^22.4.2"
- jest-regex-util "^22.1.0"
- jest-resolve "^22.4.2"
- jest-util "^22.4.1"
- jest-validate "^22.4.2"
- pretty-format "^22.4.0"
-
-jest-diff@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-22.4.0.tgz#384c2b78519ca44ca126382df53f134289232525"
- dependencies:
- chalk "^2.0.1"
- diff "^3.2.0"
- jest-get-type "^22.1.0"
- pretty-format "^22.4.0"
-
-jest-docblock@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.0.tgz#dbf1877e2550070cfc4d9b07a55775a0483159b8"
- dependencies:
- detect-newline "^2.1.0"
-
-jest-environment-jsdom@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.4.1.tgz#754f408872441740100d3917e5ec40c74de6447f"
- dependencies:
- jest-mock "^22.2.0"
- jest-util "^22.4.1"
- jsdom "^11.5.1"
-
-jest-environment-node@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.4.1.tgz#418850eb654596b8d6e36c2021cbedbc23df8e16"
- dependencies:
- jest-mock "^22.2.0"
- jest-util "^22.4.1"
-
-jest-get-type@^22.1.0:
- version "22.1.0"
- resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9"
-
-jest-haste-map@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.4.2.tgz#a90178e66146d4378bb076345a949071f3b015b4"
- dependencies:
- fb-watchman "^2.0.0"
- graceful-fs "^4.1.11"
- jest-docblock "^22.4.0"
- jest-serializer "^22.4.0"
- jest-worker "^22.2.2"
- micromatch "^2.3.11"
- sane "^2.0.0"
-
-jest-jasmine2@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.4.2.tgz#dfd3d259579ed6f52510d8f1ab692808f0d40691"
- dependencies:
- chalk "^2.0.1"
- co "^4.6.0"
- expect "^22.4.0"
- graceful-fs "^4.1.11"
- is-generator-fn "^1.0.0"
- jest-diff "^22.4.0"
- jest-matcher-utils "^22.4.0"
- jest-message-util "^22.4.0"
- jest-snapshot "^22.4.0"
- jest-util "^22.4.1"
- source-map-support "^0.5.0"
-
-jest-leak-detector@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-22.4.0.tgz#64da77f05b001c96d2062226e079f89989c4aa2f"
- dependencies:
- pretty-format "^22.4.0"
-
-jest-matcher-utils@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.4.0.tgz#d55f5faf2270462736bdf7c7485ee931c9d4b6a1"
- dependencies:
- chalk "^2.0.1"
- jest-get-type "^22.1.0"
- pretty-format "^22.4.0"
-
-jest-message-util@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.4.0.tgz#e3d861df16d2fee60cb2bc8feac2188a42579642"
- dependencies:
- "@babel/code-frame" "^7.0.0-beta.35"
- chalk "^2.0.1"
- micromatch "^2.3.11"
- slash "^1.0.0"
- stack-utils "^1.0.1"
-
-jest-mock@^22.2.0:
- version "22.2.0"
- resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7"
-
-jest-regex-util@^22.1.0:
- version "22.1.0"
- resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-22.1.0.tgz#5daf2fe270074b6da63e5d85f1c9acc866768f53"
-
-jest-resolve-dependencies@^22.1.0:
- version "22.1.0"
- resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-22.1.0.tgz#340e4139fb13315cd43abc054e6c06136be51e31"
- dependencies:
- jest-regex-util "^22.1.0"
-
-jest-resolve@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.4.2.tgz#25d88aa4147462c9c1c6a1ba16250d3794c24d00"
- dependencies:
- browser-resolve "^1.11.2"
- chalk "^2.0.1"
-
-jest-runner@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.4.2.tgz#19390ea9d99f768973e16f95a1efa351c0017e87"
- dependencies:
- exit "^0.1.2"
- jest-config "^22.4.2"
- jest-docblock "^22.4.0"
- jest-haste-map "^22.4.2"
- jest-jasmine2 "^22.4.2"
- jest-leak-detector "^22.4.0"
- jest-message-util "^22.4.0"
- jest-runtime "^22.4.2"
- jest-util "^22.4.1"
- jest-worker "^22.2.2"
- throat "^4.0.0"
-
-jest-runtime@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-22.4.2.tgz#0de0444f65ce15ee4f2e0055133fc7c17b9168f3"
- dependencies:
- babel-core "^6.0.0"
- babel-jest "^22.4.1"
- babel-plugin-istanbul "^4.1.5"
- chalk "^2.0.1"
- convert-source-map "^1.4.0"
- exit "^0.1.2"
- graceful-fs "^4.1.11"
- jest-config "^22.4.2"
- jest-haste-map "^22.4.2"
- jest-regex-util "^22.1.0"
- jest-resolve "^22.4.2"
- jest-util "^22.4.1"
- jest-validate "^22.4.2"
- json-stable-stringify "^1.0.1"
- micromatch "^2.3.11"
- realpath-native "^1.0.0"
- slash "^1.0.0"
- strip-bom "3.0.0"
- write-file-atomic "^2.1.0"
- yargs "^10.0.3"
-
-jest-serializer@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-22.4.0.tgz#b5d145b98c4b0d2c20ab686609adbb81fe23b566"
-
-jest-snapshot@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.4.0.tgz#03d3ce63f8fa7352388afc6a3c8b5ccc3a180ed7"
- dependencies:
- chalk "^2.0.1"
- jest-diff "^22.4.0"
- jest-matcher-utils "^22.4.0"
- mkdirp "^0.5.1"
- natural-compare "^1.4.0"
- pretty-format "^22.4.0"
-
-jest-util@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.4.1.tgz#dd17c3bdb067f8e90591563ec0c42bf847dc249f"
- dependencies:
- callsites "^2.0.0"
- chalk "^2.0.1"
- graceful-fs "^4.1.11"
- is-ci "^1.0.10"
- jest-message-util "^22.4.0"
- mkdirp "^0.5.1"
- source-map "^0.6.0"
-
-jest-validate@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.4.2.tgz#e789a4e056173bf97fe797a2df2d52105c57d4f4"
- dependencies:
- chalk "^2.0.1"
- jest-config "^22.4.2"
- jest-get-type "^22.1.0"
- leven "^2.1.0"
- pretty-format "^22.4.0"
-
-jest-worker@^22.2.2:
- version "22.2.2"
- resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.2.2.tgz#c1f5dc39976884b81f68ec50cb8532b2cbab3390"
- dependencies:
- merge-stream "^1.0.1"
-
-jest@^22.2.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest/-/jest-22.4.2.tgz#34012834a49bf1bdd3bc783850ab44e4499afc20"
- dependencies:
- import-local "^1.0.0"
- jest-cli "^22.4.2"
-
-js-tokens@^3.0.0, js-tokens@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
-
-js-yaml@^3.7.0, js-yaml@^3.9.1:
- version "3.10.0"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
- dependencies:
- argparse "^1.0.7"
- esprima "^4.0.0"
-
-jsbn@~0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
-
-jsdom@^11.5.1:
- version "11.6.2"
- resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb"
- dependencies:
- abab "^1.0.4"
- acorn "^5.3.0"
- acorn-globals "^4.1.0"
- array-equal "^1.0.0"
- browser-process-hrtime "^0.1.2"
- content-type-parser "^1.0.2"
- cssom ">= 0.3.2 < 0.4.0"
- cssstyle ">= 0.2.37 < 0.3.0"
- domexception "^1.0.0"
- escodegen "^1.9.0"
- html-encoding-sniffer "^1.0.2"
- left-pad "^1.2.0"
- nwmatcher "^1.4.3"
- parse5 "4.0.0"
- pn "^1.1.0"
- request "^2.83.0"
- request-promise-native "^1.0.5"
- sax "^1.2.4"
- symbol-tree "^3.2.2"
- tough-cookie "^2.3.3"
- w3c-hr-time "^1.0.1"
- webidl-conversions "^4.0.2"
- whatwg-encoding "^1.0.3"
- whatwg-url "^6.4.0"
- ws "^4.0.0"
- xml-name-validator "^3.0.0"
-
-jsesc@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
-
-json-buffer@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
-
-json-loader@^0.5.4:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
-
-json-schema-traverse@^0.3.0:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
-
-json-schema@0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
-
-json-stable-stringify-without-jsonify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
-
-json-stable-stringify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
- dependencies:
- jsonify "~0.0.0"
-
-json-stable-stringify@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
- dependencies:
- jsonify "~0.0.0"
-
-json-stringify-safe@5.0.x, json-stringify-safe@~5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
-
-json5@^0.5.0, json5@^0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
-
-jsonify@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
-
-jsonparse@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
-
-jsonpointer@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
-
-jsprim@^1.2.2:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
- dependencies:
- assert-plus "1.0.0"
- extsprintf "1.3.0"
- json-schema "0.2.3"
- verror "1.10.0"
-
-karma-chrome-launcher@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf"
- dependencies:
- fs-access "^1.0.0"
- which "^1.2.1"
-
-karma-firefox-launcher@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339"
-
-karma-jasmine@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529"
-
-karma-safari-launcher@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz#96982a2cc47d066aae71c553babb28319115a2ce"
-
-karma-webpack@^2.0.9:
- version "2.0.13"
- resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-2.0.13.tgz#cf56e3056c15b7747a0bb2140fc9a6be41dd9f02"
- dependencies:
- async "^2.0.0"
- babel-runtime "^6.0.0"
- loader-utils "^1.0.0"
- lodash "^4.0.0"
- source-map "^0.5.6"
- webpack-dev-middleware "^1.12.0"
-
-karma@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.0.tgz#a02698dd7f0f05ff5eb66ab8f65582490b512e58"
- dependencies:
- bluebird "^3.3.0"
- body-parser "^1.16.1"
- browserify "^14.5.0"
- chokidar "^1.4.1"
- colors "^1.1.0"
- combine-lists "^1.0.0"
- connect "^3.6.0"
- core-js "^2.2.0"
- di "^0.0.1"
- dom-serialize "^2.2.0"
- expand-braces "^0.1.1"
- glob "^7.1.1"
- graceful-fs "^4.1.2"
- http-proxy "^1.13.0"
- isbinaryfile "^3.0.0"
- lodash "^4.17.4"
- log4js "^2.3.9"
- mime "^1.3.4"
- minimatch "^3.0.2"
- optimist "^0.6.1"
- qjobs "^1.1.4"
- range-parser "^1.2.0"
- rimraf "^2.6.0"
- safe-buffer "^5.0.1"
- socket.io "2.0.4"
- source-map "^0.6.1"
- tmp "0.0.33"
- useragent "^2.1.12"
-
-keyv@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373"
- dependencies:
- json-buffer "3.0.0"
-
-kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
- dependencies:
- is-buffer "^1.1.5"
-
-kind-of@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
- dependencies:
- is-buffer "^1.1.5"
-
-kind-of@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
-
-kind-of@^6.0.0, kind-of@^6.0.2:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
-
-labeled-stream-splicer@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59"
- dependencies:
- inherits "^2.0.1"
- isarray "~0.0.1"
- stream-splicer "^2.0.0"
-
-lazy-cache@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
-
-lazy-cache@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264"
- dependencies:
- set-getter "^0.1.0"
-
-lcid@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
- dependencies:
- invert-kv "^1.0.0"
-
-left-pad@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
-
-leven@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
-
-levn@^0.3.0, levn@~0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
- dependencies:
- prelude-ls "~1.1.2"
- type-check "~0.3.2"
-
-lexical-scope@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4"
- dependencies:
- astw "^2.0.0"
-
-libbase64@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6"
-
-libmime@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6"
- dependencies:
- iconv-lite "0.4.15"
- libbase64 "0.1.0"
- libqp "1.1.0"
-
-libqp@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8"
-
-load-json-file@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
- dependencies:
- graceful-fs "^4.1.2"
- parse-json "^2.2.0"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
- strip-bom "^2.0.0"
-
-load-json-file@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
- dependencies:
- graceful-fs "^4.1.2"
- parse-json "^2.2.0"
- pify "^2.0.0"
- strip-bom "^3.0.0"
-
-loader-runner@^2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
-
-loader-utils@^0.2.15:
- version "0.2.17"
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
- dependencies:
- big.js "^3.1.3"
- emojis-list "^2.0.0"
- json5 "^0.5.0"
- object-assign "^4.0.1"
-
-loader-utils@^1.0.0, loader-utils@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
- dependencies:
- big.js "^3.1.3"
- emojis-list "^2.0.0"
- json5 "^0.5.0"
-
-locate-path@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
- dependencies:
- p-locate "^2.0.0"
- path-exists "^3.0.0"
-
-lodash.memoize@~3.0.3:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
-
-lodash.sortby@^4.7.0:
- version "4.7.0"
- resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
-
-lodash@^3.10.1:
- version "3.10.1"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
-
-lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.5.0:
- version "4.17.5"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
-
-log4js@^2.3.9:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.5.3.tgz#38bb7bde5e9c1c181bd75e8bc128c5cd0409caf1"
- dependencies:
- circular-json "^0.5.1"
- date-format "^1.2.0"
- debug "^3.1.0"
- semver "^5.3.0"
- streamroller "^0.7.0"
- optionalDependencies:
- amqplib "^0.5.2"
- axios "^0.15.3"
- hipchat-notifier "^1.1.0"
- loggly "^1.1.0"
- mailgun-js "^0.7.0"
- nodemailer "^2.5.0"
- redis "^2.7.1"
- slack-node "~0.2.0"
-
-loggly@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee"
- dependencies:
- json-stringify-safe "5.0.x"
- request "2.75.x"
- timespan "2.3.x"
-
-longest@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
-
-loose-envify@^1.0.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
- dependencies:
- js-tokens "^3.0.0"
-
-lowercase-keys@1.0.0, lowercase-keys@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306"
-
-lru-cache@4.1.x, lru-cache@^4.0.1, lru-cache@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
- dependencies:
- pseudomap "^1.0.2"
- yallist "^2.1.2"
-
-lru-cache@~2.6.5:
- version "2.6.5"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.6.5.tgz#e56d6354148ede8d7707b58d143220fd08df0fd5"
-
-magic-string@^0.14.0:
- version "0.14.0"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.14.0.tgz#57224aef1701caeed273b17a39a956e72b172462"
- dependencies:
- vlq "^0.2.1"
-
-magic-string@^0.22.4:
- version "0.22.4"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff"
- dependencies:
- vlq "^0.2.1"
-
-mailcomposer@4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4"
- dependencies:
- buildmail "4.0.1"
- libmime "3.0.0"
-
-mailgun-js@^0.7.0:
- version "0.7.15"
- resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.7.15.tgz#ee366a20dac64c3c15c03d6c1b3e0ed795252abb"
- dependencies:
- async "~2.1.2"
- debug "~2.2.0"
- form-data "~2.1.1"
- inflection "~1.10.0"
- is-stream "^1.1.0"
- path-proxy "~1.0.0"
- proxy-agent "~2.0.0"
- q "~1.4.0"
- tsscmp "~1.0.0"
-
-make-dir@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
- dependencies:
- pify "^3.0.0"
-
-makeerror@1.0.x:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c"
- dependencies:
- tmpl "1.0.x"
-
-map-cache@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
-
-map-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
- dependencies:
- object-visit "^1.0.0"
-
-md5.js@^1.3.4:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
- dependencies:
- hash-base "^3.0.0"
- inherits "^2.0.1"
-
-media-typer@0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
-
-mem@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76"
- dependencies:
- mimic-fn "^1.0.0"
-
-memory-fs@^0.4.0, memory-fs@~0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
- dependencies:
- errno "^0.1.3"
- readable-stream "^2.0.1"
-
-merge-stream@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
- dependencies:
- readable-stream "^2.0.1"
-
-merge@^1.1.3:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da"
-
-micromatch@^2.1.5, micromatch@^2.3.11:
- version "2.3.11"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
- dependencies:
- arr-diff "^2.0.0"
- array-unique "^0.2.1"
- braces "^1.8.2"
- expand-brackets "^0.1.4"
- extglob "^0.3.1"
- filename-regex "^2.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.1"
- kind-of "^3.0.2"
- normalize-path "^2.0.1"
- object.omit "^2.0.0"
- parse-glob "^3.0.4"
- regex-cache "^0.4.2"
-
-micromatch@^3.1.4, micromatch@^3.1.8:
- version "3.1.9"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89"
- dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- braces "^2.3.1"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- extglob "^2.0.4"
- fragment-cache "^0.2.1"
- kind-of "^6.0.2"
- nanomatch "^1.2.9"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-miller-rabin@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
- dependencies:
- bn.js "^4.0.0"
- brorand "^1.0.1"
-
-mime-db@~1.33.0:
- version "1.33.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
-
-mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7:
- version "2.1.18"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
- dependencies:
- mime-db "~1.33.0"
-
-mime@^1.3.4, mime@^1.5.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
-
-mimic-fn@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
-
-mimic-response@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e"
-
-minimalistic-assert@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3"
-
-minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
-
-minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
- dependencies:
- brace-expansion "^1.1.7"
-
-minimist@0.0.8:
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
-
-minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
-
-minimist@~0.0.1:
- version "0.0.10"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
-
-mississippi@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f"
- dependencies:
- concat-stream "^1.5.0"
- duplexify "^3.4.2"
- end-of-stream "^1.1.0"
- flush-write-stream "^1.0.0"
- from2 "^2.1.0"
- parallel-transform "^1.1.0"
- pump "^2.0.1"
- pumpify "^1.3.3"
- stream-each "^1.1.0"
- through2 "^2.0.0"
-
-mixin-deep@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
- dependencies:
- for-in "^1.0.2"
- is-extendable "^1.0.1"
-
-"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
- dependencies:
- minimist "0.0.8"
-
-module-deps@^4.0.8:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd"
- dependencies:
- JSONStream "^1.0.3"
- browser-resolve "^1.7.0"
- cached-path-relative "^1.0.0"
- concat-stream "~1.5.0"
- defined "^1.0.0"
- detective "^4.0.0"
- duplexer2 "^0.1.2"
- inherits "^2.0.1"
- parents "^1.0.0"
- readable-stream "^2.0.2"
- resolve "^1.1.3"
- stream-combiner2 "^1.1.1"
- subarg "^1.0.0"
- through2 "^2.0.0"
- xtend "^4.0.0"
-
-move-concurrently@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
- dependencies:
- aproba "^1.1.1"
- copy-concurrently "^1.0.0"
- fs-write-stream-atomic "^1.0.8"
- mkdirp "^0.5.1"
- rimraf "^2.5.4"
- run-queue "^1.0.3"
-
-ms@0.7.1:
- version "0.7.1"
- resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
-
-ms@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
-
-mute-stream@0.0.7:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
-
-nan@^2.3.0:
- version "2.9.2"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
-
-nanomatch@^1.2.9:
- version "1.2.9"
- resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2"
- dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- fragment-cache "^0.2.1"
- is-odd "^2.0.0"
- is-windows "^1.0.2"
- kind-of "^6.0.2"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-natural-compare@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
-
-negotiator@0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
-
-neo-async@^2.5.0:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f"
-
-netmask@~1.0.4:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35"
-
-node-int64@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
-
-node-libs-browser@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df"
- dependencies:
- assert "^1.1.1"
- browserify-zlib "^0.2.0"
- buffer "^4.3.0"
- console-browserify "^1.1.0"
- constants-browserify "^1.0.0"
- crypto-browserify "^3.11.0"
- domain-browser "^1.1.1"
- events "^1.0.0"
- https-browserify "^1.0.0"
- os-browserify "^0.3.0"
- path-browserify "0.0.0"
- process "^0.11.10"
- punycode "^1.2.4"
- querystring-es3 "^0.2.0"
- readable-stream "^2.3.3"
- stream-browserify "^2.0.1"
- stream-http "^2.7.2"
- string_decoder "^1.0.0"
- timers-browserify "^2.0.4"
- tty-browserify "0.0.0"
- url "^0.11.0"
- util "^0.10.3"
- vm-browserify "0.0.4"
-
-node-notifier@^5.2.1:
- version "5.2.1"
- resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea"
- dependencies:
- growly "^1.3.0"
- semver "^5.4.1"
- shellwords "^0.1.1"
- which "^1.3.0"
-
-node-pre-gyp@^0.6.39:
- version "0.6.39"
- resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649"
- dependencies:
- detect-libc "^1.0.2"
- hawk "3.1.3"
- mkdirp "^0.5.1"
- nopt "^4.0.1"
- npmlog "^4.0.2"
- rc "^1.1.7"
- request "2.81.0"
- rimraf "^2.6.1"
- semver "^5.3.0"
- tar "^2.2.1"
- tar-pack "^3.4.0"
-
-node-uuid@~1.4.7:
- version "1.4.8"
- resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
-
-node.extend@1.0.8:
- version "1.0.8"
- resolved "https://registry.yarnpkg.com/node.extend/-/node.extend-1.0.8.tgz#bab04379f7383f4587990c9df07b6a7f65db772b"
- dependencies:
- is "~0.2.6"
- object-keys "~0.4.0"
-
-node.flow@1.2.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/node.flow/-/node.flow-1.2.3.tgz#e1c44a82aeca8d78b458a77fb3dc642f2eba2649"
- dependencies:
- node.extend "1.0.8"
-
-nodemailer-direct-transport@3.3.2:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86"
- dependencies:
- nodemailer-shared "1.1.0"
- smtp-connection "2.12.0"
-
-nodemailer-fetch@1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4"
-
-nodemailer-shared@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0"
- dependencies:
- nodemailer-fetch "1.6.0"
-
-nodemailer-smtp-pool@2.8.2:
- version "2.8.2"
- resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72"
- dependencies:
- nodemailer-shared "1.1.0"
- nodemailer-wellknown "0.1.10"
- smtp-connection "2.12.0"
-
-nodemailer-smtp-transport@2.7.2:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77"
- dependencies:
- nodemailer-shared "1.1.0"
- nodemailer-wellknown "0.1.10"
- smtp-connection "2.12.0"
-
-nodemailer-wellknown@0.1.10:
- version "0.1.10"
- resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5"
-
-nodemailer@^2.5.0:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9"
- dependencies:
- libmime "3.0.0"
- mailcomposer "4.0.1"
- nodemailer-direct-transport "3.3.2"
- nodemailer-shared "1.1.0"
- nodemailer-smtp-pool "2.8.2"
- nodemailer-smtp-transport "2.7.2"
- socks "1.1.9"
-
-nopt@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
- dependencies:
- abbrev "1"
- osenv "^0.1.4"
-
-normalize-package-data@^2.3.2:
- version "2.4.0"
- resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
- dependencies:
- hosted-git-info "^2.1.4"
- is-builtin-module "^1.0.0"
- semver "2 || 3 || 4 || 5"
- validate-npm-package-license "^3.0.1"
-
-normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
- dependencies:
- remove-trailing-separator "^1.0.1"
-
-normalize-url@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6"
- dependencies:
- prepend-http "^2.0.0"
- query-string "^5.0.1"
- sort-keys "^2.0.0"
-
-npm-run-path@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
- dependencies:
- path-key "^2.0.0"
-
-npmlog@^4.0.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
- dependencies:
- are-we-there-yet "~1.1.2"
- console-control-strings "~1.1.0"
- gauge "~2.7.3"
- set-blocking "~2.0.0"
-
-null-check@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd"
-
-number-is-nan@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
-
-nwmatcher@^1.4.3:
- version "1.4.3"
- resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c"
-
-oauth-sign@~0.8.1, oauth-sign@~0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
-
-object-assign@^4.0.1, object-assign@^4.1.0:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
-
-object-component@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
-
-object-copy@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
- dependencies:
- copy-descriptor "^0.1.0"
- define-property "^0.2.5"
- kind-of "^3.0.3"
-
-object-keys@^1.0.8:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
-
-object-keys@~0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336"
-
-object-visit@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
- dependencies:
- isobject "^3.0.0"
-
-object.getownpropertydescriptors@^2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
- dependencies:
- define-properties "^1.1.2"
- es-abstract "^1.5.1"
-
-object.omit@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
- dependencies:
- for-own "^0.1.4"
- is-extendable "^0.1.1"
-
-object.pick@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
- dependencies:
- isobject "^3.0.1"
-
-observatory@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/observatory/-/observatory-1.0.0.tgz#2baa606e8299e6866914ec9c8a4db6a41136e59b"
- dependencies:
- ansi-escapes "^1.1.0"
- chalk "^1.1.1"
- lodash "^3.10.1"
-
-on-finished@~2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
- dependencies:
- ee-first "1.1.1"
-
-once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
- dependencies:
- wrappy "1"
-
-onetime@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
- dependencies:
- mimic-fn "^1.0.0"
-
-optimist@^0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
- dependencies:
- minimist "~0.0.1"
- wordwrap "~0.0.2"
-
-optionator@^0.8.1, optionator@^0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
- dependencies:
- deep-is "~0.1.3"
- fast-levenshtein "~2.0.4"
- levn "~0.3.0"
- prelude-ls "~1.1.2"
- type-check "~0.3.2"
- wordwrap "~1.0.0"
-
-os-browserify@^0.3.0, os-browserify@~0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
-
-os-homedir@^1.0.0, os-homedir@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
-
-os-locale@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2"
- dependencies:
- execa "^0.7.0"
- lcid "^1.0.0"
- mem "^1.1.0"
-
-os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
-
-osenv@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
- dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.0"
-
-p-cancelable@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa"
-
-p-finally@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
-
-p-is-promise@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e"
-
-p-limit@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
- dependencies:
- p-try "^1.0.0"
-
-p-locate@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
- dependencies:
- p-limit "^1.1.0"
-
-p-timeout@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038"
- dependencies:
- p-finally "^1.0.0"
-
-p-try@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
-
-pac-proxy-agent@1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-1.1.0.tgz#34a385dfdf61d2f0ecace08858c745d3e791fd4d"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
- get-uri "2"
- http-proxy-agent "1"
- https-proxy-agent "1"
- pac-resolver "~2.0.0"
- raw-body "2"
- socks-proxy-agent "2"
-
-pac-resolver@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-2.0.0.tgz#99b88d2f193fbdeefc1c9a529c1f3260ab5277cd"
- dependencies:
- co "~3.0.6"
- degenerator "~1.0.2"
- ip "1.0.1"
- netmask "~1.0.4"
- thunkify "~2.1.1"
-
-pako@~1.0.5:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258"
-
-parallel-transform@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06"
- dependencies:
- cyclist "~0.2.2"
- inherits "^2.0.3"
- readable-stream "^2.1.5"
-
-parents@^1.0.0, parents@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751"
- dependencies:
- path-platform "~0.11.15"
-
-parse-asn1@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712"
- dependencies:
- asn1.js "^4.0.0"
- browserify-aes "^1.0.0"
- create-hash "^1.1.0"
- evp_bytestokey "^1.0.0"
- pbkdf2 "^3.0.3"
-
-parse-glob@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
- dependencies:
- glob-base "^0.3.0"
- is-dotfile "^1.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.0"
-
-parse-json@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
- dependencies:
- error-ex "^1.2.0"
-
-parse5@4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
-
-parseqs@0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d"
- dependencies:
- better-assert "~1.0.0"
-
-parseuri@0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a"
- dependencies:
- better-assert "~1.0.0"
-
-parseurl@~1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
-
-pascalcase@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
-
-path-browserify@0.0.0, path-browserify@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a"
-
-path-dirname@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0"
-
-path-exists@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
- dependencies:
- pinkie-promise "^2.0.0"
-
-path-exists@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
-
-path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
-
-path-is-inside@^1.0.1, path-is-inside@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
-
-path-key@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
-
-path-parse@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
-
-path-platform@~0.11.15:
- version "0.11.15"
- resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2"
-
-path-proxy@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e"
- dependencies:
- inflection "~1.3.0"
-
-path-type@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
- dependencies:
- graceful-fs "^4.1.2"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
-
-path-type@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
- dependencies:
- pify "^2.0.0"
-
-pbkdf2@^3.0.3:
- version "3.0.14"
- resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade"
- dependencies:
- create-hash "^1.1.2"
- create-hmac "^1.1.4"
- ripemd160 "^2.0.1"
- safe-buffer "^5.0.1"
- sha.js "^2.4.8"
-
-performance-now@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
-
-performance-now@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
-
-pify@^2.0.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
-
-pify@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
-
-pinkie-promise@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
- dependencies:
- pinkie "^2.0.0"
-
-pinkie@^2.0.0:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
-
-pkg-dir@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b"
- dependencies:
- find-up "^2.1.0"
-
-pluralize@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
-
-pn@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
-
-posix-character-classes@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
-
-prelude-ls@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
-
-prepend-http@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
-
-preserve@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
-
-pretty-format@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.0.tgz#237b1f7e1c50ed03bc65c03ccc29d7c8bb7beb94"
- dependencies:
- ansi-regex "^3.0.0"
- ansi-styles "^3.2.0"
-
-private@^0.1.7:
- version "0.1.8"
- resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
-
-process-nextick-args@~1.0.6:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
-
-process-nextick-args@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
-
-process@^0.11.10, process@~0.11.0:
- version "0.11.10"
- resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
-
-progress@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
-
-promise-inflight@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
-
-proxy-agent@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-2.0.0.tgz#57eb5347aa805d74ec681cb25649dba39c933499"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
- http-proxy-agent "1"
- https-proxy-agent "1"
- lru-cache "~2.6.5"
- pac-proxy-agent "1"
- socks-proxy-agent "2"
-
-prr@~1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
-
-pseudomap@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
-
-public-encrypt@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
- dependencies:
- bn.js "^4.1.0"
- browserify-rsa "^4.0.0"
- create-hash "^1.1.0"
- parse-asn1 "^5.0.0"
- randombytes "^2.0.1"
-
-pump@^2.0.0, pump@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909"
- dependencies:
- end-of-stream "^1.1.0"
- once "^1.3.1"
-
-pumpify@^1.3.3:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.4.0.tgz#80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb"
- dependencies:
- duplexify "^3.5.3"
- inherits "^2.0.3"
- pump "^2.0.0"
-
-punycode@1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
-
-punycode@1.4.1, punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
-
-punycode@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
-
-q@~1.4.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
-
-qjobs@^1.1.4:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071"
-
-qs@6.5.1, qs@~6.5.1:
- version "6.5.1"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
-
-qs@~6.2.0:
- version "6.2.3"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe"
-
-qs@~6.4.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
-
-query-string@^5.0.1:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.0.tgz#9583b15fd1307f899e973ed418886426a9976469"
- dependencies:
- decode-uri-component "^0.2.0"
- object-assign "^4.1.0"
- strict-uri-encode "^1.0.0"
-
-querystring-es3@^0.2.0, querystring-es3@~0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
-
-querystring@0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
-
-randomatic@^1.1.3:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
- dependencies:
- is-number "^3.0.0"
- kind-of "^4.0.0"
-
-randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80"
- dependencies:
- safe-buffer "^5.1.0"
-
-randomfill@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458"
- dependencies:
- randombytes "^2.0.5"
- safe-buffer "^5.1.0"
-
-range-parser@^1.0.3, range-parser@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
-
-raw-body@2, raw-body@2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89"
- dependencies:
- bytes "3.0.0"
- http-errors "1.6.2"
- iconv-lite "0.4.19"
- unpipe "1.0.0"
-
-rc@^1.1.7:
- version "1.2.5"
- resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.5.tgz#275cd687f6e3b36cc756baa26dfee80a790301fd"
- dependencies:
- deep-extend "~0.4.0"
- ini "~1.3.0"
- minimist "^1.2.0"
- strip-json-comments "~2.0.1"
-
-read-only-stream@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
- dependencies:
- readable-stream "^2.0.2"
-
-read-pkg-up@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
- dependencies:
- find-up "^1.0.0"
- read-pkg "^1.0.0"
-
-read-pkg-up@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
- dependencies:
- find-up "^2.0.0"
- read-pkg "^2.0.0"
-
-read-pkg@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
- dependencies:
- load-json-file "^1.0.0"
- normalize-package-data "^2.3.2"
- path-type "^1.0.0"
-
-read-pkg@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
- dependencies:
- load-json-file "^2.0.0"
- normalize-package-data "^2.3.2"
- path-type "^2.0.0"
-
-"readable-stream@1 || 2", readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3:
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.3"
- isarray "~1.0.0"
- process-nextick-args "~2.0.0"
- safe-buffer "~5.1.1"
- string_decoder "~1.0.3"
- util-deprecate "~1.0.1"
-
-readable-stream@1.1.x, "readable-stream@1.x >=1.1.9":
- version "1.1.14"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.1"
- isarray "0.0.1"
- string_decoder "~0.10.x"
-
-readable-stream@~2.0.0, readable-stream@~2.0.5:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.1"
- isarray "~1.0.0"
- process-nextick-args "~1.0.6"
- string_decoder "~0.10.x"
- util-deprecate "~1.0.1"
-
-readdirp@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78"
- dependencies:
- graceful-fs "^4.1.2"
- minimatch "^3.0.2"
- readable-stream "^2.0.2"
- set-immediate-shim "^1.0.1"
-
-realpath-native@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.0.tgz#7885721a83b43bd5327609f0ddecb2482305fdf0"
- dependencies:
- util.promisify "^1.0.0"
-
-redis-commands@^1.2.0:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2"
-
-redis-parser@^2.6.0:
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b"
-
-redis@^2.7.1:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02"
- dependencies:
- double-ended-queue "^2.1.0-0"
- redis-commands "^1.2.0"
- redis-parser "^2.6.0"
-
-regenerator-runtime@^0.11.0:
- version "0.11.1"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
-
-regex-cache@^0.4.2:
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd"
- dependencies:
- is-equal-shallow "^0.1.3"
-
-regex-not@^1.0.0, regex-not@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
- dependencies:
- extend-shallow "^3.0.2"
- safe-regex "^1.1.0"
-
-remove-trailing-separator@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
-
-repeat-element@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a"
-
-repeat-string@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae"
-
-repeat-string@^1.5.2, repeat-string@^1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
-
-repeating@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
- dependencies:
- is-finite "^1.0.0"
-
-replace-in-file@^3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-3.1.1.tgz#84052a6948771e8833a0738a0eb905feb0c9c7f4"
- dependencies:
- chalk "^2.3.0"
- glob "^7.1.2"
- yargs "^11.0.0"
-
-request-promise-core@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6"
- dependencies:
- lodash "^4.13.1"
-
-request-promise-native@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5"
- dependencies:
- request-promise-core "1.1.1"
- stealthy-require "^1.1.0"
- tough-cookie ">=2.3.3"
-
-request@2.75.x:
- version "2.75.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93"
- dependencies:
- aws-sign2 "~0.6.0"
- aws4 "^1.2.1"
- bl "~1.1.2"
- caseless "~0.11.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.0.0"
- har-validator "~2.0.6"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- node-uuid "~1.4.7"
- oauth-sign "~0.8.1"
- qs "~6.2.0"
- stringstream "~0.0.4"
- tough-cookie "~2.3.0"
- tunnel-agent "~0.4.1"
-
-request@2.81.0:
- version "2.81.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
- dependencies:
- aws-sign2 "~0.6.0"
- aws4 "^1.2.1"
- caseless "~0.12.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.1.1"
- har-validator "~4.2.1"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- oauth-sign "~0.8.1"
- performance-now "^0.2.0"
- qs "~6.4.0"
- safe-buffer "^5.0.1"
- stringstream "~0.0.4"
- tough-cookie "~2.3.0"
- tunnel-agent "^0.6.0"
- uuid "^3.0.0"
-
-request@^2.0.0, request@^2.74.0, request@^2.83.0:
- version "2.83.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
- dependencies:
- aws-sign2 "~0.7.0"
- aws4 "^1.6.0"
- caseless "~0.12.0"
- combined-stream "~1.0.5"
- extend "~3.0.1"
- forever-agent "~0.6.1"
- form-data "~2.3.1"
- har-validator "~5.0.3"
- hawk "~6.0.2"
- http-signature "~1.2.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.17"
- oauth-sign "~0.8.2"
- performance-now "^2.1.0"
- qs "~6.5.1"
- safe-buffer "^5.1.1"
- stringstream "~0.0.5"
- tough-cookie "~2.3.3"
- tunnel-agent "^0.6.0"
- uuid "^3.1.0"
-
-requestretry@^1.2.2:
- version "1.13.0"
- resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94"
- dependencies:
- extend "^3.0.0"
- lodash "^4.15.0"
- request "^2.74.0"
- when "^3.7.7"
-
-require-directory@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
-
-require-main-filename@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
-
-require-uncached@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
- dependencies:
- caller-path "^0.1.0"
- resolve-from "^1.0.0"
-
-requires-port@1.x.x:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
-
-resolve-cwd@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
- dependencies:
- resolve-from "^3.0.0"
-
-resolve-from@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
-
-resolve-from@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
-
-resolve-url@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
-
-resolve@1.1.7:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
-
-resolve@^1.1.3, resolve@^1.1.4:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
- dependencies:
- path-parse "^1.0.5"
-
-responselike@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
- dependencies:
- lowercase-keys "^1.0.0"
-
-restore-cursor@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
- dependencies:
- onetime "^2.0.0"
- signal-exit "^3.0.2"
-
-ret@~0.1.10:
- version "0.1.15"
- resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
-
-right-align@^0.1.1:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
- dependencies:
- align-text "^0.1.1"
-
-rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1, rimraf@^2.6.2:
- version "2.6.2"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
- dependencies:
- glob "^7.0.5"
-
-rimraf@~2.2.6:
- version "2.2.8"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582"
-
-ripemd160@^2.0.0, ripemd160@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7"
- dependencies:
- hash-base "^2.0.0"
- inherits "^2.0.1"
-
-rmdir@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/rmdir/-/rmdir-1.2.0.tgz#4fe0357cb06168c258e73e968093dc4e8a0f3253"
- dependencies:
- node.flow "1.2.3"
-
-rollup-plugin-buble@^0.19.1:
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.19.2.tgz#c0590c7d3d475b5ed59f129764ec93710cc6e8dd"
- dependencies:
- buble "^0.19.2"
- rollup-pluginutils "^2.0.1"
-
-rollup-pluginutils@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0"
- dependencies:
- estree-walker "^0.3.0"
- micromatch "^2.3.11"
-
-rollup@^0.56.2:
- version "0.56.3"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.56.3.tgz#7900695531afa1badd3235f285cc4aa0d49ce254"
-
-run-async@^2.2.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
- dependencies:
- is-promise "^2.1.0"
-
-run-queue@^1.0.0, run-queue@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47"
- dependencies:
- aproba "^1.1.1"
-
-rx-lite-aggregates@^4.0.8:
- version "4.0.8"
- resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be"
- dependencies:
- rx-lite "*"
-
-rx-lite@*, rx-lite@^4.0.8:
- version "4.0.8"
- resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444"
-
-safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
-
-safe-regex@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
- dependencies:
- ret "~0.1.10"
-
-sane@^2.0.0:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/sane/-/sane-2.4.1.tgz#29f991208cf28636720efdc584293e7fd66663a5"
- dependencies:
- anymatch "^1.3.0"
- exec-sh "^0.2.0"
- fb-watchman "^2.0.0"
- minimatch "^3.0.2"
- minimist "^1.1.1"
- walker "~1.0.5"
- watch "~0.18.0"
- optionalDependencies:
- fsevents "^1.1.1"
-
-sax@^1.2.4:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
-
-schema-utils@^0.4.2:
- version "0.4.5"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e"
- dependencies:
- ajv "^6.1.0"
- ajv-keywords "^3.1.0"
-
-"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
-
-semver@~5.0.1:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a"
-
-serialize-javascript@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005"
-
-set-blocking@^2.0.0, set-blocking@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
-
-set-getter@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376"
- dependencies:
- to-object-path "^0.3.0"
-
-set-immediate-shim@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
-
-set-value@^0.4.3:
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1"
- dependencies:
- extend-shallow "^2.0.1"
- is-extendable "^0.1.1"
- is-plain-object "^2.0.1"
- to-object-path "^0.3.0"
-
-set-value@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
- dependencies:
- extend-shallow "^2.0.1"
- is-extendable "^0.1.1"
- is-plain-object "^2.0.3"
- split-string "^3.0.1"
-
-setimmediate@^1.0.4:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
-
-setprototypeof@1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
-
-sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4:
- version "2.4.10"
- resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-shasum@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f"
- dependencies:
- json-stable-stringify "~0.0.0"
- sha.js "~2.4.4"
-
-shebang-command@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
- dependencies:
- shebang-regex "^1.0.0"
-
-shebang-regex@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
-
-shell-quote@^1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767"
- dependencies:
- array-filter "~0.0.0"
- array-map "~0.0.0"
- array-reduce "~0.0.0"
- jsonify "~0.0.0"
-
-shellwords@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
-
-signal-exit@^3.0.0, signal-exit@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
-
-slack-node@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30"
- dependencies:
- requestretry "^1.2.2"
-
-slash@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
-
-slice-ansi@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
- dependencies:
- is-fullwidth-code-point "^2.0.0"
-
-smart-buffer@^1.0.13, smart-buffer@^1.0.4:
- version "1.1.15"
- resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16"
-
-smtp-connection@2.12.0:
- version "2.12.0"
- resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1"
- dependencies:
- httpntlm "1.6.1"
- nodemailer-shared "1.1.0"
-
-snapdragon-node@^2.0.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
- dependencies:
- define-property "^1.0.0"
- isobject "^3.0.0"
- snapdragon-util "^3.0.1"
-
-snapdragon-util@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
- dependencies:
- kind-of "^3.2.0"
-
-snapdragon@^0.8.1:
- version "0.8.1"
- resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370"
- dependencies:
- base "^0.11.1"
- debug "^2.2.0"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- map-cache "^0.2.2"
- source-map "^0.5.6"
- source-map-resolve "^0.5.0"
- use "^2.0.0"
-
-sntp@1.x.x:
- version "1.0.9"
- resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
- dependencies:
- hoek "2.x.x"
-
-sntp@2.x.x:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8"
- dependencies:
- hoek "4.x.x"
-
-socket.io-adapter@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b"
-
-socket.io-client@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e"
- dependencies:
- backo2 "1.0.2"
- base64-arraybuffer "0.1.5"
- component-bind "1.0.0"
- component-emitter "1.2.1"
- debug "~2.6.4"
- engine.io-client "~3.1.0"
- has-cors "1.1.0"
- indexof "0.0.1"
- object-component "0.0.3"
- parseqs "0.0.5"
- parseuri "0.0.5"
- socket.io-parser "~3.1.1"
- to-array "0.1.4"
-
-socket.io-parser@~3.1.1:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e"
- dependencies:
- component-emitter "1.2.1"
- debug "~3.1.0"
- has-binary2 "~1.0.2"
- isarray "2.0.1"
-
-socket.io@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014"
- dependencies:
- debug "~2.6.6"
- engine.io "~3.1.0"
- socket.io-adapter "~1.1.0"
- socket.io-client "2.0.4"
- socket.io-parser "~3.1.1"
-
-socks-proxy-agent@2:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-2.1.1.tgz#86ebb07193258637870e13b7bd99f26c663df3d3"
- dependencies:
- agent-base "2"
- extend "3"
- socks "~1.1.5"
-
-socks@1.1.9:
- version "1.1.9"
- resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691"
- dependencies:
- ip "^1.1.2"
- smart-buffer "^1.0.4"
-
-socks@~1.1.5:
- version "1.1.10"
- resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a"
- dependencies:
- ip "^1.1.4"
- smart-buffer "^1.0.13"
-
-sort-keys@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128"
- dependencies:
- is-plain-obj "^1.0.0"
-
-source-list-map@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
-
-source-map-resolve@^0.5.0:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a"
- dependencies:
- atob "^2.0.0"
- decode-uri-component "^0.2.0"
- resolve-url "^0.2.1"
- source-map-url "^0.4.0"
- urix "^0.1.0"
-
-source-map-support@^0.4.15:
- version "0.4.18"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
- dependencies:
- source-map "^0.5.6"
-
-source-map-support@^0.5.0:
- version "0.5.3"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76"
- dependencies:
- source-map "^0.6.0"
-
-source-map-url@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
-
-source-map@^0.4.4:
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
- dependencies:
- amdefine ">=0.0.4"
-
-source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.3:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
-
-source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
-
-spdx-correct@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82"
- dependencies:
- spdx-expression-parse "^3.0.0"
- spdx-license-ids "^3.0.0"
-
-spdx-exceptions@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9"
-
-spdx-expression-parse@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
- dependencies:
- spdx-exceptions "^2.1.0"
- spdx-license-ids "^3.0.0"
-
-spdx-license-ids@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87"
-
-split-string@^3.0.1, split-string@^3.0.2:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
- dependencies:
- extend-shallow "^3.0.0"
-
-sprintf-js@~1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
-
-sshpk@^1.7.0:
- version "1.13.1"
- resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
- dependencies:
- asn1 "~0.2.3"
- assert-plus "^1.0.0"
- dashdash "^1.12.0"
- getpass "^0.1.1"
- optionalDependencies:
- bcrypt-pbkdf "^1.0.0"
- ecc-jsbn "~0.1.1"
- jsbn "~0.1.0"
- tweetnacl "~0.14.0"
-
-ssri@^5.2.4:
- version "5.2.4"
- resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.2.4.tgz#9985e14041e65fc397af96542be35724ac11da52"
- dependencies:
- safe-buffer "^5.1.1"
-
-stack-utils@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620"
-
-static-extend@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
- dependencies:
- define-property "^0.2.5"
- object-copy "^0.1.0"
-
-"statuses@>= 1.3.1 < 2":
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
-
-statuses@~1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
-
-stealthy-require@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
-
-stream-browserify@^2.0.0, stream-browserify@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"
- dependencies:
- inherits "~2.0.1"
- readable-stream "^2.0.2"
-
-stream-combiner2@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe"
- dependencies:
- duplexer2 "~0.1.0"
- readable-stream "^2.0.2"
-
-stream-each@^1.1.0:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.2.tgz#8e8c463f91da8991778765873fe4d960d8f616bd"
- dependencies:
- end-of-stream "^1.1.0"
- stream-shift "^1.0.0"
-
-stream-http@^2.0.0, stream-http@^2.7.2:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10"
- dependencies:
- builtin-status-codes "^3.0.0"
- inherits "^2.0.1"
- readable-stream "^2.3.3"
- to-arraybuffer "^1.0.0"
- xtend "^4.0.0"
-
-stream-shift@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"
-
-stream-splicer@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83"
- dependencies:
- inherits "^2.0.1"
- readable-stream "^2.0.2"
-
-streamroller@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b"
- dependencies:
- date-format "^1.2.0"
- debug "^3.1.0"
- mkdirp "^0.5.1"
- readable-stream "^2.3.0"
-
-strict-uri-encode@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
-
-string-length@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
- dependencies:
- astral-regex "^1.0.0"
- strip-ansi "^4.0.0"
-
-string-width@^1.0.1, string-width@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
- dependencies:
- code-point-at "^1.0.0"
- is-fullwidth-code-point "^1.0.0"
- strip-ansi "^3.0.0"
-
-string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
- dependencies:
- is-fullwidth-code-point "^2.0.0"
- strip-ansi "^4.0.0"
-
-string_decoder@^1.0.0, string_decoder@~1.0.0, string_decoder@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
- dependencies:
- safe-buffer "~5.1.0"
-
-string_decoder@~0.10.x:
- version "0.10.31"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
-
-stringstream@~0.0.4, stringstream@~0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
-
-strip-ansi@^3.0.0, strip-ansi@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
- dependencies:
- ansi-regex "^2.0.0"
-
-strip-ansi@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
- dependencies:
- ansi-regex "^3.0.0"
-
-strip-bom@3.0.0, strip-bom@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
-
-strip-bom@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
- dependencies:
- is-utf8 "^0.2.0"
-
-strip-eof@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
-
-strip-json-comments@~2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
-
-subarg@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
- dependencies:
- minimist "^1.1.0"
-
-supports-color@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
-
-supports-color@^3.1.2:
- version "3.2.3"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
- dependencies:
- has-flag "^1.0.0"
-
-supports-color@^4.2.1:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b"
- dependencies:
- has-flag "^2.0.0"
-
-supports-color@^5.3.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0"
- dependencies:
- has-flag "^3.0.0"
-
-symbol-tree@^3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
-
-syntax-error@^1.1.1:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c"
- dependencies:
- acorn-node "^1.2.0"
-
-table@4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
- dependencies:
- ajv "^5.2.3"
- ajv-keywords "^2.1.0"
- chalk "^2.1.0"
- lodash "^4.17.4"
- slice-ansi "1.0.0"
- string-width "^2.1.1"
-
-tapable@^0.2.7:
- version "0.2.8"
- resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22"
-
-tapable@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2"
-
-tar-pack@^3.4.0:
- version "3.4.1"
- resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f"
- dependencies:
- debug "^2.2.0"
- fstream "^1.0.10"
- fstream-ignore "^1.0.5"
- once "^1.3.3"
- readable-stream "^2.1.4"
- rimraf "^2.5.1"
- tar "^2.2.1"
- uid-number "^0.0.6"
-
-tar@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"
- dependencies:
- block-stream "*"
- fstream "^1.0.2"
- inherits "2"
-
-temp@^0.8.3:
- version "0.8.3"
- resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59"
- dependencies:
- os-tmpdir "^1.0.0"
- rimraf "~2.2.6"
-
-test-exclude@^4.1.1:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.0.tgz#07e3613609a362c74516a717515e13322ab45b3c"
- dependencies:
- arrify "^1.0.1"
- micromatch "^2.3.11"
- object-assign "^4.1.0"
- read-pkg-up "^1.0.1"
- require-main-filename "^1.0.1"
-
-text-table@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
-
-throat@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
-
-through2@^2.0.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
- dependencies:
- readable-stream "^2.1.5"
- xtend "~4.0.1"
-
-"through@>=2.2.7 <3", through@^2.3.6:
- version "2.3.8"
- resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
-
-thunkify@~2.1.1:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d"
-
-time-stamp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357"
-
-timed-out@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"
-
-timers-browserify@^1.0.1:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d"
- dependencies:
- process "~0.11.0"
-
-timers-browserify@^2.0.4:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae"
- dependencies:
- setimmediate "^1.0.4"
-
-timespan@2.3.x:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929"
-
-tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33:
- version "0.0.33"
- resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
- dependencies:
- os-tmpdir "~1.0.2"
-
-tmpl@1.0.x:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
-
-to-array@0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
-
-to-arraybuffer@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
-
-to-fast-properties@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
-
-to-object-path@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
- dependencies:
- kind-of "^3.0.2"
-
-to-regex-range@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
- dependencies:
- is-number "^3.0.0"
- repeat-string "^1.6.1"
-
-to-regex@^3.0.1:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
- dependencies:
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- regex-not "^1.0.2"
- safe-regex "^1.1.0"
-
-tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3:
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
- dependencies:
- punycode "^1.4.1"
-
-tr46@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
- dependencies:
- punycode "^2.1.0"
-
-trim-right@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
-
-tsscmp@~1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97"
-
-tty-browserify@0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
-
-tty-browserify@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811"
-
-tunnel-agent@^0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
- dependencies:
- safe-buffer "^5.0.1"
-
-tunnel-agent@~0.4.1:
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
-
-tweetnacl@^0.14.3, tweetnacl@~0.14.0:
- version "0.14.5"
- resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
-
-type-check@~0.3.2:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
- dependencies:
- prelude-ls "~1.1.2"
-
-type-is@~1.6.15:
- version "1.6.16"
- resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194"
- dependencies:
- media-typer "0.3.0"
- mime-types "~2.1.18"
-
-typedarray@^0.0.6, typedarray@~0.0.5:
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
-
-uglify-es@^3.3.4:
- version "3.3.9"
- resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
- dependencies:
- commander "~2.13.0"
- source-map "~0.6.1"
-
-uglify-js@^2.6, uglify-js@^2.8.29:
- version "2.8.29"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
- dependencies:
- source-map "~0.5.1"
- yargs "~3.10.0"
- optionalDependencies:
- uglify-to-browserify "~1.0.0"
-
-uglify-js@^3.3.10:
- version "3.3.12"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.12.tgz#efd87c16a1f4c674a8a5ede571001ef634dcc883"
- dependencies:
- commander "~2.14.1"
- source-map "~0.6.1"
-
-uglify-to-browserify@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
-
-uglifyjs-webpack-plugin@^0.4.6:
- version "0.4.6"
- resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
- dependencies:
- source-map "^0.5.6"
- uglify-js "^2.8.29"
- webpack-sources "^1.0.1"
-
-uglifyjs-webpack-plugin@^1.1.1:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.2.tgz#e7516d4367afdb715c3847841eb46f94c45ca2b9"
- dependencies:
- cacache "^10.0.1"
- find-cache-dir "^1.0.0"
- schema-utils "^0.4.2"
- serialize-javascript "^1.4.0"
- source-map "^0.6.1"
- uglify-es "^3.3.4"
- webpack-sources "^1.1.0"
- worker-farm "^1.5.2"
-
-uid-number@^0.0.6:
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
-
-ultron@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c"
-
-umd@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e"
-
-underscore@~1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209"
-
-union-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
- dependencies:
- arr-union "^3.1.0"
- get-value "^2.0.6"
- is-extendable "^0.1.1"
- set-value "^0.4.3"
-
-unique-filename@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.0.tgz#d05f2fe4032560871f30e93cbe735eea201514f3"
- dependencies:
- unique-slug "^2.0.0"
-
-unique-slug@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.0.tgz#db6676e7c7cc0629878ff196097c78855ae9f4ab"
- dependencies:
- imurmurhash "^0.1.4"
-
-unpipe@1.0.0, unpipe@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
-
-unset-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
- dependencies:
- has-value "^0.3.1"
- isobject "^3.0.0"
-
-upath@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d"
-
-urix@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
-
-url-parse-lax@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
- dependencies:
- prepend-http "^2.0.0"
-
-url-to-options@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9"
-
-url@^0.11.0, url@~0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
- dependencies:
- punycode "1.3.2"
- querystring "0.2.0"
-
-use@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8"
- dependencies:
- define-property "^0.2.5"
- isobject "^3.0.0"
- lazy-cache "^2.0.2"
-
-useragent@^2.1.12:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972"
- dependencies:
- lru-cache "4.1.x"
- tmp "0.0.x"
-
-util-deprecate@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
-
-util.promisify@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
- dependencies:
- define-properties "^1.1.2"
- object.getownpropertydescriptors "^2.0.3"
-
-util@0.10.3, util@^0.10.3, util@~0.10.1:
- version "0.10.3"
- resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
- dependencies:
- inherits "2.0.1"
-
-utils-merge@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
-
-uuid@^3.0.0, uuid@^3.1.0:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14"
-
-uws@~9.14.0:
- version "9.14.0"
- resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95"
-
-validate-npm-package-license@^3.0.1:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338"
- dependencies:
- spdx-correct "^3.0.0"
- spdx-expression-parse "^3.0.0"
-
-verror@1.10.0:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
- dependencies:
- assert-plus "^1.0.0"
- core-util-is "1.0.2"
- extsprintf "^1.2.0"
-
-vlq@^0.2.1:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"
-
-vlq@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.0.tgz#8101be90843422954c2b13eb27f2f3122bdcc806"
-
-vm-browserify@0.0.4, vm-browserify@~0.0.1:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"
- dependencies:
- indexof "0.0.1"
-
-void-elements@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
-
-vue@^2.5.13:
- version "2.5.13"
- resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.13.tgz#95bd31e20efcf7a7f39239c9aa6787ce8cf578e1"
-
-w3c-hr-time@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
- dependencies:
- browser-process-hrtime "^0.1.2"
-
-walker@~1.0.5:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"
- dependencies:
- makeerror "1.0.x"
-
-watch@~0.18.0:
- version "0.18.0"
- resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986"
- dependencies:
- exec-sh "^0.2.0"
- minimist "^1.2.0"
-
-watchpack@^1.4.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed"
- dependencies:
- chokidar "^2.0.2"
- graceful-fs "^4.1.2"
- neo-async "^2.5.0"
-
-webidl-conversions@^4.0.1, webidl-conversions@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
-
-webpack-dev-middleware@^1.12.0:
- version "1.12.2"
- resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz#f8fc1120ce3b4fc5680ceecb43d777966b21105e"
- dependencies:
- memory-fs "~0.4.1"
- mime "^1.5.0"
- path-is-absolute "^1.0.0"
- range-parser "^1.0.3"
- time-stamp "^2.0.0"
-
-webpack-sources@^1.0.1, webpack-sources@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54"
- dependencies:
- source-list-map "^2.0.0"
- source-map "~0.6.1"
-
-webpack@*:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.0.1.tgz#768d708beeca4c5f77f6c2d38a240fb6ff50ba5d"
- dependencies:
- acorn "^5.0.0"
- acorn-dynamic-import "^3.0.0"
- ajv "^6.1.0"
- ajv-keywords "^3.1.0"
- chrome-trace-event "^0.1.1"
- enhanced-resolve "^4.0.0"
- eslint-scope "^3.7.1"
- loader-runner "^2.3.0"
- loader-utils "^1.1.0"
- memory-fs "~0.4.1"
- micromatch "^3.1.8"
- mkdirp "~0.5.0"
- neo-async "^2.5.0"
- node-libs-browser "^2.0.0"
- schema-utils "^0.4.2"
- tapable "^1.0.0"
- uglifyjs-webpack-plugin "^1.1.1"
- watchpack "^1.4.0"
- webpack-sources "^1.0.1"
-
-webpack@^3.11.0:
- version "3.11.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894"
- dependencies:
- acorn "^5.0.0"
- acorn-dynamic-import "^2.0.0"
- ajv "^6.1.0"
- ajv-keywords "^3.1.0"
- async "^2.1.2"
- enhanced-resolve "^3.4.0"
- escope "^3.6.0"
- interpret "^1.0.0"
- json-loader "^0.5.4"
- json5 "^0.5.1"
- loader-runner "^2.3.0"
- loader-utils "^1.1.0"
- memory-fs "~0.4.1"
- mkdirp "~0.5.0"
- node-libs-browser "^2.0.0"
- source-map "^0.5.3"
- supports-color "^4.2.1"
- tapable "^0.2.7"
- uglifyjs-webpack-plugin "^0.4.6"
- watchpack "^1.4.0"
- webpack-sources "^1.0.1"
- yargs "^8.0.2"
-
-whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3"
- dependencies:
- iconv-lite "0.4.19"
-
-whatwg-url@^6.4.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08"
- dependencies:
- lodash.sortby "^4.7.0"
- tr46 "^1.0.0"
- webidl-conversions "^4.0.1"
-
-when@^3.7.7:
- version "3.7.8"
- resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
-
-which-module@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
-
-which@^1.2.1, which@^1.2.12, which@^1.2.9, which@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
- dependencies:
- isexe "^2.0.0"
-
-wide-align@^1.1.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710"
- dependencies:
- string-width "^1.0.2"
-
-window-size@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
-
-wordwrap@0.0.2:
- version "0.0.2"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
-
-wordwrap@~0.0.2:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
-
-wordwrap@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
-
-worker-farm@^1.5.2:
- version "1.5.4"
- resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.4.tgz#4debbe46b40edefcc717ebde74a90b1ae1e909a1"
- dependencies:
- errno "~0.1.7"
- xtend "~4.0.1"
-
-wrap-ansi@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
- dependencies:
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
-
-wrappy@1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
-
-write-file-atomic@^2.1.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab"
- dependencies:
- graceful-fs "^4.1.11"
- imurmurhash "^0.1.4"
- signal-exit "^3.0.2"
-
-write@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
- dependencies:
- mkdirp "^0.5.1"
-
-ws@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289"
- dependencies:
- async-limiter "~1.0.0"
- safe-buffer "~5.1.0"
-
-ws@~3.3.1:
- version "3.3.3"
- resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2"
- dependencies:
- async-limiter "~1.0.0"
- safe-buffer "~5.1.0"
- ultron "~1.1.0"
-
-xml-name-validator@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
-
-xmlhttprequest-ssl@~1.5.4:
- version "1.5.5"
- resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e"
-
-xregexp@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943"
-
-xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
-
-y18n@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
-
-y18n@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
-
-yallist@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
-
-yargs-parser@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
- dependencies:
- camelcase "^4.1.0"
-
-yargs-parser@^8.1.0:
- version "8.1.0"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950"
- dependencies:
- camelcase "^4.1.0"
-
-yargs-parser@^9.0.2:
- version "9.0.2"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077"
- dependencies:
- camelcase "^4.1.0"
-
-yargs@^10.0.3:
- version "10.1.2"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5"
- dependencies:
- cliui "^4.0.0"
- decamelize "^1.1.1"
- find-up "^2.1.0"
- get-caller-file "^1.0.1"
- os-locale "^2.0.0"
- require-directory "^2.1.1"
- require-main-filename "^1.0.1"
- set-blocking "^2.0.0"
- string-width "^2.0.0"
- which-module "^2.0.0"
- y18n "^3.2.1"
- yargs-parser "^8.1.0"
-
-yargs@^11.0.0:
- version "11.0.0"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b"
- dependencies:
- cliui "^4.0.0"
- decamelize "^1.1.1"
- find-up "^2.1.0"
- get-caller-file "^1.0.1"
- os-locale "^2.0.0"
- require-directory "^2.1.1"
- require-main-filename "^1.0.1"
- set-blocking "^2.0.0"
- string-width "^2.0.0"
- which-module "^2.0.0"
- y18n "^3.2.1"
- yargs-parser "^9.0.2"
-
-yargs@^8.0.2:
- version "8.0.2"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360"
- dependencies:
- camelcase "^4.1.0"
- cliui "^3.2.0"
- decamelize "^1.1.1"
- get-caller-file "^1.0.1"
- os-locale "^2.0.0"
- read-pkg-up "^2.0.0"
- require-directory "^2.1.1"
- require-main-filename "^1.0.1"
- set-blocking "^2.0.0"
- string-width "^2.0.0"
- which-module "^2.0.0"
- y18n "^3.2.1"
- yargs-parser "^7.0.0"
-
-yargs@~3.10.0:
- version "3.10.0"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
- dependencies:
- camelcase "^1.0.2"
- cliui "^2.1.0"
- decamelize "^1.0.0"
- window-size "0.1.0"
-
-yeast@0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
+++ /dev/null
-{
- "presets": ["es2015", "flow-vue"],
- "plugins": ["transform-vue-jsx", "syntax-dynamic-import"],
- "ignore": [
- "dist/*.js",
- "packages/**/*.js"
- ]
-}
+++ /dev/null
-version: 2
-
-defaults: &defaults
- working_directory: ~/project/vue
- docker:
- - image: circleci/node:6-browsers
-
-jobs:
- install:
- <<: *defaults
- steps:
- - checkout
- - restore_cache:
- keys:
- - v1-vue-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - v1-vue-{{ .Branch }}-
- - v1-vue-
- - run: npm install
- - save_cache:
- key: v1-vue-{{ .Branch }}-{{ checksum "yarn.lock" }}
- paths:
- - node_modules/
- - persist_to_workspace:
- root: ~/project
- paths:
- - vue
-
- lint-flow-types:
- <<: *defaults
- steps:
- - attach_workspace:
- at: ~/project
- - run: npm run lint
- - run: npm run flow
- - run: npm run test:types
-
- test-cover:
- <<: *defaults
- steps:
- - attach_workspace:
- at: ~/project
- - run: npm run test:cover
- - run:
- name: report coverage stats for non-PRs
- command: |
- if [[ -z $CI_PULL_REQUEST ]]; then
- ./node_modules/.bin/codecov
- fi
-
- test-e2e:
- <<: *defaults
- steps:
- - attach_workspace:
- at: ~/project
- - run: npm run test:e2e -- --env phantomjs
-
- test-ssr-weex:
- <<: *defaults
- steps:
- - attach_workspace:
- at: ~/project
- - run: npm run test:ssr
- - run: npm run test:weex
-
-workflows:
- version: 2
- install-and-parallel-test:
- jobs:
- - install
- - test-cover:
- requires:
- - install
- - lint-flow-types:
- requires:
- - install
- - test-e2e:
- requires:
- - install
- - test-ssr-weex:
- requires:
- - install
+++ /dev/null
-# http://editorconfig.org
-
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.md]
-insert_final_newline = false
-trim_trailing_whitespace = false
+++ /dev/null
-flow
-dist
-packages
+++ /dev/null
-{
- "root": true,
- "plugins": [
- "flowtype"
- ],
- "extends": [
- "plugin:vue-libs/recommended",
- "plugin:flowtype/recommended"
- ],
- "globals": {
- "__WEEX__": true,
- "WXEnvironment": true
- }
-}
+++ /dev/null
-[ignore]
-.*/node_modules/.*
-.*/test/.*
-.*/scripts/.*
-.*/examples/.*
-.*/benchmarks/.*
-
-[include]
-
-[libs]
-flow
-
-[options]
-unsafe.enable_getters_and_setters=true
-module.name_mapper='^compiler/\(.*\)$' -> '<PROJECT_ROOT>/src/compiler/\1'
-module.name_mapper='^core/\(.*\)$' -> '<PROJECT_ROOT>/src/core/\1'
-module.name_mapper='^shared/\(.*\)$' -> '<PROJECT_ROOT>/src/shared/\1'
-module.name_mapper='^web/\(.*\)$' -> '<PROJECT_ROOT>/src/platforms/web/\1'
-module.name_mapper='^weex/\(.*\)$' -> '<PROJECT_ROOT>/src/platforms/weex/\1'
-module.name_mapper='^server/\(.*\)$' -> '<PROJECT_ROOT>/src/server/\1'
-module.name_mapper='^entries/\(.*\)$' -> '<PROJECT_ROOT>/src/entries/\1'
-module.name_mapper='^sfc/\(.*\)$' -> '<PROJECT_ROOT>/src/sfc/\1'
-suppress_comment= \\(.\\|\n\\)*\\$flow-disable-line
+++ /dev/null
-# Contributor Code of Conduct
-
-As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
-
-We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
-
-Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
-
-This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
+++ /dev/null
-## Git Commit Message Convention
-
-> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
-
-#### TL;DR:
-
-Messages must be matched by the following regex:
-
-``` js
-/^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}/
-```
-
-#### Examples
-
-Appears under "Features" header, `compiler` subheader:
-
-```
-feat(compiler): add 'comments' option
-```
-
-Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28:
-
-```
-fix(v-model): handle events on blur
-
-close #28
-```
-
-Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
-
-```
-perf(core): improve vdom diffing by removing 'foo' option
-
-BREAKING CHANGE: The 'foo' option has been removed.
-```
-
-The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
-
-```
-revert: feat(compiler): add 'comments' option
-
-This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
-```
-
-### Full Message Format
-
-A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
-
-```
-<type>(<scope>): <subject>
-<BLANK LINE>
-<body>
-<BLANK LINE>
-<footer>
-```
-
-The **header** is mandatory and the **scope** of the header is optional.
-
-### Revert
-
-If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
-
-### Type
-
-If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
-
-Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
-
-### Scope
-
-The scope could be anything specifying place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc...
-
-### Subject
-
-The subject contains succinct description of the change:
-
-* use the imperative, present tense: "change" not "changed" nor "changes"
-* don't capitalize first letter
-* no dot (.) at the end
-
-### Body
-
-Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
-The body should include the motivation for the change and contrast this with previous behavior.
-
-### Footer
-
-The footer should contain any information about **Breaking Changes** and is also the place to
-reference GitHub issues that this commit **Closes**.
-
-**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
+++ /dev/null
-# Vue.js Contributing Guide
-
-Hi! I’m really excited that you are interested in contributing to Vue.js. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
-
-- [Code of Conduct](https://github.com/vuejs/vue/blob/dev/.github/CODE_OF_CONDUCT.md)
-- [Issue Reporting Guidelines](#issue-reporting-guidelines)
-- [Pull Request Guidelines](#pull-request-guidelines)
-- [Development Setup](#development-setup)
-- [Project Structure](#project-structure)
-
-## Issue Reporting Guidelines
-
-- Always use [https://new-issue.vuejs.org/](https://new-issue.vuejs.org/) to create new issues.
-
-## Pull Request Guidelines
-
-- The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.**
-
-- Checkout a topic branch from the relevant branch, e.g. `dev`, and merge back against that branch.
-
-- Work in the `src` folder and **DO NOT** checkin `dist` in the commits.
-
-- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
-
-- Make sure `npm test` passes. (see [development setup](#development-setup))
-
-- If adding new feature:
- - Add accompanying test case.
- - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
-
-- If fixing a bug:
- - If you are resolving a special issue, add `(fix #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
- - Provide detailed description of the bug in the PR. Live demo preferred.
- - Add appropriate test coverage if applicable.
-
-## Development Setup
-
-You will need [Node.js](http://nodejs.org) **version 6+** and [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (needed for running Selenium server during e2e tests).
-
-After cloning the repo, run:
-
-``` bash
-$ npm install # or yarn
-```
-
-### Committing Changes
-
-Commit messages should follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages will be automatically validated upon commit. If you are not familiar with the commit message convention, you can use `npm run commit` instead of `git commit`, which provides an interactive CLI for generating proper commit messages.
-
-### Commonly used NPM scripts
-
-``` bash
-# watch and auto re-build dist/vue.js
-$ npm run dev
-
-# watch and auto re-run unit tests in Chrome
-$ npm run dev:test
-
-# build all dist files, including npm packages
-$ npm run build
-
-# run the full test suite, include linting / type checking
-$ npm test
-```
-
-There are some other scripts available in the `scripts` section of the `package.json` file.
-
-The default test script will do the following: lint with ESLint -> type check with Flow -> unit tests with coverage -> e2e tests. **Please make sure to have this pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally beforehand.
-
-## Project Structure
-
-- **`scripts`**: contains build-related scripts and configuration files. In most cases you don't need to touch them. However, it would be helpful to familiarize yourself with the following files:
-
- - `scripts/alias.js`: module import aliases used across all source code and tests.
-
- - `scripts/config.js`: contains the build configurations for all files found in `dist/`. Check this file if you want to find out the entry source file for a dist file.
-
-- **`dist`**: contains built files for distribution. Note this directory is only updated when a release happens; they do not reflect the latest changes in development branches.
-
- See [dist/README.md](https://github.com/vuejs/vue/blob/dev/dist/README.md) for more details on dist files.
-
-- **`flow`**: contains type declarations for [Flow](https://flowtype.org/). These declarations are loaded **globally** and you will see them used in type annotations in normal source code.
-
-- **`packages`**: contains `vue-server-renderer` and `vue-template-compiler`, which are distributed as separate NPM packages. They are automatically generated from the source code and always have the same version with the main `vue` package.
-
-- **`test`**: contains all tests. The unit tests are written with [Jasmine](http://jasmine.github.io/2.3/introduction.html) and run with [Karma](http://karma-runner.github.io/0.13/index.html). The e2e tests are written for and run with [Nightwatch.js](http://nightwatchjs.org/).
-
-- **`src`**: contains the source code, obviously. The codebase is written in ES2015 with [Flow](https://flowtype.org/) type annotations.
-
- - **`compiler`**: contains code for the template-to-render-function compiler.
-
- The compiler consists of a parser (converts template strings to element ASTs), an optimizer (detects static trees for vdom render optimization), and a code generator (generate render function code from element ASTs). Note the codegen directly generates code strings from the element AST - it's done this way for smaller code size because the compiler is shipped to the browser in the standalone build.
-
- - **`core`**: contains universal, platform-agnostic runtime code.
-
- The Vue 2.0 core is platform-agnostic - which means code inside `core` should be able to run in any JavaScript environment, be it the browser, Node.js, or an embedded JavaScript runtime in native applications.
-
- - **`observer`**: contains code related to the reactivity system.
-
- - **`vdom`**: contains code related to vdom element creation and patching.
-
- - **`instance`**: contains Vue instance constructor and prototype methods.
-
- - **`global-api`**: as the name suggests.
-
- - **`components`**: universal abstract components. Currently `keep-alive` is the only one.
-
- - **`server`**: contains code related to server-side rendering.
-
- - **`platforms`**: contains platform-specific code.
-
- Entry files for dist builds are located in their respective platform directory.
-
- Each platform module contains three parts: `compiler`, `runtime` and `server`, corresponding to the three directories above. Each part contains platform-specific modules/utilities which are then imported and injected to the core counterparts in platform-specific entry files. For example, the code implementing the logic behind `v-bind:class` is in `platforms/web/runtime/modules/class.js` - which is imported in `entries/web-runtime.js` and used to create the browser-specific vdom patching function.
-
- - **`sfc`**: contains single-file component (`*.vue` files) parsing logic. This is used in the `vue-template-compiler` package.
-
- - **`shared`**: contains utilities shared across the entire codebase.
-
- - **`types`**: contains TypeScript type definitions
-
- - **`test`**: type definitions tests
-
-
-## Financial Contribution
-
-As a pure community-driven project without major corporate backing, we also welcome financial contributions via Patreon or OpenCollective.
-
-- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou)
-- [Become a backer or sponsor on OpenCollective](https://opencollective.com/vuejs)
-
-### What's the difference between Patreon and OpenCollective?
-
-Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform.
-
-## Credits
-
-Thank you to all the people who have already contributed to Vue.js!
-
-<a href="https://github.com/vuejs/vue/graphs/contributors"><img src="https://opencollective.com/vuejs/contributors.svg?width=890" /></a>
+++ /dev/null
-<!--
-IMPORTANT: Please use the following link to create a new issue:
-
- https://new-issue.vuejs.org/
-
-If your issue was not created using the app above, it will be closed immediately.
-
-中文用户请注意:
-请使用上面的链接来创建新的 issue。如果不是用上述工具创建的 issue 会被自动关闭。
--->
-
-<!--
-Love vuejs? Please consider supporting us via Patreon or OpenCollective:
-👉 https://www.patreon.com/evanyou
-👉 https://opencollective.com/vuejs/donate
--->
+++ /dev/null
-<!--
-Please make sure to read the Pull Request Guidelines:
-https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
--->
-
-<!-- PULL REQUEST TEMPLATE -->
-<!-- (Update "[ ]" to "[x]" to check a box) -->
-
-**What kind of change does this PR introduce?** (check at least one)
-
-- [ ] Bugfix
-- [ ] Feature
-- [ ] Code style update
-- [ ] Refactor
-- [ ] Build-related changes
-- [ ] Other, please describe:
-
-**Does this PR introduce a breaking change?** (check one)
-
-- [ ] Yes
-- [ ] No
-
-If yes, please describe the impact and migration path for existing applications:
-
-**The PR fulfills these requirements:**
-
-- [ ] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
-- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
-- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
-- [ ] New/updated tests are included
-
-If adding a **new feature**, the PR's description includes:
-- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)
-
-**Other information:**
+++ /dev/null
-.DS_Store
-node_modules
-*.log
-explorations
-TODOs.md
-dist/*.gz
-dist/*.map
-dist/vue.common.min.js
-test/e2e/reports
-test/e2e/screenshots
-coverage
-RELEASE_NOTE*.md
-dist/*.js
-packages/vue-server-renderer/basic.js
-packages/vue-server-renderer/build.js
-packages/vue-server-renderer/server-plugin.js
-packages/vue-server-renderer/client-plugin.js
-packages/vue-template-compiler/build.js
-.vscode
+++ /dev/null
-<h1 align="center">Sponsors & Backers</h1>
-
-Vue.js is an MIT-licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome [backers](https://github.com/vuejs/vue/blob/dev/BACKERS.md). If you'd like to join them, please consider:
-
-- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou).
-- [Become a backer or sponsor on OpenCollective](https://opencollective.com/vuejs).
-- [One-time donation via PayPal or crypto-currencies.](https://vuejs.org/support-vuejs/#One-time-Donations)
-
-#### What's the difference between Patreon and OpenCollective?
-
-Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform.
-
-<br><br>
-
-<h2 align="center">Special Sponsors</h2>
-
-<!--special start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="https://stdlib.com" target="_blank">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/stdlib.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.bitsrc.io/?utm_source=vue&utm_medium=vue&utm_campaign=vue&utm_term=vue&utm_content=vue" target="_blank">
- <img height="90px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/bit-wide.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://xiaozhuanlan.com" target="_blank">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/cn.vuejs.org/master/themes/vue/source/images/xiaozhuanlan.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--special end-->
-
-<h2 align="center">Platinum via Patreon</h2>
-
-<!--platinum start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="http://tooltwist.com/" target="_blank">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/tooltwist.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1" target="_blank">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vueschool.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.datacamp.com/careers?utm_source=vuejs&utm_medium=sidebar" target="_blank">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/datacamp.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--platinum end-->
-
-<h2 align="center">Platinum via OpenCollective</h2>
-
-<a href="https://opencollective.com/vuejs/tiers/platinum-sponsors/0/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/platinum-sponsors/0/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/platinum-sponsors/1/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/platinum-sponsors/1/avatar.svg"></a>
-
-<h2 align="center">Gold via Patreon</h2>
-
-<!--gold start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="https://laravel.com" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/laravel.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://htmlburger.com" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/htmlburger.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://chaitin.cn/en/" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/chaitin.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://anymod.com" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/anymod.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.frontenddeveloperlove.com/" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/frontend-love.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://onsen.io/vue/" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/onsen-ui.png">
- </a>
- </td>
- </tr><tr></tr>
- <tr>
- <td align="center" valign="middle">
- <a href="https://vuetifyjs.com" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vuetify.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://neds.com.au/" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/neds.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://hackr.io/tutorials/learn-vue-js" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/hackr-io.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://icons8.com/" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/icons8.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://vuejobs.com/?ref=vuejs" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vuejobs.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://leanpub.com/vuejs2" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/tmvuejs2.png">
- </a>
- </td>
- </tr><tr></tr>
- <tr>
- <td align="center" valign="middle">
- <a href="https://www.bmqb.com/jobs" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/bmqb.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://codepilot.ai" target="_blank">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/codepilot.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--gold end-->
-
-<h2 align="center">Gold via OpenCollective</h2>
-
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/0/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/0/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/1/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/1/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/2/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/2/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/3/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/3/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/4/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/4/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/5/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/5/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/6/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/6/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/7/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/7/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/8/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/8/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/9/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/9/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/10/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/10/avatar.svg" height="60px"></a>
-
-<h2 align="center">Silver via Patreon</h2>
-
-- Matt Mullenweg
-
-<h2 align="center">Bronze via Patreon</h2>
-
-<!--bronze start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="http://tighten.co/" target="_blank">
- <img width="148px" src="http://i.imgur.com/T7fQYLT.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://alligator.io" target="_blank">
- <img width="148px" src="https://alligator.io/images/alligator-logo.svg">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.accelebrate.com/" target="_blank">
- <img width="148px" src="https://www.accelebrate.com/assets/images/accelebrate_logo@2x.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://pullstring.com" target="_blank">
- <img width="148px" src="https://i.imgur.com/hQHW6TB.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--bronze end-->
-
-<h2 align="center">Bronze via OpenCollective</h2>
-
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/0/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/0/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/1/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/1/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/2/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/2/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/3/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/3/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/4/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/4/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/5/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/5/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/6/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/6/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/7/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/7/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/8/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/8/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/9/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/9/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/10/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/10/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/11/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/11/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/12/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/12/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/13/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/13/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/14/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/14/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/15/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/15/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/16/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/16/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/17/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/17/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/18/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/18/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/19/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/19/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/20/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/20/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/21/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/21/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/22/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/22/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/23/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/23/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/24/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/24/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/25/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/25/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/26/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/26/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/27/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/27/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/28/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/28/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/bronze-sponsors/29/website" target="_blank"><img src="https://opencollective.com/vuejs/tiers/bronze-sponsors/29/avatar.svg"></a>
-
-<h2 align="center">Generous Backers via Patreon ($50+)</h2>
-
-<!--50 start-->
-- Wasim Khamlichi
-- errorrik
-- Alex Balashov
-- Konstantin Levinski
-- Samuel Smith
-- HARRI J SALOMAA
-- tjkoury
-- Evan Leonardi
-<!--50 end-->
-
-<h2 align="center">Backers via Patreon</h2>
-
-<!--10 start-->
-- Luca Borghini
-- kazuya kawaguchi
-- Keisuke KITA
-- Jack Barham
-- Santa Cruz
-- Tom Conlon
-- Simon East
-- Henry Zhu
-- Benjamin Listwon
-- Lars Andreas Ness
-- Victor Tolbert
-- Frank Dugan III
-- Stephen Hartley
-- Wen-Tien Chang
-- Kirk Lewis
-- Karol F
-- Miljan Aleksic
-- 叶解
-- Paul Straw
-- Jake Ingman
-- Barbara Liau
-- Isaac Sant
-- Milos Stojanovic
-- 4
-- The Graphic Design School
-- Christian Griffith
-- Jarek Tkaczyk
-- Andrew Davis
-- Sean MacIsaac
-- Xiaojie LI
-- David Hess
-- Niannian Modisette
-- Dariusz Jastrzębski
-- Matt Jones
-- Dave Chenell
-- Cheng-Wei Chien
-- Duncan J Kenzie
-- Mike Margerum
-- Guy Gavergun
-- Edithvale
-- Intevation GmbH
-- Luiz Eduardo Tanure Bacelar
-- Chengzhi Yin
-- Zoran Knezevic
-- James Simpson
-- Pierre Vanhulst
-- Vincent Gabriel
-- Chris Anderson
-- Jon Hobbs-Smith
-- Akiho Nagao
-- Asaf Yishai
-- Estebe Anthony
-- Haim Yulzari
-- David McGuigan
-- Jeremy Tan
-- Jim Raden
-- Fille Åström
-- Nicholas Reid
-- Tyler Scott
-- Thong Yong Jun
-- Bryan Gruneberg
-- Roman Kuba
-- Familiar Studio
-- Matias Verdier
-- Jamie McElwain
-- Vivekanandhan Natarajan
-- Rafael Belvederese
-- Mickaël Andrieu
-- Guilherme S L de Souza
-- Rob Yedlin
-- Daniel Waghorn
-- Chih-Hsuan, Fan
-- Jordan Oroshiba
-- Brian Jorden
-- Cliff Hess
-- Joe Ray Gregory
-- Johnny Eshan
-- Orney Enrique martinez Said
-- Tom Striker
-- Oskar Lindgren
-- RADD Creative
-- Maegan Wilson
-- Rua Cura D'ars
-- Richard Simpson
-- Charles McKeever
-- Alok Pant
-- Jessie Hernandez
-- Eric Fong
-- Aparajita Fishman
-<!--10 end-->
-
-<h2 align="center">Backers via OpenCollective</h2>
-
-<a href="https://opencollective.com/vuejs#backers" target="_blank"><img src="https://opencollective.com/vuejs/backers.svg?width=890"></a>
+++ /dev/null
-The MIT License (MIT)
-
-Copyright (c) 2013-present, Yuxi (Evan) You
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+++ /dev/null
-<p align="center"><a href="https://vuejs.org" target="_blank" rel="noopener noreferrer"><img width="100" src="https://vuejs.org/images/logo.png" alt="Vue logo"></a></p>
-
-<p align="center">
- <a href="https://circleci.com/gh/vuejs/vue/tree/dev"><img src="https://img.shields.io/circleci/project/vuejs/vue/dev.svg" alt="Build Status"></a>
- <a href="https://codecov.io/github/vuejs/vue?branch=dev"><img src="https://img.shields.io/codecov/c/github/vuejs/vue/dev.svg" alt="Coverage Status"></a>
- <a href="https://npmcharts.com/compare/vue?minimal=true"><img src="https://img.shields.io/npm/dm/vue.svg" alt="Downloads"></a>
- <a href="https://www.npmjs.com/package/vue"><img src="https://img.shields.io/npm/v/vue.svg" alt="Version"></a>
- <a href="https://www.npmjs.com/package/vue"><img src="https://img.shields.io/npm/l/vue.svg" alt="License"></a>
- <a href="https://chat.vuejs.org/"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a>
- <br>
- <a href="https://saucelabs.com/u/vuejs"><img src="https://saucelabs.com/browser-matrix/vuejs.svg" alt="Sauce Test Status"></a>
-</p>
-
-<h2 align="center">Supporting Vue.js</h2>
-
-Vue.js is an MIT-licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome [backers](https://github.com/vuejs/vue/blob/dev/BACKERS.md). If you'd like to join them, please consider:
-
-- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou).
-- [Become a backer or sponsor on Open Collective](https://opencollective.com/vuejs).
-- [One-time donation via PayPal or crypto-currencies.](https://vuejs.org/support-vuejs/#One-time-Donations)
-
-#### What's the difference between Patreon and OpenCollective?
-
-Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform.
-
-<h3 align="center">Special Sponsors</h3>
-<!--special start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="https://stdlib.com" target="_blank" rel="noopener noreferrer">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/stdlib.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.bitsrc.io/?utm_source=vue&utm_medium=vue&utm_campaign=vue&utm_term=vue&utm_content=vue" target="_blank" rel="noopener noreferrer">
- <img height="90px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/bit-wide.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://xiaozhuanlan.com" target="_blank" rel="noopener noreferrer">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/cn.vuejs.org/master/themes/vue/source/images/xiaozhuanlan.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--special end-->
-
-<h3 align="center">Sponsors via Patreon</h3>
-
-<h4 align="center">Platinum</h4>
-
-<!--platinum start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="http://tooltwist.com/" target="_blank" rel="noopener noreferrer">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/tooltwist.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1" target="_blank" rel="noopener noreferrer">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vueschool.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.datacamp.com/careers?utm_source=vuejs&utm_medium=sidebar" target="_blank" rel="noopener noreferrer">
- <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/datacamp.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--platinum end-->
-
-<h4 align="center">Gold</h4>
-
-<!--gold start-->
-<table>
- <tbody>
- <tr>
- <td align="center" valign="middle">
- <a href="https://laravel.com" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/laravel.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://htmlburger.com" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/htmlburger.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://chaitin.cn/en/" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/chaitin.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://anymod.com" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/anymod.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://www.frontenddeveloperlove.com/" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/frontend-love.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://onsen.io/vue/" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/onsen-ui.png">
- </a>
- </td>
- </tr><tr></tr>
- <tr>
- <td align="center" valign="middle">
- <a href="https://vuetifyjs.com" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vuetify.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://neds.com.au/" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/neds.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://hackr.io/tutorials/learn-vue-js" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/hackr-io.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://icons8.com/" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/icons8.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://vuejobs.com/?ref=vuejs" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/vuejobs.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://leanpub.com/vuejs2" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/tmvuejs2.png">
- </a>
- </td>
- </tr><tr></tr>
- <tr>
- <td align="center" valign="middle">
- <a href="https://www.bmqb.com/jobs" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/bmqb.png">
- </a>
- </td>
- <td align="center" valign="middle">
- <a href="https://codepilot.ai" target="_blank" rel="noopener noreferrer">
- <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/codepilot.png">
- </a>
- </td>
- </tr><tr></tr>
- </tbody>
-</table>
-<!--gold end-->
-
-<h3 align="center">Sponsors via <a href="https://opencollective.com/vuejs">Open Collective</a></h3>
-
-<h4 align="center">Platinum</h4>
-
-<a href="https://opencollective.com/vuejs/tiers/platinum-sponsors/0/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/platinum-sponsors/0/avatar.svg"></a>
-<a href="https://opencollective.com/vuejs/tiers/platinum-sponsors/1/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/platinum-sponsors/1/avatar.svg"></a>
-
-<h4 align="center">Gold</h4>
-
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/0/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/0/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/1/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/1/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/2/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/2/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/3/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/3/avatar.svg" height="60px"></a>
-<a href="https://opencollective.com/vuejs/tiers/gold-sponsors/4/website" target="_blank" rel="noopener noreferrer"><img src="https://opencollective.com/vuejs/tiers/gold-sponsors/4/avatar.svg" height="60px"></a>
-
----
-
-## Introduction
-
-Vue (pronounced `/vjuː/`, like view) is a **progressive framework** for building user interfaces. It is designed from the ground up to be incrementally adoptable, and can easily scale between a library and a framework depending on different use cases. It consists of an approachable core library that focuses on the view layer only, and an ecosystem of supporting libraries that helps you tackle complexity in large Single-Page Applications.
-
-#### Browser Compatibility
-
-Vue.js supports all browsers that are [ES5-compliant](http://kangax.github.io/compat-table/es5/) (IE8 and below are not supported).
-
-## Ecosystem
-
-| Project | Status | Description |
-|---------|--------|-------------|
-| [vue-router] | [![vue-router-status]][vue-router-package] | Single-page application routing |
-| [vuex] | [![vuex-status]][vuex-package] | Large-scale state management |
-| [vue-cli] | [![vue-cli-status]][vue-cli-package] | Project scaffolding |
-| [vue-loader] | [![vue-loader-status]][vue-loader-package] | Single File Component (`*.vue` file) loader for webpack |
-| [vue-server-renderer] | [![vue-server-renderer-status]][vue-server-renderer-package] | Server-side rendering support |
-| [vue-class-component] | [![vue-class-component-status]][vue-class-component-package] | TypeScript decorator for a class-based API |
-| [vue-rx] | [![vue-rx-status]][vue-rx-package] | RxJS integration |
-| [vue-devtools] | [![vue-devtools-status]][vue-devtools-package] | Browser DevTools extension |
-
-[vue-router]: https://github.com/vuejs/vue-router
-[vuex]: https://github.com/vuejs/vuex
-[vue-cli]: https://github.com/vuejs/vue-cli
-[vue-loader]: https://github.com/vuejs/vue-loader
-[vue-server-renderer]: https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer
-[vue-class-component]: https://github.com/vuejs/vue-class-component
-[vue-rx]: https://github.com/vuejs/vue-rx
-[vue-devtools]: https://github.com/vuejs/vue-devtools
-
-[vue-router-status]: https://img.shields.io/npm/v/vue-router.svg
-[vuex-status]: https://img.shields.io/npm/v/vuex.svg
-[vue-cli-status]: https://img.shields.io/npm/v/vue-cli.svg
-[vue-loader-status]: https://img.shields.io/npm/v/vue-loader.svg
-[vue-server-renderer-status]: https://img.shields.io/npm/v/vue-server-renderer.svg
-[vue-class-component-status]: https://img.shields.io/npm/v/vue-class-component.svg
-[vue-rx-status]: https://img.shields.io/npm/v/vue-rx.svg
-[vue-devtools-status]: https://img.shields.io/chrome-web-store/v/nhdogjmejiglipccpnnnanhbledajbpd.svg
-
-[vue-router-package]: https://npmjs.com/package/vue-router
-[vuex-package]: https://npmjs.com/package/vuex
-[vue-cli-package]: https://npmjs.com/package/vue-cli
-[vue-loader-package]: https://npmjs.com/package/vue-loader
-[vue-server-renderer-package]: https://npmjs.com/package/vue-server-renderer
-[vue-class-component-package]: https://npmjs.com/package/vue-class-component
-[vue-rx-package]: https://npmjs.com/package/vue-rx
-[vue-devtools-package]: https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd
-
-## Documentation
-
-To check out [live examples](https://vuejs.org/v2/examples/) and docs, visit [vuejs.org](https://vuejs.org).
-
-## Questions
-
-For questions and support please use the [the official forum](http://forum.vuejs.org) or [community chat](https://chat.vuejs.org/). The issue list of this repo is **exclusively** for bug reports and feature requests.
-
-## Issues
-
-Please make sure to read the [Issue Reporting Checklist](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
-
-## Changelog
-
-Detailed changes for each release are documented in the [release notes](https://github.com/vuejs/vue/releases).
-
-## Stay In Touch
-
-- [Twitter](https://twitter.com/vuejs)
-- [Blog](https://medium.com/the-vue-point)
-- [Job Board](https://vuejobs.com/?ref=vuejs)
-
-## Contribution
-
-Please make sure to read the [Contributing Guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md) before making a pull request. If you have a Vue-related project/component/tool, add it with a pull request to [this curated list](https://github.com/vuejs/awesome-vue)!
-
-Thank you to all the people who already contributed to Vue!
-
-<a href="https://github.com/vuejs/vue/graphs/contributors"><img src="https://opencollective.com/vuejs/contributors.svg?width=890" /></a>
-
-
-## License
-
-[MIT](http://opensource.org/licenses/MIT)
-
-Copyright (c) 2013-present, Yuxi (Evan) You
+++ /dev/null
-form {
- margin-bottom: 15px;
-}
-
-td.hidden {
- color: #ccc;
-}
-
-table.filtered td.item {
- background-color: #FFFFBF;
-}
-
-table.filtered td.item.hidden {
- background-color: transparent;
-}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title></title>
- <script src="../../dist/vue.min.js"></script>
- <link rel="stylesheet" href="style.css">
- <link rel="stylesheet" href="demo.css">
- </head>
- <body>
- <div id="el">
- <h1>Rendering Dynamic Big Table</h1>
- <p>Reference: <a href="http://insin.github.io/ui-lib-samples/large-datasets/index.html">insin/ui-lib-samples/large-datasets</a></p>
-
- <p>
- <span>{{ rows }} x {{ cols }}, {{ optimized ? 'with' : 'without' }} optimization. {{ msg }}</span>
- </p>
-
- <p>
- <button v-if="optimized" @click="loadBase">Disable optimization</button>
- <button v-else @click="loadOptimized">Enable optimization (Object.freeze)</button>
- <button @click="unmount">Unmount</button>
- <button @click="rerender">Rerender with fresh data</button>
- </p>
-
- <form>
- <strong>Filter Data</strong>:
- <input type="text" v-model="filter">
-
- <!--
- If the user is filtering the data, we want to offer some insight into
- the breadth of the filtering.
- -->
- <span v-if="filter">
- —
- Filtering <strong>{{ filter }}</strong>
- over {{ dataPoints }} data points,
- {{ visibleCount() }} found.
- </span>
-
- </form>
-
- <table width="100%" cellspacing="2" :class="{ filtered: filter }">
- <tr v-for="row in grid">
- <th>{{ row.id }}</th>
- <td v-for="item in row.items"
- class="item"
- :class="{ hidden: !matches(item) }">
- {{ item.value }}
- </td>
- </tr>
- </table>
- </div>
-
- <script>
- var ROWS = 1000
- var COLS = 10
- var OPTIMIZED = window.location.hash === '#optimized'
-
- window.onhashchange = function () {
- window.location.reload()
- }
-
- function generateGrid( rowCount, columnCount ) {
- var valuePoints = [
- "Daenerys", "Jon", "Sansa", "Arya", "Stannis", "Gregor", "Tyrion",
- "Theon", "Joffrey", "Ramsay", "Cersei", "Bran", "Margaery",
- "Melisandre", "Daario", "Jamie", "Eddard", "Myrcella", "Robb",
- "Jorah", "Petyr", "Tommen", "Sandor", "Oberyn", "Drogo", "Ygritte"
- ]
- var valueIndex = 0
- var grid = []
-
- for ( var r = 0; r < rowCount; r++ ) {
- var row = {
- id: r,
- items: []
- }
- for ( var c = 0; c < columnCount; c++ ) {
- row.items.push({
- id: ( r + "-" + c ),
- value: valuePoints[ valueIndex ]
- })
- if ( ++valueIndex >= valuePoints.length ) {
- valueIndex = 0
- }
- }
- grid.push(row)
- }
-
- return OPTIMIZED ? Object.freeze(grid) : grid
- }
-
- var grid = generateGrid(ROWS, COLS)
- var s = window.performance.now()
- console.profile('a')
- var vm = new Vue({
-
- el: '#el',
-
- data: {
- cols: COLS,
- rows: ROWS,
- optimized: OPTIMIZED,
- msg: 'loading...',
- grid: grid,
- dataPoints: grid.length * grid[0].items.length,
- filter: ''
- },
-
- methods: {
- matches: function (item) {
- return item.value.toLowerCase().indexOf(this.filter.toLowerCase()) > -1
- },
- visibleCount: function () {
- var count = 0
- var grid = this.grid
- for (var i = 0, l = grid.length; i < l; i++) {
- var row = grid[i].items
- for (var j = 0, k = row.length; j < k; j++) {
- var item = row[j]
- var matched = !this.filter || this.matches(item)
- if (matched) {
- count++
- }
- }
- }
- return count
- },
- loadBase: function () {
- window.location.hash = ''
- },
- loadOptimized: function () {
- window.location.hash = '#optimized'
- },
- unmount: function () {
- console.profile('unmount')
- var s = window.performance.now()
- this.grid = []
- setTimeout(function () {
- vm.msg = 'umount took: ' + (window.performance.now() - s).toFixed(2) + 'ms'
- console.profileEnd('unmount')
- }, 0)
- },
- rerender: function () {
- var grid = generateGrid(1000, 10)
- var s = window.performance.now()
- console.profile('rerender')
- this.grid = grid
- setTimeout(function () {
- vm.msg = 'rerender took: ' + (window.performance.now() - s).toFixed(2) + 'ms'
- console.profileEnd('rerender')
- }, 0)
- }
- }
- })
- console.profileEnd('a')
- setTimeout(function () {
- vm.msg = 'initial render took: ' + (window.performance.now() - s).toFixed(2) + 'ms'
- }, 0)
- </script>
- </body>
-</html>
+++ /dev/null
-@font-face {
- font-family: octicons-anchor;
- src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
-}
-
-body {
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
- text-size-adjust: 100%;
- color: #333;
- font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
- font-size: 16px;
- line-height: 1.6;
- word-wrap: break-word;
- padding: 1em;
-}
-
-a {
- background-color: transparent;
-}
-
-a:active,
-a:hover {
- outline: 0;
-}
-
-strong {
- font-weight: bold;
-}
-
-h1 {
- font-size: 2em;
- margin: 0.67em 0;
-}
-
-img {
- border: 0;
-}
-
-hr {
- box-sizing: content-box;
- height: 0;
-}
-
-pre {
- overflow: auto;
-}
-
-code,
-kbd,
-pre {
- font-family: monospace, monospace;
- font-size: 1em;
-}
-
-input {
- color: inherit;
- font: inherit;
- margin: 0;
-}
-
-html input[disabled] {
- cursor: default;
-}
-
-input {
- line-height: normal;
-}
-
-input[type="checkbox"] {
- box-sizing: border-box;
- padding: 0;
-}
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-td,
-th {
- padding: 0;
-}
-
-* {
- box-sizing: border-box;
-}
-
-input {
- font: 13px/1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
-}
-
-a {
- color: #4078c0;
- text-decoration: none;
-}
-
-a:hover,
-a:active {
- text-decoration: underline;
-}
-
-hr {
- height: 0;
- margin: 15px 0;
- overflow: hidden;
- background: transparent;
- border: 0;
- border-bottom: 1px solid #ddd;
-}
-
-hr:before {
- display: table;
- content: "";
-}
-
-hr:after {
- display: table;
- clear: both;
- content: "";
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin-top: 15px;
- margin-bottom: 15px;
- line-height: 1.1;
-}
-
-h1 {
- font-size: 30px;
-}
-h1:first-child {
- margin-top: 0;
-}
-
-h2 {
- font-size: 21px;
-}
-
-h3 {
- font-size: 16px;
-}
-
-h4 {
- font-size: 14px;
-}
-
-h5 {
- font-size: 12px;
-}
-
-h6 {
- font-size: 11px;
-}
-
-blockquote {
- margin: 0;
-}
-
-ul,
-ol {
- padding: 0;
- margin-top: 0;
- margin-bottom: 0;
-}
-
-ol ol,
-ul ol {
- list-style-type: lower-roman;
-}
-
-ul ul ol,
-ul ol ol,
-ol ul ol,
-ol ol ol {
- list-style-type: lower-alpha;
-}
-
-dd {
- margin-left: 0;
-}
-
-code {
- font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
- font-size: 12px;
-}
-
-pre {
- margin-top: 0;
- margin-bottom: 0;
- font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
-}
-
-.octicon {
- font: normal normal normal 16px/1 octicons-anchor;
- display: inline-block;
- text-decoration: none;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.octicon-link:before {
- content: '\f05c';
-}
-
-.markdown-body>*:first-child {
- margin-top: 0 !important;
-}
-
-.markdown-body>*:last-child {
- margin-bottom: 0 !important;
-}
-
-a:not([href]) {
- cursor: pointer;
- text-decoration: none;
-}
-
-.anchor {
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- padding-right: 6px;
- padding-left: 30px;
- margin-left: -30px;
-}
-
-.anchor:focus {
- outline: none;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- position: relative;
- margin-top: 1em;
- margin-bottom: 16px;
- font-weight: bold;
- line-height: 1.4;
-}
-
-h1 .octicon-link,
-h2 .octicon-link,
-h3 .octicon-link,
-h4 .octicon-link,
-h5 .octicon-link,
-h6 .octicon-link {
- display: none;
- color: #000;
- vertical-align: middle;
-}
-
-h1:hover .anchor,
-h2:hover .anchor,
-h3:hover .anchor,
-h4:hover .anchor,
-h5:hover .anchor,
-h6:hover .anchor {
- padding-left: 8px;
- margin-left: -30px;
- text-decoration: none;
-}
-
-h1:hover .anchor .octicon-link,
-h2:hover .anchor .octicon-link,
-h3:hover .anchor .octicon-link,
-h4:hover .anchor .octicon-link,
-h5:hover .anchor .octicon-link,
-h6:hover .anchor .octicon-link {
- display: inline-block;
-}
-
-h1 {
- padding-bottom: 0.3em;
- font-size: 2.25em;
- line-height: 1.2;
- border-bottom: 1px solid #eee;
-}
-
-h1 .anchor {
- line-height: 1;
-}
-
-h2 {
- padding-bottom: 0.3em;
- font-size: 1.75em;
- line-height: 1.225;
- border-bottom: 1px solid #eee;
-}
-
-h2 .anchor {
- line-height: 1;
-}
-
-h3 {
- font-size: 1.5em;
- line-height: 1.43;
-}
-
-h3 .anchor {
- line-height: 1.2;
-}
-
-h4 {
- font-size: 1.25em;
-}
-
-h4 .anchor {
- line-height: 1.2;
-}
-
-h5 {
- font-size: 1em;
-}
-
-h5 .anchor {
- line-height: 1.1;
-}
-
-h6 {
- font-size: 1em;
- color: #777;
-}
-
-h6 .anchor {
- line-height: 1.1;
-}
-
-p,
-blockquote,
-ul,
-ol,
-dl,
-table,
-pre {
- margin-top: 0;
- margin-bottom: 16px;
-}
-
-hr {
- height: 4px;
- padding: 0;
- margin: 16px 0;
- background-color: #e7e7e7;
- border: 0 none;
-}
-
-ul,
-ol {
- padding-left: 2em;
-}
-
-ul ul,
-ul ol,
-ol ol,
-ol ul {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-li>p {
- margin-top: 16px;
-}
-
-dl {
- padding: 0;
-}
-
-dl dt {
- padding: 0;
- margin-top: 16px;
- font-size: 1em;
- font-style: italic;
- font-weight: bold;
-}
-
-dl dd {
- padding: 0 16px;
- margin-bottom: 16px;
-}
-
-blockquote {
- padding: 0 15px;
- color: #777;
- border-left: 4px solid #ddd;
-}
-
-blockquote>:first-child {
- margin-top: 0;
-}
-
-blockquote>:last-child {
- margin-bottom: 0;
-}
-
-table {
- display: block;
- width: 100%;
- overflow: auto;
- word-break: normal;
- word-break: keep-all;
-}
-
-table th {
- font-weight: bold;
-}
-
-table th,
-table td {
- padding: 6px 13px;
- border: 1px solid #ddd;
-}
-
-table tr {
- background-color: #fff;
- border-top: 1px solid #ccc;
-}
-
-table tr:nth-child(2n) {
- background-color: #f8f8f8;
-}
-
-img {
- max-width: 100%;
- box-sizing: border-box;
-}
-
-code {
- padding: 0;
- padding-top: 0.2em;
- padding-bottom: 0.2em;
- margin: 0;
- font-size: 85%;
- background-color: rgba(0,0,0,0.04);
- border-radius: 3px;
-}
-
-code:before,
-code:after {
- letter-spacing: -0.2em;
- content: "\00a0";
-}
-
-pre>code {
- padding: 0;
- margin: 0;
- font-size: 100%;
- word-break: normal;
- white-space: pre;
- background: transparent;
- border: 0;
-}
-
-.highlight {
- margin-bottom: 16px;
-}
-
-.highlight pre,
-pre {
- padding: 16px;
- overflow: auto;
- font-size: 85%;
- line-height: 1.45;
- background-color: #f7f7f7;
- border-radius: 3px;
-}
-
-.highlight pre {
- margin-bottom: 0;
- word-break: normal;
-}
-
-pre {
- word-wrap: normal;
-}
-
-pre code {
- display: inline;
- max-width: initial;
- padding: 0;
- margin: 0;
- overflow: initial;
- line-height: inherit;
- word-wrap: normal;
- background-color: transparent;
- border: 0;
-}
-
-pre code:before,
-pre code:after {
- content: normal;
-}
-
-kbd {
- display: inline-block;
- padding: 3px 5px;
- font-size: 11px;
- line-height: 10px;
- color: #555;
- vertical-align: middle;
- background-color: #fcfcfc;
- border: solid 1px #ccc;
- border-bottom-color: #bbb;
- border-radius: 3px;
- box-shadow: inset 0 -1px 0 #bbb;
-}
-
-kbd {
- display: inline-block;
- padding: 3px 5px;
- font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
- line-height: 10px;
- color: #555;
- vertical-align: middle;
- background-color: #fcfcfc;
- border: solid 1px #ccc;
- border-bottom-color: #bbb;
- border-radius: 3px;
- box-shadow: inset 0 -1px 0 #bbb;
-}
-
-.task-list-item {
- list-style-type: none;
-}
-
-.task-list-item+.task-list-item {
- margin-top: 3px;
-}
-
-.task-list-item input {
- margin: 0 0.35em 0.25em -1.6em;
- vertical-align: middle;
-}
-
-:checked+.radio-label {
- z-index: 1;
- position: relative;
- border-color: #4078c0;
-}
+++ /dev/null
-var ENV = ENV || (function() {
-
- var first = true;
- var counter = 0;
- var data;
- var _base;
- (_base = String.prototype).lpad || (_base.lpad = function(padding, toLength) {
- return padding.repeat((toLength - this.length) / padding.length).concat(this);
- });
-
- function formatElapsed(value) {
- var str = parseFloat(value).toFixed(2);
- if (value > 60) {
- minutes = Math.floor(value / 60);
- comps = (value % 60).toFixed(2).split('.');
- seconds = comps[0].lpad('0', 2);
- ms = comps[1];
- str = minutes + ":" + seconds + "." + ms;
- }
- return str;
- }
-
- function getElapsedClassName(elapsed) {
- var className = 'Query elapsed';
- if (elapsed >= 10.0) {
- className += ' warn_long';
- }
- else if (elapsed >= 1.0) {
- className += ' warn';
- }
- else {
- className += ' short';
- }
- return className;
- }
-
- function countClassName(queries) {
- var countClassName = "label";
- if (queries >= 20) {
- countClassName += " label-important";
- }
- else if (queries >= 10) {
- countClassName += " label-warning";
- }
- else {
- countClassName += " label-success";
- }
- return countClassName;
- }
-
- function updateQuery(object) {
- if (!object) {
- object = {};
- }
- var elapsed = Math.random() * 15;
- object.elapsed = elapsed;
- object.formatElapsed = formatElapsed(elapsed);
- object.elapsedClassName = getElapsedClassName(elapsed);
- object.query = "SELECT blah FROM something";
- object.waiting = Math.random() < 0.5;
- if (Math.random() < 0.2) {
- object.query = "<IDLE> in transaction";
- }
- if (Math.random() < 0.1) {
- object.query = "vacuum";
- }
- return object;
- }
-
- function cleanQuery(value) {
- if (value) {
- value.formatElapsed = "";
- value.elapsedClassName = "";
- value.query = "";
- value.elapsed = null;
- value.waiting = null;
- } else {
- return {
- query: "***",
- formatElapsed: "",
- elapsedClassName: ""
- };
- }
- }
-
- function generateRow(object, keepIdentity, counter) {
- var nbQueries = Math.floor((Math.random() * 10) + 1);
- if (!object) {
- object = {};
- }
- object.lastMutationId = counter;
- object.nbQueries = nbQueries;
- if (!object.lastSample) {
- object.lastSample = {};
- }
- if (!object.lastSample.topFiveQueries) {
- object.lastSample.topFiveQueries = [];
- }
- if (keepIdentity) {
- // for Angular optimization
- if (!object.lastSample.queries) {
- object.lastSample.queries = [];
- for (var l = 0; l < 12; l++) {
- object.lastSample.queries[l] = cleanQuery();
- }
- }
- for (var j in object.lastSample.queries) {
- var value = object.lastSample.queries[j];
- if (j <= nbQueries) {
- updateQuery(value);
- } else {
- cleanQuery(value);
- }
- }
- } else {
- object.lastSample.queries = [];
- for (var j = 0; j < 12; j++) {
- if (j < nbQueries) {
- var value = updateQuery(cleanQuery());
- object.lastSample.queries.push(value);
- } else {
- object.lastSample.queries.push(cleanQuery());
- }
- }
- }
- for (var i = 0; i < 5; i++) {
- var source = object.lastSample.queries[i];
- object.lastSample.topFiveQueries[i] = source;
- }
- object.lastSample.nbQueries = nbQueries;
- object.lastSample.countClassName = countClassName(nbQueries);
- return object;
- }
-
- function getData(keepIdentity) {
- var oldData = data;
- if (!keepIdentity) { // reset for each tick when !keepIdentity
- data = [];
- for (var i = 1; i <= ENV.rows; i++) {
- data.push({ dbname: 'cluster' + i, query: "", formatElapsed: "", elapsedClassName: "" });
- data.push({ dbname: 'cluster' + i + ' slave', query: "", formatElapsed: "", elapsedClassName: "" });
- }
- }
- if (!data) { // first init when keepIdentity
- data = [];
- for (var i = 1; i <= ENV.rows; i++) {
- data.push({ dbname: 'cluster' + i });
- data.push({ dbname: 'cluster' + i + ' slave' });
- }
- oldData = data;
- }
- for (var i in data) {
- var row = data[i];
- if (!keepIdentity && oldData && oldData[i]) {
- row.lastSample = oldData[i].lastSample;
- }
- if (!row.lastSample || Math.random() < ENV.mutations()) {
- counter = counter + 1;
- if (!keepIdentity) {
- row.lastSample = null;
- }
- generateRow(row, keepIdentity, counter);
- } else {
- data[i] = oldData[i];
- }
- }
- first = false;
- return {
- toArray: function() {
- return data;
- }
- };
- }
-
- var mutationsValue = 0.5;
-
- function mutations(value) {
- if (value) {
- mutationsValue = value;
- return mutationsValue;
- } else {
- return mutationsValue;
- }
- }
-
- var body = document.querySelector('body');
- var theFirstChild = body.firstChild;
-
- var sliderContainer = document.createElement( 'div' );
- sliderContainer.style.cssText = "display: flex";
- var slider = document.createElement('input');
- var text = document.createElement('label');
- text.innerHTML = 'mutations : ' + (mutationsValue * 100).toFixed(0) + '%';
- text.id = "ratioval";
- slider.setAttribute("type", "range");
- slider.style.cssText = 'margin-bottom: 10px; margin-top: 5px';
- slider.addEventListener('change', function(e) {
- ENV.mutations(e.target.value / 100);
- document.querySelector('#ratioval').innerHTML = 'mutations : ' + (ENV.mutations() * 100).toFixed(0) + '%';
- });
- sliderContainer.appendChild( text );
- sliderContainer.appendChild( slider );
- body.insertBefore( sliderContainer, theFirstChild );
-
- return {
- generateData: getData,
- rows: 50,
- timeout: 0,
- mutations: mutations
- };
-})();
+++ /dev/null
-var app = new Vue({
- el: '#app',
- data: {
- databases: []
- }
-})
-
-function loadSamples() {
- app.databases = Object.freeze(ENV.generateData().toArray());
- Monitoring.renderRate.ping();
- setTimeout(loadSamples, ENV.timeout);
-}
-
-loadSamples()
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta name="description" content="dbmon vue" />
-<link href="./lib/styles.css" rel="stylesheet" type="text/css" />
-<title>dbmon (Vue)</title>
-</head>
-<body>
- <h2>
- Reference: <a href="http://mathieuancelin.github.io/js-repaint-perfs/">js-repaint-perfs</a>
- </h2>
- <div id="app">
- <table class="table table-striped lastest-data">
- <tbody>
- <tr v-for="db in databases">
- <td class="dbname">{{db.dbname}}</td>
- <td class="query-count">
- <span :class="db.lastSample.countClassName">{{db.lastSample.nbQueries}}</span>
- </td>
- <td v-for="q in db.lastSample.topFiveQueries" :class="'Query ' + q.elapsedClassName">
- {{q.formatElapsed}}
- <div class="popover left">
- <div class="popover-content">{{q.query}}</div>
- <div class="arrow"></div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-
- <script src="./ENV.js"></script>
- <script src="./lib/memory-stats.js"></script>
- <script src="./lib/monitor.js"></script>
- <script src="../../dist/vue.min.js"></script>
- <script src="./app.js"></script>
-</body>
-</html>
+++ /dev/null
-/**
- * @author mrdoob / http://mrdoob.com/
- * @author jetienne / http://jetienne.com/
- * @author paulirish / http://paulirish.com/
- */
-var MemoryStats = function (){
-
- var msMin = 100;
- var msMax = 0;
-
- var container = document.createElement( 'div' );
- container.id = 'stats';
- container.style.cssText = 'width:80px;opacity:0.9;cursor:pointer';
-
- var msDiv = document.createElement( 'div' );
- msDiv.id = 'ms';
- msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#020;';
- container.appendChild( msDiv );
-
- var msText = document.createElement( 'div' );
- msText.id = 'msText';
- msText.style.cssText = 'color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px';
- msText.innerHTML= 'Memory';
- msDiv.appendChild( msText );
-
- var msGraph = document.createElement( 'div' );
- msGraph.id = 'msGraph';
- msGraph.style.cssText = 'position:relative;width:74px;height:30px;background-color:#0f0';
- msDiv.appendChild( msGraph );
-
- while ( msGraph.children.length < 74 ) {
-
- var bar = document.createElement( 'span' );
- bar.style.cssText = 'width:1px;height:30px;float:left;background-color:#131';
- msGraph.appendChild( bar );
-
- }
-
- var updateGraph = function ( dom, height, color ) {
-
- var child = dom.appendChild( dom.firstChild );
- child.style.height = height + 'px';
- if( color ) child.style.backgroundColor = color;
-
- }
-
- var perf = window.performance || {};
- // polyfill usedJSHeapSize
- if (!perf.memory){
- perf.memory = { usedJSHeapSize : 0 };
- }
-
- // support of the API?
- if( perf.memory.totalJSHeapSize === 0 ){
- console.warn('totalJSHeapSize === 0... performance.memory is only available in Chrome .')
- }
-
- // TODO, add a sanity check to see if values are bucketed.
- // If so, remind user to adopt the --enable-precise-memory-info flag.
- // open -a "/Applications/Google Chrome.app" --args --enable-precise-memory-info
-
- var lastTime = Date.now();
- var lastUsedHeap= perf.memory.usedJSHeapSize;
- return {
- domElement: container,
-
- update: function () {
-
- // refresh only 30time per second
- if( Date.now() - lastTime < 1000/30 ) return;
- lastTime = Date.now()
-
- var delta = perf.memory.usedJSHeapSize - lastUsedHeap;
- lastUsedHeap = perf.memory.usedJSHeapSize;
- var color = delta < 0 ? '#830' : '#131';
-
- var ms = perf.memory.usedJSHeapSize;
- msMin = Math.min( msMin, ms );
- msMax = Math.max( msMax, ms );
- msText.textContent = "Mem: " + bytesToSize(ms, 2);
-
- var normValue = ms / (30*1024*1024);
- var height = Math.min( 30, 30 - normValue * 30 );
- updateGraph( msGraph, height, color);
-
- function bytesToSize( bytes, nFractDigit ){
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
- if (bytes == 0) return 'n/a';
- nFractDigit = nFractDigit !== undefined ? nFractDigit : 0;
- var precision = Math.pow(10, nFractDigit);
- var i = Math.floor(Math.log(bytes) / Math.log(1024));
- return Math.round(bytes*precision / Math.pow(1024, i))/precision + ' ' + sizes[i];
- };
- }
-
- }
-
-};
+++ /dev/null
-var Monitoring = Monitoring || (function() {
-
- var stats = new MemoryStats();
- stats.domElement.style.position = 'fixed';
- stats.domElement.style.right = '0px';
- stats.domElement.style.bottom = '0px';
- document.body.appendChild( stats.domElement );
- requestAnimationFrame(function rAFloop(){
- stats.update();
- requestAnimationFrame(rAFloop);
- });
-
- var RenderRate = function () {
- var container = document.createElement( 'div' );
- container.id = 'stats';
- container.style.cssText = 'width:150px;opacity:0.9;cursor:pointer;position:fixed;right:80px;bottom:0px;';
-
- var msDiv = document.createElement( 'div' );
- msDiv.id = 'ms';
- msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#020;';
- container.appendChild( msDiv );
-
- var msText = document.createElement( 'div' );
- msText.id = 'msText';
- msText.style.cssText = 'color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px';
- msText.innerHTML= 'Repaint rate: 0/sec';
- msDiv.appendChild( msText );
-
- var bucketSize = 20;
- var bucket = [];
- var lastTime = Date.now();
- return {
- domElement: container,
- ping: function () {
- var start = lastTime;
- var stop = Date.now();
- var rate = 1000 / (stop - start);
- bucket.push(rate);
- if (bucket.length > bucketSize) {
- bucket.shift();
- }
- var sum = 0;
- for (var i = 0; i < bucket.length; i++) {
- sum = sum + bucket[i];
- }
- msText.textContent = "Repaint rate: " + (sum / bucket.length).toFixed(2) + "/sec";
- lastTime = stop;
- }
- }
- };
-
- var renderRate = new RenderRate();
- document.body.appendChild( renderRate.domElement );
-
- return {
- memoryStats: stats,
- renderRate: renderRate
- };
-
-})();
+++ /dev/null
-body {color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;margin:0;}
-label {display:inline-block;font-weight:700;margin-bottom:5px;}
-input[type=range] {display:block;width:100%;}
-table {border-collapse:collapse;border-spacing:0;}
-:before,:after {box-sizing: border-box;}
-
-.table > thead > tr > th,.table > tbody > tr > th,.table > tfoot > tr > th,.table > thead > tr > td,.table > tbody > tr > td,.table > tfoot > tr > td {border-top:1px solid #ddd;line-height:1.42857143;padding:8px;vertical-align:top;}
-.table {width:100%;}
-.table-striped > tbody > tr:nth-child(odd) > td,.table-striped > tbody > tr:nth-child(odd) > th {background:#f9f9f9;}
-
-.label {border-radius:.25em;color:#fff;display:inline;font-size:75%;font-weight:700;line-height:1;padding:.2em .6em .3em;text-align:center;vertical-align:baseline;white-space:nowrap;}
-.label-success {background-color:#5cb85c;}
-.label-warning {background-color:#f0ad4e;}
-
-.popover {background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;box-shadow:0 5px 10px rgba(0,0,0,.2);display:none;left:0;max-width:276px;padding:1px;position:absolute;text-align:left;top:0;white-space:normal;z-index:1010;}
-.popover>.arrow:after {border-width:10px;content:"";}
-.popover.left {margin-left:-10px;}
-.popover.left > .arrow {border-right-width:0;border-left-color:rgba(0,0,0,.25);margin-top:-11px;right:-11px;top:50%;}
-.popover.left > .arrow:after {border-left-color:#fff;border-right-width:0;bottom:-10px;content:" ";right:1px;}
-.popover > .arrow {border-width:11px;}
-.popover > .arrow,.popover>.arrow:after {border-color:transparent;border-style:solid;display:block;height:0;position:absolute;width:0;}
-
-.popover-content {padding:9px 14px;}
-
-.Query {position:relative;}
-.Query:hover .popover {display:block;left:-100%;width:100%;}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue benchmark</title>
- </head>
- <body>
- <script src="https://cdn.jsdelivr.net/lodash/4.10.0/lodash.min.js"></script>
- <script src="../../dist/vue.min.js"></script>
- <style>
- .danger {
- background-color: red;
- }
- </style>
-
- <script type="text/x-template" id="t">
- <div>
- <h1>{{ total }} Components</h1>
- <p>{{ action }} took {{time}}ms.</p>
- <button @click="shuffle">shuffle</button>
- <button @click="add">add</button>
- <table class="table table-hover table-striped test-data">
- <row v-for="item in items" :key="item.id"
- :class="{ danger: item.id === selected }"
- :item="item"
- @select="select(item)"
- @remove="remove(item)">
- </row>
- </table>
- </div>
- </script>
-
- <script type="text/x-template" id="row">
- <tr>
- <td class="col-md-1">{{item.id}}</td>
- <td class="col-md-4">
- <a @click="$emit('select')">{{item.label}}</a>
- </td>
- <td class="col-md-1">
- <button @click="$emit('remove')">remove</button>
- </td>
- </tr>
- </script>
-
- <div id="el">
- </div>
-
- <script>
- var total = 1000
- var items = []
- for (var i = 0; i < total; i++) {
- items.push({
- id: i,
- label: String(Math.random()).slice(0, 5)
- })
- }
-
- var s = window.performance.now()
- console.profile('render')
- var vm = new Vue({
- el: '#el',
- template: '#t',
- data: {
- total: total,
- time: 0,
- action: 'Render',
- items: items,
- selected: null
- },
- methods: {
- shuffle: monitor('shuffle', function () {
- this.items = _.shuffle(this.items)
- }),
- add: monitor('add', function () {
- this.items.push({
- id: total++,
- label: String(Math.random()).slice(0, 5)
- })
- }),
- select: monitor('select', function (item) {
- this.selected = item.id
- }),
- remove: monitor('remove', function (item) {
- this.items.splice(this.items.indexOf(item), 1)
- })
- },
- components: {
- row: {
- props: ['item'],
- template: '#row'
- }
- }
- })
- setTimeout(function () {
- vm.time = window.performance.now() - s
- console.profileEnd('render')
- }, 0)
-
- function monitor (action, fn) {
- return function () {
- var s = window.performance.now()
- fn.apply(this, arguments)
- Vue.nextTick(function () {
- vm.action = action
- vm.time = window.performance.now() - s
- })
- }
- }
- </script>
- </body>
-</html>
+++ /dev/null
-# Vue.js SSR benchmark
-
-This benchmark renders a table of 1000 rows with 10 columns (10k components), with around 30k normal elements on the page. Note this is not something likely to be seen in a typical app. This benchmark is mostly for stress/regression testing and comparing between `renderToString` and `renderToStream`.
-
-To view the results follow the run section. Note that the overall completion time for the results are variable, this is due to other system related variants at run time (available memory, processing power, etc). In ideal circumstances both should finish within similar results.
-
-`renderToStream` pipes the content through a stream which provides considerable performance benefits (faster time-to-first-byte and non-event-loop-blocking) over `renderToString`. This can be observed through the benchmark.
-
-### run
-
-``` bash
-npm run bench:ssr
-```
+++ /dev/null
-'use strict'
-
-const self = (global || root)
-
-self.performance = {
- now: function () {
- var hrtime = process.hrtime()
- return ((hrtime[0] * 1000000 + hrtime[1] / 1000) / 1000)
- }
-}
-
-function generateGrid (rowCount, columnCount) {
- var grid = []
-
- for (var r = 0; r < rowCount; r++) {
- var row = { id: r, items: [] }
- for (var c = 0; c < columnCount; c++) {
- row.items.push({ id: (r + '-' + c) })
- }
- grid.push(row)
- }
-
- return grid
-}
-
-const gridData = generateGrid(1000, 10)
-
-module.exports = {
- template: '<div><h1>{{ Math.random() }}</h1><my-table></my-table></div>',
- components: {
- myTable: {
- data: function () {
- return {
- grid: gridData
- }
- },
- // template: '<table><tr v-for="row in grid"><th>123</th><td v-for="item in row.items">{{ item.id }}</td></tr></table>',
- template: '<table width="100%" cellspacing="2"><row v-for="row in grid" :row="row"></row></table>',
- components: {
- row: {
- props: ['row'],
- template: '<tr><th>{{ Math.random() }}</th><column v-for="item in row.items"></column></tr>',
- components: {
- column: {
- template: '<td class="item">' +
- // 25 plain elements for each cell
- '<ul class="yoyo">' +
- `<li v-for="i in 5" :class="'hihi' + i">` +
- `<span :id="i + '_' + j" v-for="j in 5">fsefs</span>` +
- '</li>' +
- '</ul>' +
- '</td>'
- }
- }
- }
- }
- }
- }
-}
+++ /dev/null
-/* eslint-disable no-unused-vars */
-
-'use strict'
-
-process.env.NODE_ENV = 'production'
-
-const Vue = require('../../dist/vue.runtime.common.js')
-const createRenderer = require('../../packages/vue-server-renderer').createRenderer
-const renderToStream = createRenderer().renderToStream
-const gridComponent = require('./common.js')
-
-console.log('--- renderToStream --- ')
-const self = (global || root)
-const s = self.performance.now()
-
-const stream = renderToStream(new Vue(gridComponent))
-let str = ''
-let first
-let complete
-stream.once('data', () => {
- first = self.performance.now() - s
-})
-stream.on('data', chunk => {
- str += chunk
-})
-stream.on('end', () => {
- complete = self.performance.now() - s
- console.log(`first chunk: ${first.toFixed(2)}ms`)
- console.log(`complete: ${complete.toFixed(2)}ms`)
- console.log()
-})
+++ /dev/null
-'use strict'
-
-process.env.NODE_ENV = 'production'
-
-const Vue = require('../../dist/vue.runtime.common.js')
-const createRenderer = require('../../packages/vue-server-renderer').createRenderer
-const renderToString = createRenderer().renderToString
-const gridComponent = require('./common.js')
-
-console.log('--- renderToString --- ')
-const self = (global || root)
-self.s = self.performance.now()
-
-renderToString(new Vue(gridComponent), (err, res) => {
- if (err) throw err
- // console.log(res)
- console.log('Complete time: ' + (self.performance.now() - self.s).toFixed(2) + 'ms')
- console.log()
-})
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>vue.js version</title>
- <script src="https://cdn.jsdelivr.net/stats.js/r11/stats.min.js"></script>
- <script src="../../dist/vue.min.js"></script>
- <style>
- html, body {
- height: 100%;
- width: 100%;
- padding: 0;
- margin: 0;
- }
- svg {
- width: 800px;
- height: 600px;
- }
- </style>
-</head>
-<body>
- <h1>Animating 1000 SVG dots</h1>
- <div id="app">
- <p>
- <button @click="toggleOptimization">
- {{ optimized ? 'disable' : 'enable' }} optimization (Object.freeze)
- </button>
- </p>
- <svg>
- <circle v-for='point in model.points' :cx='point.x' :cy='point.y' r='2px' fill='#FC309D'></circle>
- </svg>
- </div>
-<script type="text/javascript" charset="utf-8">
-var stats = new Stats()
-stats.setMode(0)
-stats.domElement.style.position = 'absolute'
-stats.domElement.style.right = '0px'
-stats.domElement.style.top = '0px'
-document.body.appendChild(stats.domElement)
-
-var WIDTH = 800
-var HEIGHT = 600
-
-new Vue({
- el: '#app',
- data: {
- model: createModel(1000),
- optimized: false
- },
- created: function () {
- var self = this
- requestAnimationFrame(render)
- stats.begin()
- function render () {
- stats.end()
- stats.begin()
- requestAnimationFrame(render)
- self.model.step()
- if (self.optimized) {
- self.$forceUpdate()
- }
- }
- },
- methods: {
- toggleOptimization: function () {
- this.model = this.optimized
- ? createModel(1000)
- : Object.freeze(createModel(1000))
- this.optimized = !this.optimized
- }
- }
-});
-
-function createModel (count) {
- var points = []
- for (var i = 0; i < count; ++i) {
- points.push({
- x: Math.random() * WIDTH,
- y: Math.random() * HEIGHT,
- vx: Math.random() * 4 - 2,
- vy: Math.random() * 4 - 2
- })
- }
-
- return {
- points: points,
- step: step
- }
-
- function step () {
- points.forEach(move)
- }
-
- function move (p) {
- if (p.x > WIDTH || p.x < 0) p.vx *= -1
- if (p.y > HEIGHT || p.y < 0) p.vy *= -1
- p.y += p.vy
- p.x += p.vx
- }
-}
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue benchmark</title>
- <style type="text/css">
- html, body {
- margin: 0;
- padding: 0 10px;
- font-family: sans-serif;
- }
-
- #fps {
- position: fixed;
- top: 0px;
- right: 0px;
- padding: 32px;
- font-size: 32px;
- text-align: right;
- }
-
- * {
- box-sizing: border-box;
- }
-
- .server-uptime {
- display: block;
- overflow: hidden;
- margin: 0 auto;
- width: 50%;
- }
-
- .server-uptime + .server-uptime {
- margin: 20px auto 0 auto;
- border-top: 1px solid #999;
- }
-
- .days {
- display: flex;
- flex-direction: row;
- flex-flow: wrap;
- }
-
- .uptime-day {
- display: flex;
- }
-
- span.uptime-day-status {
- width: 10px;
- height: 10px;
- margin: 1px;
- }
-
- .hover {
- display: none;
- }
-
- .uptime-day-status:hover + .hover {
- display: flex;
- position: absolute;
- margin-top: -35px;
- margin-left: -30px;
- border-radius: 4px;
- color: #eee;
- background-color: #333;
- padding: 10px;
- font-size: 11px;
- }
- </style>
- </head>
- <body>
- <p>Reference: <a href="https://github.com/tildeio/glimmer/blob/master/packages/glimmer-demos/lib/uptime.ts">Ember Glimmer 2 demo</a></p>
- <div id="app">
- <p>FPS: {{ fps }}</p>
- <button @click="toggle">{{ playing ? 'pause' : 'play' }}</button>
- <server-uptime
- v-for="server in servers"
- :key="server.name"
- :name="server.name"
- :days="server.days">
- </server-uptime>
- </div>
- <script src="../../dist/vue.min.js"></script>
- <script>
- // functional components are prefect for small, presentational components
- // and they are much more efficient than stateful ones.
- Vue.component('uptime-day', {
- props: ['day'],
- functional: true,
- render (h, ctx) {
- var day = ctx.props.day
- return h('div', { staticClass: 'uptime-day'}, [
- h('span', { staticClass: 'uptime-day-status', style: { backgroundColor: day.up ? '#8cc665' : '#ccc' } }),
- h('span', { staticClass: 'hover' }, [day.number + ': ' + day.up ? 'Servers operational!' : 'Red alert!'])
- ])
- }
- })
-
- Vue.component('server-uptime', {
- props: ['name', 'days'],
- computed: {
- upDays () {
- return this.days.reduce(function (upDays, day) {
- return upDays += (day.up ? 1 : 0)
- }, 0)
- },
- maxStreak () {
- var streak = this.days.reduce(([max, streak], day) => {
- if (day.up && streak + 1 > max) {
- return [streak + 1, streak + 1]
- } else if (day.up) {
- return [max, streak + 1]
- } else {
- return [max, 0]
- }
- }, [0, 0])
-
- return streak.max
- }
- },
- template: `
- <div class="server-uptime">
- <h1>{{name}}</h1>
- <h2>{{upDays}} Days Up</h2>
- <h2>Biggest Streak: {{maxStreak}}</h2>
- <div class="days">
- <uptime-day
- v-for="day in days"
- :key="day.number"
- :day="day">
- </uptime-day>
- </div>
- </div>
- `
- })
-
- function generateServer (name) {
- var days = []
- for (var i=0; i<=364; i++) {
- var up = Math.random() > 0.2
- days.push({ number: i, up })
- }
- return { name, days }
- }
-
- function generateServers () {
- return [
- generateServer("Stefan's Server"),
- generateServer("Godfrey's Server"),
- generateServer("Yehuda's Server")
- ]
- }
-
- var s = window.performance.now()
- var app = new Vue({
- el: '#app',
- data: {
- fps: 0,
- playing: false,
- servers: Object.freeze(generateServers())
- },
- methods: {
- toggle () {
- this.playing = !this.playing
- if (this.playing) {
- update()
- } else {
- clearTimeout(timeoutId)
- }
- }
- }
- })
- console.log('initial render: ' + (window.performance.now() - s) + 'ms')
-
- var fpsMeter = {
- alpha: 2/121,
- lastValue: null,
- push (dataPoint) {
- if (this.lastValue) {
- return this.lastValue = this.lastValue + this.alpha * (dataPoint - this.lastValue)
- } else {
- return this.lastValue = dataPoint
- }
- }
- }
-
- var timeoutId
- var lastFrame = null
- function update () {
- var thisFrame = window.performance.now()
- if (lastFrame) {
- app.fps = Math.round(fpsMeter.push(1000 / (thisFrame - lastFrame)))
- }
- app.servers = Object.freeze(generateServers())
- timeoutId = setTimeout(update, 0) // not using rAF because that limits us to 60fps!
- lastFrame = thisFrame
- }
- </script>
- </body>
-</html>
+++ /dev/null
-## Explanation of Build Files
-
-| | UMD | CommonJS | ES Module |
-| --- | --- | --- | --- |
-| **Full** | vue.js | vue.common.js | vue.esm.js |
-| **Runtime-only** | vue.runtime.js | vue.runtime.common.js | vue.runtime.esm.js |
-| **Full (production)** | vue.min.js | | |
-| **Runtime-only (production)** | vue.runtime.min.js | | |
-
-### Terms
-
-- **Full**: builds that contains both the compiler and the runtime.
-
-- **Compiler**: code that is responsible for compiling template strings into JavaScript render functions.
-
-- **Runtime**: code that is responsible for creating Vue instances, rendering and patching virtual DOM, etc. Basically everything minus the compiler.
-
-- **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a `<script>` tag. The default file from Unpkg CDN at [https://unpkg.com/vue](https://unpkg.com/vue) is the Runtime + Compiler UMD build (`vue.js`).
-
-- **[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: CommonJS builds are intended for use with older bundlers like [browserify](http://browserify.org/) or [webpack 1](https://webpack.github.io). The default file for these bundlers (`pkg.main`) is the Runtime only CommonJS build (`vue.runtime.common.js`).
-
-- **[ES Module](http://exploringjs.com/es6/ch_modules.html)**: ES module builds are intended for use with modern bundlers like [webpack 2](https://webpack.js.org) or [rollup](http://rollupjs.org/). The default file for these bundlers (`pkg.module`) is the Runtime only ES Module build (`vue.runtime.esm.js`).
-
-### Runtime + Compiler vs. Runtime-only
-
-If you need to compile templates on the fly (e.g. passing a string to the `template` option, or mounting to an element using its in-DOM HTML as the template), you will need the compiler and thus the full build.
-
-When using `vue-loader` or `vueify`, templates inside `*.vue` files are compiled into JavaScript at build time. You don't really need the compiler in the final bundle, and can therefore use the runtime-only build.
-
-Since the runtime-only builds are roughly 30% lighter-weight than their full-build counterparts, you should use it whenever you can. If you wish to use the full build instead, you need to configure an alias in your bundler.
-
-#### Webpack
-
-``` js
-module.exports = {
- // ...
- resolve: {
- alias: {
- 'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
- }
- }
-}
-````
-
-#### Rollup
-
-``` js
-const alias = require('rollup-plugin-alias')
-
-rollup({
- // ...
- plugins: [
- alias({
- 'vue': 'vue/dist/vue.esm.js'
- })
- ]
-})
-```
-
-#### Browserify
-
-Add to your project's `package.json`:
-
-``` js
-{
- // ...
- "browser": {
- "vue": "vue/dist/vue.common.js"
- }
-}
-```
-
-### Development vs. Production Mode
-
-Development/production modes are hard-coded for the UMD builds: the un-minified files are for development, and the minified files are for production.
-
-CommonJS and ES Module builds are intended for bundlers, therefore we don't provide minified versions for them. You will be responsible for minifying the final bundle yourself.
-
-CommonJS and ES Module builds also preserve raw checks for `process.env.NODE_ENV` to determine the mode they should run in. You should use appropriate bundler configurations to replace these environment variables in order to control which mode Vue will run in. Replacing `process.env.NODE_ENV` with string literals also allows minifiers like UglifyJS to completely drop the development-only code blocks, reducing final file size.
-
-#### Webpack
-
-Use Webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
-
-``` js
-var webpack = require('webpack')
-
-module.exports = {
- // ...
- plugins: [
- // ...
- new webpack.DefinePlugin({
- 'process.env': {
- NODE_ENV: JSON.stringify('production')
- }
- })
- ]
-}
-```
-
-#### Rollup
-
-Use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace):
-
-``` js
-const replace = require('rollup-plugin-replace')
-
-rollup({
- // ...
- plugins: [
- replace({
- 'process.env.NODE_ENV': JSON.stringify('production')
- })
- ]
-}).then(...)
-```
-
-#### Browserify
-
-Apply a global [envify](https://github.com/hughsk/envify) transform to your bundle.
-
-``` bash
-NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
-```
+++ /dev/null
-var apiURL = 'https://api.github.com/repos/vuejs/vue/commits?per_page=3&sha='
-
-/**
- * Actual demo
- */
-
-var demo = new Vue({
-
- el: '#demo',
-
- data: {
- branches: ['master', 'dev'],
- currentBranch: 'master',
- commits: null
- },
-
- created: function () {
- this.fetchData()
- },
-
- watch: {
- currentBranch: 'fetchData'
- },
-
- filters: {
- truncate: function (v) {
- var newline = v.indexOf('\n')
- return newline > 0 ? v.slice(0, newline) : v
- },
- formatDate: function (v) {
- return v.replace(/T|Z/g, ' ')
- }
- },
-
- methods: {
- fetchData: function () {
- var xhr = new XMLHttpRequest()
- var self = this
- xhr.open('GET', apiURL + self.currentBranch)
- xhr.onload = function () {
- self.commits = JSON.parse(xhr.responseText)
- console.log(self.commits[0].html_url)
- }
- xhr.send()
- }
- }
-})
+++ /dev/null
-<!DOCTYPE html>
-<html>
- <head>
- <title>Vue.js github commits example</title>
- <style>
- #demo {
- font-family: 'Helvetica', Arial, sans-serif;
- }
- a {
- text-decoration: none;
- color: #f66;
- }
- li {
- line-height: 1.5em;
- margin-bottom: 20px;
- }
- .author, .date {
- font-weight: bold;
- }
- </style>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- </head>
- <body>
- <div id="demo">
- <h1>Latest Vue.js Commits</h1>
- <template v-for="branch in branches">
- <input type="radio"
- :id="branch"
- :value="branch"
- name="branch"
- v-model="currentBranch">
- <label :for="branch">{{ branch }}</label>
- </template>
- <p>vuejs/vue@{{ currentBranch }}</p>
- <ul>
- <li v-for="record in commits">
- <a :href="record.html_url" target="_blank" class="commit">{{ record.sha.slice(0, 7) }}</a>
- - <span class="message">{{ record.commit.message | truncate }}</span><br>
- by <span class="author"><a :href="record.author.html_url" target="_blank">{{ record.commit.author.name }}</a></span>
- at <span class="date">{{ record.commit.author.date | formatDate }}</span>
- </li>
- </ul>
- </div>
- <script src="app.js"></script>
- </body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
- <title>Vue.js elastic header example</title>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <script src="http://dynamicsjs.com/lib/dynamics.js"></script>
- <link rel="stylesheet" href="style.css">
- <!-- template for the component -->
- <script type="text/x-template" id="header-view-template">
- <div class="draggable-header-view"
- @mousedown="startDrag" @touchstart="startDrag"
- @mousemove="onDrag" @touchmove="onDrag"
- @mouseup="stopDrag" @touchend="stopDrag" @mouseleave="stopDrag">
- <svg class="bg" width="320" height="560">
- <path :d="headerPath" fill="#3F51B5"></path>
- </svg>
- <div class="header">
- <slot name="header"></slot>
- </div>
- <div class="content" :style="contentPosition">
- <slot name="content"></slot>
- </div>
- </div>
- </script>
- </head>
- <body>
-
- <div id="app" @touchmove.prevent>
- <draggable-header-view>
- <template slot="header">
- <h1>Elastic Draggable SVG Header</h1>
- <p>with <a href="https://vuejs.org">Vue.js</a> + <a href="http://dynamicsjs.com">dynamics.js</a></p>
- </template>
- <template slot="content">
- <p>Note this is just an effect demo - there are of course many additional details if you want to use this in production, e.g. handling responsive sizes, reload threshold and content scrolling. Those are out of scope for this quick little hack. However, the idea is that you can hide them as internal details of a Vue.js component and expose a simple Web-Component-like interface.</p>
- </template>
- </draggable-header-view>
- </div>
-
- <script>
- Vue.component('draggable-header-view', {
- template: '#header-view-template',
- data: function () {
- return {
- dragging: false,
- // quadratic bezier control point
- c: { x: 160, y: 160 },
- // record drag start point
- start: { x: 0, y: 0 }
- }
- },
- computed: {
- headerPath: function () {
- return 'M0,0 L320,0 320,160' +
- 'Q' + this.c.x + ',' + this.c.y +
- ' 0,160'
- },
- contentPosition: function () {
- var dy = this.c.y - 160
- var dampen = dy > 0 ? 2 : 4
- return {
- transform: 'translate3d(0,' + dy / dampen + 'px,0)'
- }
- }
- },
- methods: {
- startDrag: function (e) {
- e = e.changedTouches ? e.changedTouches[0] : e
- this.dragging = true
- this.start.x = e.pageX
- this.start.y = e.pageY
- },
- onDrag: function (e) {
- e = e.changedTouches ? e.changedTouches[0] : e
- if (this.dragging) {
- this.c.x = 160 + (e.pageX - this.start.x)
- // dampen vertical drag by a factor
- var dy = e.pageY - this.start.y
- var dampen = dy > 0 ? 1.5 : 4
- this.c.y = 160 + dy / dampen
- }
- },
- stopDrag: function () {
- if (this.dragging) {
- this.dragging = false
- dynamics.animate(this.c, {
- x: 160,
- y: 160
- }, {
- type: dynamics.spring,
- duration: 700,
- friction: 280
- })
- }
- }
- }
- })
-
- new Vue({ el: '#app' })
- </script>
- </body>
-</html>
+++ /dev/null
-h1 {
- font-weight: 300;
- font-size: 1.8em;
- margin-top: 0;
-}
-a {
- color: #fff;
-}
-.draggable-header-view {
- background-color: #fff;
- box-shadow: 0 4px 16px rgba(0,0,0,.15);
- width: 320px;
- height: 560px;
- overflow: hidden;
- margin: 30px auto;
- position: relative;
- font-family: 'Roboto', Helvetica, Arial, sans-serif;
- color: #fff;
- font-size: 14px;
- font-weight: 300;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-.draggable-header-view .bg {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 0;
-}
-.draggable-header-view .header, .draggable-header-view .content {
- position: relative;
- z-index: 1;
- padding: 30px;
- box-sizing: border-box;
-}
-.draggable-header-view .header {
- height: 160px;
-}
-.draggable-header-view .content {
- color: #333;
- line-height: 1.5em;
-}
+++ /dev/null
-var emailRE = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
-
-// Setup Firebase
-var config = {
- apiKey: "AIzaSyAi_yuJciPXLFr_PYPeU3eTvtXf8jbJ8zw",
- authDomain: "vue-demo-537e6.firebaseapp.com",
- databaseURL: "https://vue-demo-537e6.firebaseio.com"
-}
-firebase.initializeApp(config)
-
-var usersRef = firebase.database().ref('users')
-
-// create Vue app
-var app = new Vue({
- // element to mount to
- el: '#app',
- // initial data
- data: {
- newUser: {
- name: '',
- email: ''
- }
- },
- // firebase binding
- // https://github.com/vuejs/vuefire
- firebase: {
- users: usersRef
- },
- // computed property for form validation state
- computed: {
- validation: function () {
- return {
- name: !!this.newUser.name.trim(),
- email: emailRE.test(this.newUser.email)
- }
- },
- isValid: function () {
- var validation = this.validation
- return Object.keys(validation).every(function (key) {
- return validation[key]
- })
- }
- },
- // methods
- methods: {
- addUser: function () {
- if (this.isValid) {
- usersRef.push(this.newUser)
- this.newUser.name = ''
- this.newUser.email = ''
- }
- },
- removeUser: function (user) {
- usersRef.child(user['.key']).remove()
- }
- }
-})
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>Vue.js firebase + validation example</title>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="style.css">
- <!-- Vue -->
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <!-- Firebase -->
- <script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script>
- <!-- VueFire -->
- <script src="https://unpkg.com/vuefire@1.3.0"></script>
- </head>
- <body>
- <div id="app">
- <ul is="transition-group">
- <li v-for="user in users" class="user" :key="user['.key']">
- <span>{{user.name}} - {{user.email}}</span>
- <button v-on:click="removeUser(user)">X</button>
- </li>
- </ul>
- <form id="form" v-on:submit.prevent="addUser">
- <input v-model="newUser.name">
- <input v-model="newUser.email">
- <input type="submit" value="Add User">
- </form>
- <ul class="errors">
- <li v-show="!validation.name">Name cannot be empty.</li>
- <li v-show="!validation.email">Please provide a valid email address.</li>
- </ul>
- </div>
- <script src="app.js"></script>
- </body>
-</html>
+++ /dev/null
-body {
- font-family: Helvetica, Arial, sans-serif;
-}
-
-ul {
- padding: 0;
-}
-
-.user {
- height: 30px;
- line-height: 30px;
- padding: 10px;
- border-top: 1px solid #eee;
- overflow: hidden;
- transition: all .25s ease;
-}
-
-.user:last-child {
- border-bottom: 1px solid #eee;
-}
-
-.v-enter, .v-leave-to {
- height: 0;
- padding-top: 0;
- padding-bottom: 0;
- border-top-width: 0;
- border-bottom-width: 0;
-}
-
-.errors {
- color: #f00;
-}
+++ /dev/null
-// register the grid component
-Vue.component('demo-grid', {
- template: '#grid-template',
- replace: true,
- props: {
- data: Array,
- columns: Array,
- filterKey: String
- },
- data: function () {
- var sortOrders = {}
- this.columns.forEach(function (key) {
- sortOrders[key] = 1
- })
- return {
- sortKey: '',
- sortOrders: sortOrders
- }
- },
- computed: {
- filteredData: function () {
- var sortKey = this.sortKey
- var filterKey = this.filterKey && this.filterKey.toLowerCase()
- var order = this.sortOrders[sortKey] || 1
- var data = this.data
- if (filterKey) {
- data = data.filter(function (row) {
- return Object.keys(row).some(function (key) {
- return String(row[key]).toLowerCase().indexOf(filterKey) > -1
- })
- })
- }
- if (sortKey) {
- data = data.slice().sort(function (a, b) {
- a = a[sortKey]
- b = b[sortKey]
- return (a === b ? 0 : a > b ? 1 : -1) * order
- })
- }
- return data
- }
- },
- filters: {
- capitalize: function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
- }
- },
- methods: {
- sortBy: function (key) {
- this.sortKey = key
- this.sortOrders[key] = this.sortOrders[key] * -1
- }
- }
-})
-
-// bootstrap the demo
-var demo = new Vue({
- el: '#demo',
- data: {
- searchQuery: '',
- gridColumns: ['name', 'power'],
- gridData: [
- { name: 'Chuck Norris', power: Infinity },
- { name: 'Bruce Lee', power: 9000 },
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
- ]
- }
-})
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js grid component example</title>
- <link rel="stylesheet" href="style.css">
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- </head>
- <body>
-
- <!-- component template -->
- <script type="text/x-template" id="grid-template">
- <table v-if="filteredData.length">
- <thead>
- <tr>
- <th v-for="key in columns"
- @click="sortBy(key)"
- :class="{ active: sortKey == key }">
- {{ key | capitalize }}
- <span class="arrow" :class="sortOrders[key] > 0 ? 'asc' : 'dsc'">
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr v-for="entry in filteredData">
- <td v-for="key in columns">
- {{entry[key]}}
- </td>
- </tr>
- </tbody>
- </table>
- <p v-else>No matches found.</p>
- </script>
-
- <!-- demo root element -->
- <div id="demo">
- <form id="search">
- Search <input name="query" v-model="searchQuery">
- </form>
- <demo-grid
- :data="gridData"
- :columns="gridColumns"
- :filter-key="searchQuery">
- </demo-grid>
- </div>
-
- <script src="grid.js"></script>
-
- </body>
-</html>
+++ /dev/null
-body {
- font-family: Helvetica Neue, Arial, sans-serif;
- font-size: 14px;
- color: #444;
-}
-
-table {
- border: 2px solid #42b983;
- border-radius: 3px;
- background-color: #fff;
-}
-
-th {
- background-color: #42b983;
- color: rgba(255,255,255,0.66);
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-td {
- background-color: #f9f9f9;
-}
-
-th, td {
- min-width: 120px;
- padding: 10px 20px;
-}
-
-th.active {
- color: #fff;
-}
-
-th.active .arrow {
- opacity: 1;
-}
-
-.arrow {
- display: inline-block;
- vertical-align: middle;
- width: 0;
- height: 0;
- margin-left: 5px;
- opacity: 0.66;
-}
-
-.arrow.asc {
- border-left: 4px solid transparent;
- border-right: 4px solid transparent;
- border-bottom: 4px solid #fff;
-}
-
-.arrow.dsc {
- border-left: 4px solid transparent;
- border-right: 4px solid transparent;
- border-top: 4px solid #fff;
-}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js markdown editor example</title>
- <link rel="stylesheet" href="style.css">
- <script src="https://unpkg.com/marked@0.3.6"></script>
- <script src="https://unpkg.com/lodash@4.16.0"></script>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- </head>
- <body>
-
- <div id="editor">
- <textarea :value="input" @input="update"></textarea>
- <div v-html="compiledMarkdown"></div>
- </div>
-
- <script>
- new Vue({
- el: '#editor',
- data: {
- input: '# hello'
- },
- computed: {
- compiledMarkdown: function () {
- return marked(this.input, { sanitize: true })
- }
- },
- methods: {
- update: _.debounce(function (e) {
- this.input = e.target.value
- }, 300)
- }
- })
- </script>
-
- </body>
-</html>
+++ /dev/null
-html, body, #editor {
- margin: 0;
- height: 100%;
- font-family: 'Helvetica Neue', Arial, sans-serif;
- color: #333;
-}
-
-textarea, #editor div {
- display: inline-block;
- width: 49%;
- height: 100%;
- vertical-align: top;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- padding: 0 20px;
-}
-
-textarea {
- border: none;
- border-right: 1px solid #ccc;
- resize: none;
- outline: none;
- background-color: #f6f6f6;
- font-size: 14px;
- font-family: 'Monaco', courier, monospace;
- padding: 20px;
-}
-
-code {
- color: #f66;
-}
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js modal component example</title>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <link rel="stylesheet" href="style.css">
- </head>
- <body>
- <!-- template for the modal component -->
- <script type="text/x-template" id="modal-template">
- <transition name="modal">
- <div class="modal-mask">
- <div class="modal-wrapper">
- <div class="modal-container">
-
- <div class="modal-header">
- <slot name="header">
- default header
- </slot>
- </div>
-
- <div class="modal-body">
- <slot name="body">
- default body
- </slot>
- </div>
-
- <div class="modal-footer">
- <slot name="footer">
- default footer
- <button class="modal-default-button" @click="$emit('close')">
- OK
- </button>
- </slot>
- </div>
- </div>
- </div>
- </div>
- </transition>
- </script>
-
- <!-- app -->
- <div id="app">
- <button id="show-modal" @click="showModal = true">Show Modal</button>
- <!-- use the modal component, pass in the prop -->
- <modal v-if="showModal" @close="showModal = false">
- <!--
- you can use custom content here to overwrite
- default content
- -->
- <h3 slot="header">custom header</h3>
- </modal>
- </div>
-
- <script>
- // register modal component
- Vue.component('modal', {
- template: '#modal-template'
- })
-
- // start app
- new Vue({
- el: '#app',
- data: {
- showModal: false
- }
- })
- </script>
- </body>
-</html>
+++ /dev/null
-.modal-mask {
- position: fixed;
- z-index: 9998;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, .5);
- display: table;
- transition: opacity .3s ease;
-}
-
-.modal-wrapper {
- display: table-cell;
- vertical-align: middle;
-}
-
-.modal-container {
- width: 300px;
- margin: 0px auto;
- padding: 20px 30px;
- background-color: #fff;
- border-radius: 2px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
- transition: all .3s ease;
- font-family: Helvetica, Arial, sans-serif;
-}
-
-.modal-header h3 {
- margin-top: 0;
- color: #42b983;
-}
-
-.modal-body {
- margin: 20px 0;
-}
-
-.modal-default-button {
- float: right;
-}
-
-/*
- * The following styles are auto-applied to elements with
- * transition="modal" when their visibility is toggled
- * by Vue.js.
- *
- * You can easily play with the modal transition by editing
- * these styles.
- */
-
-.modal-enter {
- opacity: 0;
-}
-
-.modal-leave-to {
- opacity: 0;
-}
-
-.modal-enter .modal-container,
-.modal-leave-to .modal-container {
- -webkit-transform: scale(1.1);
- transform: scale(1.1);
-}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Move Animations</title>
- <style>
- .container {
- position: relative;
- padding: 0;
- }
- .item {
- width: 100%;
- height: 30px;
- background-color: #f3f3f3;
- border: 1px solid #666;
- box-sizing: border-box;
- }
- /* 1. declare transition */
- .fade-move, .fade-enter-active, .fade-leave-active {
- transition: all .5s cubic-bezier(.55,0,.1,1);
- }
- /* 2. declare enter from and leave to state */
- .fade-enter, .fade-leave-to {
- opacity: 0;
- transform: scaleY(0.01) translate(30px, 0);
- }
- /* 3. ensure leaving items are taken out of layout flow so that moving
- animations can be calculated correctly. */
- .fade-leave-active {
- position: absolute;
- }
- </style>
- <script src="https://cdn.jsdelivr.net/lodash/4.3.0/lodash.min.js"></script>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- </head>
- <body>
- <div id="el">
- <button @click="insert">insert at random index</button>
- <button @click="reset">reset</button>
- <button @click="shuffle">shuffle</button>
- <transition-group tag="ul" name="fade" class="container">
- <item v-for="item in items"
- class="item"
- :msg="item"
- :key="item"
- @rm="remove(item)">
- </item>
- </transition-group>
- </div>
-
- <script>
- var items = [1, 2, 3, 4, 5]
- var id = items.length + 1
-
- var vm = new Vue({
- el: '#el',
- data: {
- items: items
- },
- components: {
- item: {
- props: ['msg'],
- template: `<div>{{ msg }} <button @click="$emit('rm')">x</button></div>`
- }
- },
- methods: {
- insert () {
- var i = Math.round(Math.random() * this.items.length)
- this.items.splice(i, 0, id++)
- },
- reset () {
- this.items = [1, 2, 3, 4, 5]
- },
- shuffle () {
- this.items = _.shuffle(this.items)
- },
- remove (item) {
- var i = this.items.indexOf(item)
- if (i > -1) {
- this.items.splice(i, 1)
- }
- }
- }
- })
- </script>
- </body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js wrapper component example (jquery plugin: select2)</title>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <script src="https://unpkg.com/jquery"></script>
- <script src="https://unpkg.com/select2@4.0.3"></script>
- <link href="https://unpkg.com/select2@4.0.3/dist/css/select2.min.css" rel="stylesheet">
- <style>
- html, body {
- font: 13px/18px sans-serif;
- }
- select {
- min-width: 300px;
- }
- </style>
- </head>
- <body>
-
- <div id="el">
- </div>
-
- <!-- using string template here to work around HTML <option> placement restriction -->
- <script type="text/x-template" id="demo-template">
- <div>
- <p>Selected: {{ selected }}</p>
- <select2 :options="options" v-model="selected">
- <option disabled value="0">Select one</option>
- </select2>
- </div>
- </script>
-
- <script type="text/x-template" id="select2-template">
- <select>
- <slot></slot>
- </select>
- </script>
-
- <script>
- Vue.component('select2', {
- props: ['options', 'value'],
- template: '#select2-template',
- mounted: function () {
- var vm = this
- $(this.$el)
- .val(this.value)
- // init select2
- .select2({ data: this.options })
- // emit event on change.
- .on('change', function () {
- vm.$emit('input', this.value)
- })
- },
- watch: {
- value: function (value) {
- // update value
- $(this.$el).val(value).trigger('change')
- },
- options: function (options) {
- // update options
- $(this.$el).select2({ data: options })
- }
- },
- destroyed: function () {
- $(this.$el).off().select2('destroy')
- }
- })
-
- var vm = new Vue({
- el: '#el',
- template: '#demo-template',
- data: {
- selected: 0,
- options: [
- { id: 1, text: 'Hello' },
- { id: 2, text: 'World' }
- ]
- }
- })
- </script>
- </body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js SVG graph example</title>
- <link rel="stylesheet" href="style.css">
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <script src="https://unpkg.com/marky/dist/marky.min.js"></script>
- </head>
- <body>
-
- <!-- template for the polygraph component. -->
- <script type="text/x-template" id="polygraph-template">
- <g>
- <polygon :points="points"></polygon>
- <circle cx="100" cy="100" r="80"></circle>
- <axis-label
- v-for="(stat, index) in stats"
- :stat="stat"
- :index="index"
- :total="stats.length">
- </axis-label>
- </g>
- </script>
-
- <!-- template for the axis label component. -->
- <script type="text/x-template" id="axis-label-template">
- <text :x="point.x" :y="point.y">{{stat.label}}</text>
- </script>
-
- <!-- demo root element -->
- <div id="demo">
- <!-- Use the component -->
- <svg width="200" height="200">
- <polygraph :stats="stats"></polygraph>
- </svg>
- <!-- controls -->
- <div v-for="stat in stats">
- <label>{{stat.label}}</label>
- <input type="range" v-model="stat.value" min="0" max="100">
- <span>{{stat.value}}</span>
- <button @click="remove(stat)" class="remove">X</button>
- </div>
- <form id="add">
- <input name="newlabel" v-model="newLabel">
- <button @click="add">Add a Stat</button>
- </form>
- <pre id="raw">{{ stats }}</pre>
- </div>
-
- <p style="font-size:12px">* input[type="range"] requires IE10 or above.</p>
-
- <script src="svg.js"></script>
-
- </body>
-</html>
+++ /dev/null
-body {
- font-family: Helvetica Neue, Arial, sans-serif;
-}
-
-polygon {
- fill: #42b983;
- opacity: .75;
-}
-
-circle {
- fill: transparent;
- stroke: #999;
-}
-
-text {
- font-family: Helvetica Neue, Arial, sans-serif;
- font-size: 10px;
- fill: #666;
-}
-
-label {
- display: inline-block;
- margin-left: 10px;
- width: 20px;
-}
-
-#raw {
- position: absolute;
- top: 0;
- left: 300px;
-}
\ No newline at end of file
+++ /dev/null
-// The raw data to observe
-var stats = [
- { label: 'A', value: 100 },
- { label: 'B', value: 100 },
- { label: 'C', value: 100 },
- { label: 'D', value: 100 },
- { label: 'E', value: 100 },
- { label: 'F', value: 100 }
-]
-
-// A reusable polygon graph component
-Vue.component('polygraph', {
- props: ['stats'],
- template: '#polygraph-template',
- computed: {
- // a computed property for the polygon's points
- points: function () {
- var total = this.stats.length
- return this.stats.map(function (stat, i) {
- var point = valueToPoint(stat.value, i, total)
- return point.x + ',' + point.y
- }).join(' ')
- }
- },
- components: {
- // a sub component for the labels
- 'axis-label': {
- props: {
- stat: Object,
- index: Number,
- total: Number
- },
- template: '#axis-label-template',
- computed: {
- point: function () {
- return valueToPoint(
- +this.stat.value + 10,
- this.index,
- this.total
- )
- }
- }
- }
- }
-})
-
-// math helper...
-function valueToPoint (value, index, total) {
- var x = 0
- var y = -value * 0.8
- var angle = Math.PI * 2 / total * index
- var cos = Math.cos(angle)
- var sin = Math.sin(angle)
- var tx = x * cos - y * sin + 100
- var ty = x * sin + y * cos + 100
- return {
- x: tx,
- y: ty
- }
-}
-
-// bootstrap the demo
-new Vue({
- el: '#demo',
- data: {
- newLabel: '',
- stats: stats
- },
- methods: {
- add: function (e) {
- e.preventDefault()
- if (!this.newLabel) return
- this.stats.push({
- label: this.newLabel,
- value: 100
- })
- this.newLabel = ''
- },
- remove: function (stat) {
- if (this.stats.length > 3) {
- this.stats.splice(this.stats.indexOf(stat), 1)
- } else {
- alert('Can\'t delete more!')
- }
- }
- }
-})
+++ /dev/null
-// Full spec-compliant TodoMVC with localStorage persistence
-// and hash-based routing in ~150 lines.
-
-// localStorage persistence
-var STORAGE_KEY = 'todos-vuejs-2.0'
-var todoStorage = {
- fetch: function () {
- var todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')
- todos.forEach(function (todo, index) {
- todo.id = index
- })
- todoStorage.uid = todos.length
- return todos
- },
- save: function (todos) {
- localStorage.setItem(STORAGE_KEY, JSON.stringify(todos))
- }
-}
-
-// visibility filters
-var filters = {
- all: function (todos) {
- return todos
- },
- active: function (todos) {
- return todos.filter(function (todo) {
- return !todo.completed
- })
- },
- completed: function (todos) {
- return todos.filter(function (todo) {
- return todo.completed
- })
- }
-}
-
-// app Vue instance
-var app = new Vue({
- // app initial state
- data: {
- todos: todoStorage.fetch(),
- newTodo: '',
- editedTodo: null,
- visibility: 'all'
- },
-
- // watch todos change for localStorage persistence
- watch: {
- todos: {
- handler: function (todos) {
- todoStorage.save(todos)
- },
- deep: true
- }
- },
-
- // computed properties
- // https://vuejs.org/guide/computed.html
- computed: {
- filteredTodos: function () {
- return filters[this.visibility](this.todos)
- },
- remaining: function () {
- return filters.active(this.todos).length
- },
- allDone: {
- get: function () {
- return this.remaining === 0
- },
- set: function (value) {
- this.todos.forEach(function (todo) {
- todo.completed = value
- })
- }
- }
- },
-
- filters: {
- pluralize: function (n) {
- return n === 1 ? 'item' : 'items'
- }
- },
-
- // methods that implement data logic.
- // note there's no DOM manipulation here at all.
- methods: {
- addTodo: function () {
- var value = this.newTodo && this.newTodo.trim()
- if (!value) {
- return
- }
- this.todos.push({
- id: todoStorage.uid++,
- title: value,
- completed: false
- })
- this.newTodo = ''
- },
-
- removeTodo: function (todo) {
- this.todos.splice(this.todos.indexOf(todo), 1)
- },
-
- editTodo: function (todo) {
- this.beforeEditCache = todo.title
- this.editedTodo = todo
- },
-
- doneEdit: function (todo) {
- if (!this.editedTodo) {
- return
- }
- this.editedTodo = null
- todo.title = todo.title.trim()
- if (!todo.title) {
- this.removeTodo(todo)
- }
- },
-
- cancelEdit: function (todo) {
- this.editedTodo = null
- todo.title = this.beforeEditCache
- },
-
- removeCompleted: function () {
- this.todos = filters.active(this.todos)
- }
- },
-
- // a custom directive to wait for the DOM to be updated
- // before focusing on the input field.
- // https://vuejs.org/guide/custom-directive.html
- directives: {
- 'todo-focus': function (el, binding) {
- if (binding.value) {
- el.focus()
- }
- }
- }
-})
-
-// handle routing
-function onHashChange () {
- var visibility = window.location.hash.replace(/#\/?/, '')
- if (filters[visibility]) {
- app.visibility = visibility
- } else {
- window.location.hash = ''
- app.visibility = 'all'
- }
-}
-
-window.addEventListener('hashchange', onHashChange)
-onHashChange()
-
-// mount
-app.$mount('.todoapp')
+++ /dev/null
-<!doctype html>
-<html data-framework="vue">
- <head>
- <meta charset="utf-8">
- <title>Vue.js • TodoMVC</title>
- <link rel="stylesheet" href="https://unpkg.com/todomvc-app-css@2.0.4/index.css">
- <script src="https://unpkg.com/director@1.2.8/build/director.js"></script>
- <style>[v-cloak] { display: none; }</style>
- </head>
- <body>
- <section class="todoapp">
- <header class="header">
- <h1>todos</h1>
- <input class="new-todo"
- autofocus autocomplete="off"
- placeholder="What needs to be done?"
- v-model="newTodo"
- @keyup.enter="addTodo">
- </header>
- <section class="main" v-show="todos.length" v-cloak>
- <input class="toggle-all" type="checkbox" v-model="allDone">
- <ul class="todo-list">
- <li v-for="todo in filteredTodos"
- class="todo"
- :key="todo.id"
- :class="{ completed: todo.completed, editing: todo == editedTodo }">
- <div class="view">
- <input class="toggle" type="checkbox" v-model="todo.completed">
- <label @dblclick="editTodo(todo)">{{ todo.title }}</label>
- <button class="destroy" @click="removeTodo(todo)"></button>
- </div>
- <input class="edit" type="text"
- v-model="todo.title"
- v-todo-focus="todo == editedTodo"
- @blur="doneEdit(todo)"
- @keyup.enter="doneEdit(todo)"
- @keyup.esc="cancelEdit(todo)">
- </li>
- </ul>
- </section>
- <footer class="footer" v-show="todos.length" v-cloak>
- <span class="todo-count">
- <strong>{{ remaining }}</strong> {{ remaining | pluralize }} left
- </span>
- <ul class="filters">
- <li><a href="#/all" :class="{ selected: visibility == 'all' }">All</a></li>
- <li><a href="#/active" :class="{ selected: visibility == 'active' }">Active</a></li>
- <li><a href="#/completed" :class="{ selected: visibility == 'completed' }">Completed</a></li>
- </ul>
- <button class="clear-completed" @click="removeCompleted" v-show="todos.length > remaining">
- Clear completed
- </button>
- </footer>
- </section>
- <footer class="info">
- <p>Double-click to edit a todo</p>
- <p>Written by <a href="http://evanyou.me">Evan You</a></p>
- <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
- </footer>
-
- <script>
- // for testing
- if (navigator.userAgent.indexOf('PhantomJS') > -1) localStorage.clear()
- </script>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- <script src="app.js"></script>
- </body>
-</html>
+++ /dev/null
-# Vue.js TodoMVC Example
-
-> Vue.js is a library for building interactive web interfaces.
-It provides data-driven, nestable view components with a simple and flexible API.
-
-> _[Vue.js - vuejs.org](https://vuejs.org)_
-
-## Learning Vue.js
-The [Vue.js website](https://vuejs.org/) is a great resource to get started.
-
-Here are some links you may find helpful:
-
-* [Official Guide](https://vuejs.org/guide/)
-* [API Reference](https://vuejs.org/api/)
-* [Examples](https://vuejs.org/examples/)
-
-Get help from other Vue.js users:
-
-* [Vue.js official forum](http://forum.vuejs.org)
-* [Vue.js on Twitter](https://twitter.com/vuejs)
-* [Vue.js on Gitter](https://gitter.im/vuejs/vue)
-
-_If you have other helpful links to share, or find any of the links above no longer work, please [let us know](https://github.com/tastejs/todomvc/issues)._
-
-## Credit
-
-This TodoMVC application was created by [Evan You](http://evanyou.me).
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js tree view example</title>
- <style>
- body {
- font-family: Menlo, Consolas, monospace;
- color: #444;
- }
- .item {
- cursor: pointer;
- }
- .bold {
- font-weight: bold;
- }
- ul {
- padding-left: 1em;
- line-height: 1.5em;
- list-style-type: dot;
- }
- </style>
- <!-- Delete ".min" for console warnings in development -->
- <script src="../../dist/vue.min.js"></script>
- </head>
- <body>
-
- <!-- item template -->
- <script type="text/x-template" id="item-template">
- <li>
- <div
- :class="{bold: isFolder}"
- @click="toggle"
- @dblclick="changeType">
- {{model.name}}
- <span v-if="isFolder">[{{open ? '-' : '+'}}]</span>
- </div>
- <ul v-show="open" v-if="isFolder">
- <item
- class="item"
- v-for="model in model.children"
- :model="model">
- </item>
- <li class="add" @click="addChild">+</li>
- </ul>
- </li>
- </script>
-
- <p>(You can double click on an item to turn it into a folder.)</p>
-
- <!-- the demo root element -->
- <ul id="demo">
- <item
- class="item"
- :model="treeData">
- </item>
- </ul>
-
- <!-- demo code -->
- <script src="tree.js"></script>
- </body>
-</html>
+++ /dev/null
-// demo data
-var data = {
- name: 'My Tree',
- children: [
- { name: 'hello' },
- { name: 'wat' },
- {
- name: 'child folder',
- children: [
- {
- name: 'child folder',
- children: [
- { name: 'hello' },
- { name: 'wat' }
- ]
- },
- { name: 'hello' },
- { name: 'wat' },
- {
- name: 'child folder',
- children: [
- { name: 'hello' },
- { name: 'wat' }
- ]
- }
- ]
- }
- ]
-}
-
-// define the item component
-Vue.component('item', {
- template: '#item-template',
- props: {
- model: Object
- },
- data: function () {
- return {
- open: false
- }
- },
- computed: {
- isFolder: function () {
- return this.model.children &&
- this.model.children.length
- }
- },
- methods: {
- toggle: function () {
- if (this.isFolder) {
- this.open = !this.open
- }
- },
- changeType: function () {
- if (!this.isFolder) {
- Vue.set(this.model, 'children', [])
- this.addChild()
- this.open = true
- }
- },
- addChild: function () {
- this.model.children.push({
- name: 'new stuff'
- })
- }
- }
-})
-
-// boot up the demo
-var demo = new Vue({
- el: '#demo',
- data: {
- treeData: data
- }
-})
+++ /dev/null
-declare type CompilerOptions = {
- warn?: Function; // allow customizing warning in different environments; e.g. node
- modules?: Array<ModuleOptions>; // platform specific modules; e.g. style; class
- directives?: { [key: string]: Function }; // platform specific directives
- staticKeys?: string; // a list of AST properties to be considered static; for optimization
- isUnaryTag?: (tag: string) => ?boolean; // check if a tag is unary for the platform
- canBeLeftOpenTag?: (tag: string) => ?boolean; // check if a tag can be left opened
- isReservedTag?: (tag: string) => ?boolean; // check if a tag is a native for the platform
- preserveWhitespace?: boolean; // preserve whitespace between elements?
- optimize?: boolean; // optimize static content?
-
- // web specific
- mustUseProp?: (tag: string, type: ?string, name: string) => boolean; // check if an attribute should be bound as a property
- isPreTag?: (attr: string) => ?boolean; // check if a tag needs to preserve whitespace
- getTagNamespace?: (tag: string) => ?string; // check the namespace for a tag
- expectHTML?: boolean; // only false for non-web builds
- isFromDOM?: boolean;
- shouldDecodeTags?: boolean;
- shouldDecodeNewlines?: boolean;
- shouldDecodeNewlinesForHref?: boolean;
-
- // runtime user-configurable
- delimiters?: [string, string]; // template delimiters
- comments?: boolean; // preserve comments in template
-
- // for ssr optimization compiler
- scopeId?: string;
-};
-
-declare type CompiledResult = {
- ast: ?ASTElement;
- render: string;
- staticRenderFns: Array<string>;
- stringRenderFns?: Array<string>;
- errors?: Array<string>;
- tips?: Array<string>;
-};
-
-declare type ModuleOptions = {
- // transform an AST node before any attributes are processed
- // returning an ASTElement from pre/transforms replaces the element
- preTransformNode: (el: ASTElement) => ?ASTElement;
- // transform an AST node after built-ins like v-if, v-for are processed
- transformNode: (el: ASTElement) => ?ASTElement;
- // transform an AST node after its children have been processed
- // cannot return replacement in postTransform because tree is already finalized
- postTransformNode: (el: ASTElement) => void;
- genData: (el: ASTElement) => string; // generate extra data string for an element
- transformCode?: (el: ASTElement, code: string) => string; // further transform generated code for an element
- staticKeys?: Array<string>; // AST properties to be considered static
-};
-
-declare type ASTModifiers = { [key: string]: boolean };
-declare type ASTIfCondition = { exp: ?string; block: ASTElement };
-declare type ASTIfConditions = Array<ASTIfCondition>;
-
-declare type ASTElementHandler = {
- value: string;
- params?: Array<any>;
- modifiers: ?ASTModifiers;
-};
-
-declare type ASTElementHandlers = {
- [key: string]: ASTElementHandler | Array<ASTElementHandler>;
-};
-
-declare type ASTDirective = {
- name: string;
- rawName: string;
- value: string;
- arg: ?string;
- modifiers: ?ASTModifiers;
-};
-
-declare type ASTNode = ASTElement | ASTText | ASTExpression;
-
-declare type ASTElement = {
- type: 1;
- tag: string;
- attrsList: Array<{ name: string; value: any }>;
- attrsMap: { [key: string]: any };
- parent: ASTElement | void;
- children: Array<ASTNode>;
-
- processed?: true;
-
- static?: boolean;
- staticRoot?: boolean;
- staticInFor?: boolean;
- staticProcessed?: boolean;
- hasBindings?: boolean;
-
- text?: string;
- attrs?: Array<{ name: string; value: any }>;
- props?: Array<{ name: string; value: string }>;
- plain?: boolean;
- pre?: true;
- ns?: string;
-
- component?: string;
- inlineTemplate?: true;
- transitionMode?: string | null;
- slotName?: ?string;
- slotTarget?: ?string;
- slotScope?: ?string;
- scopedSlots?: { [name: string]: ASTElement };
-
- ref?: string;
- refInFor?: boolean;
-
- if?: string;
- ifProcessed?: boolean;
- elseif?: string;
- else?: true;
- ifConditions?: ASTIfConditions;
-
- for?: string;
- forProcessed?: boolean;
- key?: string;
- alias?: string;
- iterator1?: string;
- iterator2?: string;
-
- staticClass?: string;
- classBinding?: string;
- staticStyle?: string;
- styleBinding?: string;
- events?: ASTElementHandlers;
- nativeEvents?: ASTElementHandlers;
-
- transition?: string | true;
- transitionOnAppear?: boolean;
-
- model?: {
- value: string;
- callback: string;
- expression: string;
- };
-
- directives?: Array<ASTDirective>;
-
- forbidden?: true;
- once?: true;
- onceProcessed?: boolean;
- wrapData?: (code: string) => string;
- wrapListeners?: (code: string) => string;
-
- // 2.4 ssr optimization
- ssrOptimizability?: number;
-
- // weex specific
- appendAsTree?: boolean;
-};
-
-declare type ASTExpression = {
- type: 2;
- expression: string;
- text: string;
- tokens: Array<string | Object>;
- static?: boolean;
- // 2.4 ssr optimization
- ssrOptimizability?: number;
-};
-
-declare type ASTText = {
- type: 3;
- text: string;
- static?: boolean;
- isComment?: boolean;
- // 2.4 ssr optimization
- ssrOptimizability?: number;
-};
-
-// SFC-parser related declarations
-
-// an object format describing a single-file component.
-declare type SFCDescriptor = {
- template: ?SFCBlock;
- script: ?SFCBlock;
- styles: Array<SFCBlock>;
- customBlocks: Array<SFCBlock>;
-};
-
-declare type SFCBlock = {
- type: string;
- content: string;
- attrs: {[attribute:string]: string};
- start?: number;
- end?: number;
- lang?: string;
- src?: string;
- scoped?: boolean;
- module?: string | boolean;
-};
+++ /dev/null
-import type { Config } from '../src/core/config'
-import type VNode from '../src/core/vdom/vnode'
-import type Watcher from '../src/core/observer/watcher'
-
-declare interface Component {
- // constructor information
- static cid: number;
- static options: Object;
- // extend
- static extend: (options: Object) => Function;
- static superOptions: Object;
- static extendOptions: Object;
- static sealedOptions: Object;
- static super: Class<Component>;
- // assets
- static directive: (id: string, def?: Function | Object) => Function | Object | void;
- static component: (id: string, def?: Class<Component> | Object) => Class<Component>;
- static filter: (id: string, def?: Function) => Function | void;
- // functional context constructor
- static FunctionalRenderContext: Function;
-
- // public properties
- $el: any; // so that we can attach __vue__ to it
- $data: Object;
- $props: Object;
- $options: ComponentOptions;
- $parent: Component | void;
- $root: Component;
- $children: Array<Component>;
- $refs: { [key: string]: Component | Element | Array<Component | Element> | void };
- $slots: { [key: string]: Array<VNode> };
- $scopedSlots: { [key: string]: () => VNodeChildren };
- $vnode: VNode; // the placeholder node for the component in parent's render tree
- $attrs: { [key: string] : string };
- $listeners: { [key: string]: Function | Array<Function> };
- $isServer: boolean;
-
- // public methods
- $mount: (el?: Element | string, hydrating?: boolean) => Component;
- $forceUpdate: () => void;
- $destroy: () => void;
- $set: <T>(target: Object | Array<T>, key: string | number, val: T) => T;
- $delete: <T>(target: Object | Array<T>, key: string | number) => void;
- $watch: (expOrFn: string | Function, cb: Function, options?: Object) => Function;
- $on: (event: string | Array<string>, fn: Function) => Component;
- $once: (event: string, fn: Function) => Component;
- $off: (event?: string | Array<string>, fn?: Function) => Component;
- $emit: (event: string, ...args: Array<mixed>) => Component;
- $nextTick: (fn: Function) => void | Promise<*>;
- $createElement: (tag?: string | Component, data?: Object, children?: VNodeChildren) => VNode;
-
- // private properties
- _uid: number | string;
- _name: string; // this only exists in dev mode
- _isVue: true;
- _self: Component;
- _renderProxy: Component;
- _renderContext: ?Component;
- _watcher: Watcher;
- _watchers: Array<Watcher>;
- _computedWatchers: { [key: string]: Watcher };
- _data: Object;
- _props: Object;
- _events: Object;
- _inactive: boolean | null;
- _directInactive: boolean;
- _isMounted: boolean;
- _isDestroyed: boolean;
- _isBeingDestroyed: boolean;
- _vnode: ?VNode; // self root node
- _staticTrees: ?Array<VNode>; // v-once cached trees
- _hasHookEvent: boolean;
- _provided: ?Object;
- // _virtualComponents?: { [key: string]: Component };
-
- // private methods
-
- // lifecycle
- _init: Function;
- _mount: (el?: Element | void, hydrating?: boolean) => Component;
- _update: (vnode: VNode, hydrating?: boolean) => void;
-
- // rendering
- _render: () => VNode;
-
- __patch__: (
- a: Element | VNode | void,
- b: VNode,
- hydrating?: boolean,
- removeOnly?: boolean,
- parentElm?: any,
- refElm?: any
- ) => any;
-
- // createElement
-
- // _c is internal that accepts `normalizationType` optimization hint
- _c: (
- vnode?: VNode,
- data?: VNodeData,
- children?: VNodeChildren,
- normalizationType?: number
- ) => VNode | void;
-
- // renderStatic
- _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren;
- // markOnce
- _o: (vnode: VNode | Array<VNode>, index: number, key: string) => VNode | VNodeChildren;
- // toString
- _s: (value: mixed) => string;
- // text to VNode
- _v: (value: string | number) => VNode;
- // toNumber
- _n: (value: string) => number | string;
- // empty vnode
- _e: () => VNode;
- // loose equal
- _q: (a: mixed, b: mixed) => boolean;
- // loose indexOf
- _i: (arr: Array<mixed>, val: mixed) => number;
- // resolveFilter
- _f: (id: string) => Function;
- // renderList
- _l: (val: mixed, render: Function) => ?Array<VNode>;
- // renderSlot
- _t: (name: string, fallback: ?Array<VNode>, props: ?Object) => ?Array<VNode>;
- // apply v-bind object
- _b: (data: any, tag: string, value: any, asProp: boolean, isSync?: boolean) => VNodeData;
- // apply v-on object
- _g: (data: any, value: any) => VNodeData;
- // check custom keyCode
- _k: (eventKeyCode: number, key: string, builtInAlias?: number | Array<number>, eventKeyName?: string) => ?boolean;
- // resolve scoped slots
- _u: (scopedSlots: ScopedSlotsData, res?: Object) => { [key: string]: Function };
-
- // SSR specific
- _ssrNode: Function;
- _ssrList: Function;
- _ssrEscape: Function;
- _ssrAttr: Function;
- _ssrAttrs: Function;
- _ssrDOMProps: Function;
- _ssrClass: Function;
- _ssrStyle: Function;
-
- // allow dynamic method registration
- [key: string]: any
-};
+++ /dev/null
-declare interface GlobalAPI {
- cid: number;
- options: Object;
- config: Config;
- util: Object;
-
- extend: (options: Object) => Function;
- set: <T>(target: Object | Array<T>, key: string | number, value: T) => T;
- delete: <T>(target: Object| Array<T>, key: string | number) => void;
- nextTick: (fn: Function, context?: Object) => void | Promise<*>;
- use: (plugin: Function | Object) => void;
- mixin: (mixin: Object) => void;
- compile: (template: string) => { render: Function, staticRenderFns: Array<Function> };
-
- directive: (id: string, def?: Function | Object) => Function | Object | void;
- component: (id: string, def?: Class<Component> | Object) => Class<Component>;
- filter: (id: string, def?: Function) => Function | void;
-
- // allow dynamic method registration
- [key: string]: any
-};
+++ /dev/null
-declare module 'he' {
- declare function escape(html: string): string;
- declare function decode(html: string): string;
-}
-
-declare module 'source-map' {
- declare class SourceMapGenerator {
- setSourceContent(filename: string, content: string): void;
- addMapping(mapping: Object): void;
- toString(): string;
- }
- declare class SourceMapConsumer {
- constructor (map: Object): void;
- originalPositionFor(position: { line: number; column: number; }): {
- source: ?string;
- line: ?number;
- column: ?number;
- };
- }
-}
-
-declare module 'lru-cache' {
- declare var exports: {
- (): any
- }
-}
-
-declare module 'de-indent' {
- declare var exports: {
- (input: string): string
- }
-}
-
-declare module 'serialize-javascript' {
- declare var exports: {
- (input: string, options: { isJSON: boolean }): string
- }
-}
-
-declare module 'lodash.template' {
- declare var exports: {
- (input: string, options: { interpolate: RegExp, escape: RegExp }): Function
- }
-}
+++ /dev/null
-declare type InternalComponentOptions = {
- _isComponent: true;
- parent: Component;
- _parentVnode: VNode;
- _parentElm: ?Node;
- _refElm: ?Node;
- render?: Function;
- staticRenderFns?: Array<Function>
-};
-
-type InjectKey = string | Symbol;
-
-declare type ComponentOptions = {
- componentId?: string;
-
- // data
- data: Object | Function | void;
- props?: { [key: string]: PropOptions };
- propsData?: ?Object;
- computed?: {
- [key: string]: Function | {
- get?: Function;
- set?: Function;
- cache?: boolean
- }
- };
- methods?: { [key: string]: Function };
- watch?: { [key: string]: Function | string };
-
- // DOM
- el?: string | Element;
- template?: string;
- render: (h: () => VNode) => VNode;
- renderError?: (h: () => VNode, err: Error) => VNode;
- staticRenderFns?: Array<() => VNode>;
-
- // lifecycle
- beforeCreate?: Function;
- created?: Function;
- beforeMount?: Function;
- mounted?: Function;
- beforeUpdate?: Function;
- updated?: Function;
- activated?: Function;
- deactivated?: Function;
- beforeDestroy?: Function;
- destroyed?: Function;
- errorCaptured?: () => boolean | void;
-
- // assets
- directives?: { [key: string]: Object };
- components?: { [key: string]: Class<Component> };
- transitions?: { [key: string]: Object };
- filters?: { [key: string]: Function };
-
- // context
- provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
- inject?: { [key: string]: InjectKey | { from?: InjectKey, default?: any }} | Array<string>;
-
- // component v-model customization
- model?: {
- prop?: string;
- event?: string;
- };
-
- // misc
- parent?: Component;
- mixins?: Array<Object>;
- name?: string;
- extends?: Class<Component> | Object;
- delimiters?: [string, string];
- comments?: boolean;
- inheritAttrs?: boolean;
-
- // private
- _isComponent?: true;
- _propKeys?: Array<string>;
- _parentVnode?: VNode;
- _parentListeners?: ?Object;
- _renderChildren?: ?Array<VNode>;
- _componentTag: ?string;
- _scopeId: ?string;
- _base: Class<Component>;
- _parentElm: ?Node;
- _refElm: ?Node;
-};
-
-declare type PropOptions = {
- type: Function | Array<Function> | null;
- default: any;
- required: ?boolean;
- validator: ?Function;
-}
+++ /dev/null
-declare type ComponentWithCacheContext = {
- type: 'ComponentWithCache';
- bufferIndex: number;
- buffer: Array<string>;
- key: string;
-};
-
-declare type ElementContext = {
- type: 'Element';
- children: Array<VNode>;
- rendered: number;
- endTag: string;
- total: number;
-};
-
-declare type ComponentContext = {
- type: 'Component';
- prevActive: Component;
-};
-
-declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext;
+++ /dev/null
-declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string;
-
-declare type VNodeComponentOptions = {
- Ctor: Class<Component>;
- propsData: ?Object;
- listeners: ?Object;
- children: ?Array<VNode>;
- tag?: string;
-};
-
-declare type MountedComponentVNode = {
- context: Component;
- componentOptions: VNodeComponentOptions;
- componentInstance: Component;
- parent: VNode;
- data: VNodeData;
-};
-
-// interface for vnodes in update modules
-declare type VNodeWithData = {
- tag: string;
- data: VNodeData;
- children: ?Array<VNode>;
- text: void;
- elm: any;
- ns: string | void;
- context: Component;
- key: string | number | void;
- parent?: VNodeWithData;
- componentOptions?: VNodeComponentOptions;
- componentInstance?: Component;
- isRootInsert: boolean;
-};
-
-declare interface VNodeData {
- key?: string | number;
- slot?: string;
- ref?: string;
- is?: string;
- pre?: boolean;
- tag?: string;
- staticClass?: string;
- class?: any;
- staticStyle?: { [key: string]: any };
- style?: Array<Object> | Object;
- normalizedStyle?: Object;
- props?: { [key: string]: any };
- attrs?: { [key: string]: string };
- domProps?: { [key: string]: any };
- hook?: { [key: string]: Function };
- on?: ?{ [key: string]: Function | Array<Function> };
- nativeOn?: { [key: string]: Function | Array<Function> };
- transition?: Object;
- show?: boolean; // marker for v-show
- inlineTemplate?: {
- render: Function;
- staticRenderFns: Array<Function>;
- };
- directives?: Array<VNodeDirective>;
- keepAlive?: boolean;
- scopedSlots?: { [key: string]: Function };
- model?: {
- value: any;
- callback: Function;
- };
-};
-
-declare type VNodeDirective = {
- name: string;
- rawName: string;
- value?: any;
- oldValue?: any;
- arg?: string;
- modifiers?: ASTModifiers;
- def?: Object;
-};
-
-declare type ScopedSlotsData = Array<{ key: string, fn: Function } | ScopedSlotsData>;
+++ /dev/null
-// global flag to be compiled away
-declare var __WEEX__: boolean;
-
-// global object in Weex
-declare var WXEnvironment: WeexEnvironment;
-
-declare type Weex = {
- config: WeexConfigAPI;
- document: WeexDocument;
- requireModule: (name: string) => Object | void;
- supports: (condition: string) => boolean | void;
- isRegisteredModule: (name: string, method?: string) => boolean;
- isRegisteredComponent: (name: string) => boolean;
-};
-
-declare type WeexConfigAPI = {
- bundleUrl: string; // === weex.document.URL
- bundleType: string;
- env: WeexEnvironment; // === WXEnvironment
-};
-
-declare type WeexEnvironment = {
- platform: string; // could be "Web", "iOS", "Android"
- weexVersion: string; // the version of WeexSDK
-
- osName: string; // could be "iOS", "Android" or others
- osVersion: string;
- appName: string; // mobile app name or browser name
- appVersion: string;
-
- // informations of current running device
- deviceModel: string; // phone device model
- deviceWidth: number;
- deviceHeight: number;
- scale: number;
-
- // only available on the web
- userAgent?: string;
- dpr?: number;
- rem?: number;
-};
-
-declare interface WeexDocument {
- id: string;
- URL: string;
- taskCenter: WeexTaskCenter;
-
- open: () => void;
- close: () => void;
- createElement: (tagName: string, props?: Object) => WeexElement;
- createComment: (text: string) => Object;
- fireEvent: (type: string) => void;
- destroy: () => void;
-};
-
-declare interface WeexTaskCenter {
- instanceId: string;
- callbackManager: Object;
- send: (type: string, params: Object, args: Array<any>, options?: Object) => void;
- registerHook: (componentId: string, type: string, hook: string, fn: Function) => void;
- updateData: (componentId: string, data: Object | void, callback?: Function) => void;
-};
-
-declare interface WeexElement {
- nodeType: number;
- nodeId: string;
- type: string;
- ref: string;
- text?: string;
-
- parentNode: WeexElement | void;
- children: Array<WeexElement>;
- previousSibling: WeexElement | void;
- nextSibling: WeexElement | void;
-
- appendChild: (node: WeexElement) => void;
- removeChild: (node: WeexElement, preserved?: boolean) => void;
- insertBefore: (node: WeexElement, before: WeexElement) => void;
- insertAfter: (node: WeexElement, after: WeexElement) => void;
- setAttr: (key: string, value: any, silent?: boolean) => void;
- setAttrs: (attrs: Object, silent?: boolean) => void;
- setStyle: (key: string, value: any, silent?: boolean) => void;
- setStyles: (attrs: Object, silent?: boolean) => void;
- addEvent: (type: string, handler: Function, args?: Array<any>) => void;
- removeEvent: (type: string) => void;
- fireEvent: (type: string) => void;
- destroy: () => void;
-};
-
-declare type WeexInstanceOption = {
- instanceId: string;
- config: WeexConfigAPI;
- document: WeexDocument;
- Vue?: GlobalAPI;
- app?: Component;
- data?: Object;
-};
-
-declare type WeexRuntimeContext = {
- weex: Weex;
- service: Object;
- BroadcastChannel?: Function;
-};
-
-declare type WeexInstanceContext = {
- Vue: GlobalAPI;
-
- // DEPRECATED
- setTimeout?: Function;
- clearTimeout?: Function;
- setInterval?: Function;
- clearInterval?: Function;
-};
-
-declare type WeexCompilerOptions = CompilerOptions & {
- // whether to compile special template for <recycle-list>
- recyclable?: boolean;
-};
-
-declare type WeexCompiledResult = CompiledResult & {
- '@render'?: string;
-};
+++ /dev/null
-{
- "name": "vue",
- "version": "2.5.16",
- "description": "Reactive, component-oriented view layer for modern web interfaces.",
- "main": "dist/vue.runtime.common.js",
- "module": "dist/vue.runtime.esm.js",
- "unpkg": "dist/vue.js",
- "jsdelivr": "dist/vue.js",
- "typings": "types/index.d.ts",
- "files": [
- "src",
- "dist/*.js",
- "types/*.d.ts"
- ],
- "scripts": {
- "dev": "rollup -w -c scripts/config.js --environment TARGET:web-full-dev",
- "dev:cjs": "rollup -w -c scripts/config.js --environment TARGET:web-runtime-cjs",
- "dev:esm": "rollup -w -c scripts/config.js --environment TARGET:web-runtime-esm",
- "dev:test": "karma start test/unit/karma.dev.config.js",
- "dev:ssr": "rollup -w -c scripts/config.js --environment TARGET:web-server-renderer",
- "dev:compiler": "rollup -w -c scripts/config.js --environment TARGET:web-compiler ",
- "dev:weex": "rollup -w -c scripts/config.js --environment TARGET:weex-framework",
- "dev:weex:factory": "rollup -w -c scripts/config.js --environment TARGET:weex-factory",
- "dev:weex:compiler": "rollup -w -c scripts/config.js --environment TARGET:weex-compiler ",
- "build": "node scripts/build.js",
- "build:ssr": "npm run build -- web-runtime-cjs,web-server-renderer",
- "build:weex": "npm run build -- weex",
- "test": "npm run lint && flow check && npm run test:types && npm run test:cover && npm run test:e2e -- --env phantomjs && npm run test:ssr && npm run test:weex",
- "test:unit": "karma start test/unit/karma.unit.config.js",
- "test:cover": "karma start test/unit/karma.cover.config.js",
- "test:e2e": "npm run build -- web-full-prod,web-server-basic-renderer && node test/e2e/runner.js",
- "test:weex": "npm run build:weex && jasmine JASMINE_CONFIG_PATH=test/weex/jasmine.json",
- "test:ssr": "npm run build:ssr && jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
- "test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2",
- "test:types": "tsc -p ./types/test/tsconfig.json",
- "lint": "eslint --fix src scripts test",
- "flow": "flow check",
- "sauce": "karma start test/unit/karma.sauce.config.js",
- "bench:ssr": "npm run build:ssr && node benchmarks/ssr/renderToString.js && node benchmarks/ssr/renderToStream.js",
- "release": "bash scripts/release.sh",
- "release:weex": "bash scripts/release-weex.sh",
- "release:note": "node scripts/gen-release-note.js",
- "commit": "git-cz"
- },
- "gitHooks": {
- "pre-commit": "lint-staged",
- "commit-msg": "node scripts/verify-commit-msg.js"
- },
- "lint-staged": {
- "*.js": [
- "eslint --fix",
- "git add"
- ]
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/vuejs/vue.git"
- },
- "keywords": [
- "vue"
- ],
- "author": "Evan You",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/vuejs/vue/issues"
- },
- "homepage": "https://github.com/vuejs/vue#readme",
- "devDependencies": {
- "@types/node": "^8.0.33",
- "@types/webpack": "^3.0.13",
- "acorn": "^5.2.1",
- "babel-core": "^6.25.0",
- "babel-eslint": "^8.0.3",
- "babel-helper-vue-jsx-merge-props": "^2.0.2",
- "babel-loader": "^7.0.0",
- "babel-plugin-istanbul": "^4.1.4",
- "babel-plugin-syntax-dynamic-import": "^6.18.0",
- "babel-plugin-syntax-jsx": "^6.18.0",
- "babel-plugin-transform-vue-jsx": "^3.4.3",
- "babel-preset-es2015": "^6.24.1",
- "babel-preset-flow-vue": "^1.0.0",
- "buble": "^0.19.3",
- "chalk": "^2.3.0",
- "chromedriver": "^2.30.1",
- "codecov": "^3.0.0",
- "commitizen": "^2.9.6",
- "conventional-changelog": "^1.1.3",
- "cross-spawn": "^5.1.0",
- "cz-conventional-changelog": "^2.0.0",
- "de-indent": "^1.0.2",
- "es6-promise": "^4.1.0",
- "escodegen": "^1.8.1",
- "eslint": "^4.13.1",
- "eslint-loader": "^1.7.1",
- "eslint-plugin-flowtype": "^2.34.0",
- "eslint-plugin-jasmine": "^2.8.4",
- "eslint-plugin-vue-libs": "^2.0.1",
- "file-loader": "^1.1.5",
- "flow-bin": "^0.61.0",
- "hash-sum": "^1.0.2",
- "he": "^1.1.1",
- "http-server": "^0.11.1",
- "jasmine": "^2.99.0",
- "jasmine-core": "^2.99.0",
- "karma": "^2.0.0",
- "karma-chrome-launcher": "^2.1.1",
- "karma-coverage": "^1.1.1",
- "karma-firefox-launcher": "^1.0.1",
- "karma-jasmine": "^1.1.0",
- "karma-mocha-reporter": "^2.2.3",
- "karma-phantomjs-launcher": "^1.0.4",
- "karma-safari-launcher": "^1.0.0",
- "karma-sauce-launcher": "^1.1.0",
- "karma-sourcemap-loader": "^0.3.7",
- "karma-webpack": "^2.0.3",
- "lint-staged": "^7.0.0",
- "lodash": "^4.17.4",
- "lodash.template": "^4.4.0",
- "lodash.uniq": "^4.5.0",
- "lru-cache": "^4.1.1",
- "nightwatch": "^0.9.16",
- "nightwatch-helpers": "^1.2.0",
- "phantomjs-prebuilt": "^2.1.14",
- "resolve": "^1.3.3",
- "rollup": "^0.54.1",
- "rollup-plugin-alias": "^1.3.1",
- "rollup-plugin-babel": "^3.0.2",
- "rollup-plugin-buble": "^0.19.2",
- "rollup-plugin-commonjs": "^8.0.0",
- "rollup-plugin-flow-no-whitespace": "^1.0.0",
- "rollup-plugin-node-resolve": "^3.0.0",
- "rollup-plugin-replace": "^2.0.0",
- "rollup-watch": "^4.0.0",
- "selenium-server": "^2.53.1",
- "serialize-javascript": "^1.3.0",
- "shelljs": "^0.8.1",
- "typescript": "^2.7.1",
- "uglify-js": "^3.0.15",
- "webpack": "^3.11.0",
- "weex-js-runtime": "^0.23.6",
- "weex-styler": "^0.3.0",
- "yorkie": "^1.0.1"
- },
- "config": {
- "commitizen": {
- "path": "./node_modules/cz-conventional-changelog"
- }
- }
-}
+++ /dev/null
-# vue-server-renderer
-
-> This package is auto-generated. For pull requests please see [src/platforms/web/entry-server-renderer.js](https://github.com/vuejs/vue/blob/dev/src/platforms/web/entry-server-renderer.js).
-
-This package offers Node.js server-side rendering for Vue 2.0.
-
-- [API Reference](https://ssr.vuejs.org/en/api.html)
-- [Vue.js Server-Side Rendering Guide](https://ssr.vuejs.org)
+++ /dev/null
-import { WebpackPlugin } from './types/plugin';
-declare const Plugin: WebpackPlugin;
-export = Plugin;
+++ /dev/null
-try {
- var vueVersion = require('vue').version
-} catch (e) {}
-
-var packageName = require('./package.json').name
-var packageVersion = require('./package.json').version
-if (vueVersion && vueVersion !== packageVersion) {
- throw new Error(
- '\n\nVue packages version mismatch:\n\n' +
- '- vue@' + vueVersion + '\n' +
- '- ' + packageName + '@' + packageVersion + '\n\n' +
- 'This may cause things to work incorrectly. Make sure to use the same version for both.\n'
- )
-}
-
-module.exports = require('./build')
+++ /dev/null
-{
- "name": "vue-server-renderer",
- "version": "2.5.16",
- "description": "server renderer for Vue 2.0",
- "main": "index.js",
- "types": "types/index.d.ts",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/vuejs/vue.git"
- },
- "keywords": [
- "vue",
- "server",
- "ssr"
- ],
- "author": "Evan You",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/vuejs/vue/issues"
- },
- "dependencies": {
- "chalk": "^1.1.3",
- "hash-sum": "^1.0.2",
- "he": "^1.1.0",
- "lodash.template": "^4.4.0",
- "lodash.uniq": "^4.5.0",
- "resolve": "^1.2.0",
- "serialize-javascript": "^1.3.0",
- "source-map": "0.5.6"
- },
- "devDependencies": {
- "vue": "file:../.."
- },
- "homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer#readme"
-}
+++ /dev/null
-import { WebpackPlugin } from './types/plugin';
-declare const Plugin: WebpackPlugin;
-export = Plugin;
+++ /dev/null
-import Vue, { VNode, VNodeDirective } from 'vue';
-import { Readable } from 'stream';
-
-export declare function createRenderer(options?: RendererOptions): Renderer;
-
-export declare function createBundleRenderer(bundle: string | object, options?: BundleRendererOptions): BundleRenderer;
-
-type RenderCallback = (err: Error | null, html: string) => void;
-
-interface Renderer {
- renderToString(vm: Vue, callback: RenderCallback): void;
- renderToString(vm: Vue, context: object, callback: RenderCallback): void;
- renderToString(vm: Vue): Promise<string>;
- renderToString(vm: Vue, context: object): Promise<string>;
-
- renderToStream(vm: Vue, context?: object): Readable;
-}
-
-interface BundleRenderer {
- renderToString(callback: RenderCallback): void;
- renderToString(context: object, callback: RenderCallback): void;
- renderToString(): Promise<string>;
- renderToString(context: object): Promise<string>;
-
- renderToStream(context?: object): Readable;
-}
-
-interface RendererOptions {
- template?: string;
- inject?: boolean;
- shouldPreload?: (file: string, type: string) => boolean;
- shouldPrefetch?: (file: string, type: string) => boolean;
- cache?: RenderCache;
- directives?: {
- [key: string]: (vnode: VNode, dir: VNodeDirective) => void
- };
-}
-
-interface BundleRendererOptions extends RendererOptions {
- clientManifest?: object;
- runInNewContext?: boolean | 'once';
- basedir?: string;
-}
-
-interface RenderCache {
- get: (key: string, cb?: (res: string) => void) => string | void;
- set: (key: string, val: string) => void;
- has?: (key: string, cb?: (hit: boolean) => void) => boolean | void;
-}
+++ /dev/null
-import { Plugin } from 'webpack';
-
-interface WebpackPluginOptions {
- filename?: string;
-}
-
-export interface WebpackPlugin {
- new (options?: WebpackPluginOptions): Plugin;
-}
+++ /dev/null
-{
- "compilerOptions": {
- "target": "es5",
- "module": "commonjs",
- "moduleResolution": "node",
- "strict": true,
- "noEmit": true
- },
- "compileOnSave": false,
- "include": [
- "**/*.ts"
- ]
-}
+++ /dev/null
-# vue-template-compiler
-
-> This package is auto-generated. For pull requests please see [src/platforms/web/entry-compiler.js](https://github.com/vuejs/vue/tree/dev/src/platforms/web/entry-compiler.js).
-
-This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions. You will only need it if you are writing build tools with very specific needs. In most cases you should be using [`vue-loader`](https://github.com/vuejs/vue-loader) or [`vueify`](https://github.com/vuejs/vueify) instead, both of which use this package internally.
-
-## Installation
-
-``` bash
-npm install vue-template-compiler
-```
-
-``` js
-const compiler = require('vue-template-compiler')
-```
-
-## API
-
-### compiler.compile(template, [options])
-
-Compiles a template string and returns compiled JavaScript code. The returned result is an object of the following format:
-
-``` js
-{
- ast: ?ASTElement, // parsed template elements to AST
- render: string, // main render function code
- staticRenderFns: Array<string>, // render code for static sub trees, if any
- errors: Array<string> // template syntax errors, if any
-}
-```
-
-Note the returned function code uses `with` and thus cannot be used in strict mode code.
-
-#### Options
-
-It's possible to hook into the compilation process to support custom template features. **However, beware that by injecting custom compile-time modules, your templates will not work with other build tools built on standard built-in modules, e.g `vue-loader` and `vueify`.**
-
-The optional `options` object can contain the following:
-
-- `modules`
-
- An array of compiler modules. For details on compiler modules, refer to the `ModuleOptions` type in [flow declarations](https://github.com/vuejs/vue/blob/dev/flow/compiler.js#L38-L45) and the [built-in modules](https://github.com/vuejs/vue/tree/dev/src/platforms/web/compiler/modules).
-
-- `directives`
-
- An object where the key is the directive name and the value is a function that transforms an template AST node. For example:
-
- ``` js
- compiler.compile('<div v-test></div>', {
- directives: {
- test (node, directiveMeta) {
- // transform node based on directiveMeta
- }
- }
- })
- ```
-
- By default, a compile-time directive will extract the directive and the directive will not be present at runtime. If you want the directive to also be handled by a runtime definition, return `true` in the transform function.
-
- Refer to the implementation of some [built-in compile-time directives](https://github.com/vuejs/vue/tree/dev/src/platforms/web/compiler/directives).
-
-- `preserveWhitespace`
-
- Defaults to `true`. This means the compiled render function preserves all whitespace characters between HTML tags. If set to `false`, whitespace between tags will be ignored. This can result in slightly better performance but may affect layout for inline elements.
-
----
-
-### compiler.compileToFunctions(template)
-
-Similar to `compiler.compile`, but directly returns instantiated functions:
-
-``` js
-{
- render: Function,
- staticRenderFns: Array<Function>
-}
-```
-
-This is only useful at runtime with pre-configured builds, so it doesn't accept any compile-time options. In addition, this method uses `new Function()` so it is not CSP-compliant.
-
----
-
-### compiler.ssrCompile(template, [options])
-
-> 2.4.0+
-
-Same as `compiler.compile` but generates SSR-specific render function code by optimizing parts of the template into string concatenation in order to improve SSR performance.
-
-This is used by default in `vue-loader@>=12` and can be disabled using the [`optimizeSSR`](https://vue-loader.vuejs.org/en/options.html#optimizessr) option.
-
----
-
-### compiler.ssrCompileToFunctions(template)
-
-> 2.4.0+
-
-Same as `compiler.compileToFunction` but generates SSR-specific render function code by optimizing parts of the template into string concatenation in order to improve SSR performance.
-
----
-
-### compiler.parseComponent(file, [options])
-
-Parse a SFC (single-file component, or `*.vue` file) into a descriptor (refer to the `SFCDescriptor` type in [flow declarations](https://github.com/vuejs/vue/blob/dev/flow/compiler.js)). This is used in SFC build tools like `vue-loader` and `vueify`.
-
-#### Options
-
-#### `pad`
-
-`pad` is useful when you are piping the extracted content into other pre-processors, as you will get correct line numbers or character indices if there are any syntax errors.
-
-- with `{ pad: "line" }`, the extracted content for each block will be prefixed with one newline for each line in the leading content from the original file to ensure that the line numbers align with the original file.
-- with `{ pad: "space" }`, the extracted content for each block will be prefixed with one space for each character in the leading content from the original file to ensure that the character count remains the same as the original file.
+++ /dev/null
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.VueTemplateCompiler = {})));
-}(this, (function (exports) { 'use strict';
-
-var splitRE = /\r?\n/g;
-var emptyRE = /^\s*$/;
-var needFixRE = /^(\r?\n)*[\t\s]/;
-
-var deIndent = function deindent (str) {
- if (!needFixRE.test(str)) {
- return str
- }
- var lines = str.split(splitRE);
- var min = Infinity;
- var type, cur, c;
- for (var i = 0; i < lines.length; i++) {
- var line = lines[i];
- if (!emptyRE.test(line)) {
- if (!type) {
- c = line.charAt(0);
- if (c === ' ' || c === '\t') {
- type = c;
- cur = count(line, type);
- if (cur < min) {
- min = cur;
- }
- } else {
- return str
- }
- } else {
- cur = count(line, type);
- if (cur < min) {
- min = cur;
- }
- }
- }
- }
- return lines.map(function (line) {
- return line.slice(min)
- }).join('\n')
-};
-
-function count (line, type) {
- var i = 0;
- while (line.charAt(i) === type) {
- i++;
- }
- return i
-}
-
-/* */
-
-var emptyObject = Object.freeze({});
-
-// these helpers produces better vm code in JS engines due to their
-// explicitness and function inlining
-function isUndef (v) {
- return v === undefined || v === null
-}
-
-
-
-
-
-
-
-/**
- * Check if value is primitive
- */
-function isPrimitive (value) {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
-}
-
-/**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
-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.
- */
-function isPlainObject (obj) {
- return _toString.call(obj) === '[object Object]'
-}
-
-
-
-/**
- * Check if val is a valid array index.
- */
-function isValidArrayIndex (val) {
- var n = parseFloat(String(val));
- return n >= 0 && Math.floor(n) === n && isFinite(val)
-}
-
-/**
- * Convert a value to a string that is actually rendered.
- */
-
-
-/**
- * Convert a input value to a number for persistence.
- * If the conversion fails, return original string.
- */
-
-
-/**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
-function makeMap (
- str,
- expectsLowerCase
-) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
-}
-
-/**
- * Check if a tag is a built-in tag.
- */
-var isBuiltInTag = makeMap('slot,component', true);
-
-/**
- * Check if a attribute is a reserved attribute.
- */
-var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
-
-/**
- * Remove an item from an array
- */
-function remove (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
-}
-
-/**
- * Check whether the object has the property.
- */
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
-}
-
-/**
- * Create a cached version of a pure function.
- */
-function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
-}
-
-/**
- * Camelize a hyphen-delimited string.
- */
-var camelizeRE = /-(\w)/g;
-var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
-});
-
-/**
- * Capitalize a string.
- */
-
-
-
-
-/**
- * Simple bind polyfill for environments that do not support it... e.g.
- * PhantomJS 1.x. Technically we don't need this anymore since native bind is
- * now more performant in most browsers, but removing it would be breaking for
- * code that was able to run in PhantomJS 1.x, so this must be kept for
- * backwards compatibility.
- */
-
-/* istanbul ignore next */
-function polyfillBind (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
-
- boundFn._length = fn.length;
- return boundFn
-}
-
-function nativeBind (fn, ctx) {
- return fn.bind(ctx)
-}
-
-var bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind;
-
-/**
- * Convert an Array-like object to a real Array.
- */
-
-
-/**
- * Mix properties into target object.
- */
-function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
-}
-
-/**
- * Merge an Array of Objects into a single Object.
- */
-
-
-/**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
- */
-function noop (a, b, c) {}
-
-/**
- * Always return false.
- */
-var no = function (a, b, c) { return false; };
-
-/**
- * Return same value
- */
-var identity = function (_) { return _; };
-
-/**
- * Generate a static keys string from compiler modules.
- */
-function genStaticKeys (modules) {
- return modules.reduce(function (keys, m) {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
-}
-
-/**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
-
-
-
-
-/**
- * Ensure a function is called only once.
- */
-
-/* */
-
-var isUnaryTag = makeMap(
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
- 'link,meta,param,source,track,wbr'
-);
-
-// Elements that you can, intentionally, leave open
-// (and which close themselves)
-var canBeLeftOpenTag = makeMap(
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
-);
-
-// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
-// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
-var isNonPhrasingTag = makeMap(
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
- 'title,tr,track'
-);
-
-/**
- * Not type-checking this file because it's mostly vendor code.
- */
-
-/*!
- * HTML Parser By John Resig (ejohn.org)
- * Modified by Juriy "kangax" Zaytsev
- * Original code by Erik Arvidsson, Mozilla Public License
- * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
- */
-
-// Regular Expressions for parsing tags and attributes
-var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
-// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
-// but for Vue templates we can enforce a simple charset
-var ncname = '[a-zA-Z_][\\w\\-\\.]*';
-var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
-var startTagOpen = new RegExp(("^<" + qnameCapture));
-var startTagClose = /^\s*(\/?)>/;
-var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
-var doctype = /^<!DOCTYPE [^>]+>/i;
-// #7298: escape - to avoid being pased as HTML comment when inlined in page
-var comment = /^<!\--/;
-var conditionalComment = /^<!\[/;
-
-var IS_REGEX_CAPTURING_BROKEN = false;
-'x'.replace(/x(.)?/g, function (m, g) {
- IS_REGEX_CAPTURING_BROKEN = g === '';
-});
-
-// Special Elements (can contain anything)
-var isPlainTextElement = makeMap('script,style,textarea', true);
-var reCache = {};
-
-var decodingMap = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&',
- ' ': '\n',
- '	': '\t'
-};
-var encodedAttr = /&(?:lt|gt|quot|amp);/g;
-var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g;
-
-// #5992
-var isIgnoreNewlineTag = makeMap('pre,textarea', true);
-var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
-
-function decodeAttr (value, shouldDecodeNewlines) {
- var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
- return value.replace(re, function (match) { return decodingMap[match]; })
-}
-
-function parseHTML (html, options) {
- var stack = [];
- var expectHTML = options.expectHTML;
- var isUnaryTag$$1 = options.isUnaryTag || no;
- var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
- var index = 0;
- var last, lastTag;
- while (html) {
- last = html;
- // Make sure we're not in a plaintext content element like script/style
- if (!lastTag || !isPlainTextElement(lastTag)) {
- var textEnd = html.indexOf('<');
- if (textEnd === 0) {
- // Comment:
- if (comment.test(html)) {
- var commentEnd = html.indexOf('-->');
-
- if (commentEnd >= 0) {
- if (options.shouldKeepComment) {
- options.comment(html.substring(4, commentEnd));
- }
- advance(commentEnd + 3);
- continue
- }
- }
-
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
- if (conditionalComment.test(html)) {
- var conditionalEnd = html.indexOf(']>');
-
- if (conditionalEnd >= 0) {
- advance(conditionalEnd + 2);
- continue
- }
- }
-
- // Doctype:
- var doctypeMatch = html.match(doctype);
- if (doctypeMatch) {
- advance(doctypeMatch[0].length);
- continue
- }
-
- // End tag:
- var endTagMatch = html.match(endTag);
- if (endTagMatch) {
- var curIndex = index;
- advance(endTagMatch[0].length);
- parseEndTag(endTagMatch[1], curIndex, index);
- continue
- }
-
- // Start tag:
- var startTagMatch = parseStartTag();
- if (startTagMatch) {
- handleStartTag(startTagMatch);
- if (shouldIgnoreFirstNewline(lastTag, html)) {
- advance(1);
- }
- continue
- }
- }
-
- var text = (void 0), rest = (void 0), next = (void 0);
- if (textEnd >= 0) {
- rest = html.slice(textEnd);
- while (
- !endTag.test(rest) &&
- !startTagOpen.test(rest) &&
- !comment.test(rest) &&
- !conditionalComment.test(rest)
- ) {
- // < in plain text, be forgiving and treat it as text
- next = rest.indexOf('<', 1);
- if (next < 0) { break }
- textEnd += next;
- rest = html.slice(textEnd);
- }
- text = html.substring(0, textEnd);
- advance(textEnd);
- }
-
- if (textEnd < 0) {
- text = html;
- html = '';
- }
-
- if (options.chars && text) {
- options.chars(text);
- }
- } else {
- var endTagLength = 0;
- var stackedTag = lastTag.toLowerCase();
- var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
- var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
- endTagLength = endTag.length;
- if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
- text = text
- .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
- }
- if (shouldIgnoreFirstNewline(stackedTag, text)) {
- text = text.slice(1);
- }
- if (options.chars) {
- options.chars(text);
- }
- return ''
- });
- index += html.length - rest$1.length;
- html = rest$1;
- parseEndTag(stackedTag, index - endTagLength, index);
- }
-
- if (html === last) {
- options.chars && options.chars(html);
- if ("development" !== 'production' && !stack.length && options.warn) {
- options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
- }
- break
- }
- }
-
- // Clean up any remaining tags
- parseEndTag();
-
- function advance (n) {
- index += n;
- html = html.substring(n);
- }
-
- function parseStartTag () {
- var start = html.match(startTagOpen);
- if (start) {
- var match = {
- tagName: start[1],
- attrs: [],
- start: index
- };
- advance(start[0].length);
- var end, attr;
- while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
- advance(attr[0].length);
- match.attrs.push(attr);
- }
- if (end) {
- match.unarySlash = end[1];
- advance(end[0].length);
- match.end = index;
- return match
- }
- }
- }
-
- function handleStartTag (match) {
- var tagName = match.tagName;
- var unarySlash = match.unarySlash;
-
- if (expectHTML) {
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
- parseEndTag(lastTag);
- }
- if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
- parseEndTag(tagName);
- }
- }
-
- var unary = isUnaryTag$$1(tagName) || !!unarySlash;
-
- var l = match.attrs.length;
- var attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- var args = match.attrs[i];
- // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
- if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
- if (args[3] === '') { delete args[3]; }
- if (args[4] === '') { delete args[4]; }
- if (args[5] === '') { delete args[5]; }
- }
- var value = args[3] || args[4] || args[5] || '';
- var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
- ? options.shouldDecodeNewlinesForHref
- : options.shouldDecodeNewlines;
- attrs[i] = {
- name: args[1],
- value: decodeAttr(value, shouldDecodeNewlines)
- };
- }
-
- if (!unary) {
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
- lastTag = tagName;
- }
-
- if (options.start) {
- options.start(tagName, attrs, unary, match.start, match.end);
- }
- }
-
- function parseEndTag (tagName, start, end) {
- var pos, lowerCasedTagName;
- if (start == null) { start = index; }
- if (end == null) { end = index; }
-
- if (tagName) {
- lowerCasedTagName = tagName.toLowerCase();
- }
-
- // Find the closest opened tag of the same type
- if (tagName) {
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
- break
- }
- }
- } else {
- // If no tag name is provided, clean shop
- pos = 0;
- }
-
- if (pos >= 0) {
- // Close all the open elements, up the stack
- for (var i = stack.length - 1; i >= pos; i--) {
- if ("development" !== 'production' &&
- (i > pos || !tagName) &&
- options.warn
- ) {
- options.warn(
- ("tag <" + (stack[i].tag) + "> has no matching end tag.")
- );
- }
- if (options.end) {
- options.end(stack[i].tag, start, end);
- }
- }
-
- // Remove the open elements from the stack
- stack.length = pos;
- lastTag = pos && stack[pos - 1].tag;
- } else if (lowerCasedTagName === 'br') {
- if (options.start) {
- options.start(tagName, [], true, start, end);
- }
- } else if (lowerCasedTagName === 'p') {
- if (options.start) {
- options.start(tagName, [], false, start, end);
- }
- if (options.end) {
- options.end(tagName, start, end);
- }
- }
- }
-}
-
-/* */
-
-var splitRE$1 = /\r?\n/g;
-var replaceRE = /./g;
-var isSpecialTag = makeMap('script,style,template', true);
-
-
-
-/**
- * Parse a single-file component (*.vue) file into an SFC Descriptor Object.
- */
-function parseComponent (
- content,
- options
-) {
- if ( options === void 0 ) options = {};
-
- var sfc = {
- template: null,
- script: null,
- styles: [],
- customBlocks: []
- };
- var depth = 0;
- var currentBlock = null;
-
- function start (
- tag,
- attrs,
- unary,
- start,
- end
- ) {
- if (depth === 0) {
- currentBlock = {
- type: tag,
- content: '',
- start: end,
- attrs: attrs.reduce(function (cumulated, ref) {
- var name = ref.name;
- var value = ref.value;
-
- cumulated[name] = value || true;
- return cumulated
- }, {})
- };
- if (isSpecialTag(tag)) {
- checkAttrs(currentBlock, attrs);
- if (tag === 'style') {
- sfc.styles.push(currentBlock);
- } else {
- sfc[tag] = currentBlock;
- }
- } else { // custom blocks
- sfc.customBlocks.push(currentBlock);
- }
- }
- if (!unary) {
- depth++;
- }
- }
-
- function checkAttrs (block, attrs) {
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (attr.name === 'lang') {
- block.lang = attr.value;
- }
- if (attr.name === 'scoped') {
- block.scoped = true;
- }
- if (attr.name === 'module') {
- block.module = attr.value || true;
- }
- if (attr.name === 'src') {
- block.src = attr.value;
- }
- }
- }
-
- function end (tag, start, end) {
- if (depth === 1 && currentBlock) {
- currentBlock.end = start;
- var text = deIndent(content.slice(currentBlock.start, currentBlock.end));
- // pad content so that linters and pre-processors can output correct
- // line numbers in errors and warnings
- if (currentBlock.type !== 'template' && options.pad) {
- text = padContent(currentBlock, options.pad) + text;
- }
- currentBlock.content = text;
- currentBlock = null;
- }
- depth--;
- }
-
- function padContent (block, pad) {
- if (pad === 'space') {
- return content.slice(0, block.start).replace(replaceRE, ' ')
- } else {
- var offset = content.slice(0, block.start).split(splitRE$1).length;
- var padChar = block.type === 'script' && !block.lang
- ? '//\n'
- : '\n';
- return Array(offset).join(padChar)
- }
- }
-
- parseHTML(content, {
- start: start,
- end: end
- });
-
- return sfc
-}
-
-/* */
-
-/**
- * Check if a string starts with $ or _
- */
-
-
-/**
- * Define a property.
- */
-function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
-}
-
-/* */
-
-// can we use __proto__?
-var hasProto = '__proto__' in {};
-
-// Browser environment sniffing
-var inBrowser = typeof window !== 'undefined';
-var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
-var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
-var UA = inBrowser && window.navigator.userAgent.toLowerCase();
-var isIE = UA && /msie|trident/.test(UA);
-var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
-var isEdge = UA && UA.indexOf('edge/') > 0;
-var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
-var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
-var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
-
-// Firefox has a "watch" function on Object.prototype...
-var nativeWatch = ({}).watch;
-
-
-if (inBrowser) {
- try {
- var opts = {};
- Object.defineProperty(opts, 'passive', ({
- get: function get () {
- /* istanbul ignore next */
-
- }
- })); // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts);
- } catch (e) {}
-}
-
-// this needs to be lazy-evaled because vue may be required before
-// vue-server-renderer can set VUE_ENV
-var _isServer;
-var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
-};
-
-// detect devtools
-var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
-/* istanbul ignore next */
-function isNative (Ctor) {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
-}
-
-var hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
-
-/* istanbul ignore if */ // $flow-disable-line
-if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
-
-} else {
- // a non-standard Set polyfill that only works with primitive keys.
-
-}
-
-var ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
-];
-
-var LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured'
-];
-
-/* */
-
-var config = ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Show production mode tip message on boot?
- */
- productionTip: "development" !== 'production',
-
- /**
- * Whether to enable devtools
- */
- devtools: "development" !== 'production',
-
- /**
- * Whether to record perf
- */
- performance: false,
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
-})
-
-/* */
-
-var warn = noop;
-var tip = noop;
-var generateComponentTrace = (noop); // work around flow check
-var formatComponentName = (noop);
-
-{
- 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 '<Root>'
- }
- 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)) + ">") : "<Anonymous>") +
- (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;
-
-/**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
-var Dep = function Dep () {
- this.id = uid++;
- this.subs = [];
-};
-
-Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
-};
-
-Dep.prototype.removeSub = function removeSub (sub) {
- remove(this.subs, sub);
-};
-
-Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
-};
-
-Dep.prototype.notify = function notify () {
- // stabilize the subscriber list first
- var subs = this.subs.slice();
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
-};
-
-// the current target watcher being evaluated.
-// this is globally unique because there could be only one
-// watcher being evaluated at any time.
-Dep.target = null;
-
-/* */
-
-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.fnContext = undefined;
- this.fnOptions = undefined;
- this.fnScopeId = 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 );
-
-
-
-
-
-// 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.
-
-/*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
-var arrayProto = Array.prototype;
-var arrayMethods = Object.create(arrayProto);
-
-var methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
-];
-
-/**
- * Intercept mutating methods and emit events
- */
-methodsToPatch.forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
-});
-
-/* */
-
-var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
-/**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
-var shouldObserve = true;
-
-
-
-/**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
-var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- var augment = hasProto
- ? protoAugment
- : copyAugment;
- augment(value, arrayMethods, arrayKeys);
- this.observeArray(value);
- } else {
- this.walk(value);
- }
-};
-
-/**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
-Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive(obj, keys[i]);
- }
-};
-
-/**
- * Observe a list of Array items.
- */
-Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
-};
-
-// helpers
-
-/**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- */
-function protoAugment (target, src, keys) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
-}
-
-/**
- * Augment an target Object or Array by defining
- * hidden properties.
- */
-/* istanbul ignore next */
-function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
-}
-
-/**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
-function observe (value, asRootData) {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
-}
-
-/**
- * Define a reactive property on an Object.
- */
-function defineReactive (
- obj,
- key,
- val,
- customSetter,
- shallow
-) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- if (!getter && arguments.length === 2) {
- val = obj[key];
- }
- var setter = property && property.set;
-
- var childOb = !shallow && observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if ("development" !== 'production' && customSetter) {
- customSetter();
- }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = !shallow && observe(newVal);
- dep.notify();
- }
- });
-}
-
-/**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
-function set (target, key, val) {
- if ("development" !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val;
- return val
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- "development" !== 'production' && warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return val
- }
- if (!ob) {
- target[key] = val;
- return val
- }
- defineReactive(ob.value, key, val);
- ob.dep.notify();
- return val
-}
-
-/**
- * Delete a property and trigger change if necessary.
- */
-
-
-/**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
-function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
-}
-
-/* */
-
-/**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
-var strats = config.optionMergeStrategies;
-
-/**
- * Options with restrictions
- */
-{
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
-}
-
-/**
- * Helper that recursively merges two data objects together.
- */
-function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
- var keys = Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
- mergeData(toVal, fromVal);
- }
- }
- return to
-}
-
-/**
- * Data
- */
-function mergeDataOrFn (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
-}
-
-strats.data = function (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- "development" !== 'production' && warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
-
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
-
- return mergeDataOrFn(parentVal, childVal, vm)
-};
-
-/**
- * Hooks and props are merged as arrays.
- */
-function mergeHook (
- parentVal,
- childVal
-) {
- return childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal
-}
-
-LIFECYCLE_HOOKS.forEach(function (hook) {
- strats[hook] = mergeHook;
-});
-
-/**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
-function mergeAssets (
- parentVal,
- childVal,
- vm,
- key
-) {
- var res = Object.create(parentVal || null);
- if (childVal) {
- "development" !== 'production' && assertObjectType(key, childVal, vm);
- return extend(res, childVal)
- } else {
- return res
- }
-}
-
-ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
-});
-
-/**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
-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) }
- {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- 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$1] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child];
- }
- return ret
-};
-
-/**
- * Other object hashes.
- */
-strats.props =
-strats.methods =
-strats.inject =
-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);
- if (childVal) { extend(ret, childVal); }
- return ret
-};
-strats.provide = mergeDataOrFn;
-
-/**
- * Default strategy.
- */
-var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
-};
-
-
-
-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.
- */
-
-
-/**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
-
-/* */
-
-/* */
-
-/* */
-/* globals MessageChannel */
-
-var callbacks = [];
-function flushCallbacks () {
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
-}
-
-// 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)) {
-
-} else if (typeof MessageChannel !== 'undefined' && (
- isNative(MessageChannel) ||
- // PhantomJS
- MessageChannel.toString() === '[object MessageChannelConstructor]'
-)) {
- var channel = new MessageChannel();
- channel.port1.onmessage = flushCallbacks;
-
-} else {
- /* istanbul ignore next */
-
-}
-
-// Determine microtask defer implementation.
-/* istanbul ignore next, $flow-disable-line */
-if (typeof Promise !== 'undefined' && isNative(Promise)) {
-
-} else {
- // fallback to macro
-
-}
-
-/**
- * Wrap a function so that if any code inside triggers state change,
- * the changes are queued using a (macro) task instead of a microtask.
- */
-
-/* */
-
-/* */
-
-// these are reserved for web because they are directly compiled away
-// during template compilation
-var isReservedAttr = makeMap('style,class');
-
-// attributes that should be using props for binding
-var acceptValue = makeMap('input,textarea,option,select,progress');
-var mustUseProp = function (tag, type, attr) {
- return (
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
- (attr === 'selected' && tag === 'option') ||
- (attr === 'checked' && tag === 'input') ||
- (attr === 'muted' && tag === 'video')
- )
-};
-
-var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
-
-var isBooleanAttr = makeMap(
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
- 'truespeed,typemustmatch,visible'
-);
-
-/* */
-
-/* */
-
-
-
-var isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template,blockquote,iframe,tfoot'
-);
-
-// this map is intentionally selective, only covering SVG elements that may
-// contain child elements.
-var isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
-);
-
-var isPreTag = function (tag) { return tag === 'pre'; };
-
-var isReservedTag = function (tag) {
- return isHTMLTag(tag) || isSVG(tag)
-};
-
-function getTagNamespace (tag) {
- if (isSVG(tag)) {
- return 'svg'
- }
- // basic support for MathML
- // note it doesn't support other MathML elements being component roots
- if (tag === 'math') {
- return 'math'
- }
-}
-
-
-
-var isTextInputType = makeMap('text,number,password,search,email,tel,url');
-
-/* */
-
-/**
- * Query an element selector if it's not an element already.
- */
-
-/* */
-
-var validDivisionCharRE = /[\w).+\-_$\]]/;
-
-function parseFilters (exp) {
- var inSingle = false;
- var inDouble = false;
- var inTemplateString = false;
- var inRegex = false;
- var curly = 0;
- var square = 0;
- var paren = 0;
- var lastFilterIndex = 0;
- var c, prev, i, expression, filters;
-
- for (i = 0; i < exp.length; i++) {
- prev = c;
- c = exp.charCodeAt(i);
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
- } else if (inDouble) {
- if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
- } else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
- } else if (inRegex) {
- if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
- } else if (
- c === 0x7C && // pipe
- exp.charCodeAt(i + 1) !== 0x7C &&
- exp.charCodeAt(i - 1) !== 0x7C &&
- !curly && !square && !paren
- ) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1;
- expression = exp.slice(0, i).trim();
- } else {
- pushFilter();
- }
- } else {
- switch (c) {
- case 0x22: inDouble = true; break // "
- case 0x27: inSingle = true; break // '
- case 0x60: inTemplateString = true; break // `
- case 0x28: paren++; break // (
- case 0x29: paren--; break // )
- case 0x5B: square++; break // [
- case 0x5D: square--; break // ]
- case 0x7B: curly++; break // {
- case 0x7D: curly--; break // }
- }
- if (c === 0x2f) { // /
- var j = i - 1;
- var p = (void 0);
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j);
- if (p !== ' ') { break }
- }
- if (!p || !validDivisionCharRE.test(p)) {
- inRegex = true;
- }
- }
- }
- }
-
- if (expression === undefined) {
- expression = exp.slice(0, i).trim();
- } else if (lastFilterIndex !== 0) {
- pushFilter();
- }
-
- function pushFilter () {
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
- lastFilterIndex = i + 1;
- }
-
- if (filters) {
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i]);
- }
- }
-
- return expression
-}
-
-function wrapFilter (exp, filter) {
- var i = filter.indexOf('(');
- if (i < 0) {
- // _f: resolveFilter
- return ("_f(\"" + filter + "\")(" + exp + ")")
- } else {
- var name = filter.slice(0, i);
- var args = filter.slice(i + 1);
- return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
- }
-}
-
-/* */
-
-var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
-var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
-
-var buildRegex = cached(function (delimiters) {
- var open = delimiters[0].replace(regexEscapeRE, '\\$&');
- var close = delimiters[1].replace(regexEscapeRE, '\\$&');
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
-});
-
-
-
-function parseText (
- text,
- delimiters
-) {
- var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
- if (!tagRE.test(text)) {
- return
- }
- var tokens = [];
- var rawTokens = [];
- var lastIndex = tagRE.lastIndex = 0;
- var match, index, tokenValue;
- while ((match = tagRE.exec(text))) {
- index = match.index;
- // push text token
- if (index > lastIndex) {
- rawTokens.push(tokenValue = text.slice(lastIndex, index));
- tokens.push(JSON.stringify(tokenValue));
- }
- // tag token
- var exp = parseFilters(match[1].trim());
- tokens.push(("_s(" + exp + ")"));
- rawTokens.push({ '@binding': exp });
- lastIndex = index + match[0].length;
- }
- if (lastIndex < text.length) {
- rawTokens.push(tokenValue = text.slice(lastIndex));
- tokens.push(JSON.stringify(tokenValue));
- }
- return {
- expression: tokens.join('+'),
- tokens: rawTokens
- }
-}
-
-/* */
-
-function baseWarn (msg) {
- console.error(("[Vue compiler]: " + msg));
-}
-
-function pluckModuleFunction (
- modules,
- key
-) {
- return modules
- ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
- : []
-}
-
-function addProp (el, name, value) {
- (el.props || (el.props = [])).push({ name: name, value: value });
- el.plain = false;
-}
-
-function addAttr (el, name, value) {
- (el.attrs || (el.attrs = [])).push({ name: name, value: value });
- el.plain = false;
-}
-
-// add a raw attr (use this in preTransforms)
-function addRawAttr (el, name, value) {
- el.attrsMap[name] = value;
- el.attrsList.push({ name: name, value: value });
-}
-
-function addDirective (
- el,
- name,
- rawName,
- value,
- arg,
- modifiers
-) {
- (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
- el.plain = false;
-}
-
-function addHandler (
- el,
- name,
- value,
- modifiers,
- important,
- warn
-) {
- modifiers = modifiers || emptyObject;
- // warn prevent and passive modifier
- /* istanbul ignore if */
- if (
- "development" !== 'production' && warn &&
- modifiers.prevent && modifiers.passive
- ) {
- warn(
- 'passive and prevent can\'t be used together. ' +
- 'Passive handler can\'t prevent default event.'
- );
- }
-
- // check capture modifier
- if (modifiers.capture) {
- delete modifiers.capture;
- name = '!' + name; // mark the event as captured
- }
- if (modifiers.once) {
- delete modifiers.once;
- name = '~' + name; // mark the event as once
- }
- /* istanbul ignore if */
- if (modifiers.passive) {
- delete modifiers.passive;
- name = '&' + name; // mark the event as passive
- }
-
- // normalize click.right and click.middle since they don't actually fire
- // this is technically browser-specific, but at least for now browsers are
- // the only target envs that have right/middle clicks.
- if (name === 'click') {
- if (modifiers.right) {
- name = 'contextmenu';
- delete modifiers.right;
- } else if (modifiers.middle) {
- name = 'mouseup';
- }
- }
-
- var events;
- if (modifiers.native) {
- delete modifiers.native;
- events = el.nativeEvents || (el.nativeEvents = {});
- } else {
- events = el.events || (el.events = {});
- }
-
- var newHandler = {
- value: value.trim()
- };
- if (modifiers !== emptyObject) {
- newHandler.modifiers = modifiers;
- }
-
- var handlers = events[name];
- /* istanbul ignore if */
- if (Array.isArray(handlers)) {
- important ? handlers.unshift(newHandler) : handlers.push(newHandler);
- } else if (handlers) {
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
- } else {
- events[name] = newHandler;
- }
-
- el.plain = false;
-}
-
-function getBindingAttr (
- el,
- name,
- getStatic
-) {
- var dynamicValue =
- getAndRemoveAttr(el, ':' + name) ||
- getAndRemoveAttr(el, 'v-bind:' + name);
- if (dynamicValue != null) {
- return parseFilters(dynamicValue)
- } else if (getStatic !== false) {
- var staticValue = getAndRemoveAttr(el, name);
- if (staticValue != null) {
- return JSON.stringify(staticValue)
- }
- }
-}
-
-// 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;
- for (var i = 0, l = list.length; i < l; i++) {
- if (list[i].name === name) {
- list.splice(i, 1);
- break
- }
- }
- }
- if (removeFromMap) {
- delete el.attrsMap[name];
- }
- return val
-}
-
-/* */
-
-function transformNode (el, options) {
- var warn = options.warn || baseWarn;
- var staticClass = getAndRemoveAttr(el, 'class');
- if ("development" !== 'production' && staticClass) {
- var res = parseText(staticClass, options.delimiters);
- if (res) {
- warn(
- "class=\"" + staticClass + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div class="{{ val }}">, use <div :class="val">.'
- );
- }
- }
- if (staticClass) {
- el.staticClass = JSON.stringify(staticClass);
- }
- var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
- if (classBinding) {
- el.classBinding = classBinding;
- }
-}
-
-function genData (el) {
- var data = '';
- if (el.staticClass) {
- data += "staticClass:" + (el.staticClass) + ",";
- }
- if (el.classBinding) {
- data += "class:" + (el.classBinding) + ",";
- }
- return data
-}
-
-var klass = {
- staticKeys: ['staticClass'],
- transformNode: transformNode,
- genData: genData
-}
-
-/* */
-
-var parseStyleText = cached(function (cssText) {
- var res = {};
- var listDelimiter = /;(?![^(]*\))/g;
- var propertyDelimiter = /:(.+)/;
- cssText.split(listDelimiter).forEach(function (item) {
- if (item) {
- var tmp = item.split(propertyDelimiter);
- tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return res
-});
-
-// normalize possible array / string values into Object
-
-
-/**
- * parent component style should be after child's
- * so that parent component's style could override it
- */
-
-/* */
-
-function transformNode$1 (el, options) {
- var warn = options.warn || baseWarn;
- var staticStyle = getAndRemoveAttr(el, 'style');
- if (staticStyle) {
- /* istanbul ignore if */
- {
- var res = parseText(staticStyle, options.delimiters);
- if (res) {
- warn(
- "style=\"" + staticStyle + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div style="{{ val }}">, use <div :style="val">.'
- );
- }
- }
- el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
- }
-
- var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
- if (styleBinding) {
- el.styleBinding = styleBinding;
- }
-}
-
-function genData$1 (el) {
- var data = '';
- if (el.staticStyle) {
- data += "staticStyle:" + (el.staticStyle) + ",";
- }
- if (el.styleBinding) {
- data += "style:(" + (el.styleBinding) + "),";
- }
- return data
-}
-
-var style = {
- staticKeys: ['staticStyle'],
- transformNode: transformNode$1,
- genData: genData$1
-}
-
-var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
-
-
-
-
-function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
-}
-
-var he = createCommonjsModule(function (module, exports) {
-/*! https://mths.be/he v1.1.1 by @mathias | MIT license */
-(function(root) {
-
- // Detect free variables `exports`.
- var freeExports = 'object' == 'object' && exports;
-
- // Detect free variable `module`.
- var freeModule = 'object' == 'object' && module &&
- module.exports == freeExports && module;
-
- // Detect free variable `global`, from Node.js or Browserified code,
- // and use it as `root`.
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
- root = freeGlobal;
- }
-
- /*--------------------------------------------------------------------------*/
-
- // All astral symbols.
- var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- // All ASCII symbols (not just printable ASCII) except those listed in the
- // first column of the overrides table.
- // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides
- var regexAsciiWhitelist = /[\x01-\x7F]/g;
- // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or
- // code points listed in the first column of the overrides table on
- // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.
- var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
-
- var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;
- var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\u25AB':'EmptyVerySmallSquare','\u25AD':'rect','\u25AE':'marker','\u25B1':'fltns','\u25B3':'xutri','\u25B4':'utrif','\u25B5':'utri','\u25B8':'rtrif','\u25B9':'rtri','\u25BD':'xdtri','\u25BE':'dtrif','\u25BF':'dtri','\u25C2':'ltrif','\u25C3':'ltri','\u25CA':'loz','\u25CB':'cir','\u25EC':'tridot','\u25EF':'xcirc','\u25F8':'ultri','\u25F9':'urtri','\u25FA':'lltri','\u25FB':'EmptySmallSquare','\u25FC':'FilledSmallSquare','\u2605':'starf','\u2606':'star','\u260E':'phone','\u2640':'female','\u2642':'male','\u2660':'spades','\u2663':'clubs','\u2665':'hearts','\u2666':'diams','\u266A':'sung','\u2713':'check','\u2717':'cross','\u2720':'malt','\u2736':'sext','\u2758':'VerticalSeparator','\u27C8':'bsolhsub','\u27C9':'suphsol','\u27F5':'xlarr','\u27F6':'xrarr','\u27F7':'xharr','\u27F8':'xlArr','\u27F9':'xrArr','\u27FA':'xhArr','\u27FC':'xmap','\u27FF':'dzigrarr','\u2902':'nvlArr','\u2903':'nvrArr','\u2904':'nvHarr','\u2905':'Map','\u290C':'lbarr','\u290D':'rbarr','\u290E':'lBarr','\u290F':'rBarr','\u2910':'RBarr','\u2911':'DDotrahd','\u2912':'UpArrowBar','\u2913':'DownArrowBar','\u2916':'Rarrtl','\u2919':'latail','\u291A':'ratail','\u291B':'lAtail','\u291C':'rAtail','\u291D':'larrfs','\u291E':'rarrfs','\u291F':'larrbfs','\u2920':'rarrbfs','\u2923':'nwarhk','\u2924':'nearhk','\u2925':'searhk','\u2926':'swarhk','\u2927':'nwnear','\u2928':'toea','\u2929':'tosa','\u292A':'swnwar','\u2933':'rarrc','\u2933\u0338':'nrarrc','\u2935':'cudarrr','\u2936':'ldca','\u2937':'rdca','\u2938':'cudarrl','\u2939':'larrpl','\u293C':'curarrm','\u293D':'cularrp','\u2945':'rarrpl','\u2948':'harrcir','\u2949':'Uarrocir','\u294A':'lurdshar','\u294B':'ldrushar','\u294E':'LeftRightVector','\u294F':'RightUpDownVector','\u2950':'DownLeftRightVector','\u2951':'LeftUpDownVector','\u2952':'LeftVectorBar','\u2953':'RightVectorBar','\u2954':'RightUpVectorBar','\u2955':'RightDownVectorBar','\u2956':'DownLeftVectorBar','\u2957':'DownRightVectorBar','\u2958':'LeftUpVectorBar','\u2959':'LeftDownVectorBar','\u295A':'LeftTeeVector','\u295B':'RightTeeVector','\u295C':'RightUpTeeVector','\u295D':'RightDownTeeVector','\u295E':'DownLeftTeeVector','\u295F':'DownRightTeeVector','\u2960':'LeftUpTeeVector','\u2961':'LeftDownTeeVector','\u2962':'lHar','\u2963':'uHar','\u2964':'rHar','\u2965':'dHar','\u2966':'luruhar','\u2967':'ldrdhar','\u2968':'ruluhar','\u2969':'rdldhar','\u296A':'lharul','\u296B':'llhard','\u296C':'rharul','\u296D':'lrhard','\u296E':'udhar','\u296F':'duhar','\u2970':'RoundImplies','\u2971':'erarr','\u2972':'simrarr','\u2973':'larrsim','\u2974':'rarrsim','\u2975':'rarrap','\u2976':'ltlarr','\u2978':'gtrarr','\u2979':'subrarr','\u297B':'suplarr','\u297C':'lfisht','\u297D':'rfisht','\u297E':'ufisht','\u297F':'dfisht','\u299A':'vzigzag','\u299C':'vangrt','\u299D':'angrtvbd','\u29A4':'ange','\u29A5':'range','\u29A6':'dwangle','\u29A7':'uwangle','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u29B0':'bemptyv','\u29B1':'demptyv','\u29B2':'cemptyv','\u29B3':'raemptyv','\u29B4':'laemptyv','\u29B5':'ohbar','\u29B6':'omid','\u29B7':'opar','\u29B9':'operp','\u29BB':'olcross','\u29BC':'odsold','\u29BE':'olcir','\u29BF':'ofcir','\u29C0':'olt','\u29C1':'ogt','\u29C2':'cirscir','\u29C3':'cirE','\u29C4':'solb','\u29C5':'bsolb','\u29C9':'boxbox','\u29CD':'trisb','\u29CE':'rtriltri','\u29CF':'LeftTriangleBar','\u29CF\u0338':'NotLeftTriangleBar','\u29D0':'RightTriangleBar','\u29D0\u0338':'NotRightTriangleBar','\u29DC':'iinfin','\u29DD':'infintie','\u29DE':'nvinfin','\u29E3':'eparsl','\u29E4':'smeparsl','\u29E5':'eqvparsl','\u29EB':'lozf','\u29F4':'RuleDelayed','\u29F6':'dsol','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A04':'xuplus','\u2A06':'xsqcup','\u2A0D':'fpartint','\u2A10':'cirfnint','\u2A11':'awint','\u2A12':'rppolint','\u2A13':'scpolint','\u2A14':'npolint','\u2A15':'pointint','\u2A16':'quatint','\u2A17':'intlarhk','\u2A22':'pluscir','\u2A23':'plusacir','\u2A24':'simplus','\u2A25':'plusdu','\u2A26':'plussim','\u2A27':'plustwo','\u2A29':'mcomma','\u2A2A':'minusdu','\u2A2D':'loplus','\u2A2E':'roplus','\u2A2F':'Cross','\u2A30':'timesd','\u2A31':'timesbar','\u2A33':'smashp','\u2A34':'lotimes','\u2A35':'rotimes','\u2A36':'otimesas','\u2A37':'Otimes','\u2A38':'odiv','\u2A39':'triplus','\u2A3A':'triminus','\u2A3B':'tritime','\u2A3C':'iprod','\u2A3F':'amalg','\u2A40':'capdot','\u2A42':'ncup','\u2A43':'ncap','\u2A44':'capand','\u2A45':'cupor','\u2A46':'cupcap','\u2A47':'capcup','\u2A48':'cupbrcap','\u2A49':'capbrcup','\u2A4A':'cupcup','\u2A4B':'capcap','\u2A4C':'ccups','\u2A4D':'ccaps','\u2A50':'ccupssm','\u2A53':'And','\u2A54':'Or','\u2A55':'andand','\u2A56':'oror','\u2A57':'orslope','\u2A58':'andslope','\u2A5A':'andv','\u2A5B':'orv','\u2A5C':'andd','\u2A5D':'ord','\u2A5F':'wedbar','\u2A66':'sdote','\u2A6A':'simdot','\u2A6D':'congdot','\u2A6D\u0338':'ncongdot','\u2A6E':'easter','\u2A6F':'apacir','\u2A70':'apE','\u2A70\u0338':'napE','\u2A71':'eplus','\u2A72':'pluse','\u2A73':'Esim','\u2A77':'eDDot','\u2A78':'equivDD','\u2A79':'ltcir','\u2A7A':'gtcir','\u2A7B':'ltquest','\u2A7C':'gtquest','\u2A7D':'les','\u2A7D\u0338':'nles','\u2A7E':'ges','\u2A7E\u0338':'nges','\u2A7F':'lesdot','\u2A80':'gesdot','\u2A81':'lesdoto','\u2A82':'gesdoto','\u2A83':'lesdotor','\u2A84':'gesdotol','\u2A85':'lap','\u2A86':'gap','\u2A87':'lne','\u2A88':'gne','\u2A89':'lnap','\u2A8A':'gnap','\u2A8B':'lEg','\u2A8C':'gEl','\u2A8D':'lsime','\u2A8E':'gsime','\u2A8F':'lsimg','\u2A90':'gsiml','\u2A91':'lgE','\u2A92':'glE','\u2A93':'lesges','\u2A94':'gesles','\u2A95':'els','\u2A96':'egs','\u2A97':'elsdot','\u2A98':'egsdot','\u2A99':'el','\u2A9A':'eg','\u2A9D':'siml','\u2A9E':'simg','\u2A9F':'simlE','\u2AA0':'simgE','\u2AA1':'LessLess','\u2AA1\u0338':'NotNestedLessLess','\u2AA2':'GreaterGreater','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA4':'glj','\u2AA5':'gla','\u2AA6':'ltcc','\u2AA7':'gtcc','\u2AA8':'lescc','\u2AA9':'gescc','\u2AAA':'smt','\u2AAB':'lat','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u2AAD':'late','\u2AAD\uFE00':'lates','\u2AAE':'bumpE','\u2AAF':'pre','\u2AAF\u0338':'npre','\u2AB0':'sce','\u2AB0\u0338':'nsce','\u2AB3':'prE','\u2AB4':'scE','\u2AB5':'prnE','\u2AB6':'scnE','\u2AB7':'prap','\u2AB8':'scap','\u2AB9':'prnap','\u2ABA':'scnap','\u2ABB':'Pr','\u2ABC':'Sc','\u2ABD':'subdot','\u2ABE':'supdot','\u2ABF':'subplus','\u2AC0':'supplus','\u2AC1':'submult','\u2AC2':'supmult','\u2AC3':'subedot','\u2AC4':'supedot','\u2AC5':'subE','\u2AC5\u0338':'nsubE','\u2AC6':'supE','\u2AC6\u0338':'nsupE','\u2AC7':'subsim','\u2AC8':'supsim','\u2ACB\uFE00':'vsubnE','\u2ACB':'subnE','\u2ACC\uFE00':'vsupnE','\u2ACC':'supnE','\u2ACF':'csub','\u2AD0':'csup','\u2AD1':'csube','\u2AD2':'csupe','\u2AD3':'subsup','\u2AD4':'supsub','\u2AD5':'subsub','\u2AD6':'supsup','\u2AD7':'suphsub','\u2AD8':'supdsub','\u2AD9':'forkv','\u2ADA':'topfork','\u2ADB':'mlcp','\u2AE4':'Dashv','\u2AE6':'Vdashl','\u2AE7':'Barv','\u2AE8':'vBar','\u2AE9':'vBarv','\u2AEB':'Vbar','\u2AEC':'Not','\u2AED':'bNot','\u2AEE':'rnmid','\u2AEF':'cirmid','\u2AF0':'midcir','\u2AF1':'topcir','\u2AF2':'nhpar','\u2AF3':'parsim','\u2AFD':'parsl','\u2AFD\u20E5':'nparsl','\u266D':'flat','\u266E':'natur','\u266F':'sharp','\xA4':'curren','\xA2':'cent','$':'dollar','\xA3':'pound','\xA5':'yen','\u20AC':'euro','\xB9':'sup1','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\xB2':'sup2','\u2154':'frac23','\u2156':'frac25','\xB3':'sup3','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\uD835\uDCB6':'ascr','\uD835\uDD52':'aopf','\uD835\uDD1E':'afr','\uD835\uDD38':'Aopf','\uD835\uDD04':'Afr','\uD835\uDC9C':'Ascr','\xAA':'ordf','\xE1':'aacute','\xC1':'Aacute','\xE0':'agrave','\xC0':'Agrave','\u0103':'abreve','\u0102':'Abreve','\xE2':'acirc','\xC2':'Acirc','\xE5':'aring','\xC5':'angst','\xE4':'auml','\xC4':'Auml','\xE3':'atilde','\xC3':'Atilde','\u0105':'aogon','\u0104':'Aogon','\u0101':'amacr','\u0100':'Amacr','\xE6':'aelig','\xC6':'AElig','\uD835\uDCB7':'bscr','\uD835\uDD53':'bopf','\uD835\uDD1F':'bfr','\uD835\uDD39':'Bopf','\u212C':'Bscr','\uD835\uDD05':'Bfr','\uD835\uDD20':'cfr','\uD835\uDCB8':'cscr','\uD835\uDD54':'copf','\u212D':'Cfr','\uD835\uDC9E':'Cscr','\u2102':'Copf','\u0107':'cacute','\u0106':'Cacute','\u0109':'ccirc','\u0108':'Ccirc','\u010D':'ccaron','\u010C':'Ccaron','\u010B':'cdot','\u010A':'Cdot','\xE7':'ccedil','\xC7':'Ccedil','\u2105':'incare','\uD835\uDD21':'dfr','\u2146':'dd','\uD835\uDD55':'dopf','\uD835\uDCB9':'dscr','\uD835\uDC9F':'Dscr','\uD835\uDD07':'Dfr','\u2145':'DD','\uD835\uDD3B':'Dopf','\u010F':'dcaron','\u010E':'Dcaron','\u0111':'dstrok','\u0110':'Dstrok','\xF0':'eth','\xD0':'ETH','\u2147':'ee','\u212F':'escr','\uD835\uDD22':'efr','\uD835\uDD56':'eopf','\u2130':'Escr','\uD835\uDD08':'Efr','\uD835\uDD3C':'Eopf','\xE9':'eacute','\xC9':'Eacute','\xE8':'egrave','\xC8':'Egrave','\xEA':'ecirc','\xCA':'Ecirc','\u011B':'ecaron','\u011A':'Ecaron','\xEB':'euml','\xCB':'Euml','\u0117':'edot','\u0116':'Edot','\u0119':'eogon','\u0118':'Eogon','\u0113':'emacr','\u0112':'Emacr','\uD835\uDD23':'ffr','\uD835\uDD57':'fopf','\uD835\uDCBB':'fscr','\uD835\uDD09':'Ffr','\uD835\uDD3D':'Fopf','\u2131':'Fscr','\uFB00':'fflig','\uFB03':'ffilig','\uFB04':'ffllig','\uFB01':'filig','fj':'fjlig','\uFB02':'fllig','\u0192':'fnof','\u210A':'gscr','\uD835\uDD58':'gopf','\uD835\uDD24':'gfr','\uD835\uDCA2':'Gscr','\uD835\uDD3E':'Gopf','\uD835\uDD0A':'Gfr','\u01F5':'gacute','\u011F':'gbreve','\u011E':'Gbreve','\u011D':'gcirc','\u011C':'Gcirc','\u0121':'gdot','\u0120':'Gdot','\u0122':'Gcedil','\uD835\uDD25':'hfr','\u210E':'planckh','\uD835\uDCBD':'hscr','\uD835\uDD59':'hopf','\u210B':'Hscr','\u210C':'Hfr','\u210D':'Hopf','\u0125':'hcirc','\u0124':'Hcirc','\u210F':'hbar','\u0127':'hstrok','\u0126':'Hstrok','\uD835\uDD5A':'iopf','\uD835\uDD26':'ifr','\uD835\uDCBE':'iscr','\u2148':'ii','\uD835\uDD40':'Iopf','\u2110':'Iscr','\u2111':'Im','\xED':'iacute','\xCD':'Iacute','\xEC':'igrave','\xCC':'Igrave','\xEE':'icirc','\xCE':'Icirc','\xEF':'iuml','\xCF':'Iuml','\u0129':'itilde','\u0128':'Itilde','\u0130':'Idot','\u012F':'iogon','\u012E':'Iogon','\u012B':'imacr','\u012A':'Imacr','\u0133':'ijlig','\u0132':'IJlig','\u0131':'imath','\uD835\uDCBF':'jscr','\uD835\uDD5B':'jopf','\uD835\uDD27':'jfr','\uD835\uDCA5':'Jscr','\uD835\uDD0D':'Jfr','\uD835\uDD41':'Jopf','\u0135':'jcirc','\u0134':'Jcirc','\u0237':'jmath','\uD835\uDD5C':'kopf','\uD835\uDCC0':'kscr','\uD835\uDD28':'kfr','\uD835\uDCA6':'Kscr','\uD835\uDD42':'Kopf','\uD835\uDD0E':'Kfr','\u0137':'kcedil','\u0136':'Kcedil','\uD835\uDD29':'lfr','\uD835\uDCC1':'lscr','\u2113':'ell','\uD835\uDD5D':'lopf','\u2112':'Lscr','\uD835\uDD0F':'Lfr','\uD835\uDD43':'Lopf','\u013A':'lacute','\u0139':'Lacute','\u013E':'lcaron','\u013D':'Lcaron','\u013C':'lcedil','\u013B':'Lcedil','\u0142':'lstrok','\u0141':'Lstrok','\u0140':'lmidot','\u013F':'Lmidot','\uD835\uDD2A':'mfr','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\uD835\uDD10':'Mfr','\uD835\uDD44':'Mopf','\u2133':'Mscr','\uD835\uDD2B':'nfr','\uD835\uDD5F':'nopf','\uD835\uDCC3':'nscr','\u2115':'Nopf','\uD835\uDCA9':'Nscr','\uD835\uDD11':'Nfr','\u0144':'nacute','\u0143':'Nacute','\u0148':'ncaron','\u0147':'Ncaron','\xF1':'ntilde','\xD1':'Ntilde','\u0146':'ncedil','\u0145':'Ncedil','\u2116':'numero','\u014B':'eng','\u014A':'ENG','\uD835\uDD60':'oopf','\uD835\uDD2C':'ofr','\u2134':'oscr','\uD835\uDCAA':'Oscr','\uD835\uDD12':'Ofr','\uD835\uDD46':'Oopf','\xBA':'ordm','\xF3':'oacute','\xD3':'Oacute','\xF2':'ograve','\xD2':'Ograve','\xF4':'ocirc','\xD4':'Ocirc','\xF6':'ouml','\xD6':'Ouml','\u0151':'odblac','\u0150':'Odblac','\xF5':'otilde','\xD5':'Otilde','\xF8':'oslash','\xD8':'Oslash','\u014D':'omacr','\u014C':'Omacr','\u0153':'oelig','\u0152':'OElig','\uD835\uDD2D':'pfr','\uD835\uDCC5':'pscr','\uD835\uDD61':'popf','\u2119':'Popf','\uD835\uDD13':'Pfr','\uD835\uDCAB':'Pscr','\uD835\uDD62':'qopf','\uD835\uDD2E':'qfr','\uD835\uDCC6':'qscr','\uD835\uDCAC':'Qscr','\uD835\uDD14':'Qfr','\u211A':'Qopf','\u0138':'kgreen','\uD835\uDD2F':'rfr','\uD835\uDD63':'ropf','\uD835\uDCC7':'rscr','\u211B':'Rscr','\u211C':'Re','\u211D':'Ropf','\u0155':'racute','\u0154':'Racute','\u0159':'rcaron','\u0158':'Rcaron','\u0157':'rcedil','\u0156':'Rcedil','\uD835\uDD64':'sopf','\uD835\uDCC8':'sscr','\uD835\uDD30':'sfr','\uD835\uDD4A':'Sopf','\uD835\uDD16':'Sfr','\uD835\uDCAE':'Sscr','\u24C8':'oS','\u015B':'sacute','\u015A':'Sacute','\u015D':'scirc','\u015C':'Scirc','\u0161':'scaron','\u0160':'Scaron','\u015F':'scedil','\u015E':'Scedil','\xDF':'szlig','\uD835\uDD31':'tfr','\uD835\uDCC9':'tscr','\uD835\uDD65':'topf','\uD835\uDCAF':'Tscr','\uD835\uDD17':'Tfr','\uD835\uDD4B':'Topf','\u0165':'tcaron','\u0164':'Tcaron','\u0163':'tcedil','\u0162':'Tcedil','\u2122':'trade','\u0167':'tstrok','\u0166':'Tstrok','\uD835\uDCCA':'uscr','\uD835\uDD66':'uopf','\uD835\uDD32':'ufr','\uD835\uDD4C':'Uopf','\uD835\uDD18':'Ufr','\uD835\uDCB0':'Uscr','\xFA':'uacute','\xDA':'Uacute','\xF9':'ugrave','\xD9':'Ugrave','\u016D':'ubreve','\u016C':'Ubreve','\xFB':'ucirc','\xDB':'Ucirc','\u016F':'uring','\u016E':'Uring','\xFC':'uuml','\xDC':'Uuml','\u0171':'udblac','\u0170':'Udblac','\u0169':'utilde','\u0168':'Utilde','\u0173':'uogon','\u0172':'Uogon','\u016B':'umacr','\u016A':'Umacr','\uD835\uDD33':'vfr','\uD835\uDD67':'vopf','\uD835\uDCCB':'vscr','\uD835\uDD19':'Vfr','\uD835\uDD4D':'Vopf','\uD835\uDCB1':'Vscr','\uD835\uDD68':'wopf','\uD835\uDCCC':'wscr','\uD835\uDD34':'wfr','\uD835\uDCB2':'Wscr','\uD835\uDD4E':'Wopf','\uD835\uDD1A':'Wfr','\u0175':'wcirc','\u0174':'Wcirc','\uD835\uDD35':'xfr','\uD835\uDCCD':'xscr','\uD835\uDD69':'xopf','\uD835\uDD4F':'Xopf','\uD835\uDD1B':'Xfr','\uD835\uDCB3':'Xscr','\uD835\uDD36':'yfr','\uD835\uDCCE':'yscr','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDD1C':'Yfr','\uD835\uDD50':'Yopf','\xFD':'yacute','\xDD':'Yacute','\u0177':'ycirc','\u0176':'Ycirc','\xFF':'yuml','\u0178':'Yuml','\uD835\uDCCF':'zscr','\uD835\uDD37':'zfr','\uD835\uDD6B':'zopf','\u2128':'Zfr','\u2124':'Zopf','\uD835\uDCB5':'Zscr','\u017A':'zacute','\u0179':'Zacute','\u017E':'zcaron','\u017D':'Zcaron','\u017C':'zdot','\u017B':'Zdot','\u01B5':'imped','\xFE':'thorn','\xDE':'THORN','\u0149':'napos','\u03B1':'alpha','\u0391':'Alpha','\u03B2':'beta','\u0392':'Beta','\u03B3':'gamma','\u0393':'Gamma','\u03B4':'delta','\u0394':'Delta','\u03B5':'epsi','\u03F5':'epsiv','\u0395':'Epsilon','\u03DD':'gammad','\u03DC':'Gammad','\u03B6':'zeta','\u0396':'Zeta','\u03B7':'eta','\u0397':'Eta','\u03B8':'theta','\u03D1':'thetav','\u0398':'Theta','\u03B9':'iota','\u0399':'Iota','\u03BA':'kappa','\u03F0':'kappav','\u039A':'Kappa','\u03BB':'lambda','\u039B':'Lambda','\u03BC':'mu','\xB5':'micro','\u039C':'Mu','\u03BD':'nu','\u039D':'Nu','\u03BE':'xi','\u039E':'Xi','\u03BF':'omicron','\u039F':'Omicron','\u03C0':'pi','\u03D6':'piv','\u03A0':'Pi','\u03C1':'rho','\u03F1':'rhov','\u03A1':'Rho','\u03C3':'sigma','\u03A3':'Sigma','\u03C2':'sigmaf','\u03C4':'tau','\u03A4':'Tau','\u03C5':'upsi','\u03A5':'Upsilon','\u03D2':'Upsi','\u03C6':'phi','\u03D5':'phiv','\u03A6':'Phi','\u03C7':'chi','\u03A7':'Chi','\u03C8':'psi','\u03A8':'Psi','\u03C9':'omega','\u03A9':'ohm','\u0430':'acy','\u0410':'Acy','\u0431':'bcy','\u0411':'Bcy','\u0432':'vcy','\u0412':'Vcy','\u0433':'gcy','\u0413':'Gcy','\u0453':'gjcy','\u0403':'GJcy','\u0434':'dcy','\u0414':'Dcy','\u0452':'djcy','\u0402':'DJcy','\u0435':'iecy','\u0415':'IEcy','\u0451':'iocy','\u0401':'IOcy','\u0454':'jukcy','\u0404':'Jukcy','\u0436':'zhcy','\u0416':'ZHcy','\u0437':'zcy','\u0417':'Zcy','\u0455':'dscy','\u0405':'DScy','\u0438':'icy','\u0418':'Icy','\u0456':'iukcy','\u0406':'Iukcy','\u0457':'yicy','\u0407':'YIcy','\u0439':'jcy','\u0419':'Jcy','\u0458':'jsercy','\u0408':'Jsercy','\u043A':'kcy','\u041A':'Kcy','\u045C':'kjcy','\u040C':'KJcy','\u043B':'lcy','\u041B':'Lcy','\u0459':'ljcy','\u0409':'LJcy','\u043C':'mcy','\u041C':'Mcy','\u043D':'ncy','\u041D':'Ncy','\u045A':'njcy','\u040A':'NJcy','\u043E':'ocy','\u041E':'Ocy','\u043F':'pcy','\u041F':'Pcy','\u0440':'rcy','\u0420':'Rcy','\u0441':'scy','\u0421':'Scy','\u0442':'tcy','\u0422':'Tcy','\u045B':'tshcy','\u040B':'TSHcy','\u0443':'ucy','\u0423':'Ucy','\u045E':'ubrcy','\u040E':'Ubrcy','\u0444':'fcy','\u0424':'Fcy','\u0445':'khcy','\u0425':'KHcy','\u0446':'tscy','\u0426':'TScy','\u0447':'chcy','\u0427':'CHcy','\u045F':'dzcy','\u040F':'DZcy','\u0448':'shcy','\u0428':'SHcy','\u0449':'shchcy','\u0429':'SHCHcy','\u044A':'hardcy','\u042A':'HARDcy','\u044B':'ycy','\u042B':'Ycy','\u044C':'softcy','\u042C':'SOFTcy','\u044D':'ecy','\u042D':'Ecy','\u044E':'yucy','\u042E':'YUcy','\u044F':'yacy','\u042F':'YAcy','\u2135':'aleph','\u2136':'beth','\u2137':'gimel','\u2138':'daleth'};
-
- var regexEscape = /["&'<>`]/g;
- var escapeMap = {
- '"': '"',
- '&': '&',
- '\'': ''',
- '<': '<',
- // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
- // following is not strictly necessary unless it’s part of a tag or an
- // unquoted attribute value. We’re only escaping it to support those
- // situations, and for XML support.
- '>': '>',
- // In Internet Explorer ≤ 8, the backtick character can be used
- // to break out of (un)quoted attribute values or HTML comments.
- // See http://html5sec.org/#102, http://html5sec.org/#108, and
- // http://html5sec.org/#133.
- '`': '`'
- };
-
- var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;
- var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g;
- var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};
- var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};
- var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};
- var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];
-
- /*--------------------------------------------------------------------------*/
-
- var stringFromCharCode = String.fromCharCode;
-
- var object = {};
- var hasOwnProperty = object.hasOwnProperty;
- var has = function(object, propertyName) {
- return hasOwnProperty.call(object, propertyName);
- };
-
- var contains = function(array, value) {
- var index = -1;
- var length = array.length;
- while (++index < length) {
- if (array[index] == value) {
- return true;
- }
- }
- return false;
- };
-
- var merge = function(options, defaults) {
- if (!options) {
- return defaults;
- }
- var result = {};
- var key;
- for (key in defaults) {
- // A `hasOwnProperty` check is not needed here, since only recognized
- // option names are used anyway. Any others are ignored.
- result[key] = has(options, key) ? options[key] : defaults[key];
- }
- return result;
- };
-
- // Modified version of `ucs2encode`; see https://mths.be/punycode.
- var codePointToSymbol = function(codePoint, strict) {
- var output = '';
- if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {
- // See issue #4:
- // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is
- // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD
- // REPLACEMENT CHARACTER.”
- if (strict) {
- parseError('character reference outside the permissible Unicode range');
- }
- return '\uFFFD';
- }
- if (has(decodeMapNumeric, codePoint)) {
- if (strict) {
- parseError('disallowed character reference');
- }
- return decodeMapNumeric[codePoint];
- }
- if (strict && contains(invalidReferenceCodePoints, codePoint)) {
- parseError('disallowed character reference');
- }
- if (codePoint > 0xFFFF) {
- codePoint -= 0x10000;
- output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
- codePoint = 0xDC00 | codePoint & 0x3FF;
- }
- output += stringFromCharCode(codePoint);
- return output;
- };
-
- var hexEscape = function(codePoint) {
- return '&#x' + codePoint.toString(16).toUpperCase() + ';';
- };
-
- var decEscape = function(codePoint) {
- return '&#' + codePoint + ';';
- };
-
- var parseError = function(message) {
- throw Error('Parse error: ' + message);
- };
-
- /*--------------------------------------------------------------------------*/
-
- var encode = function(string, options) {
- options = merge(options, encode.options);
- var strict = options.strict;
- if (strict && regexInvalidRawCodePoint.test(string)) {
- parseError('forbidden code point');
- }
- var encodeEverything = options.encodeEverything;
- var useNamedReferences = options.useNamedReferences;
- var allowUnsafeSymbols = options.allowUnsafeSymbols;
- var escapeCodePoint = options.decimal ? decEscape : hexEscape;
-
- var escapeBmpSymbol = function(symbol) {
- return escapeCodePoint(symbol.charCodeAt(0));
- };
-
- if (encodeEverything) {
- // Encode ASCII symbols.
- string = string.replace(regexAsciiWhitelist, function(symbol) {
- // Use named references if requested & possible.
- if (useNamedReferences && has(encodeMap, symbol)) {
- return '&' + encodeMap[symbol] + ';';
- }
- return escapeBmpSymbol(symbol);
- });
- // Shorten a few escapes that represent two symbols, of which at least one
- // is within the ASCII range.
- if (useNamedReferences) {
- string = string
- .replace(/>\u20D2/g, '>⃒')
- .replace(/<\u20D2/g, '<⃒')
- .replace(/fj/g, 'fj');
- }
- // Encode non-ASCII symbols.
- if (useNamedReferences) {
- // Encode non-ASCII symbols that can be replaced with a named reference.
- string = string.replace(regexEncodeNonAscii, function(string) {
- // Note: there is no need to check `has(encodeMap, string)` here.
- return '&' + encodeMap[string] + ';';
- });
- }
- // Note: any remaining non-ASCII symbols are handled outside of the `if`.
- } else if (useNamedReferences) {
- // Apply named character references.
- // Encode `<>"'&` using named character references.
- if (!allowUnsafeSymbols) {
- string = string.replace(regexEscape, function(string) {
- return '&' + encodeMap[string] + ';'; // no need to check `has()` here
- });
- }
- // Shorten escapes that represent two symbols, of which at least one is
- // `<>"'&`.
- string = string
- .replace(/>\u20D2/g, '>⃒')
- .replace(/<\u20D2/g, '<⃒');
- // Encode non-ASCII symbols that can be replaced with a named reference.
- string = string.replace(regexEncodeNonAscii, function(string) {
- // Note: there is no need to check `has(encodeMap, string)` here.
- return '&' + encodeMap[string] + ';';
- });
- } else if (!allowUnsafeSymbols) {
- // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled
- // using named character references.
- string = string.replace(regexEscape, escapeBmpSymbol);
- }
- return string
- // Encode astral symbols.
- .replace(regexAstralSymbols, function($0) {
- // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
- var high = $0.charCodeAt(0);
- var low = $0.charCodeAt(1);
- var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
- return escapeCodePoint(codePoint);
- })
- // Encode any remaining BMP symbols that are not printable ASCII symbols
- // using a hexadecimal escape.
- .replace(regexBmpWhitelist, escapeBmpSymbol);
- };
- // Expose default options (so they can be overridden globally).
- encode.options = {
- 'allowUnsafeSymbols': false,
- 'encodeEverything': false,
- 'strict': false,
- 'useNamedReferences': false,
- 'decimal' : false
- };
-
- var decode = function(html, options) {
- options = merge(options, decode.options);
- var strict = options.strict;
- if (strict && regexInvalidEntity.test(html)) {
- parseError('malformed character reference');
- }
- return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) {
- var codePoint;
- var semicolon;
- var decDigits;
- var hexDigits;
- var reference;
- var next;
- if ($1) {
- // Decode decimal escapes, e.g. `𝌆`.
- decDigits = $1;
- semicolon = $2;
- if (strict && !semicolon) {
- parseError('character reference was not terminated by a semicolon');
- }
- codePoint = parseInt(decDigits, 10);
- return codePointToSymbol(codePoint, strict);
- }
- if ($3) {
- // Decode hexadecimal escapes, e.g. `𝌆`.
- hexDigits = $3;
- semicolon = $4;
- if (strict && !semicolon) {
- parseError('character reference was not terminated by a semicolon');
- }
- codePoint = parseInt(hexDigits, 16);
- return codePointToSymbol(codePoint, strict);
- }
- if ($5) {
- // Decode named character references with trailing `;`, e.g. `©`.
- reference = $5;
- if (has(decodeMap, reference)) {
- return decodeMap[reference];
- } else {
- // Ambiguous ampersand. https://mths.be/notes/ambiguous-ampersands
- if (strict) {
- parseError(
- 'named character reference was not terminated by a semicolon'
- );
- }
- return $0;
- }
- }
- // If we’re still here, it’s a legacy reference for sure. No need for an
- // extra `if` check.
- // Decode named character references without trailing `;`, e.g. `&`
- // This is only a parse error if it gets converted to `&`, or if it is
- // followed by `=` in an attribute context.
- reference = $6;
- next = $7;
- if (next && options.isAttributeValue) {
- if (strict && next == '=') {
- parseError('`&` did not start a character reference');
- }
- return $0;
- } else {
- if (strict) {
- parseError(
- 'named character reference was not terminated by a semicolon'
- );
- }
- // Note: there is no need to check `has(decodeMapLegacy, reference)`.
- return decodeMapLegacy[reference] + (next || '');
- }
- });
- };
- // Expose default options (so they can be overridden globally).
- decode.options = {
- 'isAttributeValue': false,
- 'strict': false
- };
-
- var escape = function(string) {
- return string.replace(regexEscape, function($0) {
- // Note: there is no need to check `has(escapeMap, $0)` here.
- return escapeMap[$0];
- });
- };
-
- /*--------------------------------------------------------------------------*/
-
- var he = {
- 'version': '1.1.1',
- 'encode': encode,
- 'decode': decode,
- 'escape': escape,
- 'unescape': decode
- };
-
- // Some AMD build optimizers, like r.js, check for specific condition patterns
- // like the following:
- if (
- typeof undefined == 'function' &&
- typeof undefined.amd == 'object' &&
- undefined.amd
- ) {
- undefined(function() {
- return he;
- });
- } else if (freeExports && !freeExports.nodeType) {
- if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
- freeModule.exports = he;
- } else { // in Narwhal or RingoJS v0.7.0-
- for (var key in he) {
- has(he, key) && (freeExports[key] = he[key]);
- }
- }
- } else { // in Rhino or a web browser
- root.he = he;
- }
-
-}(commonjsGlobal));
-});
-
-/* */
-
-/**
- * Cross-platform code generation for component v-model
- */
-function genComponentModel (
- el,
- value,
- modifiers
-) {
- var ref = modifiers || {};
- var number = ref.number;
- var trim = ref.trim;
-
- var baseValueExpression = '$$v';
- var valueExpression = baseValueExpression;
- if (trim) {
- valueExpression =
- "(typeof " + baseValueExpression + " === 'string'" +
- "? " + baseValueExpression + ".trim()" +
- ": " + baseValueExpression + ")";
- }
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
- var assignment = genAssignmentCode(value, valueExpression);
-
- el.model = {
- value: ("(" + value + ")"),
- expression: ("\"" + value + "\""),
- callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
- };
-}
-
-/**
- * Cross-platform codegen helper for generating v-model value assignment code.
- */
-function genAssignmentCode (
- value,
- assignment
-) {
- var res = parseModel(value);
- if (res.key === null) {
- return (value + "=" + assignment)
- } else {
- return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
- }
-}
-
-/**
- * Parse a v-model expression into a base path and a final key segment.
- * Handles both dot-path and possible square brackets.
- *
- * Possible cases:
- *
- * - test
- * - test[key]
- * - test[test1[key]]
- * - test["a"][key]
- * - xxx.test[a[a].test1[key]]
- * - test.xxx.a["asa"][test1[key]]
- *
- */
-
-var len;
-var str;
-var chr;
-var index;
-var expressionPos;
-var expressionEndPos;
-
-
-
-function parseModel (val) {
- // Fix https://github.com/vuejs/vue/pull/7730
- // allow v-model="obj.val " (trailing whitespace)
- val = val.trim();
- len = val.length;
-
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
- index = val.lastIndexOf('.');
- if (index > -1) {
- return {
- exp: val.slice(0, index),
- key: '"' + val.slice(index + 1) + '"'
- }
- } else {
- return {
- exp: val,
- key: null
- }
- }
- }
-
- str = val;
- index = expressionPos = expressionEndPos = 0;
-
- while (!eof()) {
- chr = next();
- /* istanbul ignore if */
- if (isStringStart(chr)) {
- parseString(chr);
- } else if (chr === 0x5B) {
- parseBracket(chr);
- }
- }
-
- return {
- exp: val.slice(0, expressionPos),
- key: val.slice(expressionPos + 1, expressionEndPos)
- }
-}
-
-function next () {
- return str.charCodeAt(++index)
-}
-
-function eof () {
- return index >= len
-}
-
-function isStringStart (chr) {
- return chr === 0x22 || chr === 0x27
-}
-
-function parseBracket (chr) {
- var inBracket = 1;
- expressionPos = index;
- while (!eof()) {
- chr = next();
- if (isStringStart(chr)) {
- parseString(chr);
- continue
- }
- if (chr === 0x5B) { inBracket++; }
- if (chr === 0x5D) { inBracket--; }
- if (inBracket === 0) {
- expressionEndPos = index;
- break
- }
- }
-}
-
-function parseString (chr) {
- var stringQuote = chr;
- while (!eof()) {
- chr = next();
- if (chr === stringQuote) {
- break
- }
- }
-}
-
-/* */
-
-var onRE = /^@|^v-on:/;
-var dirRE = /^v-|^@|^:/;
-var forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/;
-var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
-var stripParensRE = /^\(|\)$/g;
-
-var argRE = /:(.*)$/;
-var bindRE = /^:|^v-bind:/;
-var modifierRE = /\.[^.]+/g;
-
-var decodeHTMLCached = cached(he.decode);
-
-// configurable state
-var warn$1;
-var delimiters;
-var transforms;
-var preTransforms;
-var postTransforms;
-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.
- */
-function parse (
- template,
- options
-) {
- warn$1 = options.warn || baseWarn;
-
- platformIsPreTag = options.isPreTag || no;
- platformMustUseProp = options.mustUseProp || no;
- platformGetTagNamespace = options.getTagNamespace || no;
-
- transforms = pluckModuleFunction(options.modules, 'transformNode');
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
-
- delimiters = options.delimiters;
-
- var stack = [];
- var preserveWhitespace = options.preserveWhitespace !== false;
- var root;
- var currentParent;
- var inVPre = false;
- var inPre = false;
- var warned = false;
-
- function warnOnce (msg) {
- if (!warned) {
- warned = true;
- warn$1(msg);
- }
- }
-
- function closeElement (element) {
- // check pre state
- if (element.pre) {
- inVPre = false;
- }
- if (platformIsPreTag(element.tag)) {
- inPre = false;
- }
- // apply post-transforms
- for (var i = 0; i < postTransforms.length; i++) {
- postTransforms[i](element, options);
- }
- }
-
- parseHTML(template, {
- warn: warn$1,
- expectHTML: options.expectHTML,
- isUnaryTag: options.isUnaryTag,
- canBeLeftOpenTag: options.canBeLeftOpenTag,
- shouldDecodeNewlines: options.shouldDecodeNewlines,
- shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
- shouldKeepComment: options.comments,
- start: function start (tag, attrs, unary) {
- // check namespace.
- // inherit parent ns if there is one
- var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
-
- // handle IE svg bug
- /* istanbul ignore if */
- if (isIE && ns === 'svg') {
- attrs = guardIESVGBug(attrs);
- }
-
- var element = createASTElement(tag, attrs, currentParent);
- if (ns) {
- element.ns = ns;
- }
-
- if (isForbiddenTag(element) && !isServerRendering()) {
- element.forbidden = true;
- "development" !== 'production' && warn$1(
- 'Templates should only be responsible for mapping the state to the ' +
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
- "<" + tag + ">" + ', as they will not be parsed.'
- );
- }
-
- // apply pre-transforms
- for (var i = 0; i < preTransforms.length; i++) {
- element = preTransforms[i](element, options) || element;
- }
-
- if (!inVPre) {
- processPre(element);
- if (element.pre) {
- inVPre = true;
- }
- }
- if (platformIsPreTag(element.tag)) {
- inPre = true;
- }
- if (inVPre) {
- processRawAttrs(element);
- } else if (!element.processed) {
- // structural directives
- processFor(element);
- processIf(element);
- processOnce(element);
- // element-scope stuff
- processElement(element, options);
- }
-
- function checkRootConstraints (el) {
- {
- if (el.tag === 'slot' || el.tag === 'template') {
- warnOnce(
- "Cannot use <" + (el.tag) + "> as component root element because it may " +
- 'contain multiple nodes.'
- );
- }
- if (el.attrsMap.hasOwnProperty('v-for')) {
- warnOnce(
- 'Cannot use v-for on stateful component root element because ' +
- 'it renders multiple elements.'
- );
- }
- }
- }
-
- // tree management
- if (!root) {
- root = element;
- checkRootConstraints(root);
- } else if (!stack.length) {
- // allow root elements with v-if, v-else-if and v-else
- if (root.if && (element.elseif || element.else)) {
- checkRootConstraints(element);
- addIfCondition(root, {
- exp: element.elseif,
- block: element
- });
- } else {
- warnOnce(
- "Component template should contain exactly one root element. " +
- "If you are using v-if on multiple elements, " +
- "use v-else-if to chain them instead."
- );
- }
- }
- if (currentParent && !element.forbidden) {
- if (element.elseif || element.else) {
- processIfConditions(element, currentParent);
- } else if (element.slotScope) { // scoped slot
- currentParent.plain = false;
- var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
- } else {
- currentParent.children.push(element);
- element.parent = currentParent;
- }
- }
- if (!unary) {
- currentParent = element;
- stack.push(element);
- } else {
- closeElement(element);
- }
- },
-
- end: function end () {
- // remove trailing whitespace
- var element = stack[stack.length - 1];
- var lastNode = element.children[element.children.length - 1];
- if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
- element.children.pop();
- }
- // pop stack
- stack.length -= 1;
- currentParent = stack[stack.length - 1];
- closeElement(element);
- },
-
- chars: function chars (text) {
- if (!currentParent) {
- {
- if (text === template) {
- warnOnce(
- 'Component template requires a root element, rather than just text.'
- );
- } else if ((text = text.trim())) {
- warnOnce(
- ("text \"" + text + "\" outside root element will be ignored.")
- );
- }
- }
- return
- }
- // IE textarea placeholder bug
- /* istanbul ignore if */
- if (isIE &&
- currentParent.tag === 'textarea' &&
- currentParent.attrsMap.placeholder === text
- ) {
- return
- }
- var children = currentParent.children;
- text = inPre || text.trim()
- ? isTextTag(currentParent) ? text : decodeHTMLCached(text)
- // only preserve whitespace if its not right after a starting tag
- : preserveWhitespace && children.length ? ' ' : '';
- if (text) {
- var res;
- if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
- children.push({
- type: 2,
- expression: res.expression,
- tokens: res.tokens,
- text: text
- });
- } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
- children.push({
- type: 3,
- text: text
- });
- }
- }
- },
- comment: function comment (text) {
- currentParent.children.push({
- type: 3,
- text: text,
- isComment: true
- });
- }
- });
- return root
-}
-
-function processPre (el) {
- if (getAndRemoveAttr(el, 'v-pre') != null) {
- el.pre = true;
- }
-}
-
-function processRawAttrs (el) {
- var l = el.attrsList.length;
- if (l) {
- var attrs = el.attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- attrs[i] = {
- name: el.attrsList[i].name,
- value: JSON.stringify(el.attrsList[i].value)
- };
- }
- } else if (!el.pre) {
- // non root node in pre blocks with no attributes
- el.plain = true;
- }
-}
-
-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) {
- if ("development" !== 'production' && el.tag === 'template') {
- warn$1("<template> cannot be keyed. Place the key on real elements instead.");
- }
- el.key = exp;
- }
-}
-
-function processRef (el) {
- var ref = getBindingAttr(el, 'ref');
- if (ref) {
- el.ref = ref;
- el.refInFor = checkInFor(el);
- }
-}
-
-function processFor (el) {
- var exp;
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
- var res = parseFor(exp);
- if (res) {
- extend(el, res);
- } else {
- warn$1(
- ("Invalid v-for expression: " + exp)
- );
- }
- }
-}
-
-
-
-function parseFor (exp) {
- var inMatch = exp.match(forAliasRE);
- if (!inMatch) { return }
- var res = {};
- res.for = inMatch[2].trim();
- var alias = inMatch[1].trim().replace(stripParensRE, '');
- var iteratorMatch = alias.match(forIteratorRE);
- if (iteratorMatch) {
- res.alias = alias.replace(forIteratorRE, '');
- res.iterator1 = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.iterator2 = iteratorMatch[2].trim();
- }
- } else {
- res.alias = alias;
- }
- return res
-}
-
-function processIf (el) {
- var exp = getAndRemoveAttr(el, 'v-if');
- if (exp) {
- el.if = exp;
- addIfCondition(el, {
- exp: exp,
- block: el
- });
- } else {
- if (getAndRemoveAttr(el, 'v-else') != null) {
- el.else = true;
- }
- var elseif = getAndRemoveAttr(el, 'v-else-if');
- if (elseif) {
- el.elseif = elseif;
- }
- }
-}
-
-function processIfConditions (el, parent) {
- var prev = findPrevElement(parent.children);
- if (prev && prev.if) {
- addIfCondition(prev, {
- exp: el.elseif,
- block: el
- });
- } else {
- warn$1(
- "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
- "used on element <" + (el.tag) + "> without corresponding v-if."
- );
- }
-}
-
-function findPrevElement (children) {
- var i = children.length;
- while (i--) {
- if (children[i].type === 1) {
- return children[i]
- } else {
- if ("development" !== 'production' && children[i].text !== ' ') {
- warn$1(
- "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
- "will be ignored."
- );
- }
- children.pop();
- }
- }
-}
-
-function addIfCondition (el, condition) {
- if (!el.ifConditions) {
- el.ifConditions = [];
- }
- el.ifConditions.push(condition);
-}
-
-function processOnce (el) {
- var once$$1 = getAndRemoveAttr(el, 'v-once');
- if (once$$1 != null) {
- el.once = true;
- }
-}
-
-function processSlot (el) {
- if (el.tag === 'slot') {
- el.slotName = getBindingAttr(el, 'name');
- if ("development" !== 'production' && el.key) {
- warn$1(
- "`key` does not work on <slot> because slots are abstract outlets " +
- "and can possibly expand into multiple elements. " +
- "Use the key on a wrapping element instead."
- );
- }
- } else {
- var slotScope;
- if (el.tag === 'template') {
- slotScope = getAndRemoveAttr(el, 'scope');
- /* istanbul ignore if */
- if ("development" !== 'production' && slotScope) {
- warn$1(
- "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 <template> to " +
- "denote scoped slots.",
- true
- );
- }
- el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
- } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
- /* istanbul ignore if */
- if ("development" !== 'production' && el.attrsMap['v-for']) {
- warn$1(
- "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
- "(v-for takes higher priority). Use a wrapper <template> for the " +
- "scoped slot to make it clearer.",
- true
- );
- }
- el.slotScope = slotScope;
- }
- var slotTarget = getBindingAttr(el, 'slot');
- if (slotTarget) {
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
- // preserve slot as an attribute for native shadow DOM compat
- // only for non-scoped slots.
- if (el.tag !== 'template' && !el.slotScope) {
- addAttr(el, 'slot', slotTarget);
- }
- }
- }
-}
-
-function processComponent (el) {
- var binding;
- if ((binding = getBindingAttr(el, 'is'))) {
- el.component = binding;
- }
- if (getAndRemoveAttr(el, 'inline-template') != null) {
- el.inlineTemplate = true;
- }
-}
-
-function processAttrs (el) {
- var list = el.attrsList;
- var i, l, name, rawName, value, modifiers, isProp;
- for (i = 0, l = list.length; i < l; i++) {
- name = rawName = list[i].name;
- value = list[i].value;
- if (dirRE.test(name)) {
- // mark element as dynamic
- el.hasBindings = true;
- // modifiers
- modifiers = parseModifiers(name);
- if (modifiers) {
- name = name.replace(modifierRE, '');
- }
- if (bindRE.test(name)) { // v-bind
- name = name.replace(bindRE, '');
- value = parseFilters(value);
- isProp = false;
- if (modifiers) {
- if (modifiers.prop) {
- isProp = true;
- name = camelize(name);
- if (name === 'innerHtml') { name = 'innerHTML'; }
- }
- if (modifiers.camel) {
- name = camelize(name);
- }
- if (modifiers.sync) {
- addHandler(
- el,
- ("update:" + (camelize(name))),
- genAssignmentCode(value, "$event")
- );
- }
- }
- if (isProp || (
- !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
- )) {
- addProp(el, name, value);
- } else {
- addAttr(el, name, value);
- }
- } else if (onRE.test(name)) { // v-on
- name = name.replace(onRE, '');
- addHandler(el, name, value, modifiers, false, warn$1);
- } else { // normal directives
- name = name.replace(dirRE, '');
- // parse arg
- var argMatch = name.match(argRE);
- var arg = argMatch && argMatch[1];
- if (arg) {
- name = name.slice(0, -(arg.length + 1));
- }
- addDirective(el, name, rawName, value, arg, modifiers);
- if ("development" !== 'production' && name === 'model') {
- checkForAliasModel(el, value);
- }
- }
- } else {
- // literal attribute
- {
- var res = parseText(value, delimiters);
- if (res) {
- warn$1(
- name + "=\"" + value + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div id="{{ val }}">, use <div :id="val">.'
- );
- }
- }
- addAttr(el, name, JSON.stringify(value));
- // #6887 firefox doesn't update muted state if set via attribute
- // even immediately after element creation
- if (!el.component &&
- name === 'muted' &&
- platformMustUseProp(el.tag, el.attrsMap.type, name)) {
- addProp(el, name, 'true');
- }
- }
- }
-}
-
-function checkInFor (el) {
- var parent = el;
- while (parent) {
- if (parent.for !== undefined) {
- return true
- }
- parent = parent.parent;
- }
- return false
-}
-
-function parseModifiers (name) {
- var match = name.match(modifierRE);
- if (match) {
- var ret = {};
- match.forEach(function (m) { ret[m.slice(1)] = true; });
- return ret
- }
-}
-
-function makeAttrsMap (attrs) {
- var map = {};
- for (var i = 0, l = attrs.length; i < l; i++) {
- if (
- "development" !== 'production' &&
- map[attrs[i].name] && !isIE && !isEdge
- ) {
- warn$1('duplicate attribute: ' + attrs[i].name);
- }
- map[attrs[i].name] = attrs[i].value;
- }
- return map
-}
-
-// for script (e.g. type="x/template") or style, do not decode content
-function isTextTag (el) {
- return el.tag === 'script' || el.tag === 'style'
-}
-
-function isForbiddenTag (el) {
- return (
- el.tag === 'style' ||
- (el.tag === 'script' && (
- !el.attrsMap.type ||
- el.attrsMap.type === 'text/javascript'
- ))
- )
-}
-
-var ieNSBug = /^xmlns:NS\d+/;
-var ieNSPrefix = /^NS\d+:/;
-
-/* istanbul ignore next */
-function guardIESVGBug (attrs) {
- var res = [];
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (!ieNSBug.test(attr.name)) {
- attr.name = attr.name.replace(ieNSPrefix, '');
- res.push(attr);
- }
- }
- return res
-}
-
-function checkForAliasModel (el, value) {
- var _el = el;
- while (_el) {
- if (_el.for && _el.alias === value) {
- warn$1(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "You are binding v-model directly to a v-for iteration alias. " +
- "This will not be able to modify the v-for source array because " +
- "writing to the alias is like modifying a function local variable. " +
- "Consider using an array of objects and use v-model on an object property instead."
- );
- }
- _el = _el.parent;
- }
-}
-
-/* */
-
-/**
- * Expand input[v-model] with dyanmic type bindings into v-if-else chains
- * Turn this:
- * <input v-model="data[type]" :type="type">
- * into this:
- * <input v-if="type === 'checkbox'" type="checkbox" v-model="data[type]">
- * <input v-else-if="type === 'radio'" type="radio" v-model="data[type]">
- * <input v-else :type="type" v-model="data[type]">
- */
-
-function preTransformNode (el, options) {
- if (el.tag === 'input') {
- var map = el.attrsMap;
- if (!map['v-model']) {
- return
- }
-
- var typeBinding;
- if (map[':type'] || map['v-bind:type']) {
- typeBinding = getBindingAttr(el, 'type');
- }
- if (!map.type && !typeBinding && map['v-bind']) {
- typeBinding = "(" + (map['v-bind']) + ").type";
- }
-
- if (typeBinding) {
- var ifCondition = getAndRemoveAttr(el, 'v-if', true);
- var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
- var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
- var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
- // 1. checkbox
- var branch0 = cloneASTElement(el);
- // process for on the main node
- processFor(branch0);
- addRawAttr(branch0, 'type', 'checkbox');
- processElement(branch0, options);
- branch0.processed = true; // prevent it from double-processed
- branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
- addIfCondition(branch0, {
- exp: branch0.if,
- block: branch0
- });
- // 2. add radio else-if condition
- var branch1 = cloneASTElement(el);
- getAndRemoveAttr(branch1, 'v-for', true);
- addRawAttr(branch1, 'type', 'radio');
- processElement(branch1, options);
- addIfCondition(branch0, {
- exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
- block: branch1
- });
- // 3. other
- var branch2 = cloneASTElement(el);
- getAndRemoveAttr(branch2, 'v-for', true);
- addRawAttr(branch2, ':type', typeBinding);
- processElement(branch2, options);
- addIfCondition(branch0, {
- exp: ifCondition,
- block: branch2
- });
-
- if (hasElse) {
- branch0.else = true;
- } else if (elseIfCondition) {
- branch0.elseif = elseIfCondition;
- }
-
- return branch0
- }
- }
-}
-
-function cloneASTElement (el) {
- return createASTElement(el.tag, el.attrsList.slice(), el.parent)
-}
-
-var model = {
- preTransformNode: preTransformNode
-}
-
-var modules = [
- klass,
- style,
- model
-]
-
-/* */
-
-var warn$2;
-
-// in some cases, the event used has to be determined at runtime
-// so we used some reserved tokens during compile.
-var RANGE_TOKEN = '__r';
-
-
-function model$1 (
- el,
- dir,
- _warn
-) {
- warn$2 = _warn;
- var value = dir.value;
- var modifiers = dir.modifiers;
- var tag = el.tag;
- var type = el.attrsMap.type;
-
- {
- // inputs with type="file" are read only and setting the input's
- // value will throw an error.
- if (tag === 'input' && type === 'file') {
- warn$2(
- "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
- "File inputs are read only. Use a v-on:change listener instead."
- );
- }
- }
-
- if (el.component) {
- genComponentModel(el, value, modifiers);
- // component v-model doesn't need extra runtime
- return false
- } else if (tag === 'select') {
- genSelect(el, value, modifiers);
- } else if (tag === 'input' && type === 'checkbox') {
- genCheckboxModel(el, value, modifiers);
- } else if (tag === 'input' && type === 'radio') {
- genRadioModel(el, value, modifiers);
- } else if (tag === 'input' || tag === 'textarea') {
- genDefaultModel(el, value, modifiers);
- } else if (!config.isReservedTag(tag)) {
- genComponentModel(el, value, modifiers);
- // component v-model doesn't need extra runtime
- return false
- } else {
- warn$2(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "v-model is not supported on this element type. " +
- 'If you are working with contenteditable, it\'s recommended to ' +
- 'wrap a library dedicated for that purpose inside a custom component.'
- );
- }
-
- // ensure runtime directive metadata
- return true
-}
-
-function genCheckboxModel (
- el,
- value,
- modifiers
-) {
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
- var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
- addProp(el, 'checked',
- "Array.isArray(" + value + ")" +
- "?_i(" + value + "," + valueBinding + ")>-1" + (
- trueValueBinding === 'true'
- ? (":(" + value + ")")
- : (":_q(" + value + "," + trueValueBinding + ")")
- )
- );
- addHandler(el, 'change',
- "var $$a=" + value + "," +
- '$$el=$event.target,' +
- "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
- 'if(Array.isArray($$a)){' +
- "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
- '$$i=_i($$a,$$v);' +
- "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
- "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
- "}else{" + (genAssignmentCode(value, '$$c')) + "}",
- null, true
- );
-}
-
-function genRadioModel (
- el,
- value,
- modifiers
-) {
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
- addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
- addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
-}
-
-function genSelect (
- el,
- value,
- modifiers
-) {
- var number = modifiers && modifiers.number;
- var selectedVal = "Array.prototype.filter" +
- ".call($event.target.options,function(o){return o.selected})" +
- ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
- "return " + (number ? '_n(val)' : 'val') + "})";
-
- var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
- var code = "var $$selectedVal = " + selectedVal + ";";
- code = code + " " + (genAssignmentCode(value, assignment));
- addHandler(el, 'change', code, null, true);
-}
-
-function genDefaultModel (
- el,
- value,
- modifiers
-) {
- var type = el.attrsMap.type;
-
- // warn if v-bind:value conflicts with v-model
- // except for inputs with v-bind:type
- {
- var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
- var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
- if (value$1 && !typeBinding) {
- var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
- warn$2(
- binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
- 'because the latter already expands to a value binding internally'
- );
- }
- }
-
- var ref = modifiers || {};
- var lazy = ref.lazy;
- var number = ref.number;
- var trim = ref.trim;
- var needCompositionGuard = !lazy && type !== 'range';
- var event = lazy
- ? 'change'
- : type === 'range'
- ? RANGE_TOKEN
- : 'input';
-
- var valueExpression = '$event.target.value';
- if (trim) {
- valueExpression = "$event.target.value.trim()";
- }
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
-
- var code = genAssignmentCode(value, valueExpression);
- if (needCompositionGuard) {
- code = "if($event.target.composing)return;" + code;
- }
-
- addProp(el, 'value', ("(" + value + ")"));
- addHandler(el, event, code, null, true);
- if (trim || number) {
- addHandler(el, 'blur', '$forceUpdate()');
- }
-}
-
-/* */
-
-function text (el, dir) {
- if (dir.value) {
- addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
- }
-}
-
-/* */
-
-function html (el, dir) {
- if (dir.value) {
- addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
- }
-}
-
-var directives = {
- model: model$1,
- text: text,
- html: html
-}
-
-/* */
-
-var baseOptions = {
- expectHTML: true,
- modules: modules,
- directives: directives,
- isPreTag: isPreTag,
- isUnaryTag: isUnaryTag,
- mustUseProp: mustUseProp,
- canBeLeftOpenTag: canBeLeftOpenTag,
- isReservedTag: isReservedTag,
- getTagNamespace: getTagNamespace,
- staticKeys: genStaticKeys(modules)
-};
-
-/* */
-
-var isStaticKey;
-var isPlatformReservedTag;
-
-var genStaticKeysCached = cached(genStaticKeys$1);
-
-/**
- * Goal of the optimizer: walk the generated template AST tree
- * and detect sub-trees that are purely static, i.e. parts of
- * the DOM that never needs to change.
- *
- * Once we detect these sub-trees, we can:
- *
- * 1. Hoist them into constants, so that we no longer need to
- * create fresh nodes for them on each re-render;
- * 2. Completely skip them in the patching process.
- */
-function optimize (root, options) {
- if (!root) { return }
- isStaticKey = genStaticKeysCached(options.staticKeys || '');
- isPlatformReservedTag = options.isReservedTag || no;
- // first pass: mark all non-static nodes.
- markStatic(root);
- // second pass: mark static roots.
- markStaticRoots(root, false);
-}
-
-function genStaticKeys$1 (keys) {
- return makeMap(
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
- (keys ? ',' + keys : '')
- )
-}
-
-function markStatic (node) {
- node.static = isStatic(node);
- if (node.type === 1) {
- // do not make component slot content static. this avoids
- // 1. components not able to mutate slot nodes
- // 2. static slot content fails for hot-reloading
- if (
- !isPlatformReservedTag(node.tag) &&
- node.tag !== 'slot' &&
- node.attrsMap['inline-template'] == null
- ) {
- return
- }
- for (var i = 0, l = node.children.length; i < l; i++) {
- var child = node.children[i];
- markStatic(child);
- if (!child.static) {
- node.static = false;
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- var block = node.ifConditions[i$1].block;
- markStatic(block);
- if (!block.static) {
- node.static = false;
- }
- }
- }
- }
-}
-
-function markStaticRoots (node, isInFor) {
- if (node.type === 1) {
- if (node.static || node.once) {
- node.staticInFor = isInFor;
- }
- // For a node to qualify as a static root, it should have children that
- // are not just static text. Otherwise the cost of hoisting out will
- // outweigh the benefits and it's better off to just always render it fresh.
- if (node.static && node.children.length && !(
- node.children.length === 1 &&
- node.children[0].type === 3
- )) {
- node.staticRoot = true;
- return
- } else {
- node.staticRoot = false;
- }
- if (node.children) {
- for (var i = 0, l = node.children.length; i < l; i++) {
- markStaticRoots(node.children[i], isInFor || !!node.for);
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- markStaticRoots(node.ifConditions[i$1].block, isInFor);
- }
- }
- }
-}
-
-function isStatic (node) {
- if (node.type === 2) { // expression
- return false
- }
- if (node.type === 3) { // text
- return true
- }
- return !!(node.pre || (
- !node.hasBindings && // no dynamic bindings
- !node.if && !node.for && // not v-if or v-for or v-else
- !isBuiltInTag(node.tag) && // not a built-in
- isPlatformReservedTag(node.tag) && // not a component
- !isDirectChildOfTemplateFor(node) &&
- Object.keys(node).every(isStaticKey)
- ))
-}
-
-function isDirectChildOfTemplateFor (node) {
- while (node.parent) {
- node = node.parent;
- if (node.tag !== 'template') {
- return false
- }
- if (node.for) {
- return true
- }
- }
- return false
-}
-
-/* */
-
-var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
-var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
-
-// KeyboardEvent.keyCode aliases
-var keyCodes = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- up: 38,
- left: 37,
- right: 39,
- down: 40,
- 'delete': [8, 46]
-};
-
-// KeyboardEvent.key aliases
-var keyNames = {
- esc: 'Escape',
- tab: 'Tab',
- enter: 'Enter',
- space: ' ',
- // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- 'delete': ['Backspace', 'Delete']
-};
-
-// #4868: modifiers that prevent the execution of the listener
-// need to explicitly return null so that we can determine whether to remove
-// the listener for .once
-var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
-
-var modifierCode = {
- stop: '$event.stopPropagation();',
- prevent: '$event.preventDefault();',
- self: genGuard("$event.target !== $event.currentTarget"),
- ctrl: genGuard("!$event.ctrlKey"),
- shift: genGuard("!$event.shiftKey"),
- alt: genGuard("!$event.altKey"),
- meta: genGuard("!$event.metaKey"),
- left: genGuard("'button' in $event && $event.button !== 0"),
- middle: genGuard("'button' in $event && $event.button !== 1"),
- right: genGuard("'button' in $event && $event.button !== 2")
-};
-
-function genHandlers (
- events,
- isNative,
- warn
-) {
- var res = isNative ? 'nativeOn:{' : 'on:{';
- for (var name in events) {
- res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
- }
- return res.slice(0, -1) + '}'
-}
-
-function genHandler (
- name,
- handler
-) {
- if (!handler) {
- return 'function(){}'
- }
-
- if (Array.isArray(handler)) {
- return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
- }
-
- var isMethodPath = simplePathRE.test(handler.value);
- var isFunctionExpression = fnExpRE.test(handler.value);
-
- if (!handler.modifiers) {
- if (isMethodPath || isFunctionExpression) {
- return handler.value
- }
- /* istanbul ignore if */
- return ("function($event){" + (handler.value) + "}") // inline statement
- } else {
- var code = '';
- var genModifierCode = '';
- var keys = [];
- for (var key in handler.modifiers) {
- if (modifierCode[key]) {
- genModifierCode += modifierCode[key];
- // left/right
- if (keyCodes[key]) {
- keys.push(key);
- }
- } else if (key === 'exact') {
- var modifiers = (handler.modifiers);
- genModifierCode += genGuard(
- ['ctrl', 'shift', 'alt', 'meta']
- .filter(function (keyModifier) { return !modifiers[keyModifier]; })
- .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
- .join('||')
- );
- } else {
- keys.push(key);
- }
- }
- if (keys.length) {
- code += genKeyFilter(keys);
- }
- // Make sure modifiers like prevent and stop get executed after key filtering
- if (genModifierCode) {
- code += genModifierCode;
- }
- var handlerCode = isMethodPath
- ? ("return " + (handler.value) + "($event)")
- : isFunctionExpression
- ? ("return (" + (handler.value) + ")($event)")
- : handler.value;
- /* istanbul ignore if */
- return ("function($event){" + code + handlerCode + "}")
- }
-}
-
-function genKeyFilter (keys) {
- return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
-}
-
-function genFilterCode (key) {
- var keyVal = parseInt(key, 10);
- if (keyVal) {
- return ("$event.keyCode!==" + keyVal)
- }
- var keyCode = keyCodes[key];
- var keyName = keyNames[key];
- return (
- "_k($event.keyCode," +
- (JSON.stringify(key)) + "," +
- (JSON.stringify(keyCode)) + "," +
- "$event.key," +
- "" + (JSON.stringify(keyName)) +
- ")"
- )
-}
-
-/* */
-
-function on (el, dir) {
- if ("development" !== 'production' && dir.modifiers) {
- warn("v-on without argument does not support modifiers.");
- }
- el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
-}
-
-/* */
-
-function bind$1 (el, dir) {
- el.wrapData = function (code) {
- return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
- };
-}
-
-/* */
-
-var baseDirectives = {
- on: on,
- bind: bind$1,
- cloak: noop
-}
-
-/* */
-
-var CodegenState = function CodegenState (options) {
- this.options = options;
- this.warn = options.warn || baseWarn;
- this.transforms = pluckModuleFunction(options.modules, 'transformCode');
- this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
- this.directives = extend(extend({}, baseDirectives), options.directives);
- var isReservedTag = options.isReservedTag || no;
- this.maybeComponent = function (el) { return !isReservedTag(el.tag); };
- this.onceId = 0;
- this.staticRenderFns = [];
-};
-
-
-
-function generate (
- ast,
- options
-) {
- var state = new CodegenState(options);
- var code = ast ? genElement(ast, state) : '_c("div")';
- return {
- render: ("with(this){return " + code + "}"),
- staticRenderFns: state.staticRenderFns
- }
-}
-
-function genElement (el, state) {
- if (el.staticRoot && !el.staticProcessed) {
- return genStatic(el, state)
- } else if (el.once && !el.onceProcessed) {
- return genOnce(el, state)
- } else if (el.for && !el.forProcessed) {
- return genFor(el, state)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return genChildren(el, state) || 'void 0'
- } else if (el.tag === 'slot') {
- return genSlot(el, state)
- } else {
- // component or element
- var code;
- if (el.component) {
- code = genComponent(el.component, el, state);
- } else {
- var data = el.plain ? undefined : genData$2(el, state);
-
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
- }
- // module transforms
- for (var i = 0; i < state.transforms.length; i++) {
- code = state.transforms[i](el, code);
- }
- return code
- }
-}
-
-// hoist static sub-trees out
-function genStatic (el, state) {
- el.staticProcessed = true;
- state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
- return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
-}
-
-// v-once
-function genOnce (el, state) {
- el.onceProcessed = true;
- if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.staticInFor) {
- var key = '';
- var parent = el.parent;
- while (parent) {
- if (parent.for) {
- key = parent.key;
- break
- }
- parent = parent.parent;
- }
- if (!key) {
- "development" !== 'production' && state.warn(
- "v-once can only be used inside v-for that is keyed. "
- );
- return genElement(el, state)
- }
- return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
- } else {
- return genStatic(el, state)
- }
-}
-
-function genIf (
- el,
- state,
- altGen,
- altEmpty
-) {
- el.ifProcessed = true; // avoid recursion
- return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
-}
-
-function genIfConditions (
- conditions,
- state,
- altGen,
- altEmpty
-) {
- if (!conditions.length) {
- return altEmpty || '_e()'
- }
-
- var condition = conditions.shift();
- if (condition.exp) {
- return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
- } else {
- return ("" + (genTernaryExp(condition.block)))
- }
-
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
- function genTernaryExp (el) {
- return altGen
- ? altGen(el, state)
- : el.once
- ? genOnce(el, state)
- : genElement(el, state)
- }
-}
-
-function genFor (
- el,
- state,
- altGen,
- altHelper
-) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
-
- if ("development" !== 'production' &&
- state.maybeComponent(el) &&
- el.tag !== 'slot' &&
- el.tag !== 'template' &&
- !el.key
- ) {
- state.warn(
- "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
- "v-for should have explicit keys. " +
- "See https://vuejs.org/guide/list.html#key for more info.",
- true /* tip */
- );
- }
-
- el.forProcessed = true; // avoid recursion
- return (altHelper || '_l') + "((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + ((altGen || genElement)(el, state)) +
- '})'
-}
-
-function genData$2 (el, state) {
- var data = '{';
-
- // directives first.
- // directives may mutate the el's other properties before they are generated.
- var dirs = genDirectives(el, state);
- if (dirs) { data += dirs + ','; }
-
- // key
- if (el.key) {
- data += "key:" + (el.key) + ",";
- }
- // ref
- if (el.ref) {
- data += "ref:" + (el.ref) + ",";
- }
- if (el.refInFor) {
- data += "refInFor:true,";
- }
- // pre
- if (el.pre) {
- data += "pre:true,";
- }
- // record original tag name for components using "is" attribute
- if (el.component) {
- data += "tag:\"" + (el.tag) + "\",";
- }
- // module data generation functions
- for (var i = 0; i < state.dataGenFns.length; i++) {
- data += state.dataGenFns[i](el);
- }
- // attributes
- if (el.attrs) {
- data += "attrs:{" + (genProps(el.attrs)) + "},";
- }
- // DOM props
- if (el.props) {
- data += "domProps:{" + (genProps(el.props)) + "},";
- }
- // event handlers
- if (el.events) {
- data += (genHandlers(el.events, false, state.warn)) + ",";
- }
- if (el.nativeEvents) {
- data += (genHandlers(el.nativeEvents, true, state.warn)) + ",";
- }
- // slot target
- // only for non-scoped slots
- if (el.slotTarget && !el.slotScope) {
- data += "slot:" + (el.slotTarget) + ",";
- }
- // scoped slots
- if (el.scopedSlots) {
- data += (genScopedSlots(el.scopedSlots, state)) + ",";
- }
- // component v-model
- if (el.model) {
- data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
- }
- // inline-template
- if (el.inlineTemplate) {
- var inlineTemplate = genInlineTemplate(el, state);
- if (inlineTemplate) {
- data += inlineTemplate + ",";
- }
- }
- data = data.replace(/,$/, '') + '}';
- // v-bind data wrap
- if (el.wrapData) {
- data = el.wrapData(data);
- }
- // v-on data wrap
- if (el.wrapListeners) {
- data = el.wrapListeners(data);
- }
- return data
-}
-
-function genDirectives (el, state) {
- var dirs = el.directives;
- if (!dirs) { return }
- var res = 'directives:[';
- var hasRuntime = false;
- var i, l, dir, needRuntime;
- for (i = 0, l = dirs.length; i < l; i++) {
- dir = dirs[i];
- needRuntime = true;
- var gen = state.directives[dir.name];
- if (gen) {
- // compile-time directive that manipulates AST.
- // returns true if it also needs a runtime counterpart.
- needRuntime = !!gen(el, dir, state.warn);
- }
- if (needRuntime) {
- hasRuntime = true;
- res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
- }
- }
- if (hasRuntime) {
- return res.slice(0, -1) + ']'
- }
-}
-
-function genInlineTemplate (el, state) {
- var ast = el.children[0];
- if ("development" !== 'production' && (
- el.children.length !== 1 || ast.type !== 1
- )) {
- state.warn('Inline-template components must have exactly one child element.');
- }
- if (ast.type === 1) {
- var inlineRenderFns = generate(ast, state.options);
- return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
- }
-}
-
-function genScopedSlots (
- slots,
- state
-) {
- return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
- return genScopedSlot(key, slots[key], state)
- }).join(',')) + "])")
-}
-
-function genScopedSlot (
- key,
- el,
- state
-) {
- if (el.for && !el.forProcessed) {
- return genForScopedSlot(key, el, state)
- }
- var fn = "function(" + (String(el.slotScope)) + "){" +
- "return " + (el.tag === 'template'
- ? el.if
- ? ((el.if) + "?" + (genChildren(el, state) || 'undefined') + ":undefined")
- : genChildren(el, state) || 'undefined'
- : genElement(el, state)) + "}";
- return ("{key:" + key + ",fn:" + fn + "}")
-}
-
-function genForScopedSlot (
- key,
- el,
- state
-) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
- el.forProcessed = true; // avoid recursion
- return "_l((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + (genScopedSlot(key, el, state)) +
- '})'
-}
-
-function genChildren (
- el,
- state,
- checkSkip,
- altGenElement,
- altGenNode
-) {
- var children = el.children;
- if (children.length) {
- var el$1 = children[0];
- // optimize single v-for
- if (children.length === 1 &&
- el$1.for &&
- el$1.tag !== 'template' &&
- el$1.tag !== 'slot'
- ) {
- return (altGenElement || genElement)(el$1, state)
- }
- var normalizationType = checkSkip
- ? getNormalizationType(children, state.maybeComponent)
- : 0;
- var gen = altGenNode || genNode;
- return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
- }
-}
-
-// determine the normalization needed for the children array.
-// 0: no normalization needed
-// 1: simple normalization needed (possible 1-level deep nested array)
-// 2: full normalization needed
-function getNormalizationType (
- children,
- maybeComponent
-) {
- var res = 0;
- for (var i = 0; i < children.length; i++) {
- var el = children[i];
- if (el.type !== 1) {
- continue
- }
- if (needsNormalization(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
- res = 2;
- break
- }
- if (maybeComponent(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
- res = 1;
- }
- }
- return res
-}
-
-function needsNormalization (el) {
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
-}
-
-function genNode (node, state) {
- if (node.type === 1) {
- return genElement(node, state)
- } if (node.type === 3 && node.isComment) {
- return genComment(node)
- } else {
- return genText(node)
- }
-}
-
-function genText (text) {
- return ("_v(" + (text.type === 2
- ? text.expression // no need for () because already wrapped in _s()
- : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
-}
-
-function genComment (comment) {
- return ("_e(" + (JSON.stringify(comment.text)) + ")")
-}
-
-function genSlot (el, state) {
- var slotName = el.slotName || '"default"';
- var children = genChildren(el, state);
- var res = "_t(" + slotName + (children ? ("," + children) : '');
- var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
- var bind$$1 = el.attrsMap['v-bind'];
- if ((attrs || bind$$1) && !children) {
- res += ",null";
- }
- if (attrs) {
- res += "," + attrs;
- }
- if (bind$$1) {
- res += (attrs ? '' : ',null') + "," + bind$$1;
- }
- return res + ')'
-}
-
-// componentName is el.component, take it as argument to shun flow's pessimistic refinement
-function genComponent (
- componentName,
- el,
- state
-) {
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
-}
-
-function genProps (props) {
- var res = '';
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- /* istanbul ignore if */
- {
- res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
- }
- }
- return res.slice(0, -1)
-}
-
-// #3895, #4268
-function transformSpecialNewlines (text) {
- return text
- .replace(/\u2028/g, '\\u2028')
- .replace(/\u2029/g, '\\u2029')
-}
-
-/* */
-
-// these keywords should not appear inside expressions, but operators like
-// typeof, instanceof and in are allowed
-var prohibitedKeywordRE = new RegExp('\\b' + (
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments'
-).split(',').join('\\b|\\b') + '\\b');
-
-// these unary operators should not be used as property/method names
-var unaryOperatorsRE = new RegExp('\\b' + (
- 'delete,typeof,void'
-).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
-
-// strip strings in expressions
-var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
-
-// detect problematic expressions in a template
-function detectErrors (ast) {
- var errors = [];
- if (ast) {
- checkNode(ast, errors);
- }
- return errors
-}
-
-function checkNode (node, errors) {
- if (node.type === 1) {
- for (var name in node.attrsMap) {
- if (dirRE.test(name)) {
- var value = node.attrsMap[name];
- if (value) {
- if (name === 'v-for') {
- checkFor(node, ("v-for=\"" + value + "\""), errors);
- } else if (onRE.test(name)) {
- checkEvent(value, (name + "=\"" + value + "\""), errors);
- } else {
- checkExpression(value, (name + "=\"" + value + "\""), errors);
- }
- }
- }
- }
- if (node.children) {
- for (var i = 0; i < node.children.length; i++) {
- checkNode(node.children[i], errors);
- }
- }
- } else if (node.type === 2) {
- checkExpression(node.expression, node.text, errors);
- }
-}
-
-function checkEvent (exp, text, errors) {
- var stipped = exp.replace(stripStringRE, '');
- var keywordMatch = stipped.match(unaryOperatorsRE);
- if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
- errors.push(
- "avoid using JavaScript unary operator as property name: " +
- "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
- );
- }
- checkExpression(exp, text, errors);
-}
-
-function checkFor (node, text, errors) {
- checkExpression(node.for || '', text, errors);
- checkIdentifier(node.alias, 'v-for alias', text, errors);
- checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
- checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
-}
-
-function checkIdentifier (
- ident,
- type,
- text,
- errors
-) {
- if (typeof ident === 'string') {
- try {
- new Function(("var " + ident + "=_"));
- } catch (e) {
- errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
- }
- }
-}
-
-function checkExpression (exp, text, errors) {
- try {
- new Function(("return " + exp));
- } catch (e) {
- var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
- if (keywordMatch) {
- errors.push(
- "avoid using JavaScript keyword as property name: " +
- "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim())
- );
- } else {
- errors.push(
- "invalid expression: " + (e.message) + " in\n\n" +
- " " + exp + "\n\n" +
- " Raw expression: " + (text.trim()) + "\n"
- );
- }
- }
-}
-
-/* */
-
-function createFunction (code, errors) {
- try {
- return new Function(code)
- } catch (err) {
- errors.push({ err: err, code: code });
- return noop
- }
-}
-
-function createCompileToFunctionFn (compile) {
- var cache = Object.create(null);
-
- return function compileToFunctions (
- template,
- options,
- vm
- ) {
- options = extend({}, options);
- var warn$$1 = options.warn || warn;
- delete options.warn;
-
- /* istanbul ignore if */
- {
- // detect possible CSP restriction
- try {
- new Function('return 1');
- } catch (e) {
- if (e.toString().match(/unsafe-eval|CSP/)) {
- warn$$1(
- 'It seems you are using the standalone build of Vue.js in an ' +
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
- 'The template compiler cannot work in this environment. Consider ' +
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
- 'templates into render functions.'
- );
- }
- }
- }
-
- // check cache
- var key = options.delimiters
- ? String(options.delimiters) + template
- : template;
- if (cache[key]) {
- return cache[key]
- }
-
- // compile
- var compiled = compile(template, options);
-
- // check compilation errors/tips
- {
- if (compiled.errors && compiled.errors.length) {
- warn$$1(
- "Error compiling template:\n\n" + template + "\n\n" +
- compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
- vm
- );
- }
- if (compiled.tips && compiled.tips.length) {
- compiled.tips.forEach(function (msg) { return tip(msg, vm); });
- }
- }
-
- // turn code into functions
- var res = {};
- var fnGenErrors = [];
- res.render = createFunction(compiled.render, fnGenErrors);
- res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
- return createFunction(code, fnGenErrors)
- });
-
- // check function generation errors.
- // this should only happen if there is a bug in the compiler itself.
- // mostly for codegen development use
- /* istanbul ignore if */
- {
- if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
- warn$$1(
- "Failed to generate render function:\n\n" +
- fnGenErrors.map(function (ref) {
- var err = ref.err;
- var code = ref.code;
-
- return ((err.toString()) + " in\n\n" + code + "\n");
- }).join('\n'),
- vm
- );
- }
- }
-
- return (cache[key] = res)
- }
-}
-
-/* */
-
-function createCompilerCreator (baseCompile) {
- return function createCompiler (baseOptions) {
- function compile (
- template,
- options
- ) {
- var finalOptions = Object.create(baseOptions);
- var errors = [];
- var tips = [];
- finalOptions.warn = function (msg, tip) {
- (tip ? tips : errors).push(msg);
- };
-
- if (options) {
- // merge custom modules
- if (options.modules) {
- finalOptions.modules =
- (baseOptions.modules || []).concat(options.modules);
- }
- // merge custom directives
- if (options.directives) {
- finalOptions.directives = extend(
- Object.create(baseOptions.directives || null),
- options.directives
- );
- }
- // copy other options
- for (var key in options) {
- if (key !== 'modules' && key !== 'directives') {
- finalOptions[key] = options[key];
- }
- }
- }
-
- var compiled = baseCompile(template, finalOptions);
- {
- errors.push.apply(errors, detectErrors(compiled.ast));
- }
- compiled.errors = errors;
- compiled.tips = tips;
- return compiled
- }
-
- return {
- compile: compile,
- compileToFunctions: createCompileToFunctionFn(compile)
- }
- }
-}
-
-/* */
-
-// `createCompilerCreator` allows creating compilers that use alternative
-// parser/optimizer/codegen, e.g the SSR optimizing compiler.
-// Here we just export a default compiler using the default parts.
-var createCompiler = createCompilerCreator(function baseCompile (
- template,
- options
-) {
- var ast = parse(template.trim(), options);
- if (options.optimize !== false) {
- optimize(ast, options);
- }
- var code = generate(ast, options);
- return {
- ast: ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
-});
-
-/* */
-
-var ref = createCompiler(baseOptions);
-var compile = ref.compile;
-var compileToFunctions = ref.compileToFunctions;
-
-/* */
-
-var isAttr = makeMap(
- 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
- 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
- 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' +
- 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' +
- 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' +
- 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' +
- 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
- 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
- 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
- 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
- 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
- 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
- 'target,title,type,usemap,value,width,wrap'
-);
-
-/* istanbul ignore next */
-var isRenderableAttr = function (name) {
- return (
- isAttr(name) ||
- name.indexOf('data-') === 0 ||
- name.indexOf('aria-') === 0
- )
-};
-var propsToAttrMap = {
- acceptCharset: 'accept-charset',
- className: 'class',
- htmlFor: 'for',
- httpEquiv: 'http-equiv'
-};
-
-var ESC = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&'
-};
-
-function escape (s) {
- return s.replace(/[<>"&]/g, escapeChar)
-}
-
-function escapeChar (a) {
- return ESC[a] || a
-}
-
-/* */
-
-var plainStringRE = /^"(?:[^"\\]|\\.)*"$|^'(?:[^'\\]|\\.)*'$/;
-
-// let the model AST transform translate v-model into appropriate
-// props bindings
-function applyModelTransform (el, state) {
- if (el.directives) {
- for (var i = 0; i < el.directives.length; i++) {
- var dir = el.directives[i];
- if (dir.name === 'model') {
- state.directives.model(el, dir, state.warn);
- // remove value for textarea as its converted to text
- if (el.tag === 'textarea' && el.props) {
- el.props = el.props.filter(function (p) { return p.name !== 'value'; });
- }
- break
- }
- }
- }
-}
-
-function genAttrSegments (
- attrs
-) {
- return attrs.map(function (ref) {
- var name = ref.name;
- var value = ref.value;
-
- return genAttrSegment(name, value);
- })
-}
-
-function genDOMPropSegments (
- props,
- attrs
-) {
- var segments = [];
- props.forEach(function (ref) {
- var name = ref.name;
- var value = ref.value;
-
- name = propsToAttrMap[name] || name.toLowerCase();
- if (isRenderableAttr(name) &&
- !(attrs && attrs.some(function (a) { return a.name === name; }))
- ) {
- segments.push(genAttrSegment(name, value));
- }
- });
- return segments
-}
-
-function genAttrSegment (name, value) {
- if (plainStringRE.test(value)) {
- // force double quote
- value = value.replace(/^'|'$/g, '"');
- // force enumerated attr to "true"
- if (isEnumeratedAttr(name) && value !== "\"false\"") {
- value = "\"true\"";
- }
- return {
- type: RAW,
- value: isBooleanAttr(name)
- ? (" " + name + "=\"" + name + "\"")
- : value === '""'
- ? (" " + name)
- : (" " + name + "=\"" + (JSON.parse(value)) + "\"")
- }
- } else {
- return {
- type: EXPRESSION,
- value: ("_ssrAttr(" + (JSON.stringify(name)) + "," + value + ")")
- }
- }
-}
-
-function genClassSegments (
- staticClass,
- classBinding
-) {
- if (staticClass && !classBinding) {
- return [{ type: RAW, value: (" class=" + staticClass) }]
- } else {
- return [{
- type: EXPRESSION,
- value: ("_ssrClass(" + (staticClass || 'null') + "," + (classBinding || 'null') + ")")
- }]
- }
-}
-
-function genStyleSegments (
- staticStyle,
- parsedStaticStyle,
- styleBinding,
- vShowExpression
-) {
- if (staticStyle && !styleBinding && !vShowExpression) {
- return [{ type: RAW, value: (" style=" + (JSON.stringify(staticStyle))) }]
- } else {
- return [{
- type: EXPRESSION,
- value: ("_ssrStyle(" + (parsedStaticStyle || 'null') + "," + (styleBinding || 'null') + ", " + (vShowExpression
- ? ("{ display: (" + vShowExpression + ") ? '' : 'none' }")
- : 'null') + ")")
- }]
- }
-}
-
-/* */
-
-/**
- * In SSR, the vdom tree is generated only once and never patched, so
- * we can optimize most element / trees into plain string render functions.
- * The SSR optimizer walks the AST tree to detect optimizable elements and trees.
- *
- * The criteria for SSR optimizability is quite a bit looser than static tree
- * detection (which is designed for client re-render). In SSR we bail only for
- * components/slots/custom directives.
- */
-
-// optimizability constants
-var optimizability = {
- FALSE: 0, // whole sub tree un-optimizable
- FULL: 1, // whole sub tree optimizable
- SELF: 2, // self optimizable but has some un-optimizable children
- CHILDREN: 3, // self un-optimizable but have fully optimizable children
- PARTIAL: 4 // self un-optimizable with some un-optimizable children
-};
-
-var isPlatformReservedTag$1;
-
-function optimize$1 (root, options) {
- if (!root) { return }
- isPlatformReservedTag$1 = options.isReservedTag || no;
- walk(root, true);
-}
-
-function walk (node, isRoot) {
- if (isUnOptimizableTree(node)) {
- node.ssrOptimizability = optimizability.FALSE;
- return
- }
- // root node or nodes with custom directives should always be a VNode
- var selfUnoptimizable = isRoot || hasCustomDirective(node);
- var check = function (child) {
- if (child.ssrOptimizability !== optimizability.FULL) {
- node.ssrOptimizability = selfUnoptimizable
- ? optimizability.PARTIAL
- : optimizability.SELF;
- }
- };
- if (selfUnoptimizable) {
- node.ssrOptimizability = optimizability.CHILDREN;
- }
- if (node.type === 1) {
- for (var i = 0, l = node.children.length; i < l; i++) {
- var child = node.children[i];
- walk(child);
- check(child);
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- var block = node.ifConditions[i$1].block;
- walk(block, isRoot);
- check(block);
- }
- }
- if (node.ssrOptimizability == null ||
- (!isRoot && (node.attrsMap['v-html'] || node.attrsMap['v-text']))
- ) {
- node.ssrOptimizability = optimizability.FULL;
- } else {
- node.children = optimizeSiblings(node);
- }
- } else {
- node.ssrOptimizability = optimizability.FULL;
- }
-}
-
-function optimizeSiblings (el) {
- var children = el.children;
- var optimizedChildren = [];
-
- var currentOptimizableGroup = [];
- var pushGroup = function () {
- if (currentOptimizableGroup.length) {
- optimizedChildren.push({
- type: 1,
- parent: el,
- tag: 'template',
- attrsList: [],
- attrsMap: {},
- children: currentOptimizableGroup,
- ssrOptimizability: optimizability.FULL
- });
- }
- currentOptimizableGroup = [];
- };
-
- for (var i = 0; i < children.length; i++) {
- var c = children[i];
- if (c.ssrOptimizability === optimizability.FULL) {
- currentOptimizableGroup.push(c);
- } else {
- // wrap fully-optimizable adjacent siblings inside a template tag
- // so that they can be optimized into a single ssrNode by codegen
- pushGroup();
- optimizedChildren.push(c);
- }
- }
- pushGroup();
- return optimizedChildren
-}
-
-function isUnOptimizableTree (node) {
- if (node.type === 2 || node.type === 3) { // text or expression
- return false
- }
- return (
- isBuiltInTag(node.tag) || // built-in (slot, component)
- !isPlatformReservedTag$1(node.tag) || // custom component
- !!node.component || // "is" component
- isSelectWithModel(node) // <select v-model> requires runtime inspection
- )
-}
-
-var isBuiltInDir = makeMap('text,html,show,on,bind,model,pre,cloak,once');
-
-function hasCustomDirective (node) {
- return (
- node.type === 1 &&
- node.directives &&
- node.directives.some(function (d) { return !isBuiltInDir(d.name); })
- )
-}
-
-// <select v-model> cannot be optimized because it requires a runtime check
-// to determine proper selected option
-function isSelectWithModel (node) {
- return (
- node.type === 1 &&
- node.tag === 'select' &&
- node.directives != null &&
- node.directives.some(function (d) { return d.name === 'model'; })
- )
-}
-
-/* */
-
-// The SSR codegen is essentially extending the default codegen to handle
-// SSR-optimizable nodes and turn them into string render fns. In cases where
-// a node is not optimizable it simply falls back to the default codegen.
-
-// segment types
-var RAW = 0;
-var INTERPOLATION = 1;
-var EXPRESSION = 2;
-
-function generate$1 (
- ast,
- options
-) {
- var state = new CodegenState(options);
- var code = ast ? genSSRElement(ast, state) : '_c("div")';
- return {
- render: ("with(this){return " + code + "}"),
- staticRenderFns: state.staticRenderFns
- }
-}
-
-function genSSRElement (el, state) {
- if (el.for && !el.forProcessed) {
- return genFor(el, state, genSSRElement)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state, genSSRElement)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return el.ssrOptimizability === optimizability.FULL
- ? genChildrenAsStringNode(el, state)
- : genSSRChildren(el, state) || 'void 0'
- }
-
- switch (el.ssrOptimizability) {
- case optimizability.FULL:
- // stringify whole tree
- return genStringElement(el, state)
- case optimizability.SELF:
- // stringify self and check children
- return genStringElementWithChildren(el, state)
- case optimizability.CHILDREN:
- // generate self as VNode and stringify children
- return genNormalElement(el, state, true)
- case optimizability.PARTIAL:
- // generate self as VNode and check children
- return genNormalElement(el, state, false)
- default:
- // bail whole tree
- return genElement(el, state)
- }
-}
-
-function genNormalElement (el, state, stringifyChildren) {
- var data = el.plain ? undefined : genData$2(el, state);
- var children = stringifyChildren
- ? ("[" + (genChildrenAsStringNode(el, state)) + "]")
- : genSSRChildren(el, state, true);
- return ("_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")")
-}
-
-function genSSRChildren (el, state, checkSkip) {
- return genChildren(el, state, checkSkip, genSSRElement, genSSRNode)
-}
-
-function genSSRNode (el, state) {
- return el.type === 1
- ? genSSRElement(el, state)
- : genText(el)
-}
-
-function genChildrenAsStringNode (el, state) {
- return el.children.length
- ? ("_ssrNode(" + (flattenSegments(childrenToSegments(el, state))) + ")")
- : ''
-}
-
-function genStringElement (el, state) {
- return ("_ssrNode(" + (elementToString(el, state)) + ")")
-}
-
-function genStringElementWithChildren (el, state) {
- var children = genSSRChildren(el, state, true);
- return ("_ssrNode(" + (flattenSegments(elementToOpenTagSegments(el, state))) + ",\"</" + (el.tag) + ">\"" + (children ? ("," + children) : '') + ")")
-}
-
-function elementToString (el, state) {
- return ("(" + (flattenSegments(elementToSegments(el, state))) + ")")
-}
-
-function elementToSegments (el, state) {
- // v-for / v-if
- if (el.for && !el.forProcessed) {
- el.forProcessed = true;
- return [{
- type: EXPRESSION,
- value: genFor(el, state, elementToString, '_ssrList')
- }]
- } else if (el.if && !el.ifProcessed) {
- el.ifProcessed = true;
- return [{
- type: EXPRESSION,
- value: genIf(el, state, elementToString, '"<!---->"')
- }]
- } else if (el.tag === 'template') {
- return childrenToSegments(el, state)
- }
-
- var openSegments = elementToOpenTagSegments(el, state);
- var childrenSegments = childrenToSegments(el, state);
- var ref = state.options;
- var isUnaryTag = ref.isUnaryTag;
- var close = (isUnaryTag && isUnaryTag(el.tag))
- ? []
- : [{ type: RAW, value: ("</" + (el.tag) + ">") }];
- return openSegments.concat(childrenSegments, close)
-}
-
-function elementToOpenTagSegments (el, state) {
- applyModelTransform(el, state);
- var binding;
- var segments = [{ type: RAW, value: ("<" + (el.tag)) }];
- // attrs
- if (el.attrs) {
- segments.push.apply(segments, genAttrSegments(el.attrs));
- }
- // domProps
- if (el.props) {
- segments.push.apply(segments, genDOMPropSegments(el.props, el.attrs));
- }
- // v-bind="object"
- if ((binding = el.attrsMap['v-bind'])) {
- segments.push({ type: EXPRESSION, value: ("_ssrAttrs(" + binding + ")") });
- }
- // v-bind.prop="object"
- if ((binding = el.attrsMap['v-bind.prop'])) {
- segments.push({ type: EXPRESSION, value: ("_ssrDOMProps(" + binding + ")") });
- }
- // class
- if (el.staticClass || el.classBinding) {
- segments.push.apply(
- segments,
- genClassSegments(el.staticClass, el.classBinding)
- );
- }
- // style & v-show
- if (el.staticStyle || el.styleBinding || el.attrsMap['v-show']) {
- segments.push.apply(
- segments,
- genStyleSegments(
- el.attrsMap.style,
- el.staticStyle,
- el.styleBinding,
- el.attrsMap['v-show']
- )
- );
- }
- // _scopedId
- if (state.options.scopeId) {
- segments.push({ type: RAW, value: (" " + (state.options.scopeId)) });
- }
- segments.push({ type: RAW, value: ">" });
- return segments
-}
-
-function childrenToSegments (el, state) {
- var binding;
- if ((binding = el.attrsMap['v-html'])) {
- return [{ type: EXPRESSION, value: ("_s(" + binding + ")") }]
- }
- if ((binding = el.attrsMap['v-text'])) {
- return [{ type: INTERPOLATION, value: ("_s(" + binding + ")") }]
- }
- if (el.tag === 'textarea' && (binding = el.attrsMap['v-model'])) {
- return [{ type: INTERPOLATION, value: ("_s(" + binding + ")") }]
- }
- return el.children
- ? nodesToSegments(el.children, state)
- : []
-}
-
-function nodesToSegments (
- children,
- state
-) {
- var segments = [];
- for (var i = 0; i < children.length; i++) {
- var c = children[i];
- if (c.type === 1) {
- segments.push.apply(segments, elementToSegments(c, state));
- } else if (c.type === 2) {
- segments.push({ type: INTERPOLATION, value: c.expression });
- } else if (c.type === 3) {
- segments.push({ type: RAW, value: escape(c.text) });
- }
- }
- return segments
-}
-
-function flattenSegments (segments) {
- var mergedSegments = [];
- var textBuffer = '';
-
- var pushBuffer = function () {
- if (textBuffer) {
- mergedSegments.push(JSON.stringify(textBuffer));
- textBuffer = '';
- }
- };
-
- for (var i = 0; i < segments.length; i++) {
- var s = segments[i];
- if (s.type === RAW) {
- textBuffer += s.value;
- } else if (s.type === INTERPOLATION) {
- pushBuffer();
- mergedSegments.push(("_ssrEscape(" + (s.value) + ")"));
- } else if (s.type === EXPRESSION) {
- pushBuffer();
- mergedSegments.push(("(" + (s.value) + ")"));
- }
- }
- pushBuffer();
-
- return mergedSegments.join('+')
-}
-
-/* */
-
-var createCompiler$1 = createCompilerCreator(function baseCompile (
- template,
- options
-) {
- var ast = parse(template.trim(), options);
- optimize$1(ast, options);
- var code = generate$1(ast, options);
- return {
- ast: ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
-});
-
-/* */
-
-var ref$1 = createCompiler$1(baseOptions);
-var compile$1 = ref$1.compile;
-var compileToFunctions$1 = ref$1.compileToFunctions;
-
-/* */
-
-exports.parseComponent = parseComponent;
-exports.compile = compile;
-exports.compileToFunctions = compileToFunctions;
-exports.ssrCompile = compile$1;
-exports.ssrCompileToFunctions = compileToFunctions$1;
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
+++ /dev/null
-try {
- var vueVersion = require('vue').version
-} catch (e) {}
-
-var packageName = require('./package.json').name
-var packageVersion = require('./package.json').version
-if (vueVersion && vueVersion !== packageVersion) {
- throw new Error(
- '\n\nVue packages version mismatch:\n\n' +
- '- vue@' + vueVersion + '\n' +
- '- ' + packageName + '@' + packageVersion + '\n\n' +
- 'This may cause things to work incorrectly. Make sure to use the same version for both.\n' +
- 'If you are using vue-loader@>=10.0, simply update vue-template-compiler.\n' +
- 'If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump ' + packageName + ' to the latest.\n'
- )
-}
-
-module.exports = require('./build')
+++ /dev/null
-{
- "name": "vue-template-compiler",
- "version": "2.5.16",
- "description": "template compiler for Vue 2.0",
- "main": "index.js",
- "unpkg": "browser.js",
- "jsdelivr": "browser.js",
- "browser": "browser.js",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/vuejs/vue.git"
- },
- "keywords": [
- "vue",
- "compiler"
- ],
- "author": "Evan You",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/vuejs/vue/issues"
- },
- "homepage": "https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#readme",
- "dependencies": {
- "he": "^1.1.0",
- "de-indent": "^1.0.2"
- }
-}
+++ /dev/null
-# weex-template-compiler
-
-> This package is auto-generated. For pull requests please see [src/platforms/weex/entry-compiler.js](https://github.com/vuejs/vue/tree/dev/src/platforms/weex/entry-compiler.js).
+++ /dev/null
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-
-var he = _interopDefault(require('he'));
-
-/* */
-
-var emptyObject = Object.freeze({});
-
-// these helpers produces better vm code in JS engines due to their
-// explicitness and function inlining
-function isUndef (v) {
- return v === undefined || v === null
-}
-
-
-
-
-
-
-
-/**
- * Check if value is primitive
- */
-function isPrimitive (value) {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
-}
-
-/**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
-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.
- */
-function isPlainObject (obj) {
- return _toString.call(obj) === '[object Object]'
-}
-
-
-
-/**
- * Check if val is a valid array index.
- */
-function isValidArrayIndex (val) {
- var n = parseFloat(String(val));
- return n >= 0 && Math.floor(n) === n && isFinite(val)
-}
-
-/**
- * Convert a value to a string that is actually rendered.
- */
-
-
-/**
- * Convert a input value to a number for persistence.
- * If the conversion fails, return original string.
- */
-
-
-/**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
-function makeMap (
- str,
- expectsLowerCase
-) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
-}
-
-/**
- * Check if a tag is a built-in tag.
- */
-var isBuiltInTag = makeMap('slot,component', true);
-
-/**
- * Check if a attribute is a reserved attribute.
- */
-var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
-
-/**
- * Remove an item from an array
- */
-function remove (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
-}
-
-/**
- * Check whether the object has the property.
- */
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
-}
-
-/**
- * Create a cached version of a pure function.
- */
-function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
-}
-
-/**
- * Camelize a hyphen-delimited string.
- */
-var camelizeRE = /-(\w)/g;
-var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
-});
-
-/**
- * Capitalize a string.
- */
-
-
-
-
-/**
- * Simple bind polyfill for environments that do not support it... e.g.
- * PhantomJS 1.x. Technically we don't need this anymore since native bind is
- * now more performant in most browsers, but removing it would be breaking for
- * code that was able to run in PhantomJS 1.x, so this must be kept for
- * backwards compatibility.
- */
-
-/* istanbul ignore next */
-function polyfillBind (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
-
- boundFn._length = fn.length;
- return boundFn
-}
-
-function nativeBind (fn, ctx) {
- return fn.bind(ctx)
-}
-
-var bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind;
-
-/**
- * Convert an Array-like object to a real Array.
- */
-
-
-/**
- * Mix properties into target object.
- */
-function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
-}
-
-/**
- * Merge an Array of Objects into a single Object.
- */
-
-
-/**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
- */
-function noop (a, b, c) {}
-
-/**
- * Always return false.
- */
-var no = function (a, b, c) { return false; };
-
-/**
- * Return same value
- */
-var identity = function (_) { return _; };
-
-/**
- * Generate a static keys string from compiler modules.
- */
-function genStaticKeys (modules) {
- return modules.reduce(function (keys, m) {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
-}
-
-/**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
-
-
-
-
-/**
- * Ensure a function is called only once.
- */
-
-/* */
-
-var isUnaryTag = makeMap(
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
- 'link,meta,param,source,track,wbr'
-);
-
-// Elements that you can, intentionally, leave open
-// (and which close themselves)
-var canBeLeftOpenTag = makeMap(
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
-);
-
-// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
-// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
-var isNonPhrasingTag = makeMap(
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
- 'title,tr,track'
-);
-
-/**
- * Not type-checking this file because it's mostly vendor code.
- */
-
-/*!
- * HTML Parser By John Resig (ejohn.org)
- * Modified by Juriy "kangax" Zaytsev
- * Original code by Erik Arvidsson, Mozilla Public License
- * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
- */
-
-// Regular Expressions for parsing tags and attributes
-var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
-// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
-// but for Vue templates we can enforce a simple charset
-var ncname = '[a-zA-Z_][\\w\\-\\.]*';
-var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
-var startTagOpen = new RegExp(("^<" + qnameCapture));
-var startTagClose = /^\s*(\/?)>/;
-var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
-var doctype = /^<!DOCTYPE [^>]+>/i;
-// #7298: escape - to avoid being pased as HTML comment when inlined in page
-var comment = /^<!\--/;
-var conditionalComment = /^<!\[/;
-
-var IS_REGEX_CAPTURING_BROKEN = false;
-'x'.replace(/x(.)?/g, function (m, g) {
- IS_REGEX_CAPTURING_BROKEN = g === '';
-});
-
-// Special Elements (can contain anything)
-var isPlainTextElement = makeMap('script,style,textarea', true);
-var reCache = {};
-
-var decodingMap = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&',
- ' ': '\n',
- '	': '\t'
-};
-var encodedAttr = /&(?:lt|gt|quot|amp);/g;
-var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g;
-
-// #5992
-var isIgnoreNewlineTag = makeMap('pre,textarea', true);
-var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
-
-function decodeAttr (value, shouldDecodeNewlines) {
- var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
- return value.replace(re, function (match) { return decodingMap[match]; })
-}
-
-function parseHTML (html, options) {
- var stack = [];
- var expectHTML = options.expectHTML;
- var isUnaryTag$$1 = options.isUnaryTag || no;
- var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
- var index = 0;
- var last, lastTag;
- while (html) {
- last = html;
- // Make sure we're not in a plaintext content element like script/style
- if (!lastTag || !isPlainTextElement(lastTag)) {
- var textEnd = html.indexOf('<');
- if (textEnd === 0) {
- // Comment:
- if (comment.test(html)) {
- var commentEnd = html.indexOf('-->');
-
- if (commentEnd >= 0) {
- if (options.shouldKeepComment) {
- options.comment(html.substring(4, commentEnd));
- }
- advance(commentEnd + 3);
- continue
- }
- }
-
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
- if (conditionalComment.test(html)) {
- var conditionalEnd = html.indexOf(']>');
-
- if (conditionalEnd >= 0) {
- advance(conditionalEnd + 2);
- continue
- }
- }
-
- // Doctype:
- var doctypeMatch = html.match(doctype);
- if (doctypeMatch) {
- advance(doctypeMatch[0].length);
- continue
- }
-
- // End tag:
- var endTagMatch = html.match(endTag);
- if (endTagMatch) {
- var curIndex = index;
- advance(endTagMatch[0].length);
- parseEndTag(endTagMatch[1], curIndex, index);
- continue
- }
-
- // Start tag:
- var startTagMatch = parseStartTag();
- if (startTagMatch) {
- handleStartTag(startTagMatch);
- if (shouldIgnoreFirstNewline(lastTag, html)) {
- advance(1);
- }
- continue
- }
- }
-
- var text = (void 0), rest = (void 0), next = (void 0);
- if (textEnd >= 0) {
- rest = html.slice(textEnd);
- while (
- !endTag.test(rest) &&
- !startTagOpen.test(rest) &&
- !comment.test(rest) &&
- !conditionalComment.test(rest)
- ) {
- // < in plain text, be forgiving and treat it as text
- next = rest.indexOf('<', 1);
- if (next < 0) { break }
- textEnd += next;
- rest = html.slice(textEnd);
- }
- text = html.substring(0, textEnd);
- advance(textEnd);
- }
-
- if (textEnd < 0) {
- text = html;
- html = '';
- }
-
- if (options.chars && text) {
- options.chars(text);
- }
- } else {
- var endTagLength = 0;
- var stackedTag = lastTag.toLowerCase();
- var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
- var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
- endTagLength = endTag.length;
- if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
- text = text
- .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
- }
- if (shouldIgnoreFirstNewline(stackedTag, text)) {
- text = text.slice(1);
- }
- if (options.chars) {
- options.chars(text);
- }
- return ''
- });
- index += html.length - rest$1.length;
- html = rest$1;
- parseEndTag(stackedTag, index - endTagLength, index);
- }
-
- if (html === last) {
- options.chars && options.chars(html);
- if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) {
- options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
- }
- break
- }
- }
-
- // Clean up any remaining tags
- parseEndTag();
-
- function advance (n) {
- index += n;
- html = html.substring(n);
- }
-
- function parseStartTag () {
- var start = html.match(startTagOpen);
- if (start) {
- var match = {
- tagName: start[1],
- attrs: [],
- start: index
- };
- advance(start[0].length);
- var end, attr;
- while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
- advance(attr[0].length);
- match.attrs.push(attr);
- }
- if (end) {
- match.unarySlash = end[1];
- advance(end[0].length);
- match.end = index;
- return match
- }
- }
- }
-
- function handleStartTag (match) {
- var tagName = match.tagName;
- var unarySlash = match.unarySlash;
-
- if (expectHTML) {
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
- parseEndTag(lastTag);
- }
- if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
- parseEndTag(tagName);
- }
- }
-
- var unary = isUnaryTag$$1(tagName) || !!unarySlash;
-
- var l = match.attrs.length;
- var attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- var args = match.attrs[i];
- // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
- if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
- if (args[3] === '') { delete args[3]; }
- if (args[4] === '') { delete args[4]; }
- if (args[5] === '') { delete args[5]; }
- }
- var value = args[3] || args[4] || args[5] || '';
- var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
- ? options.shouldDecodeNewlinesForHref
- : options.shouldDecodeNewlines;
- attrs[i] = {
- name: args[1],
- value: decodeAttr(value, shouldDecodeNewlines)
- };
- }
-
- if (!unary) {
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
- lastTag = tagName;
- }
-
- if (options.start) {
- options.start(tagName, attrs, unary, match.start, match.end);
- }
- }
-
- function parseEndTag (tagName, start, end) {
- var pos, lowerCasedTagName;
- if (start == null) { start = index; }
- if (end == null) { end = index; }
-
- if (tagName) {
- lowerCasedTagName = tagName.toLowerCase();
- }
-
- // Find the closest opened tag of the same type
- if (tagName) {
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
- break
- }
- }
- } else {
- // If no tag name is provided, clean shop
- pos = 0;
- }
-
- if (pos >= 0) {
- // Close all the open elements, up the stack
- for (var i = stack.length - 1; i >= pos; i--) {
- if (process.env.NODE_ENV !== 'production' &&
- (i > pos || !tagName) &&
- options.warn
- ) {
- options.warn(
- ("tag <" + (stack[i].tag) + "> has no matching end tag.")
- );
- }
- if (options.end) {
- options.end(stack[i].tag, start, end);
- }
- }
-
- // Remove the open elements from the stack
- stack.length = pos;
- lastTag = pos && stack[pos - 1].tag;
- } else if (lowerCasedTagName === 'br') {
- if (options.start) {
- options.start(tagName, [], true, start, end);
- }
- } else if (lowerCasedTagName === 'p') {
- if (options.start) {
- options.start(tagName, [], false, start, end);
- }
- if (options.end) {
- options.end(tagName, start, end);
- }
- }
- }
-}
-
-/* */
-
-var validDivisionCharRE = /[\w).+\-_$\]]/;
-
-function parseFilters (exp) {
- var inSingle = false;
- var inDouble = false;
- var inTemplateString = false;
- var inRegex = false;
- var curly = 0;
- var square = 0;
- var paren = 0;
- var lastFilterIndex = 0;
- var c, prev, i, expression, filters;
-
- for (i = 0; i < exp.length; i++) {
- prev = c;
- c = exp.charCodeAt(i);
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
- } else if (inDouble) {
- if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
- } else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
- } else if (inRegex) {
- if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
- } else if (
- c === 0x7C && // pipe
- exp.charCodeAt(i + 1) !== 0x7C &&
- exp.charCodeAt(i - 1) !== 0x7C &&
- !curly && !square && !paren
- ) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1;
- expression = exp.slice(0, i).trim();
- } else {
- pushFilter();
- }
- } else {
- switch (c) {
- case 0x22: inDouble = true; break // "
- case 0x27: inSingle = true; break // '
- case 0x60: inTemplateString = true; break // `
- case 0x28: paren++; break // (
- case 0x29: paren--; break // )
- case 0x5B: square++; break // [
- case 0x5D: square--; break // ]
- case 0x7B: curly++; break // {
- case 0x7D: curly--; break // }
- }
- if (c === 0x2f) { // /
- var j = i - 1;
- var p = (void 0);
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j);
- if (p !== ' ') { break }
- }
- if (!p || !validDivisionCharRE.test(p)) {
- inRegex = true;
- }
- }
- }
- }
-
- if (expression === undefined) {
- expression = exp.slice(0, i).trim();
- } else if (lastFilterIndex !== 0) {
- pushFilter();
- }
-
- function pushFilter () {
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
- lastFilterIndex = i + 1;
- }
-
- if (filters) {
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i]);
- }
- }
-
- return expression
-}
-
-function wrapFilter (exp, filter) {
- var i = filter.indexOf('(');
- if (i < 0) {
- // _f: resolveFilter
- return ("_f(\"" + filter + "\")(" + exp + ")")
- } else {
- var name = filter.slice(0, i);
- var args = filter.slice(i + 1);
- return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
- }
-}
-
-/* */
-
-var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
-var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
-
-var buildRegex = cached(function (delimiters) {
- var open = delimiters[0].replace(regexEscapeRE, '\\$&');
- var close = delimiters[1].replace(regexEscapeRE, '\\$&');
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
-});
-
-
-
-function parseText (
- text,
- delimiters
-) {
- var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
- if (!tagRE.test(text)) {
- return
- }
- var tokens = [];
- var rawTokens = [];
- var lastIndex = tagRE.lastIndex = 0;
- var match, index, tokenValue;
- while ((match = tagRE.exec(text))) {
- index = match.index;
- // push text token
- if (index > lastIndex) {
- rawTokens.push(tokenValue = text.slice(lastIndex, index));
- tokens.push(JSON.stringify(tokenValue));
- }
- // tag token
- var exp = parseFilters(match[1].trim());
- tokens.push(("_s(" + exp + ")"));
- rawTokens.push({ '@binding': exp });
- lastIndex = index + match[0].length;
- }
- if (lastIndex < text.length) {
- rawTokens.push(tokenValue = text.slice(lastIndex));
- tokens.push(JSON.stringify(tokenValue));
- }
- return {
- expression: tokens.join('+'),
- tokens: rawTokens
- }
-}
-
-/* */
-
-/**
- * Cross-platform code generation for component v-model
- */
-function genComponentModel (
- el,
- value,
- modifiers
-) {
- var ref = modifiers || {};
- var number = ref.number;
- var trim = ref.trim;
-
- var baseValueExpression = '$$v';
- var valueExpression = baseValueExpression;
- if (trim) {
- valueExpression =
- "(typeof " + baseValueExpression + " === 'string'" +
- "? " + baseValueExpression + ".trim()" +
- ": " + baseValueExpression + ")";
- }
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
- var assignment = genAssignmentCode(value, valueExpression);
-
- el.model = {
- value: ("(" + value + ")"),
- expression: ("\"" + value + "\""),
- callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
- };
-}
-
-/**
- * Cross-platform codegen helper for generating v-model value assignment code.
- */
-function genAssignmentCode (
- value,
- assignment
-) {
- var res = parseModel(value);
- if (res.key === null) {
- return (value + "=" + assignment)
- } else {
- return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
- }
-}
-
-/**
- * Parse a v-model expression into a base path and a final key segment.
- * Handles both dot-path and possible square brackets.
- *
- * Possible cases:
- *
- * - test
- * - test[key]
- * - test[test1[key]]
- * - test["a"][key]
- * - xxx.test[a[a].test1[key]]
- * - test.xxx.a["asa"][test1[key]]
- *
- */
-
-var len;
-var str;
-var chr;
-var index;
-var expressionPos;
-var expressionEndPos;
-
-
-
-function parseModel (val) {
- // Fix https://github.com/vuejs/vue/pull/7730
- // allow v-model="obj.val " (trailing whitespace)
- val = val.trim();
- len = val.length;
-
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
- index = val.lastIndexOf('.');
- if (index > -1) {
- return {
- exp: val.slice(0, index),
- key: '"' + val.slice(index + 1) + '"'
- }
- } else {
- return {
- exp: val,
- key: null
- }
- }
- }
-
- str = val;
- index = expressionPos = expressionEndPos = 0;
-
- while (!eof()) {
- chr = next();
- /* istanbul ignore if */
- if (isStringStart(chr)) {
- parseString(chr);
- } else if (chr === 0x5B) {
- parseBracket(chr);
- }
- }
-
- return {
- exp: val.slice(0, expressionPos),
- key: val.slice(expressionPos + 1, expressionEndPos)
- }
-}
-
-function next () {
- return str.charCodeAt(++index)
-}
-
-function eof () {
- return index >= len
-}
-
-function isStringStart (chr) {
- return chr === 0x22 || chr === 0x27
-}
-
-function parseBracket (chr) {
- var inBracket = 1;
- expressionPos = index;
- while (!eof()) {
- chr = next();
- if (isStringStart(chr)) {
- parseString(chr);
- continue
- }
- if (chr === 0x5B) { inBracket++; }
- if (chr === 0x5D) { inBracket--; }
- if (inBracket === 0) {
- expressionEndPos = index;
- break
- }
- }
-}
-
-function parseString (chr) {
- var stringQuote = chr;
- while (!eof()) {
- chr = next();
- if (chr === stringQuote) {
- break
- }
- }
-}
-
-/* */
-
-// can we use __proto__?
-var hasProto = '__proto__' in {};
-
-// Browser environment sniffing
-var inBrowser = typeof window !== 'undefined';
-var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
-var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
-var UA = inBrowser && window.navigator.userAgent.toLowerCase();
-var isIE = UA && /msie|trident/.test(UA);
-var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
-var isEdge = UA && UA.indexOf('edge/') > 0;
-var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
-var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
-var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
-
-// Firefox has a "watch" function on Object.prototype...
-var nativeWatch = ({}).watch;
-
-
-if (inBrowser) {
- try {
- var opts = {};
- Object.defineProperty(opts, 'passive', ({
- get: function get () {
- /* istanbul ignore next */
-
- }
- })); // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts);
- } catch (e) {}
-}
-
-// this needs to be lazy-evaled because vue may be required before
-// vue-server-renderer can set VUE_ENV
-var _isServer;
-var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
-};
-
-// detect devtools
-var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
-/* istanbul ignore next */
-function isNative (Ctor) {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
-}
-
-var hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
-
-/* istanbul ignore if */ // $flow-disable-line
-if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
-
-} else {
- // a non-standard Set polyfill that only works with primitive keys.
-
-}
-
-/* */
-
-function baseWarn (msg) {
- console.error(("[Vue compiler]: " + msg));
-}
-
-function pluckModuleFunction (
- modules,
- key
-) {
- return modules
- ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
- : []
-}
-
-function addProp (el, name, value) {
- (el.props || (el.props = [])).push({ name: name, value: value });
- el.plain = false;
-}
-
-function addAttr (el, name, value) {
- (el.attrs || (el.attrs = [])).push({ name: name, value: value });
- el.plain = false;
-}
-
-// add a raw attr (use this in preTransforms)
-function addRawAttr (el, name, value) {
- el.attrsMap[name] = value;
- el.attrsList.push({ name: name, value: value });
-}
-
-function addDirective (
- el,
- name,
- rawName,
- value,
- arg,
- modifiers
-) {
- (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
- el.plain = false;
-}
-
-function addHandler (
- el,
- name,
- value,
- modifiers,
- important,
- warn
-) {
- modifiers = modifiers || emptyObject;
- // warn prevent and passive modifier
- /* istanbul ignore if */
- if (
- process.env.NODE_ENV !== 'production' && warn &&
- modifiers.prevent && modifiers.passive
- ) {
- warn(
- 'passive and prevent can\'t be used together. ' +
- 'Passive handler can\'t prevent default event.'
- );
- }
-
- // check capture modifier
- if (modifiers.capture) {
- delete modifiers.capture;
- name = '!' + name; // mark the event as captured
- }
- if (modifiers.once) {
- delete modifiers.once;
- name = '~' + name; // mark the event as once
- }
- /* istanbul ignore if */
- if (modifiers.passive) {
- delete modifiers.passive;
- name = '&' + name; // mark the event as passive
- }
-
- // normalize click.right and click.middle since they don't actually fire
- // this is technically browser-specific, but at least for now browsers are
- // the only target envs that have right/middle clicks.
- if (name === 'click') {
- if (modifiers.right) {
- name = 'contextmenu';
- delete modifiers.right;
- } else if (modifiers.middle) {
- name = 'mouseup';
- }
- }
-
- var events;
- if (modifiers.native) {
- delete modifiers.native;
- events = el.nativeEvents || (el.nativeEvents = {});
- } else {
- events = el.events || (el.events = {});
- }
-
- var newHandler = {
- value: value.trim()
- };
- if (modifiers !== emptyObject) {
- newHandler.modifiers = modifiers;
- }
-
- var handlers = events[name];
- /* istanbul ignore if */
- if (Array.isArray(handlers)) {
- important ? handlers.unshift(newHandler) : handlers.push(newHandler);
- } else if (handlers) {
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
- } else {
- events[name] = newHandler;
- }
-
- el.plain = false;
-}
-
-function getBindingAttr (
- el,
- name,
- getStatic
-) {
- var dynamicValue =
- getAndRemoveAttr(el, ':' + name) ||
- getAndRemoveAttr(el, 'v-bind:' + name);
- if (dynamicValue != null) {
- return parseFilters(dynamicValue)
- } else if (getStatic !== false) {
- var staticValue = getAndRemoveAttr(el, name);
- if (staticValue != null) {
- return JSON.stringify(staticValue)
- }
- }
-}
-
-// 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;
- for (var i = 0, l = list.length; i < l; i++) {
- if (list[i].name === name) {
- list.splice(i, 1);
- break
- }
- }
- }
- if (removeFromMap) {
- delete el.attrsMap[name];
- }
- return val
-}
-
-/* */
-
-var onRE = /^@|^v-on:/;
-var dirRE = /^v-|^@|^:/;
-var forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/;
-var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
-var stripParensRE = /^\(|\)$/g;
-
-var argRE = /:(.*)$/;
-var bindRE = /^:|^v-bind:/;
-var modifierRE = /\.[^.]+/g;
-
-var decodeHTMLCached = cached(he.decode);
-
-// configurable state
-var warn;
-var delimiters;
-var transforms;
-var preTransforms;
-var postTransforms;
-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.
- */
-function parse (
- template,
- options
-) {
- warn = options.warn || baseWarn;
-
- platformIsPreTag = options.isPreTag || no;
- platformMustUseProp = options.mustUseProp || no;
- platformGetTagNamespace = options.getTagNamespace || no;
-
- transforms = pluckModuleFunction(options.modules, 'transformNode');
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
-
- delimiters = options.delimiters;
-
- var stack = [];
- var preserveWhitespace = options.preserveWhitespace !== false;
- var root;
- var currentParent;
- var inVPre = false;
- var inPre = false;
- var warned = false;
-
- function warnOnce (msg) {
- if (!warned) {
- warned = true;
- warn(msg);
- }
- }
-
- function closeElement (element) {
- // check pre state
- if (element.pre) {
- inVPre = false;
- }
- if (platformIsPreTag(element.tag)) {
- inPre = false;
- }
- // apply post-transforms
- for (var i = 0; i < postTransforms.length; i++) {
- postTransforms[i](element, options);
- }
- }
-
- parseHTML(template, {
- warn: warn,
- expectHTML: options.expectHTML,
- isUnaryTag: options.isUnaryTag,
- canBeLeftOpenTag: options.canBeLeftOpenTag,
- shouldDecodeNewlines: options.shouldDecodeNewlines,
- shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
- shouldKeepComment: options.comments,
- start: function start (tag, attrs, unary) {
- // check namespace.
- // inherit parent ns if there is one
- var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
-
- // handle IE svg bug
- /* istanbul ignore if */
- if (isIE && ns === 'svg') {
- attrs = guardIESVGBug(attrs);
- }
-
- var element = createASTElement(tag, attrs, currentParent);
- if (ns) {
- element.ns = ns;
- }
-
- if (isForbiddenTag(element) && !isServerRendering()) {
- element.forbidden = true;
- process.env.NODE_ENV !== 'production' && warn(
- 'Templates should only be responsible for mapping the state to the ' +
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
- "<" + tag + ">" + ', as they will not be parsed.'
- );
- }
-
- // apply pre-transforms
- for (var i = 0; i < preTransforms.length; i++) {
- element = preTransforms[i](element, options) || element;
- }
-
- if (!inVPre) {
- processPre(element);
- if (element.pre) {
- inVPre = true;
- }
- }
- if (platformIsPreTag(element.tag)) {
- inPre = true;
- }
- if (inVPre) {
- processRawAttrs(element);
- } else if (!element.processed) {
- // structural directives
- processFor(element);
- processIf(element);
- processOnce(element);
- // element-scope stuff
- processElement(element, options);
- }
-
- function checkRootConstraints (el) {
- if (process.env.NODE_ENV !== 'production') {
- if (el.tag === 'slot' || el.tag === 'template') {
- warnOnce(
- "Cannot use <" + (el.tag) + "> as component root element because it may " +
- 'contain multiple nodes.'
- );
- }
- if (el.attrsMap.hasOwnProperty('v-for')) {
- warnOnce(
- 'Cannot use v-for on stateful component root element because ' +
- 'it renders multiple elements.'
- );
- }
- }
- }
-
- // tree management
- if (!root) {
- root = element;
- checkRootConstraints(root);
- } else if (!stack.length) {
- // allow root elements with v-if, v-else-if and v-else
- if (root.if && (element.elseif || element.else)) {
- checkRootConstraints(element);
- addIfCondition(root, {
- exp: element.elseif,
- block: element
- });
- } else if (process.env.NODE_ENV !== 'production') {
- warnOnce(
- "Component template should contain exactly one root element. " +
- "If you are using v-if on multiple elements, " +
- "use v-else-if to chain them instead."
- );
- }
- }
- if (currentParent && !element.forbidden) {
- if (element.elseif || element.else) {
- processIfConditions(element, currentParent);
- } else if (element.slotScope) { // scoped slot
- currentParent.plain = false;
- var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
- } else {
- currentParent.children.push(element);
- element.parent = currentParent;
- }
- }
- if (!unary) {
- currentParent = element;
- stack.push(element);
- } else {
- closeElement(element);
- }
- },
-
- end: function end () {
- // remove trailing whitespace
- var element = stack[stack.length - 1];
- var lastNode = element.children[element.children.length - 1];
- if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
- element.children.pop();
- }
- // pop stack
- stack.length -= 1;
- currentParent = stack[stack.length - 1];
- closeElement(element);
- },
-
- chars: function chars (text) {
- if (!currentParent) {
- if (process.env.NODE_ENV !== 'production') {
- if (text === template) {
- warnOnce(
- 'Component template requires a root element, rather than just text.'
- );
- } else if ((text = text.trim())) {
- warnOnce(
- ("text \"" + text + "\" outside root element will be ignored.")
- );
- }
- }
- return
- }
- // IE textarea placeholder bug
- /* istanbul ignore if */
- if (isIE &&
- currentParent.tag === 'textarea' &&
- currentParent.attrsMap.placeholder === text
- ) {
- return
- }
- var children = currentParent.children;
- text = inPre || text.trim()
- ? isTextTag(currentParent) ? text : decodeHTMLCached(text)
- // only preserve whitespace if its not right after a starting tag
- : preserveWhitespace && children.length ? ' ' : '';
- if (text) {
- var res;
- if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
- children.push({
- type: 2,
- expression: res.expression,
- tokens: res.tokens,
- text: text
- });
- } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
- children.push({
- type: 3,
- text: text
- });
- }
- }
- },
- comment: function comment (text) {
- currentParent.children.push({
- type: 3,
- text: text,
- isComment: true
- });
- }
- });
- return root
-}
-
-function processPre (el) {
- if (getAndRemoveAttr(el, 'v-pre') != null) {
- el.pre = true;
- }
-}
-
-function processRawAttrs (el) {
- var l = el.attrsList.length;
- if (l) {
- var attrs = el.attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- attrs[i] = {
- name: el.attrsList[i].name,
- value: JSON.stringify(el.attrsList[i].value)
- };
- }
- } else if (!el.pre) {
- // non root node in pre blocks with no attributes
- el.plain = true;
- }
-}
-
-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) {
- if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
- warn("<template> cannot be keyed. Place the key on real elements instead.");
- }
- el.key = exp;
- }
-}
-
-function processRef (el) {
- var ref = getBindingAttr(el, 'ref');
- if (ref) {
- el.ref = ref;
- el.refInFor = checkInFor(el);
- }
-}
-
-function processFor (el) {
- var exp;
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
- var res = parseFor(exp);
- if (res) {
- extend(el, res);
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- ("Invalid v-for expression: " + exp)
- );
- }
- }
-}
-
-
-
-function parseFor (exp) {
- var inMatch = exp.match(forAliasRE);
- if (!inMatch) { return }
- var res = {};
- res.for = inMatch[2].trim();
- var alias = inMatch[1].trim().replace(stripParensRE, '');
- var iteratorMatch = alias.match(forIteratorRE);
- if (iteratorMatch) {
- res.alias = alias.replace(forIteratorRE, '');
- res.iterator1 = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.iterator2 = iteratorMatch[2].trim();
- }
- } else {
- res.alias = alias;
- }
- return res
-}
-
-function processIf (el) {
- var exp = getAndRemoveAttr(el, 'v-if');
- if (exp) {
- el.if = exp;
- addIfCondition(el, {
- exp: exp,
- block: el
- });
- } else {
- if (getAndRemoveAttr(el, 'v-else') != null) {
- el.else = true;
- }
- var elseif = getAndRemoveAttr(el, 'v-else-if');
- if (elseif) {
- el.elseif = elseif;
- }
- }
-}
-
-function processIfConditions (el, parent) {
- var prev = findPrevElement(parent.children);
- if (prev && prev.if) {
- addIfCondition(prev, {
- exp: el.elseif,
- block: el
- });
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
- "used on element <" + (el.tag) + "> without corresponding v-if."
- );
- }
-}
-
-function findPrevElement (children) {
- var i = children.length;
- while (i--) {
- if (children[i].type === 1) {
- return children[i]
- } else {
- if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
- warn(
- "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
- "will be ignored."
- );
- }
- children.pop();
- }
- }
-}
-
-function addIfCondition (el, condition) {
- if (!el.ifConditions) {
- el.ifConditions = [];
- }
- el.ifConditions.push(condition);
-}
-
-function processOnce (el) {
- var once$$1 = getAndRemoveAttr(el, 'v-once');
- if (once$$1 != null) {
- el.once = true;
- }
-}
-
-function processSlot (el) {
- if (el.tag === 'slot') {
- el.slotName = getBindingAttr(el, 'name');
- if (process.env.NODE_ENV !== 'production' && el.key) {
- warn(
- "`key` does not work on <slot> because slots are abstract outlets " +
- "and can possibly expand into multiple elements. " +
- "Use the key on a wrapping element instead."
- );
- }
- } else {
- var slotScope;
- if (el.tag === 'template') {
- slotScope = getAndRemoveAttr(el, 'scope');
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && slotScope) {
- warn(
- "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 <template> to " +
- "denote scoped slots.",
- true
- );
- }
- el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
- } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
- warn(
- "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
- "(v-for takes higher priority). Use a wrapper <template> for the " +
- "scoped slot to make it clearer.",
- true
- );
- }
- el.slotScope = slotScope;
- }
- var slotTarget = getBindingAttr(el, 'slot');
- if (slotTarget) {
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
- // preserve slot as an attribute for native shadow DOM compat
- // only for non-scoped slots.
- if (el.tag !== 'template' && !el.slotScope) {
- addAttr(el, 'slot', slotTarget);
- }
- }
- }
-}
-
-function processComponent (el) {
- var binding;
- if ((binding = getBindingAttr(el, 'is'))) {
- el.component = binding;
- }
- if (getAndRemoveAttr(el, 'inline-template') != null) {
- el.inlineTemplate = true;
- }
-}
-
-function processAttrs (el) {
- var list = el.attrsList;
- var i, l, name, rawName, value, modifiers, isProp;
- for (i = 0, l = list.length; i < l; i++) {
- name = rawName = list[i].name;
- value = list[i].value;
- if (dirRE.test(name)) {
- // mark element as dynamic
- el.hasBindings = true;
- // modifiers
- modifiers = parseModifiers(name);
- if (modifiers) {
- name = name.replace(modifierRE, '');
- }
- if (bindRE.test(name)) { // v-bind
- name = name.replace(bindRE, '');
- value = parseFilters(value);
- isProp = false;
- if (modifiers) {
- if (modifiers.prop) {
- isProp = true;
- name = camelize(name);
- if (name === 'innerHtml') { name = 'innerHTML'; }
- }
- if (modifiers.camel) {
- name = camelize(name);
- }
- if (modifiers.sync) {
- addHandler(
- el,
- ("update:" + (camelize(name))),
- genAssignmentCode(value, "$event")
- );
- }
- }
- if (isProp || (
- !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
- )) {
- addProp(el, name, value);
- } else {
- addAttr(el, name, value);
- }
- } else if (onRE.test(name)) { // v-on
- name = name.replace(onRE, '');
- addHandler(el, name, value, modifiers, false, warn);
- } else { // normal directives
- name = name.replace(dirRE, '');
- // parse arg
- var argMatch = name.match(argRE);
- var arg = argMatch && argMatch[1];
- if (arg) {
- name = name.slice(0, -(arg.length + 1));
- }
- addDirective(el, name, rawName, value, arg, modifiers);
- if (process.env.NODE_ENV !== 'production' && name === 'model') {
- checkForAliasModel(el, value);
- }
- }
- } else {
- // literal attribute
- if (process.env.NODE_ENV !== 'production') {
- var res = parseText(value, delimiters);
- if (res) {
- warn(
- name + "=\"" + value + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div id="{{ val }}">, use <div :id="val">.'
- );
- }
- }
- addAttr(el, name, JSON.stringify(value));
- // #6887 firefox doesn't update muted state if set via attribute
- // even immediately after element creation
- if (!el.component &&
- name === 'muted' &&
- platformMustUseProp(el.tag, el.attrsMap.type, name)) {
- addProp(el, name, 'true');
- }
- }
- }
-}
-
-function checkInFor (el) {
- var parent = el;
- while (parent) {
- if (parent.for !== undefined) {
- return true
- }
- parent = parent.parent;
- }
- return false
-}
-
-function parseModifiers (name) {
- var match = name.match(modifierRE);
- if (match) {
- var ret = {};
- match.forEach(function (m) { ret[m.slice(1)] = true; });
- return ret
- }
-}
-
-function makeAttrsMap (attrs) {
- var map = {};
- for (var i = 0, l = attrs.length; i < l; i++) {
- if (
- process.env.NODE_ENV !== 'production' &&
- map[attrs[i].name] && !isIE && !isEdge
- ) {
- warn('duplicate attribute: ' + attrs[i].name);
- }
- map[attrs[i].name] = attrs[i].value;
- }
- return map
-}
-
-// for script (e.g. type="x/template") or style, do not decode content
-function isTextTag (el) {
- return el.tag === 'script' || el.tag === 'style'
-}
-
-function isForbiddenTag (el) {
- return (
- el.tag === 'style' ||
- (el.tag === 'script' && (
- !el.attrsMap.type ||
- el.attrsMap.type === 'text/javascript'
- ))
- )
-}
-
-var ieNSBug = /^xmlns:NS\d+/;
-var ieNSPrefix = /^NS\d+:/;
-
-/* istanbul ignore next */
-function guardIESVGBug (attrs) {
- var res = [];
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (!ieNSBug.test(attr.name)) {
- attr.name = attr.name.replace(ieNSPrefix, '');
- res.push(attr);
- }
- }
- return res
-}
-
-function checkForAliasModel (el, value) {
- var _el = el;
- while (_el) {
- if (_el.for && _el.alias === value) {
- warn(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "You are binding v-model directly to a v-for iteration alias. " +
- "This will not be able to modify the v-for source array because " +
- "writing to the alias is like modifying a function local variable. " +
- "Consider using an array of objects and use v-model on an object property instead."
- );
- }
- _el = _el.parent;
- }
-}
-
-/* */
-
-var isStaticKey;
-var isPlatformReservedTag;
-
-var genStaticKeysCached = cached(genStaticKeys$1);
-
-/**
- * Goal of the optimizer: walk the generated template AST tree
- * and detect sub-trees that are purely static, i.e. parts of
- * the DOM that never needs to change.
- *
- * Once we detect these sub-trees, we can:
- *
- * 1. Hoist them into constants, so that we no longer need to
- * create fresh nodes for them on each re-render;
- * 2. Completely skip them in the patching process.
- */
-function optimize (root, options) {
- if (!root) { return }
- isStaticKey = genStaticKeysCached(options.staticKeys || '');
- isPlatformReservedTag = options.isReservedTag || no;
- // first pass: mark all non-static nodes.
- markStatic(root);
- // second pass: mark static roots.
- markStaticRoots(root, false);
-}
-
-function genStaticKeys$1 (keys) {
- return makeMap(
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
- (keys ? ',' + keys : '')
- )
-}
-
-function markStatic (node) {
- node.static = isStatic(node);
- if (node.type === 1) {
- // do not make component slot content static. this avoids
- // 1. components not able to mutate slot nodes
- // 2. static slot content fails for hot-reloading
- if (
- !isPlatformReservedTag(node.tag) &&
- node.tag !== 'slot' &&
- node.attrsMap['inline-template'] == null
- ) {
- return
- }
- for (var i = 0, l = node.children.length; i < l; i++) {
- var child = node.children[i];
- markStatic(child);
- if (!child.static) {
- node.static = false;
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- var block = node.ifConditions[i$1].block;
- markStatic(block);
- if (!block.static) {
- node.static = false;
- }
- }
- }
- }
-}
-
-function markStaticRoots (node, isInFor) {
- if (node.type === 1) {
- if (node.static || node.once) {
- node.staticInFor = isInFor;
- }
- // For a node to qualify as a static root, it should have children that
- // are not just static text. Otherwise the cost of hoisting out will
- // outweigh the benefits and it's better off to just always render it fresh.
- if (node.static && node.children.length && !(
- node.children.length === 1 &&
- node.children[0].type === 3
- )) {
- node.staticRoot = true;
- return
- } else {
- node.staticRoot = false;
- }
- if (node.children) {
- for (var i = 0, l = node.children.length; i < l; i++) {
- markStaticRoots(node.children[i], isInFor || !!node.for);
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- markStaticRoots(node.ifConditions[i$1].block, isInFor);
- }
- }
- }
-}
-
-function isStatic (node) {
- if (node.type === 2) { // expression
- return false
- }
- if (node.type === 3) { // text
- return true
- }
- return !!(node.pre || (
- !node.hasBindings && // no dynamic bindings
- !node.if && !node.for && // not v-if or v-for or v-else
- !isBuiltInTag(node.tag) && // not a built-in
- isPlatformReservedTag(node.tag) && // not a component
- !isDirectChildOfTemplateFor(node) &&
- Object.keys(node).every(isStaticKey)
- ))
-}
-
-function isDirectChildOfTemplateFor (node) {
- while (node.parent) {
- node = node.parent;
- if (node.tag !== 'template') {
- return false
- }
- if (node.for) {
- return true
- }
- }
- return false
-}
-
-/* */
-
-var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
-var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
-
-// KeyboardEvent.keyCode aliases
-var keyCodes = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- up: 38,
- left: 37,
- right: 39,
- down: 40,
- 'delete': [8, 46]
-};
-
-// KeyboardEvent.key aliases
-var keyNames = {
- esc: 'Escape',
- tab: 'Tab',
- enter: 'Enter',
- space: ' ',
- // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- 'delete': ['Backspace', 'Delete']
-};
-
-// #4868: modifiers that prevent the execution of the listener
-// need to explicitly return null so that we can determine whether to remove
-// the listener for .once
-var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
-
-var modifierCode = {
- stop: '$event.stopPropagation();',
- prevent: '$event.preventDefault();',
- self: genGuard("$event.target !== $event.currentTarget"),
- ctrl: genGuard("!$event.ctrlKey"),
- shift: genGuard("!$event.shiftKey"),
- alt: genGuard("!$event.altKey"),
- meta: genGuard("!$event.metaKey"),
- left: genGuard("'button' in $event && $event.button !== 0"),
- middle: genGuard("'button' in $event && $event.button !== 1"),
- right: genGuard("'button' in $event && $event.button !== 2")
-};
-
-function genHandlers (
- events,
- isNative,
- warn
-) {
- var res = isNative ? 'nativeOn:{' : 'on:{';
- for (var name in events) {
- res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
- }
- return res.slice(0, -1) + '}'
-}
-
-// Generate handler code with binding params on Weex
-/* istanbul ignore next */
-function genWeexHandler (params, handlerCode) {
- var innerHandlerCode = handlerCode;
- var exps = params.filter(function (exp) { return simplePathRE.test(exp) && exp !== '$event'; });
- var bindings = exps.map(function (exp) { return ({ '@binding': exp }); });
- var args = exps.map(function (exp, i) {
- var key = "$_" + (i + 1);
- innerHandlerCode = innerHandlerCode.replace(exp, key);
- return key
- });
- args.push('$event');
- return '{\n' +
- "handler:function(" + (args.join(',')) + "){" + innerHandlerCode + "},\n" +
- "params:" + (JSON.stringify(bindings)) + "\n" +
- '}'
-}
-
-function genHandler (
- name,
- handler
-) {
- if (!handler) {
- return 'function(){}'
- }
-
- if (Array.isArray(handler)) {
- return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
- }
-
- var isMethodPath = simplePathRE.test(handler.value);
- var isFunctionExpression = fnExpRE.test(handler.value);
-
- if (!handler.modifiers) {
- if (isMethodPath || isFunctionExpression) {
- return handler.value
- }
- /* istanbul ignore if */
- if (true && handler.params) {
- return genWeexHandler(handler.params, handler.value)
- }
- return ("function($event){" + (handler.value) + "}") // inline statement
- } else {
- var code = '';
- var genModifierCode = '';
- var keys = [];
- for (var key in handler.modifiers) {
- if (modifierCode[key]) {
- genModifierCode += modifierCode[key];
- // left/right
- if (keyCodes[key]) {
- keys.push(key);
- }
- } else if (key === 'exact') {
- var modifiers = (handler.modifiers);
- genModifierCode += genGuard(
- ['ctrl', 'shift', 'alt', 'meta']
- .filter(function (keyModifier) { return !modifiers[keyModifier]; })
- .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
- .join('||')
- );
- } else {
- keys.push(key);
- }
- }
- if (keys.length) {
- code += genKeyFilter(keys);
- }
- // Make sure modifiers like prevent and stop get executed after key filtering
- if (genModifierCode) {
- code += genModifierCode;
- }
- var handlerCode = isMethodPath
- ? ("return " + (handler.value) + "($event)")
- : isFunctionExpression
- ? ("return (" + (handler.value) + ")($event)")
- : handler.value;
- /* istanbul ignore if */
- if (true && handler.params) {
- return genWeexHandler(handler.params, code + handlerCode)
- }
- return ("function($event){" + code + handlerCode + "}")
- }
-}
-
-function genKeyFilter (keys) {
- return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
-}
-
-function genFilterCode (key) {
- var keyVal = parseInt(key, 10);
- if (keyVal) {
- return ("$event.keyCode!==" + keyVal)
- }
- var keyCode = keyCodes[key];
- var keyName = keyNames[key];
- return (
- "_k($event.keyCode," +
- (JSON.stringify(key)) + "," +
- (JSON.stringify(keyCode)) + "," +
- "$event.key," +
- "" + (JSON.stringify(keyName)) +
- ")"
- )
-}
-
-/* */
-
-/**
- * Check if a string starts with $ or _
- */
-
-
-/**
- * Define a property.
- */
-function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
-}
-
-var ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
-];
-
-var LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured'
-];
-
-/* */
-
-var config = ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Show production mode tip message on boot?
- */
- productionTip: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to enable devtools
- */
- devtools: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to record perf
- */
- performance: false,
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
-})
-
-/* */
-
-var warn$1 = noop;
-var tip = noop;
-var generateComponentTrace = (noop); // work around flow check
-var formatComponentName = (noop);
-
-if (process.env.NODE_ENV !== 'production') {
- 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$1 = 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 '<Root>'
- }
- 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)) + ">") : "<Anonymous>") +
- (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;
-
-/**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
-var Dep = function Dep () {
- this.id = uid++;
- this.subs = [];
-};
-
-Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
-};
-
-Dep.prototype.removeSub = function removeSub (sub) {
- remove(this.subs, sub);
-};
-
-Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
-};
-
-Dep.prototype.notify = function notify () {
- // stabilize the subscriber list first
- var subs = this.subs.slice();
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
-};
-
-// the current target watcher being evaluated.
-// this is globally unique because there could be only one
-// watcher being evaluated at any time.
-Dep.target = null;
-
-/* */
-
-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.fnContext = undefined;
- this.fnOptions = undefined;
- this.fnScopeId = 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 );
-
-
-
-
-
-// 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.
-
-/*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
-var arrayProto = Array.prototype;
-var arrayMethods = Object.create(arrayProto);
-
-var methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
-];
-
-/**
- * Intercept mutating methods and emit events
- */
-methodsToPatch.forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
-});
-
-/* */
-
-var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
-/**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
-var shouldObserve = true;
-
-
-
-/**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
-var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- var augment = hasProto
- ? protoAugment
- : copyAugment;
- augment(value, arrayMethods, arrayKeys);
- this.observeArray(value);
- } else {
- this.walk(value);
- }
-};
-
-/**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
-Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive(obj, keys[i]);
- }
-};
-
-/**
- * Observe a list of Array items.
- */
-Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
-};
-
-// helpers
-
-/**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- */
-function protoAugment (target, src, keys) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
-}
-
-/**
- * Augment an target Object or Array by defining
- * hidden properties.
- */
-/* istanbul ignore next */
-function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
-}
-
-/**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
-function observe (value, asRootData) {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
-}
-
-/**
- * Define a reactive property on an Object.
- */
-function defineReactive (
- obj,
- key,
- val,
- customSetter,
- shallow
-) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- if (!getter && arguments.length === 2) {
- val = obj[key];
- }
- var setter = property && property.set;
-
- var childOb = !shallow && observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if (process.env.NODE_ENV !== 'production' && customSetter) {
- customSetter();
- }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = !shallow && observe(newVal);
- dep.notify();
- }
- });
-}
-
-/**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
-function set (target, key, val) {
- if (process.env.NODE_ENV !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn$1(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val;
- return val
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- process.env.NODE_ENV !== 'production' && warn$1(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return val
- }
- if (!ob) {
- target[key] = val;
- return val
- }
- defineReactive(ob.value, key, val);
- ob.dep.notify();
- return val
-}
-
-/**
- * Delete a property and trigger change if necessary.
- */
-
-
-/**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
-function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
-}
-
-/* */
-
-/**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
-var strats = config.optionMergeStrategies;
-
-/**
- * Options with restrictions
- */
-if (process.env.NODE_ENV !== 'production') {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn$1(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
-}
-
-/**
- * Helper that recursively merges two data objects together.
- */
-function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
- var keys = Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
- mergeData(toVal, fromVal);
- }
- }
- return to
-}
-
-/**
- * Data
- */
-function mergeDataOrFn (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
-}
-
-strats.data = function (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- process.env.NODE_ENV !== 'production' && warn$1(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
-
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
-
- return mergeDataOrFn(parentVal, childVal, vm)
-};
-
-/**
- * Hooks and props are merged as arrays.
- */
-function mergeHook (
- parentVal,
- childVal
-) {
- return childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal
-}
-
-LIFECYCLE_HOOKS.forEach(function (hook) {
- strats[hook] = mergeHook;
-});
-
-/**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
-function mergeAssets (
- parentVal,
- childVal,
- vm,
- key
-) {
- var res = Object.create(parentVal || null);
- if (childVal) {
- process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
- return extend(res, childVal)
- } else {
- return res
- }
-}
-
-ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
-});
-
-/**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
-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 (process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- 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$1] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child];
- }
- return ret
-};
-
-/**
- * Other object hashes.
- */
-strats.props =
-strats.methods =
-strats.inject =
-strats.computed = function (
- parentVal,
- childVal,
- vm,
- key
-) {
- if (childVal && process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = Object.create(null);
- extend(ret, parentVal);
- if (childVal) { extend(ret, childVal); }
- return ret
-};
-strats.provide = mergeDataOrFn;
-
-/**
- * Default strategy.
- */
-var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
-};
-
-
-
-function assertObjectType (name, value, vm) {
- if (!isPlainObject(value)) {
- warn$1(
- "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.
- */
-
-
-/**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
-
-/* */
-
-/* */
-
-/* */
-/* globals MessageChannel */
-
-var callbacks = [];
-function flushCallbacks () {
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
-}
-
-// 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)) {
-
-} else if (typeof MessageChannel !== 'undefined' && (
- isNative(MessageChannel) ||
- // PhantomJS
- MessageChannel.toString() === '[object MessageChannelConstructor]'
-)) {
- var channel = new MessageChannel();
- channel.port1.onmessage = flushCallbacks;
-
-} else {
- /* istanbul ignore next */
-
-}
-
-// Determine microtask defer implementation.
-/* istanbul ignore next, $flow-disable-line */
-if (typeof Promise !== 'undefined' && isNative(Promise)) {
-
-} else {
- // fallback to macro
-
-}
-
-/**
- * Wrap a function so that if any code inside triggers state change,
- * the changes are queued using a (macro) task instead of a microtask.
- */
-
-/* */
-
-/* */
-
-function on (el, dir) {
- if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
- warn$1("v-on without argument does not support modifiers.");
- }
- el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
-}
-
-/* */
-
-function bind$1 (el, dir) {
- el.wrapData = function (code) {
- return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
- };
-}
-
-/* */
-
-var baseDirectives = {
- on: on,
- bind: bind$1,
- cloak: noop
-}
-
-/* */
-
-var CodegenState = function CodegenState (options) {
- this.options = options;
- this.warn = options.warn || baseWarn;
- this.transforms = pluckModuleFunction(options.modules, 'transformCode');
- this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
- this.directives = extend(extend({}, baseDirectives), options.directives);
- var isReservedTag = options.isReservedTag || no;
- this.maybeComponent = function (el) { return !isReservedTag(el.tag); };
- this.onceId = 0;
- this.staticRenderFns = [];
-};
-
-
-
-function generate (
- ast,
- options
-) {
- var state = new CodegenState(options);
- var code = ast ? genElement(ast, state) : '_c("div")';
- return {
- render: ("with(this){return " + code + "}"),
- staticRenderFns: state.staticRenderFns
- }
-}
-
-function genElement (el, state) {
- if (el.staticRoot && !el.staticProcessed) {
- return genStatic(el, state)
- } else if (el.once && !el.onceProcessed) {
- return genOnce(el, state)
- } else if (el.for && !el.forProcessed) {
- return genFor(el, state)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return genChildren(el, state) || 'void 0'
- } else if (el.tag === 'slot') {
- return genSlot(el, state)
- } else {
- // component or element
- var code;
- if (el.component) {
- code = genComponent(el.component, el, state);
- } else {
- var data = el.plain ? undefined : genData(el, state);
-
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
- }
- // module transforms
- for (var i = 0; i < state.transforms.length; i++) {
- code = state.transforms[i](el, code);
- }
- return code
- }
-}
-
-// hoist static sub-trees out
-function genStatic (el, state) {
- el.staticProcessed = true;
- state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
- return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
-}
-
-// v-once
-function genOnce (el, state) {
- el.onceProcessed = true;
- if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.staticInFor) {
- var key = '';
- var parent = el.parent;
- while (parent) {
- if (parent.for) {
- key = parent.key;
- break
- }
- parent = parent.parent;
- }
- if (!key) {
- process.env.NODE_ENV !== 'production' && state.warn(
- "v-once can only be used inside v-for that is keyed. "
- );
- return genElement(el, state)
- }
- return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
- } else {
- return genStatic(el, state)
- }
-}
-
-function genIf (
- el,
- state,
- altGen,
- altEmpty
-) {
- el.ifProcessed = true; // avoid recursion
- return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
-}
-
-function genIfConditions (
- conditions,
- state,
- altGen,
- altEmpty
-) {
- if (!conditions.length) {
- return altEmpty || '_e()'
- }
-
- var condition = conditions.shift();
- if (condition.exp) {
- return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
- } else {
- return ("" + (genTernaryExp(condition.block)))
- }
-
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
- function genTernaryExp (el) {
- return altGen
- ? altGen(el, state)
- : el.once
- ? genOnce(el, state)
- : genElement(el, state)
- }
-}
-
-function genFor (
- el,
- state,
- altGen,
- altHelper
-) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
-
- if (process.env.NODE_ENV !== 'production' &&
- state.maybeComponent(el) &&
- el.tag !== 'slot' &&
- el.tag !== 'template' &&
- !el.key
- ) {
- state.warn(
- "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
- "v-for should have explicit keys. " +
- "See https://vuejs.org/guide/list.html#key for more info.",
- true /* tip */
- );
- }
-
- el.forProcessed = true; // avoid recursion
- return (altHelper || '_l') + "((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + ((altGen || genElement)(el, state)) +
- '})'
-}
-
-function genData (el, state) {
- var data = '{';
-
- // directives first.
- // directives may mutate the el's other properties before they are generated.
- var dirs = genDirectives(el, state);
- if (dirs) { data += dirs + ','; }
-
- // key
- if (el.key) {
- data += "key:" + (el.key) + ",";
- }
- // ref
- if (el.ref) {
- data += "ref:" + (el.ref) + ",";
- }
- if (el.refInFor) {
- data += "refInFor:true,";
- }
- // pre
- if (el.pre) {
- data += "pre:true,";
- }
- // record original tag name for components using "is" attribute
- if (el.component) {
- data += "tag:\"" + (el.tag) + "\",";
- }
- // module data generation functions
- for (var i = 0; i < state.dataGenFns.length; i++) {
- data += state.dataGenFns[i](el);
- }
- // attributes
- if (el.attrs) {
- data += "attrs:{" + (genProps(el.attrs)) + "},";
- }
- // DOM props
- if (el.props) {
- data += "domProps:{" + (genProps(el.props)) + "},";
- }
- // event handlers
- if (el.events) {
- data += (genHandlers(el.events, false, state.warn)) + ",";
- }
- if (el.nativeEvents) {
- data += (genHandlers(el.nativeEvents, true, state.warn)) + ",";
- }
- // slot target
- // only for non-scoped slots
- if (el.slotTarget && !el.slotScope) {
- data += "slot:" + (el.slotTarget) + ",";
- }
- // scoped slots
- if (el.scopedSlots) {
- data += (genScopedSlots(el.scopedSlots, state)) + ",";
- }
- // component v-model
- if (el.model) {
- data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
- }
- // inline-template
- if (el.inlineTemplate) {
- var inlineTemplate = genInlineTemplate(el, state);
- if (inlineTemplate) {
- data += inlineTemplate + ",";
- }
- }
- data = data.replace(/,$/, '') + '}';
- // v-bind data wrap
- if (el.wrapData) {
- data = el.wrapData(data);
- }
- // v-on data wrap
- if (el.wrapListeners) {
- data = el.wrapListeners(data);
- }
- return data
-}
-
-function genDirectives (el, state) {
- var dirs = el.directives;
- if (!dirs) { return }
- var res = 'directives:[';
- var hasRuntime = false;
- var i, l, dir, needRuntime;
- for (i = 0, l = dirs.length; i < l; i++) {
- dir = dirs[i];
- needRuntime = true;
- var gen = state.directives[dir.name];
- if (gen) {
- // compile-time directive that manipulates AST.
- // returns true if it also needs a runtime counterpart.
- needRuntime = !!gen(el, dir, state.warn);
- }
- if (needRuntime) {
- hasRuntime = true;
- res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
- }
- }
- if (hasRuntime) {
- return res.slice(0, -1) + ']'
- }
-}
-
-function genInlineTemplate (el, state) {
- var ast = el.children[0];
- if (process.env.NODE_ENV !== 'production' && (
- el.children.length !== 1 || ast.type !== 1
- )) {
- state.warn('Inline-template components must have exactly one child element.');
- }
- if (ast.type === 1) {
- var inlineRenderFns = generate(ast, state.options);
- return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
- }
-}
-
-function genScopedSlots (
- slots,
- state
-) {
- return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
- return genScopedSlot(key, slots[key], state)
- }).join(',')) + "])")
-}
-
-function genScopedSlot (
- key,
- el,
- state
-) {
- if (el.for && !el.forProcessed) {
- return genForScopedSlot(key, el, state)
- }
- var fn = "function(" + (String(el.slotScope)) + "){" +
- "return " + (el.tag === 'template'
- ? el.if
- ? ((el.if) + "?" + (genChildren(el, state) || 'undefined') + ":undefined")
- : genChildren(el, state) || 'undefined'
- : genElement(el, state)) + "}";
- return ("{key:" + key + ",fn:" + fn + "}")
-}
-
-function genForScopedSlot (
- key,
- el,
- state
-) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
- el.forProcessed = true; // avoid recursion
- return "_l((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + (genScopedSlot(key, el, state)) +
- '})'
-}
-
-function genChildren (
- el,
- state,
- checkSkip,
- altGenElement,
- altGenNode
-) {
- var children = el.children;
- if (children.length) {
- var el$1 = children[0];
- // optimize single v-for
- if (children.length === 1 &&
- el$1.for &&
- el$1.tag !== 'template' &&
- el$1.tag !== 'slot'
- ) {
- return (altGenElement || genElement)(el$1, state)
- }
- var normalizationType = checkSkip
- ? getNormalizationType(children, state.maybeComponent)
- : 0;
- var gen = altGenNode || genNode;
- return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
- }
-}
-
-// determine the normalization needed for the children array.
-// 0: no normalization needed
-// 1: simple normalization needed (possible 1-level deep nested array)
-// 2: full normalization needed
-function getNormalizationType (
- children,
- maybeComponent
-) {
- var res = 0;
- for (var i = 0; i < children.length; i++) {
- var el = children[i];
- if (el.type !== 1) {
- continue
- }
- if (needsNormalization(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
- res = 2;
- break
- }
- if (maybeComponent(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
- res = 1;
- }
- }
- return res
-}
-
-function needsNormalization (el) {
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
-}
-
-function genNode (node, state) {
- if (node.type === 1) {
- return genElement(node, state)
- } if (node.type === 3 && node.isComment) {
- return genComment(node)
- } else {
- return genText(node)
- }
-}
-
-function genText (text) {
- return ("_v(" + (text.type === 2
- ? text.expression // no need for () because already wrapped in _s()
- : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
-}
-
-function genComment (comment) {
- return ("_e(" + (JSON.stringify(comment.text)) + ")")
-}
-
-function genSlot (el, state) {
- var slotName = el.slotName || '"default"';
- var children = genChildren(el, state);
- var res = "_t(" + slotName + (children ? ("," + children) : '');
- var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
- var bind$$1 = el.attrsMap['v-bind'];
- if ((attrs || bind$$1) && !children) {
- res += ",null";
- }
- if (attrs) {
- res += "," + attrs;
- }
- if (bind$$1) {
- res += (attrs ? '' : ',null') + "," + bind$$1;
- }
- return res + ')'
-}
-
-// componentName is el.component, take it as argument to shun flow's pessimistic refinement
-function genComponent (
- componentName,
- el,
- state
-) {
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- return ("_c(" + componentName + "," + (genData(el, state)) + (children ? ("," + children) : '') + ")")
-}
-
-function genProps (props) {
- var res = '';
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- /* istanbul ignore if */
- {
- res += "\"" + (prop.name) + "\":" + (generateValue(prop.value)) + ",";
- }
- }
- return res.slice(0, -1)
-}
-
-/* istanbul ignore next */
-function generateValue (value) {
- if (typeof value === 'string') {
- return transformSpecialNewlines(value)
- }
- return JSON.stringify(value)
-}
-
-// #3895, #4268
-function transformSpecialNewlines (text) {
- return text
- .replace(/\u2028/g, '\\u2028')
- .replace(/\u2029/g, '\\u2029')
-}
-
-/* */
-
-// these keywords should not appear inside expressions, but operators like
-// typeof, instanceof and in are allowed
-var prohibitedKeywordRE = new RegExp('\\b' + (
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments'
-).split(',').join('\\b|\\b') + '\\b');
-
-// these unary operators should not be used as property/method names
-var unaryOperatorsRE = new RegExp('\\b' + (
- 'delete,typeof,void'
-).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
-
-// strip strings in expressions
-var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
-
-// detect problematic expressions in a template
-function detectErrors (ast) {
- var errors = [];
- if (ast) {
- checkNode(ast, errors);
- }
- return errors
-}
-
-function checkNode (node, errors) {
- if (node.type === 1) {
- for (var name in node.attrsMap) {
- if (dirRE.test(name)) {
- var value = node.attrsMap[name];
- if (value) {
- if (name === 'v-for') {
- checkFor(node, ("v-for=\"" + value + "\""), errors);
- } else if (onRE.test(name)) {
- checkEvent(value, (name + "=\"" + value + "\""), errors);
- } else {
- checkExpression(value, (name + "=\"" + value + "\""), errors);
- }
- }
- }
- }
- if (node.children) {
- for (var i = 0; i < node.children.length; i++) {
- checkNode(node.children[i], errors);
- }
- }
- } else if (node.type === 2) {
- checkExpression(node.expression, node.text, errors);
- }
-}
-
-function checkEvent (exp, text, errors) {
- var stipped = exp.replace(stripStringRE, '');
- var keywordMatch = stipped.match(unaryOperatorsRE);
- if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
- errors.push(
- "avoid using JavaScript unary operator as property name: " +
- "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
- );
- }
- checkExpression(exp, text, errors);
-}
-
-function checkFor (node, text, errors) {
- checkExpression(node.for || '', text, errors);
- checkIdentifier(node.alias, 'v-for alias', text, errors);
- checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
- checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
-}
-
-function checkIdentifier (
- ident,
- type,
- text,
- errors
-) {
- if (typeof ident === 'string') {
- try {
- new Function(("var " + ident + "=_"));
- } catch (e) {
- errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
- }
- }
-}
-
-function checkExpression (exp, text, errors) {
- try {
- new Function(("return " + exp));
- } catch (e) {
- var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
- if (keywordMatch) {
- errors.push(
- "avoid using JavaScript keyword as property name: " +
- "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim())
- );
- } else {
- errors.push(
- "invalid expression: " + (e.message) + " in\n\n" +
- " " + exp + "\n\n" +
- " Raw expression: " + (text.trim()) + "\n"
- );
- }
- }
-}
-
-/* */
-
-function createFunction (code, errors) {
- try {
- return new Function(code)
- } catch (err) {
- errors.push({ err: err, code: code });
- return noop
- }
-}
-
-function createCompileToFunctionFn (compile) {
- var cache = Object.create(null);
-
- return function compileToFunctions (
- template,
- options,
- vm
- ) {
- options = extend({}, options);
- var warn$$1 = options.warn || warn$1;
- delete options.warn;
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- // detect possible CSP restriction
- try {
- new Function('return 1');
- } catch (e) {
- if (e.toString().match(/unsafe-eval|CSP/)) {
- warn$$1(
- 'It seems you are using the standalone build of Vue.js in an ' +
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
- 'The template compiler cannot work in this environment. Consider ' +
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
- 'templates into render functions.'
- );
- }
- }
- }
-
- // check cache
- var key = options.delimiters
- ? String(options.delimiters) + template
- : template;
- if (cache[key]) {
- return cache[key]
- }
-
- // compile
- var compiled = compile(template, options);
-
- // check compilation errors/tips
- if (process.env.NODE_ENV !== 'production') {
- if (compiled.errors && compiled.errors.length) {
- warn$$1(
- "Error compiling template:\n\n" + template + "\n\n" +
- compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
- vm
- );
- }
- if (compiled.tips && compiled.tips.length) {
- compiled.tips.forEach(function (msg) { return tip(msg, vm); });
- }
- }
-
- // turn code into functions
- var res = {};
- var fnGenErrors = [];
- res.render = createFunction(compiled.render, fnGenErrors);
- res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
- return createFunction(code, fnGenErrors)
- });
-
- // check function generation errors.
- // this should only happen if there is a bug in the compiler itself.
- // mostly for codegen development use
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
- warn$$1(
- "Failed to generate render function:\n\n" +
- fnGenErrors.map(function (ref) {
- var err = ref.err;
- var code = ref.code;
-
- return ((err.toString()) + " in\n\n" + code + "\n");
- }).join('\n'),
- vm
- );
- }
- }
-
- return (cache[key] = res)
- }
-}
-
-/* */
-
-function createCompilerCreator (baseCompile) {
- return function createCompiler (baseOptions) {
- function compile (
- template,
- options
- ) {
- var finalOptions = Object.create(baseOptions);
- var errors = [];
- var tips = [];
- finalOptions.warn = function (msg, tip) {
- (tip ? tips : errors).push(msg);
- };
-
- if (options) {
- // merge custom modules
- if (options.modules) {
- finalOptions.modules =
- (baseOptions.modules || []).concat(options.modules);
- }
- // merge custom directives
- if (options.directives) {
- finalOptions.directives = extend(
- Object.create(baseOptions.directives || null),
- options.directives
- );
- }
- // copy other options
- for (var key in options) {
- if (key !== 'modules' && key !== 'directives') {
- finalOptions[key] = options[key];
- }
- }
- }
-
- var compiled = baseCompile(template, finalOptions);
- if (process.env.NODE_ENV !== 'production') {
- errors.push.apply(errors, detectErrors(compiled.ast));
- }
- compiled.errors = errors;
- compiled.tips = tips;
- return compiled
- }
-
- return {
- compile: compile,
- compileToFunctions: createCompileToFunctionFn(compile)
- }
- }
-}
-
-/* */
-
-// `createCompilerCreator` allows creating compilers that use alternative
-// parser/optimizer/codegen, e.g the SSR optimizing compiler.
-// Here we just export a default compiler using the default parts.
-var createCompiler = createCompilerCreator(function baseCompile (
- template,
- options
-) {
- var ast = parse(template.trim(), options);
- if (options.optimize !== false) {
- optimize(ast, options);
- }
- var code = generate(ast, options);
- return {
- ast: ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
-});
-
-/* */
-
-function transformNode (el, options) {
- var warn = options.warn || baseWarn;
- var staticClass = getAndRemoveAttr(el, 'class');
- var ref = parseStaticClass(staticClass, options);
- var dynamic = ref.dynamic;
- var classResult = ref.classResult;
- if (process.env.NODE_ENV !== 'production' && dynamic && staticClass) {
- warn(
- "class=\"" + staticClass + "\": " +
- 'Interpolation inside attributes has been deprecated. ' +
- 'Use v-bind or the colon shorthand instead.'
- );
- }
- if (!dynamic && classResult) {
- el.staticClass = classResult;
- }
- var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
- if (classBinding) {
- el.classBinding = classBinding;
- } else if (dynamic) {
- el.classBinding = classResult;
- }
-}
-
-function genData$1 (el) {
- var data = '';
- if (el.staticClass) {
- data += "staticClass:" + (el.staticClass) + ",";
- }
- if (el.classBinding) {
- data += "class:" + (el.classBinding) + ",";
- }
- return data
-}
-
-function parseStaticClass (staticClass, options) {
- // "a b c" -> ["a", "b", "c"] => staticClass: ["a", "b", "c"]
- // "a {{x}} c" -> ["a", x, "c"] => classBinding: '["a", x, "c"]'
- var dynamic = false;
- var classResult = '';
- if (staticClass) {
- var classList = staticClass.trim().split(' ').map(function (name) {
- var result = parseText(name, options.delimiters);
- if (result) {
- dynamic = true;
- return result.expression
- }
- return JSON.stringify(name)
- });
- if (classList.length) {
- classResult = '[' + classList.join(',') + ']';
- }
- }
- return { dynamic: dynamic, classResult: classResult }
-}
-
-var klass = {
- staticKeys: ['staticClass'],
- transformNode: transformNode,
- genData: genData$1
-}
-
-/* */
-
-var normalize = cached(camelize);
-
-function transformNode$1 (el, options) {
- var warn = options.warn || baseWarn;
- var staticStyle = getAndRemoveAttr(el, 'style');
- var ref = parseStaticStyle(staticStyle, options);
- var dynamic = ref.dynamic;
- var styleResult = ref.styleResult;
- if (process.env.NODE_ENV !== 'production' && dynamic) {
- warn(
- "style=\"" + (String(staticStyle)) + "\": " +
- 'Interpolation inside attributes has been deprecated. ' +
- 'Use v-bind or the colon shorthand instead.'
- );
- }
- if (!dynamic && styleResult) {
- // $flow-disable-line
- el.staticStyle = styleResult;
- }
- var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
- if (styleBinding) {
- el.styleBinding = styleBinding;
- } else if (dynamic) {
- // $flow-disable-line
- el.styleBinding = styleResult;
- }
-}
-
-function genData$2 (el) {
- var data = '';
- if (el.staticStyle) {
- data += "staticStyle:" + (el.staticStyle) + ",";
- }
- if (el.styleBinding) {
- data += "style:" + (el.styleBinding) + ",";
- }
- return data
-}
-
-function parseStaticStyle (staticStyle, options) {
- // "width: 200px; height: 200px;" -> {width: 200, height: 200}
- // "width: 200px; height: {{y}}" -> {width: 200, height: y}
- var dynamic = false;
- var styleResult = '';
- if (typeof staticStyle === 'string') {
- var styleList = staticStyle.trim().split(';').map(function (style) {
- var result = style.trim().split(':');
- if (result.length !== 2) {
- return
- }
- var key = normalize(result[0].trim());
- var value = result[1].trim();
- var dynamicValue = parseText(value, options.delimiters);
- if (dynamicValue) {
- dynamic = true;
- return key + ':' + dynamicValue.expression
- }
- return key + ':' + JSON.stringify(value)
- }).filter(function (result) { return result; });
- if (styleList.length) {
- styleResult = '{' + styleList.join(',') + '}';
- }
- } else if (isPlainObject(staticStyle)) {
- styleResult = JSON.stringify(staticStyle) || '';
- }
- return { dynamic: dynamic, styleResult: styleResult }
-}
-
-var style = {
- staticKeys: ['staticStyle'],
- transformNode: transformNode$1,
- genData: genData$2
-}
-
-/* */
-
-var normalize$1 = cached(camelize);
-
-function normalizeKeyName (str) {
- if (str.match(/^v\-/)) {
- return str.replace(/(v-[a-z\-]+\:)([a-z\-]+)$/i, function ($, directive, prop) {
- return directive + normalize$1(prop)
- })
- }
- return normalize$1(str)
-}
-
-function transformNode$2 (el, options) {
- if (Array.isArray(el.attrsList)) {
- el.attrsList.forEach(function (attr) {
- if (attr.name && attr.name.match(/\-/)) {
- var realName = normalizeKeyName(attr.name);
- if (el.attrsMap) {
- el.attrsMap[realName] = el.attrsMap[attr.name];
- delete el.attrsMap[attr.name];
- }
- attr.name = realName;
- }
- });
- }
-}
-var props = {
- transformNode: transformNode$2
-}
-
-/* */
-
-// The "unitary tag" means that the tag node and its children
-// must be sent to the native together.
-var isUnitaryTag = makeMap('cell,header,cell-slot,recycle-list', true);
-
-function preTransformNode (el, options) {
- if (isUnitaryTag(el.tag) && !el.attrsList.some(function (item) { return item.name === 'append'; })) {
- el.attrsMap.append = 'tree';
- el.attrsList.push({ name: 'append', value: 'tree' });
- }
- if (el.attrsMap.append === 'tree') {
- el.appendAsTree = true;
- }
-}
-
-function genData$3 (el) {
- return el.appendAsTree ? "appendAsTree:true," : ''
-}
-
-var append = {
- staticKeys: ['appendAsTree'],
- preTransformNode: preTransformNode,
- genData: genData$3
-}
-
-/* */
-
-/**
- * Map the following syntax to corresponding attrs:
- *
- * <recycle-list for="(item, i) in longList" switch="cellType">
- * <cell-slot case="A"> ... </cell-slot>
- * <cell-slot case="B"> ... </cell-slot>
- * </recycle-list>
- */
-
-function preTransformRecycleList (
- el,
- options
-) {
- var exp = getAndRemoveAttr(el, 'for');
- if (!exp) {
- if (options.warn) {
- options.warn("Invalid <recycle-list> syntax: missing \"for\" expression.");
- }
- return
- }
-
- var res = parseFor(exp);
- if (!res) {
- if (options.warn) {
- options.warn(("Invalid <recycle-list> syntax: " + exp + "."));
- }
- return
- }
-
- addRawAttr(el, ':list-data', res.for);
- addRawAttr(el, 'binding-expression', res.for);
- addRawAttr(el, 'alias', res.alias);
- if (res.iterator2) {
- // (item, key, index) for object iteration
- // is this even supported?
- addRawAttr(el, 'index', res.iterator2);
- } else if (res.iterator1) {
- addRawAttr(el, 'index', res.iterator1);
- }
-
- var switchKey = getAndRemoveAttr(el, 'switch');
- if (switchKey) {
- addRawAttr(el, 'switch', switchKey);
- }
-}
-
-/* */
-
-
-var RECYCLE_LIST_MARKER = '@inRecycleList';
-
-// Register the component hook to weex native render engine.
-// The hook will be triggered by native, not javascript.
-
-
-// Updates the state of the component to weex native render engine.
-
-/* */
-
-// mark components as inside recycle-list so that we know we need to invoke
-// their special @render function instead of render in create-component.js
-function postTransformComponent (
- el,
- options
-) {
- // $flow-disable-line (we know isReservedTag is there)
- if (!options.isReservedTag(el.tag) && el.tag !== 'cell-slot') {
- addAttr(el, RECYCLE_LIST_MARKER, 'true');
- }
-}
-
-/* */
-
-// mark component root nodes as
-function postTransformComponentRoot (
- el,
- options
-) {
- if (!el.parent) {
- // component root
- addAttr(el, '@isComponentRoot', 'true');
- addAttr(el, '@templateId', '_uid');
- addAttr(el, '@componentProps', '$props || {}');
- }
-}
-
-/* */
-
-function genText$1 (node) {
- var value = node.type === 3
- ? node.text
- : node.type === 2
- ? node.tokens.length === 1
- ? node.tokens[0]
- : node.tokens
- : '';
- return JSON.stringify(value)
-}
-
-function postTransformText (el, options) {
- // weex <text> can only contain text, so the parser
- // always generates a single child.
- if (el.children.length) {
- addAttr(el, 'value', genText$1(el.children[0]));
- el.children = [];
- }
-}
-
-/* */
-
-// import { warn } from 'core/util/index'
-
-// this will be preserved during build
-// $flow-disable-line
-var acorn = require('acorn'); // $flow-disable-line
-var walk = require('acorn/dist/walk'); // $flow-disable-line
-var escodegen = require('escodegen');
-
-function nodeToBinding (node) {
- switch (node.type) {
- case 'Literal': return node.value
- case 'Identifier':
- case 'UnaryExpression':
- case 'BinaryExpression':
- case 'LogicalExpression':
- case 'ConditionalExpression':
- case 'MemberExpression': return { '@binding': escodegen.generate(node) }
- case 'ArrayExpression': return node.elements.map(function (_) { return nodeToBinding(_); })
- case 'ObjectExpression': {
- var object = {};
- node.properties.forEach(function (prop) {
- if (!prop.key || prop.key.type !== 'Identifier') {
- return
- }
- var key = escodegen.generate(prop.key);
- var value = nodeToBinding(prop.value);
- if (key && value) {
- object[key] = value;
- }
- });
- return object
- }
- default: {
- // warn(`Not support ${node.type}: "${escodegen.generate(node)}"`)
- return ''
- }
- }
-}
-
-function generateBinding (exp) {
- if (exp && typeof exp === 'string') {
- var ast = null;
- try {
- ast = acorn.parse(("(" + exp + ")"));
- } catch (e) {
- // warn(`Failed to parse the expression: "${exp}"`)
- return ''
- }
-
- var output = '';
- walk.simple(ast, {
- Expression: function Expression (node) {
- output = nodeToBinding(node);
- }
- });
- return output
- }
-}
-
-/* */
-
-function parseAttrName (name) {
- return camelize(name.replace(bindRE, ''))
-}
-
-function preTransformVBind (el, options) {
- for (var attr in el.attrsMap) {
- if (bindRE.test(attr)) {
- var name = parseAttrName(attr);
- var value = generateBinding(getAndRemoveAttr(el, attr));
- delete el.attrsMap[attr];
- addRawAttr(el, name, value);
- }
- }
-}
-
-/* */
-
-function hasConditionDirective (el) {
- for (var attr in el.attrsMap) {
- if (/^v\-if|v\-else|v\-else\-if$/.test(attr)) {
- return true
- }
- }
- return false
-}
-
-function getPreviousConditions (el) {
- var conditions = [];
- if (el.parent && el.parent.children) {
- for (var c = 0, n = el.parent.children.length; c < n; ++c) {
- // $flow-disable-line
- var ifConditions = el.parent.children[c].ifConditions;
- if (ifConditions) {
- for (var i = 0, l = ifConditions.length; i < l; ++i) {
- var condition = ifConditions[i];
- if (condition && condition.exp) {
- conditions.push(condition.exp);
- }
- }
- }
- }
- }
- return conditions
-}
-
-function preTransformVIf (el, options) {
- if (hasConditionDirective(el)) {
- var exp;
- var ifExp = getAndRemoveAttr(el, 'v-if', true /* remove from attrsMap */);
- var elseifExp = getAndRemoveAttr(el, 'v-else-if', true);
- // don't need the value, but remove it to avoid being generated as a
- // custom directive
- getAndRemoveAttr(el, 'v-else', true);
- if (ifExp) {
- exp = ifExp;
- addIfCondition(el, { exp: ifExp, block: el });
- } else {
- elseifExp && addIfCondition(el, { exp: elseifExp, block: el });
- var prevConditions = getPreviousConditions(el);
- if (prevConditions.length) {
- var prevMatch = prevConditions.join(' || ');
- exp = elseifExp
- ? ("!(" + prevMatch + ") && (" + elseifExp + ")") // v-else-if
- : ("!(" + prevMatch + ")"); // v-else
- } else if (process.env.NODE_ENV !== 'production' && options.warn) {
- options.warn(
- "v-" + (elseifExp ? ('else-if="' + elseifExp + '"') : 'else') + " " +
- "used on element <" + (el.tag) + "> without corresponding v-if."
- );
- return
- }
- }
- addRawAttr(el, '[[match]]', exp);
- }
-}
-
-/* */
-
-function preTransformVFor (el, options) {
- var exp = getAndRemoveAttr(el, 'v-for');
- if (!exp) {
- return
- }
-
- var res = parseFor(exp);
- if (!res) {
- if (process.env.NODE_ENV !== 'production' && options.warn) {
- options.warn(("Invalid v-for expression: " + exp));
- }
- return
- }
-
- var desc = {
- '@expression': res.for,
- '@alias': res.alias
- };
- if (res.iterator2) {
- desc['@key'] = res.iterator1;
- desc['@index'] = res.iterator2;
- } else {
- desc['@index'] = res.iterator1;
- }
-
- delete el.attrsMap['v-for'];
- addRawAttr(el, '[[repeat]]', desc);
-}
-
-/* */
-
-var inlineStatementRE = /^\s*([A-Za-z_$0-9\['\."\]]+)*\s*\(\s*(([A-Za-z_$0-9\['\."\]]+)?(\s*,\s*([A-Za-z_$0-9\['\."\]]+))*)\s*\)$/;
-
-function parseHandlerParams (handler) {
- var res = inlineStatementRE.exec(handler.value);
- if (res && res[2]) {
- handler.params = res[2].split(/\s*,\s*/);
- }
-}
-
-function postTransformVOn (el, options) {
- var events = el.events;
- if (!events) {
- return
- }
- for (var name in events) {
- var handler = events[name];
- if (Array.isArray(handler)) {
- handler.map(function (fn) { return parseHandlerParams(fn); });
- } else {
- parseHandlerParams(handler);
- }
- }
-}
-
-/* */
-
-function containVOnce (el) {
- for (var attr in el.attrsMap) {
- if (/^v\-once$/i.test(attr)) {
- return true
- }
- }
- return false
-}
-
-function preTransformVOnce (el, options) {
- if (containVOnce(el)) {
- getAndRemoveAttr(el, 'v-once', true);
- addRawAttr(el, '[[once]]', true);
- }
-}
-
-/* */
-
-var currentRecycleList = null;
-
-function shouldCompile (el, options) {
- return options.recyclable ||
- (currentRecycleList && el !== currentRecycleList)
-}
-
-function preTransformNode$1 (el, options) {
- if (el.tag === 'recycle-list') {
- preTransformRecycleList(el, options);
- currentRecycleList = el;
- }
- if (shouldCompile(el, options)) {
- preTransformVBind(el, options);
- preTransformVIf(el, options); // also v-else-if and v-else
- preTransformVFor(el, options);
- preTransformVOnce(el, options);
- }
-}
-
-function transformNode$3 (el, options) {
- if (shouldCompile(el, options)) {
- // do nothing yet
- }
-}
-
-function postTransformNode (el, options) {
- if (shouldCompile(el, options)) {
- // mark child component in parent template
- postTransformComponent(el, options);
- // mark root in child component template
- postTransformComponentRoot(el, options);
- // <text>: transform children text into value attr
- if (el.tag === 'text') {
- postTransformText(el, options);
- }
- postTransformVOn(el, options);
- }
- if (el === currentRecycleList) {
- currentRecycleList = null;
- }
-}
-
-var recycleList = {
- preTransformNode: preTransformNode$1,
- transformNode: transformNode$3,
- postTransformNode: postTransformNode
-}
-
-var modules = [
- recycleList,
- klass,
- style,
- props,
- append
-]
-
-/* */
-
-function model (
- el,
- dir,
- _warn
-) {
- if (el.tag === 'input' || el.tag === 'textarea') {
- genDefaultModel(el, dir.value, dir.modifiers);
- } else {
- genComponentModel(el, dir.value, dir.modifiers);
- }
-}
-
-function genDefaultModel (
- el,
- value,
- modifiers
-) {
- var ref = modifiers || {};
- var lazy = ref.lazy;
- var trim = ref.trim;
- var number = ref.number;
- var event = lazy ? 'change' : 'input';
-
- var valueExpression = "$event.target.attr.value" + (trim ? '.trim()' : '');
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
-
- var code = genAssignmentCode(value, valueExpression);
- addAttr(el, 'value', ("(" + value + ")"));
- addHandler(el, event, code, null, true);
-}
-
-var directives = {
- model: model
-}
-
-/* */
-
-// These util functions are split into its own file because Rollup cannot drop
-// makeMap() due to potential side effects, so these variables end up
-// bloating the web builds.
-
-var isReservedTag = makeMap(
- 'template,script,style,element,content,slot,link,meta,svg,view,' +
- 'a,div,img,image,text,span,input,switch,textarea,spinner,select,' +
- 'slider,slider-neighbor,indicator,canvas,' +
- 'list,cell,header,loading,loading-indicator,refresh,scrollable,scroller,' +
- 'video,web,embed,tabbar,tabheader,datepicker,timepicker,marquee,countdown',
- true
-);
-
-// Elements that you can, intentionally, leave open (and which close themselves)
-// more flexible than web
-var canBeLeftOpenTag$1 = makeMap(
- 'web,spinner,switch,video,textarea,canvas,' +
- 'indicator,marquee,countdown',
- true
-);
-
-var isRuntimeComponent = makeMap(
- 'richtext,transition,transition-group',
- true
-);
-
-var isUnaryTag$1 = makeMap(
- 'embed,img,image,input,link,meta',
- true
-);
-
-function mustUseProp (tag, type, name) {
- return false
-}
-
-function getTagNamespace (tag) { }
-
-/* */
-
-var baseOptions = {
- modules: modules,
- directives: directives,
- isUnaryTag: isUnaryTag$1,
- mustUseProp: mustUseProp,
- canBeLeftOpenTag: canBeLeftOpenTag$1,
- isReservedTag: isReservedTag,
- getTagNamespace: getTagNamespace,
- preserveWhitespace: false,
- recyclable: false,
- staticKeys: genStaticKeys(modules)
-};
-
-var compiler = createCompiler(baseOptions);
-
-function compile (
- template,
- options
-) {
- var generateAltRender = false;
- if (options && options.recyclable === true) {
- generateAltRender = true;
- options.recyclable = false;
- }
- var result = compiler.compile(template, options);
-
- // generate @render function for <recycle-list>
- if (options && generateAltRender) {
- options.recyclable = true;
- // disable static optimizations
- options.optimize = false;
- var ref = compiler.compile(template, options);
- var render = ref.render;
- result['@render'] = render;
- }
- return result
-}
-
-exports.compile = compile;
+++ /dev/null
-try {
- var vueVersion = require('weex-vue-framework').version
-} catch (e) {}
-
-var packageName = require('./package.json').name
-var packageVersion = require('./package.json').version
-if (vueVersion && vueVersion !== packageVersion) {
- throw new Error(
- '\n\nVue packages version mismatch:\n\n' +
- '- vue@' + vueVersion + '\n' +
- '- ' + packageName + '@' + packageVersion + '\n\n' +
- 'This may cause things to work incorrectly. Make sure to use the same version for both.\n' +
- 'If you are using weex-vue-loader, re-installing them should bump ' + packageName + ' to the latest.\n'
- )
-}
-
-module.exports = require('./build')
+++ /dev/null
-{
- "name": "weex-template-compiler",
- "version": "2.4.2-weex.1",
- "description": "Weex template compiler for Vue 2.0",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/vuejs/vue.git"
- },
- "keywords": [
- "vue",
- "compiler"
- ],
- "author": "Evan You",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/vuejs/vue/issues"
- },
- "homepage": "https://github.com/vuejs/vue/tree/dev/packages/weex-template-compiler#readme",
- "dependencies": {
- "acorn": "^5.2.1",
- "escodegen": "^1.8.1",
- "he": "^1.1.0"
- }
-}
+++ /dev/null
-# weex-vue-framework
-
-> This package is auto-generated. For pull requests please see [src/platforms/weex/entry-framework.js](https://github.com/vuejs/vue/blob/dev/src/platforms/weex/entry-framework.js).
+++ /dev/null
-'use strict';
-
-module.exports = function weexFactory (exports, document) {
-
-/* */
-
-var emptyObject = Object.freeze({});
-
-// these helpers produces better vm code in JS engines due to their
-// explicitness and function inlining
-function isUndef (v) {
- return v === undefined || v === null
-}
-
-function isDef (v) {
- return v !== undefined && v !== null
-}
-
-function isTrue (v) {
- return v === true
-}
-
-function isFalse (v) {
- return v === false
-}
-
-/**
- * Check if value is primitive
- */
-function isPrimitive (value) {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
-}
-
-/**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
-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.
- */
-function isPlainObject (obj) {
- return _toString.call(obj) === '[object Object]'
-}
-
-function isRegExp (v) {
- return _toString.call(v) === '[object RegExp]'
-}
-
-/**
- * Check if val is a valid array index.
- */
-function isValidArrayIndex (val) {
- var n = parseFloat(String(val));
- return n >= 0 && Math.floor(n) === n && isFinite(val)
-}
-
-/**
- * Convert a value to a string that is actually rendered.
- */
-function toString (val) {
- return val == null
- ? ''
- : typeof val === 'object'
- ? JSON.stringify(val, null, 2)
- : String(val)
-}
-
-/**
- * Convert a input value to a number for persistence.
- * If the conversion fails, return original string.
- */
-function toNumber (val) {
- var n = parseFloat(val);
- return isNaN(n) ? val : n
-}
-
-/**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
-function makeMap (
- str,
- expectsLowerCase
-) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
-}
-
-/**
- * Check if a tag is a built-in tag.
- */
-var isBuiltInTag = makeMap('slot,component', true);
-
-/**
- * Check if a attribute is a reserved attribute.
- */
-var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
-
-/**
- * Remove an item from an array
- */
-function remove (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
-}
-
-/**
- * Check whether the object has the property.
- */
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
-}
-
-/**
- * Create a cached version of a pure function.
- */
-function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
-}
-
-/**
- * Camelize a hyphen-delimited string.
- */
-var camelizeRE = /-(\w)/g;
-var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
-});
-
-/**
- * Capitalize a string.
- */
-var capitalize = cached(function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
-});
-
-/**
- * Hyphenate a camelCase string.
- */
-var hyphenateRE = /\B([A-Z])/g;
-var hyphenate = cached(function (str) {
- return str.replace(hyphenateRE, '-$1').toLowerCase()
-});
-
-/**
- * Simple bind polyfill for environments that do not support it... e.g.
- * PhantomJS 1.x. Technically we don't need this anymore since native bind is
- * now more performant in most browsers, but removing it would be breaking for
- * code that was able to run in PhantomJS 1.x, so this must be kept for
- * backwards compatibility.
- */
-
-/* istanbul ignore next */
-function polyfillBind (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
-
- boundFn._length = fn.length;
- return boundFn
-}
-
-function nativeBind (fn, ctx) {
- return fn.bind(ctx)
-}
-
-var bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind;
-
-/**
- * Convert an Array-like object to a real Array.
- */
-function toArray (list, start) {
- start = start || 0;
- var i = list.length - start;
- var ret = new Array(i);
- while (i--) {
- ret[i] = list[i + start];
- }
- return ret
-}
-
-/**
- * Mix properties into target object.
- */
-function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
-}
-
-/**
- * Merge an Array of Objects into a single Object.
- */
-function toObject (arr) {
- var res = {};
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res
-}
-
-/**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
- */
-function noop (a, b, c) {}
-
-/**
- * Always return false.
- */
-var no = function (a, b, c) { return false; };
-
-/**
- * Return same value
- */
-var identity = function (_) { return _; };
-
-/**
- * Generate a static keys string from compiler modules.
- */
-
-
-/**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
-function looseEqual (a, b) {
- if (a === b) { return true }
- var isObjectA = isObject(a);
- var isObjectB = isObject(b);
- if (isObjectA && isObjectB) {
- try {
- var isArrayA = Array.isArray(a);
- var isArrayB = Array.isArray(b);
- if (isArrayA && isArrayB) {
- return a.length === b.length && a.every(function (e, i) {
- return looseEqual(e, b[i])
- })
- } else if (!isArrayA && !isArrayB) {
- var keysA = Object.keys(a);
- var keysB = Object.keys(b);
- return keysA.length === keysB.length && keysA.every(function (key) {
- return looseEqual(a[key], b[key])
- })
- } else {
- /* istanbul ignore next */
- return false
- }
- } catch (e) {
- /* istanbul ignore next */
- return false
- }
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b)
- } else {
- return false
- }
-}
-
-function looseIndexOf (arr, val) {
- for (var i = 0; i < arr.length; i++) {
- if (looseEqual(arr[i], val)) { return i }
- }
- return -1
-}
-
-/**
- * Ensure a function is called only once.
- */
-function once (fn) {
- var called = false;
- return function () {
- if (!called) {
- called = true;
- fn.apply(this, arguments);
- }
- }
-}
-
-var SSR_ATTR = 'data-server-rendered';
-
-var ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
-];
-
-var LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured'
-];
-
-/* */
-
-var config = ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Show production mode tip message on boot?
- */
- productionTip: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to enable devtools
- */
- devtools: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to record perf
- */
- performance: false,
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
-})
-
-/* */
-
-/**
- * Check if a string starts with $ or _
- */
-function isReserved (str) {
- var c = (str + '').charCodeAt(0);
- return c === 0x24 || c === 0x5F
-}
-
-/**
- * Define a property.
- */
-function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
-}
-
-/**
- * Parse simple path.
- */
-var bailRE = /[^\w.$]/;
-function parsePath (path) {
- if (bailRE.test(path)) {
- return
- }
- var segments = path.split('.');
- return function (obj) {
- for (var i = 0; i < segments.length; i++) {
- if (!obj) { return }
- obj = obj[segments[i]];
- }
- return obj
- }
-}
-
-/* */
-
-// can we use __proto__?
-var hasProto = '__proto__' in {};
-
-// Browser environment sniffing
-var inBrowser = typeof window !== 'undefined';
-var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
-var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
-var UA = inBrowser && window.navigator.userAgent.toLowerCase();
-var isIE = UA && /msie|trident/.test(UA);
-var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
-var isEdge = UA && UA.indexOf('edge/') > 0;
-var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
-var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
-var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
-
-// Firefox has a "watch" function on Object.prototype...
-var nativeWatch = ({}).watch;
-
-
-if (inBrowser) {
- try {
- var opts = {};
- Object.defineProperty(opts, 'passive', ({
- get: function get () {
- /* istanbul ignore next */
-
- }
- })); // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts);
- } catch (e) {}
-}
-
-// this needs to be lazy-evaled because vue may be required before
-// vue-server-renderer can set VUE_ENV
-var _isServer;
-var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
-};
-
-// detect devtools
-var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
-/* istanbul ignore next */
-function isNative (Ctor) {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
-}
-
-var hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
-
-var _Set;
-/* istanbul ignore if */ // $flow-disable-line
-if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set;
-} else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = (function () {
- function Set () {
- this.set = Object.create(null);
- }
- Set.prototype.has = function has (key) {
- return this.set[key] === true
- };
- Set.prototype.add = function add (key) {
- this.set[key] = true;
- };
- Set.prototype.clear = function clear () {
- this.set = Object.create(null);
- };
-
- return Set;
- }());
-}
-
-/* */
-
-var warn = noop;
-var tip = noop;
-var generateComponentTrace = (noop); // work around flow check
-var formatComponentName = (noop);
-
-if (process.env.NODE_ENV !== 'production') {
- 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 '<Root>'
- }
- 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)) + ">") : "<Anonymous>") +
- (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;
-
-/**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
-var Dep = function Dep () {
- this.id = uid++;
- this.subs = [];
-};
-
-Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
-};
-
-Dep.prototype.removeSub = function removeSub (sub) {
- remove(this.subs, sub);
-};
-
-Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
-};
-
-Dep.prototype.notify = function notify () {
- // stabilize the subscriber list first
- var subs = this.subs.slice();
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
-};
-
-// the current target watcher being evaluated.
-// this is globally unique because there could be only one
-// watcher being evaluated at any time.
-Dep.target = null;
-var targetStack = [];
-
-function pushTarget (_target) {
- if (Dep.target) { targetStack.push(Dep.target); }
- Dep.target = _target;
-}
-
-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.fnContext = undefined;
- this.fnOptions = undefined;
- this.fnScopeId = 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) {
- 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.fnContext = vnode.fnContext;
- cloned.fnOptions = vnode.fnOptions;
- cloned.fnScopeId = vnode.fnScopeId;
- cloned.isCloned = true;
- return cloned
-}
-
-/*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
-var arrayProto = Array.prototype;
-var arrayMethods = Object.create(arrayProto);
-
-var methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
-];
-
-/**
- * Intercept mutating methods and emit events
- */
-methodsToPatch.forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
-});
-
-/* */
-
-var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
-/**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
-var shouldObserve = true;
-
-function toggleObserving (value) {
- shouldObserve = value;
-}
-
-/**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
-var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- var augment = hasProto
- ? protoAugment
- : copyAugment;
- augment(value, arrayMethods, arrayKeys);
- this.observeArray(value);
- } else {
- this.walk(value);
- }
-};
-
-/**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
-Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive(obj, keys[i]);
- }
-};
-
-/**
- * Observe a list of Array items.
- */
-Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
-};
-
-// helpers
-
-/**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- */
-function protoAugment (target, src, keys) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
-}
-
-/**
- * Augment an target Object or Array by defining
- * hidden properties.
- */
-/* istanbul ignore next */
-function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
-}
-
-/**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
-function observe (value, asRootData) {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
-}
-
-/**
- * Define a reactive property on an Object.
- */
-function defineReactive (
- obj,
- key,
- val,
- customSetter,
- shallow
-) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- if (!getter && arguments.length === 2) {
- val = obj[key];
- }
- var setter = property && property.set;
-
- var childOb = !shallow && observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if (process.env.NODE_ENV !== 'production' && customSetter) {
- customSetter();
- }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = !shallow && observe(newVal);
- dep.notify();
- }
- });
-}
-
-/**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
-function set (target, key, val) {
- if (process.env.NODE_ENV !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val;
- return val
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return val
- }
- if (!ob) {
- target[key] = val;
- return val
- }
- defineReactive(ob.value, key, val);
- ob.dep.notify();
- return val
-}
-
-/**
- * Delete a property and trigger change if necessary.
- */
-function del (target, key) {
- if (process.env.NODE_ENV !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.splice(key, 1);
- return
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'Avoid deleting properties on a Vue instance or its root $data ' +
- '- just set it to null.'
- );
- return
- }
- if (!hasOwn(target, key)) {
- return
- }
- delete target[key];
- if (!ob) {
- return
- }
- ob.dep.notify();
-}
-
-/**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
-function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
-}
-
-/* */
-
-/**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
-var strats = config.optionMergeStrategies;
-
-/**
- * Options with restrictions
- */
-if (process.env.NODE_ENV !== 'production') {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
-}
-
-/**
- * Helper that recursively merges two data objects together.
- */
-function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
- var keys = Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
- mergeData(toVal, fromVal);
- }
- }
- return to
-}
-
-/**
- * Data
- */
-function mergeDataOrFn (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
-}
-
-strats.data = function (
- parentVal,
- childVal,
- vm
-) {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- process.env.NODE_ENV !== 'production' && warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
-
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
-
- return mergeDataOrFn(parentVal, childVal, vm)
-};
-
-/**
- * Hooks and props are merged as arrays.
- */
-function mergeHook (
- parentVal,
- childVal
-) {
- return childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal
-}
-
-LIFECYCLE_HOOKS.forEach(function (hook) {
- strats[hook] = mergeHook;
-});
-
-/**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
-function mergeAssets (
- parentVal,
- childVal,
- vm,
- key
-) {
- var res = Object.create(parentVal || null);
- if (childVal) {
- process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
- return extend(res, childVal)
- } else {
- return res
- }
-}
-
-ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
-});
-
-/**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
-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 (process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- 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$1] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child];
- }
- return ret
-};
-
-/**
- * Other object hashes.
- */
-strats.props =
-strats.methods =
-strats.inject =
-strats.computed = function (
- parentVal,
- childVal,
- vm,
- key
-) {
- if (childVal && process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = Object.create(null);
- extend(ret, parentVal);
- if (childVal) { extend(ret, childVal); }
- return ret
-};
-strats.provide = mergeDataOrFn;
-
-/**
- * Default strategy.
- */
-var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
-};
-
-/**
- * Validate component names
- */
-function checkComponents (options) {
- for (var key in options.components) {
- validateComponentName(key);
- }
-}
-
-function validateComponentName (name) {
- if (!/^[a-zA-Z][\w-]*$/.test(name)) {
- warn(
- 'Invalid component name: "' + name + '". Component names ' +
- 'can only contain alphanumeric characters and the hyphen, ' +
- 'and must start with a letter.'
- );
- }
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + name
- );
- }
-}
-
-/**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- */
-function normalizeProps (options, vm) {
- var props = options.props;
- if (!props) { return }
- var res = {};
- var i, val, name;
- if (Array.isArray(props)) {
- i = props.length;
- while (i--) {
- val = props[i];
- if (typeof val === 'string') {
- name = camelize(val);
- res[name] = { type: null };
- } else if (process.env.NODE_ENV !== 'production') {
- warn('props must be strings when using array syntax.');
- }
- }
- } else if (isPlainObject(props)) {
- for (var key in props) {
- val = props[key];
- name = camelize(key);
- res[name] = isPlainObject(val)
- ? val
- : { type: val };
- }
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- "Invalid value for option \"props\": expected an Array or an Object, " +
- "but got " + (toRawType(props)) + ".",
- vm
- );
- }
- options.props = res;
-}
-
-/**
- * Normalize all injections into Object-based format
- */
-function normalizeInject (options, vm) {
- var inject = options.inject;
- if (!inject) { return }
- var normalized = options.inject = {};
- if (Array.isArray(inject)) {
- for (var i = 0; i < inject.length; 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 (process.env.NODE_ENV !== 'production') {
- warn(
- "Invalid value for option \"inject\": expected an Array or an Object, " +
- "but got " + (toRawType(inject)) + ".",
- vm
- );
- }
-}
-
-/**
- * Normalize raw function directives into object format.
- */
-function normalizeDirectives (options) {
- var dirs = options.directives;
- if (dirs) {
- for (var key in dirs) {
- var def = dirs[key];
- if (typeof def === 'function') {
- dirs[key] = { bind: def, update: def };
- }
- }
- }
-}
-
-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.
- */
-function mergeOptions (
- parent,
- child,
- vm
-) {
- if (process.env.NODE_ENV !== 'production') {
- checkComponents(child);
- }
-
- if (typeof child === 'function') {
- child = child.options;
- }
-
- normalizeProps(child, vm);
- normalizeInject(child, vm);
- normalizeDirectives(child);
- var extendsFrom = child.extends;
- if (extendsFrom) {
- parent = mergeOptions(parent, extendsFrom, vm);
- }
- if (child.mixins) {
- for (var i = 0, l = child.mixins.length; i < l; i++) {
- parent = mergeOptions(parent, child.mixins[i], vm);
- }
- }
- var options = {};
- var key;
- for (key in parent) {
- mergeField(key);
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key);
- }
- }
- function mergeField (key) {
- var strat = strats[key] || defaultStrat;
- options[key] = strat(parent[key], child[key], vm, key);
- }
- return options
-}
-
-/**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
-function resolveAsset (
- options,
- type,
- id,
- warnMissing
-) {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return
- }
- var assets = options[type];
- // check local registration variations first
- if (hasOwn(assets, id)) { return assets[id] }
- var camelizedId = camelize(id);
- if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
- var PascalCaseId = capitalize(camelizedId);
- if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
- // fallback to prototype chain
- var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
- if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
- warn(
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
- options
- );
- }
- return res
-}
-
-/* */
-
-function validateProp (
- key,
- propOptions,
- propsData,
- vm
-) {
- var prop = propOptions[key];
- var absent = !hasOwn(propsData, key);
- var value = propsData[key];
- // boolean casting
- var booleanIndex = getTypeIndex(Boolean, prop.type);
- if (booleanIndex > -1) {
- if (absent && !hasOwn(prop, 'default')) {
- value = false;
- } else if (value === '' || value === hyphenate(key)) {
- // only cast empty string / same name to boolean if
- // boolean has higher priority
- var stringIndex = getTypeIndex(String, prop.type);
- if (stringIndex < 0 || booleanIndex < stringIndex) {
- value = true;
- }
- }
- }
- // check default value
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop, key);
- // since the default value is a fresh copy,
- // make sure to observe it.
- var prevShouldObserve = shouldObserve;
- toggleObserving(true);
- observe(value);
- toggleObserving(prevShouldObserve);
- }
- if (
- process.env.NODE_ENV !== 'production' &&
- // skip validation for weex recycle-list child component props
- !(true && isObject(value) && ('@binding' in value))
- ) {
- assertProp(prop, key, value, vm, absent);
- }
- return value
-}
-
-/**
- * Get the default value of a prop.
- */
-function getPropDefaultValue (vm, prop, key) {
- // no default, return undefined
- if (!hasOwn(prop, 'default')) {
- return undefined
- }
- var def = prop.default;
- // warn against non-factory defaults for Object & Array
- if (process.env.NODE_ENV !== 'production' && isObject(def)) {
- warn(
- 'Invalid default value for prop "' + key + '": ' +
- 'Props with type Object/Array must use a factory function ' +
- 'to return the default value.',
- vm
- );
- }
- // the raw prop value was also undefined from previous render,
- // return previous default value to avoid unnecessary watcher trigger
- if (vm && vm.$options.propsData &&
- vm.$options.propsData[key] === undefined &&
- vm._props[key] !== undefined
- ) {
- return vm._props[key]
- }
- // call factory function for non-Function types
- // a value is Function if its prototype is function even across different execution context
- return typeof def === 'function' && getType(prop.type) !== 'Function'
- ? def.call(vm)
- : def
-}
-
-/**
- * Assert whether a prop is valid.
- */
-function assertProp (
- prop,
- name,
- value,
- vm,
- absent
-) {
- if (prop.required && absent) {
- warn(
- 'Missing required prop: "' + name + '"',
- vm
- );
- return
- }
- if (value == null && !prop.required) {
- return
- }
- var type = prop.type;
- var valid = !type || type === true;
- var expectedTypes = [];
- if (type) {
- if (!Array.isArray(type)) {
- type = [type];
- }
- for (var i = 0; i < type.length && !valid; i++) {
- var assertedType = assertType(value, type[i]);
- expectedTypes.push(assertedType.expectedType || '');
- valid = assertedType.valid;
- }
- }
- if (!valid) {
- warn(
- "Invalid prop: type check failed for prop \"" + name + "\"." +
- " Expected " + (expectedTypes.map(capitalize).join(', ')) +
- ", got " + (toRawType(value)) + ".",
- vm
- );
- return
- }
- var validator = prop.validator;
- if (validator) {
- if (!validator(value)) {
- warn(
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
- vm
- );
- }
- }
-}
-
-var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
-
-function assertType (value, type) {
- var valid;
- var expectedType = getType(type);
- if (simpleCheckRE.test(expectedType)) {
- var t = typeof value;
- valid = t === expectedType.toLowerCase();
- // for primitive wrapper objects
- if (!valid && t === 'object') {
- valid = value instanceof type;
- }
- } else if (expectedType === 'Object') {
- valid = isPlainObject(value);
- } else if (expectedType === 'Array') {
- valid = Array.isArray(value);
- } else {
- valid = value instanceof type;
- }
- return {
- valid: valid,
- expectedType: expectedType
- }
-}
-
-/**
- * Use function string name to check built-in types,
- * because a simple equality check will fail when running
- * across different vms / iframes.
- */
-function getType (fn) {
- var match = fn && fn.toString().match(/^\s*function (\w+)/);
- return match ? match[1] : ''
-}
-
-function isSameType (a, b) {
- return getType(a) === getType(b)
-}
-
-function getTypeIndex (type, expectedTypes) {
- if (!Array.isArray(expectedTypes)) {
- return isSameType(expectedTypes, type) ? 0 : -1
- }
- for (var i = 0, len = expectedTypes.length; i < len; i++) {
- if (isSameType(expectedTypes[i], type)) {
- return i
- }
- }
- return -1
-}
-
-/* */
-
-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 (process.env.NODE_ENV !== 'production') {
- warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
- }
- /* istanbul ignore else */
- if ((inBrowser || inWeex) && 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 microtasks and (macro) tasks.
-// In < 2.4 we used microtasks everywhere, but there are some scenarios where
-// microtasks have too high a priority and fire 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 microtask 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 (macro) task instead of a microtask.
- */
-
-
-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;
- })
- }
-}
-
-/* */
-
-/* not type checking this file because flow doesn't play well with Proxy */
-
-var initProxy;
-
-if (process.env.NODE_ENV !== 'production') {
- var allowedGlobals = makeMap(
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
- 'require' // for Webpack/Browserify
- );
-
- var warnNonPresent = function (target, key) {
- warn(
- "Property or method \"" + key + "\" is not defined on the instance but " +
- '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
- );
- };
-
- var hasProxy =
- typeof Proxy !== 'undefined' && isNative(Proxy);
-
- if (hasProxy) {
- 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)) {
- warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
- return false
- } else {
- target[key] = value;
- return true
- }
- }
- });
- }
-
- var hasHandler = {
- has: function has (target, key) {
- var has = key in target;
- var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
- if (!has && !isAllowed) {
- warnNonPresent(target, key);
- }
- return has || !isAllowed
- }
- };
-
- var getHandler = {
- get: function get (target, key) {
- if (typeof key === 'string' && !(key in target)) {
- warnNonPresent(target, key);
- }
- return target[key]
- }
- };
-
- initProxy = function initProxy (vm) {
- if (hasProxy) {
- // determine which proxy handler to use
- var options = vm.$options;
- var handlers = options.render && options.render._withStripped
- ? getHandler
- : hasHandler;
- vm._renderProxy = new Proxy(vm, handlers);
- } else {
- vm._renderProxy = vm;
- }
- };
-}
-
-/* */
-
-var seenObjects = new _Set();
-
-/**
- * Recursively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- */
-function traverse (val) {
- _traverse(val, seenObjects);
- seenObjects.clear();
-}
-
-function _traverse (val, seen) {
- var i, keys;
- var isA = Array.isArray(val);
- if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
- return
- }
- if (val.__ob__) {
- var depId = val.__ob__.dep.id;
- if (seen.has(depId)) {
- return
- }
- seen.add(depId);
- }
- if (isA) {
- i = val.length;
- while (i--) { _traverse(val[i], seen); }
- } else {
- keys = Object.keys(val);
- i = keys.length;
- while (i--) { _traverse(val[keys[i]], seen); }
- }
-}
-
-var mark;
-var measure;
-
-if (process.env.NODE_ENV !== 'production') {
- var perf = inBrowser && window.performance;
- /* istanbul ignore if */
- if (
- perf &&
- perf.mark &&
- perf.measure &&
- perf.clearMarks &&
- perf.clearMeasures
- ) {
- mark = function (tag) { return perf.mark(tag); };
- measure = function (name, startTag, endTag) {
- perf.measure(name, startTag, endTag);
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- perf.clearMeasures(name);
- };
- }
-}
-
-/* */
-
-var normalizeEvent = cached(function (name) {
- var passive = name.charAt(0) === '&';
- name = passive ? name.slice(1) : name;
- var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
- name = once$$1 ? name.slice(1) : name;
- var capture = name.charAt(0) === '!';
- name = capture ? name.slice(1) : name;
- return {
- name: name,
- once: once$$1,
- capture: capture,
- passive: passive
- }
-});
-
-function createFnInvoker (fns) {
- function invoker () {
- var arguments$1 = arguments;
-
- var fns = invoker.fns;
- if (Array.isArray(fns)) {
- var cloned = fns.slice();
- for (var i = 0; i < cloned.length; i++) {
- cloned[i].apply(null, arguments$1);
- }
- } else {
- // return handler return value for single handlers
- return fns.apply(null, arguments)
- }
- }
- invoker.fns = fns;
- return invoker
-}
-
-function updateListeners (
- on,
- oldOn,
- add,
- remove$$1,
- vm
-) {
- var name, def, cur, old, event;
- for (name in on) {
- def = cur = on[name];
- old = oldOn[name];
- event = normalizeEvent(name);
- /* istanbul ignore if */
- if (true && isPlainObject(def)) {
- cur = def.handler;
- event.params = def.params;
- }
- if (isUndef(cur)) {
- process.env.NODE_ENV !== 'production' && warn(
- "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
- vm
- );
- } else if (isUndef(old)) {
- if (isUndef(cur.fns)) {
- cur = on[name] = createFnInvoker(cur);
- }
- add(event.name, cur, event.once, event.capture, event.passive, event.params);
- } else if (cur !== old) {
- old.fns = cur;
- on[name] = old;
- }
- }
- for (name in oldOn) {
- if (isUndef(on[name])) {
- event = normalizeEvent(name);
- remove$$1(event.name, oldOn[name], event.capture);
- }
- }
-}
-
-/* */
-
-function mergeVNodeHook (def, hookKey, hook) {
- if (def instanceof VNode) {
- def = def.data.hook || (def.data.hook = {});
- }
- var invoker;
- var oldHook = def[hookKey];
-
- function wrappedHook () {
- hook.apply(this, arguments);
- // important: remove merged hook to ensure it's called only once
- // and prevent memory leak
- remove(invoker.fns, wrappedHook);
- }
-
- if (isUndef(oldHook)) {
- // no existing hook
- invoker = createFnInvoker([wrappedHook]);
- } else {
- /* istanbul ignore if */
- if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
- // already a merged invoker
- invoker = oldHook;
- invoker.fns.push(wrappedHook);
- } else {
- // existing plain hook
- invoker = createFnInvoker([oldHook, wrappedHook]);
- }
- }
-
- invoker.merged = true;
- def[hookKey] = invoker;
-}
-
-/* */
-
-function extractPropsFromVNodeData (
- data,
- Ctor,
- tag
-) {
- // we are only extracting raw values here.
- // validation and default values are handled in the child
- // component itself.
- var propOptions = Ctor.options.props;
- if (isUndef(propOptions)) {
- return
- }
- var res = {};
- var attrs = data.attrs;
- var props = data.props;
- if (isDef(attrs) || isDef(props)) {
- for (var key in propOptions) {
- var altKey = hyphenate(key);
- if (process.env.NODE_ENV !== 'production') {
- var keyInLowerCase = key.toLowerCase();
- if (
- key !== keyInLowerCase &&
- attrs && hasOwn(attrs, keyInLowerCase)
- ) {
- tip(
- "Prop \"" + keyInLowerCase + "\" is passed to component " +
- (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
- " \"" + key + "\". " +
- "Note that HTML attributes are case-insensitive and camelCased " +
- "props need to use their kebab-case equivalents when using in-DOM " +
- "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
- );
- }
- }
- checkProp(res, props, key, altKey, true) ||
- checkProp(res, attrs, key, altKey, false);
- }
- }
- return res
-}
-
-function checkProp (
- res,
- hash,
- key,
- altKey,
- preserve
-) {
- if (isDef(hash)) {
- if (hasOwn(hash, key)) {
- res[key] = hash[key];
- if (!preserve) {
- delete hash[key];
- }
- return true
- } else if (hasOwn(hash, altKey)) {
- res[key] = hash[altKey];
- if (!preserve) {
- delete hash[altKey];
- }
- return true
- }
- }
- return false
-}
-
-/* */
-
-// The template compiler attempts to minimize the need for normalization by
-// statically analyzing the template at compile time.
-//
-// For plain HTML markup, normalization can be completely skipped because the
-// generated render function is guaranteed to return Array<VNode>. There are
-// two cases where extra normalization is needed:
-
-// 1. When the children contains components - because a functional component
-// may return an Array instead of a single root. In this case, just a simple
-// normalization is needed - if any child is an Array, we flatten the whole
-// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
-// because functional components already normalize their own children.
-function simpleNormalizeChildren (children) {
- for (var i = 0; i < children.length; i++) {
- if (Array.isArray(children[i])) {
- return Array.prototype.concat.apply([], children)
- }
- }
- return children
-}
-
-// 2. When the children contains constructs that always generated nested Arrays,
-// e.g. <template>, <slot>, v-for, or when the children is provided by user
-// with hand-written render functions / JSX. In such cases a full normalization
-// is needed to cater to all possible types of children values.
-function normalizeChildren (children) {
- return isPrimitive(children)
- ? [createTextVNode(children)]
- : Array.isArray(children)
- ? normalizeArrayChildren(children)
- : undefined
-}
-
-function isTextNode (node) {
- return isDef(node) && isDef(node.text) && isFalse(node.isComment)
-}
-
-function normalizeArrayChildren (children, nestedIndex) {
- var res = [];
- var i, c, lastIndex, last;
- for (i = 0; i < children.length; i++) {
- c = children[i];
- if (isUndef(c) || typeof c === 'boolean') { continue }
- lastIndex = res.length - 1;
- last = res[lastIndex];
- // nested
- if (Array.isArray(c)) {
- 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
- res[lastIndex] = createTextVNode(last.text + c);
- } else if (c !== '') {
- // convert primitive to vnode
- res.push(createTextVNode(c));
- }
- } else {
- if (isTextNode(c) && isTextNode(last)) {
- // merge adjacent text nodes
- res[lastIndex] = createTextVNode(last.text + c.text);
- } else {
- // default key for nested array children (likely generated by v-for)
- if (isTrue(children._isVList) &&
- isDef(c.tag) &&
- isUndef(c.key) &&
- isDef(nestedIndex)) {
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
- }
- res.push(c);
- }
- }
- }
- return res
-}
-
-/* */
-
-function ensureCtor (comp, base) {
- if (
- comp.__esModule ||
- (hasSymbol && comp[Symbol.toStringTag] === 'Module')
- ) {
- comp = comp.default;
- }
- return isObject(comp)
- ? base.extend(comp)
- : comp
-}
-
-function createAsyncPlaceholder (
- factory,
- data,
- context,
- children,
- tag
-) {
- var node = createEmptyVNode();
- node.asyncFactory = factory;
- node.asyncMeta = { data: data, context: context, children: children, tag: tag };
- return node
-}
-
-function resolveAsyncComponent (
- factory,
- baseCtor,
- context
-) {
- if (isTrue(factory.error) && isDef(factory.errorComp)) {
- return factory.errorComp
- }
-
- if (isDef(factory.resolved)) {
- return factory.resolved
- }
-
- if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
- return factory.loadingComp
- }
-
- if (isDef(factory.contexts)) {
- // already pending
- factory.contexts.push(context);
- } else {
- var contexts = factory.contexts = [context];
- var sync = true;
-
- var forceRender = function () {
- for (var i = 0, l = contexts.length; i < l; i++) {
- contexts[i].$forceUpdate();
- }
- };
-
- var resolve = once(function (res) {
- // cache resolved
- factory.resolved = ensureCtor(res, baseCtor);
- // invoke callbacks only if this is not a synchronous resolve
- // (async resolves are shimmed as synchronous during SSR)
- if (!sync) {
- forceRender();
- }
- });
-
- var reject = once(function (reason) {
- process.env.NODE_ENV !== 'production' && warn(
- "Failed to resolve async component: " + (String(factory)) +
- (reason ? ("\nReason: " + reason) : '')
- );
- if (isDef(factory.errorComp)) {
- factory.error = true;
- forceRender();
- }
- });
-
- var res = factory(resolve, reject);
-
- if (isObject(res)) {
- if (typeof res.then === 'function') {
- // () => Promise
- if (isUndef(factory.resolved)) {
- res.then(resolve, reject);
- }
- } else if (isDef(res.component) && typeof res.component.then === 'function') {
- res.component.then(resolve, reject);
-
- if (isDef(res.error)) {
- factory.errorComp = ensureCtor(res.error, baseCtor);
- }
-
- if (isDef(res.loading)) {
- factory.loadingComp = ensureCtor(res.loading, baseCtor);
- if (res.delay === 0) {
- factory.loading = true;
- } else {
- setTimeout(function () {
- if (isUndef(factory.resolved) && isUndef(factory.error)) {
- factory.loading = true;
- forceRender();
- }
- }, res.delay || 200);
- }
- }
-
- if (isDef(res.timeout)) {
- setTimeout(function () {
- if (isUndef(factory.resolved)) {
- reject(
- process.env.NODE_ENV !== 'production'
- ? ("timeout (" + (res.timeout) + "ms)")
- : null
- );
- }
- }, res.timeout);
- }
- }
- }
-
- sync = false;
- // return in case resolved synchronously
- return factory.loading
- ? factory.loadingComp
- : factory.resolved
- }
-}
-
-/* */
-
-function isAsyncPlaceholder (node) {
- return node.isComment && node.asyncFactory
-}
-
-/* */
-
-function getFirstComponentChild (children) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- var c = children[i];
- if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
- return c
- }
- }
- }
-}
-
-/* */
-
-/* */
-
-function initEvents (vm) {
- vm._events = Object.create(null);
- vm._hasHookEvent = false;
- // init parent attached events
- var listeners = vm.$options._parentListeners;
- if (listeners) {
- updateComponentListeners(vm, listeners);
- }
-}
-
-var target;
-
-function add (event, fn, once) {
- if (once) {
- target.$once(event, fn);
- } else {
- target.$on(event, fn);
- }
-}
-
-function remove$1 (event, fn) {
- target.$off(event, fn);
-}
-
-function updateComponentListeners (
- vm,
- listeners,
- oldListeners
-) {
- target = vm;
- updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
- target = undefined;
-}
-
-function eventsMixin (Vue) {
- var hookRE = /^hook:/;
- Vue.prototype.$on = function (event, fn) {
- var this$1 = this;
-
- var vm = this;
- if (Array.isArray(event)) {
- for (var i = 0, l = event.length; i < l; i++) {
- this$1.$on(event[i], fn);
- }
- } else {
- (vm._events[event] || (vm._events[event] = [])).push(fn);
- // optimize hook:event cost by using a boolean flag marked at registration
- // instead of a hash lookup
- if (hookRE.test(event)) {
- vm._hasHookEvent = true;
- }
- }
- return vm
- };
-
- Vue.prototype.$once = function (event, fn) {
- var vm = this;
- function on () {
- vm.$off(event, on);
- fn.apply(vm, arguments);
- }
- on.fn = fn;
- vm.$on(event, on);
- return vm
- };
-
- Vue.prototype.$off = function (event, fn) {
- var this$1 = this;
-
- var vm = this;
- // all
- if (!arguments.length) {
- vm._events = Object.create(null);
- return vm
- }
- // array of events
- if (Array.isArray(event)) {
- for (var i = 0, l = event.length; i < l; i++) {
- this$1.$off(event[i], fn);
- }
- return vm
- }
- // specific event
- var cbs = vm._events[event];
- if (!cbs) {
- return vm
- }
- if (!fn) {
- vm._events[event] = null;
- return vm
- }
- if (fn) {
- // specific handler
- var cb;
- var i$1 = cbs.length;
- while (i$1--) {
- cb = cbs[i$1];
- if (cb === fn || cb.fn === fn) {
- cbs.splice(i$1, 1);
- break
- }
- }
- }
- return vm
- };
-
- Vue.prototype.$emit = function (event) {
- var vm = this;
- if (process.env.NODE_ENV !== 'production') {
- var lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
- tip(
- "Event \"" + lowerCaseEvent + "\" is emitted in component " +
- (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
- "Note that HTML attributes are case-insensitive and you cannot use " +
- "v-on to listen to camelCase events when using in-DOM templates. " +
- "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
- );
- }
- }
- var cbs = vm._events[event];
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
- var args = toArray(arguments, 1);
- for (var i = 0, l = cbs.length; i < l; i++) {
- try {
- cbs[i].apply(vm, args);
- } catch (e) {
- handleError(e, vm, ("event handler for \"" + event + "\""));
- }
- }
- }
- return vm
- };
-}
-
-/* */
-
-
-
-/**
- * Runtime helper for resolving raw children VNodes into a slot object.
- */
-function resolveSlots (
- children,
- context
-) {
- var slots = {};
- if (!children) {
- return slots
- }
- for (var i = 0, l = children.length; i < l; i++) {
- var child = children[i];
- var data = child.data;
- // remove slot attribute if the node is resolved as a Vue slot node
- if (data && data.attrs && data.attrs.slot) {
- delete data.attrs.slot;
- }
- // named slots should only be respected if the vnode was rendered in the
- // same context.
- if ((child.context === context || child.fnContext === context) &&
- data && data.slot != null
- ) {
- var name = data.slot;
- var slot = (slots[name] || (slots[name] = []));
- if (child.tag === 'template') {
- slot.push.apply(slot, child.children || []);
- } else {
- slot.push(child);
- }
- } else {
- (slots.default || (slots.default = [])).push(child);
- }
- }
- // ignore slots that contains only whitespace
- for (var name$1 in slots) {
- if (slots[name$1].every(isWhitespace)) {
- delete slots[name$1];
- }
- }
- return slots
-}
-
-function isWhitespace (node) {
- return (node.isComment && !node.asyncFactory) || node.text === ' '
-}
-
-function resolveScopedSlots (
- fns, // see flow/vnode
- res
-) {
- res = res || {};
- for (var i = 0; i < fns.length; i++) {
- if (Array.isArray(fns[i])) {
- resolveScopedSlots(fns[i], res);
- } else {
- res[fns[i].key] = fns[i].fn;
- }
- }
- return res
-}
-
-/* */
-
-var activeInstance = null;
-var isUpdatingChildComponent = false;
-
-function initLifecycle (vm) {
- var options = vm.$options;
-
- // locate first non-abstract parent
- var parent = options.parent;
- if (parent && !options.abstract) {
- while (parent.$options.abstract && parent.$parent) {
- parent = parent.$parent;
- }
- parent.$children.push(vm);
- }
-
- vm.$parent = parent;
- vm.$root = parent ? parent.$root : vm;
-
- vm.$children = [];
- vm.$refs = {};
-
- vm._watcher = null;
- vm._inactive = null;
- vm._directInactive = false;
- vm._isMounted = false;
- vm._isDestroyed = false;
- vm._isBeingDestroyed = false;
-}
-
-function lifecycleMixin (Vue) {
- Vue.prototype._update = function (vnode, hydrating) {
- var vm = this;
- if (vm._isMounted) {
- callHook(vm, 'beforeUpdate');
- }
- var prevEl = vm.$el;
- var prevVnode = vm._vnode;
- var prevActiveInstance = activeInstance;
- activeInstance = vm;
- vm._vnode = vnode;
- // Vue.prototype.__patch__ is injected in entry points
- // based on the rendering backend used.
- if (!prevVnode) {
- // initial render
- vm.$el = vm.__patch__(
- vm.$el, vnode, hydrating, false /* removeOnly */,
- vm.$options._parentElm,
- vm.$options._refElm
- );
- // no need for the ref nodes after initial patch
- // this prevents keeping a detached DOM tree in memory (#5851)
- vm.$options._parentElm = vm.$options._refElm = null;
- } else {
- // updates
- vm.$el = vm.__patch__(prevVnode, vnode);
- }
- activeInstance = prevActiveInstance;
- // update __vue__ reference
- if (prevEl) {
- prevEl.__vue__ = null;
- }
- if (vm.$el) {
- vm.$el.__vue__ = vm;
- }
- // if parent is an HOC, update its $el as well
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
- vm.$parent.$el = vm.$el;
- }
- // updated hook is called by the scheduler to ensure that children are
- // updated in a parent's updated hook.
- };
-
- Vue.prototype.$forceUpdate = function () {
- var vm = this;
- if (vm._watcher) {
- vm._watcher.update();
- }
- };
-
- Vue.prototype.$destroy = function () {
- var vm = this;
- if (vm._isBeingDestroyed) {
- return
- }
- callHook(vm, 'beforeDestroy');
- vm._isBeingDestroyed = true;
- // remove self from parent
- var parent = vm.$parent;
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
- remove(parent.$children, vm);
- }
- // teardown watchers
- if (vm._watcher) {
- vm._watcher.teardown();
- }
- var i = vm._watchers.length;
- while (i--) {
- vm._watchers[i].teardown();
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (vm._data.__ob__) {
- vm._data.__ob__.vmCount--;
- }
- // call the last hook...
- vm._isDestroyed = true;
- // invoke destroy hooks on current rendered tree
- vm.__patch__(vm._vnode, null);
- // fire destroyed hook
- callHook(vm, 'destroyed');
- // turn off all instance listeners.
- vm.$off();
- // remove __vue__ reference
- if (vm.$el) {
- vm.$el.__vue__ = null;
- }
- // release circular reference (#6759)
- if (vm.$vnode) {
- vm.$vnode.parent = null;
- }
- };
-}
-
-function mountComponent (
- vm,
- el,
- hydrating
-) {
- vm.$el = el;
- if (!vm.$options.render) {
- vm.$options.render = createEmptyVNode;
- if (process.env.NODE_ENV !== 'production') {
- /* istanbul ignore if */
- if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
- vm.$options.el || el) {
- warn(
- 'You are using the runtime-only build of Vue where the template ' +
- 'compiler is not available. Either pre-compile the templates into ' +
- 'render functions, or use the compiler-included build.',
- vm
- );
- } else {
- warn(
- 'Failed to mount component: template or render function not defined.',
- vm
- );
- }
- }
- }
- callHook(vm, 'beforeMount');
-
- var updateComponent;
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- updateComponent = function () {
- var name = vm._name;
- var id = vm._uid;
- var startTag = "vue-perf-start:" + id;
- var endTag = "vue-perf-end:" + id;
-
- mark(startTag);
- var vnode = vm._render();
- mark(endTag);
- measure(("vue " + name + " render"), startTag, endTag);
-
- mark(startTag);
- vm._update(vnode, hydrating);
- mark(endTag);
- measure(("vue " + name + " patch"), startTag, endTag);
- };
- } else {
- updateComponent = function () {
- vm._update(vm._render(), hydrating);
- };
- }
-
- // we set this to vm._watcher inside the watcher's constructor
- // since the watcher's initial patch may call $forceUpdate (e.g. inside child
- // component's mounted hook), which relies on vm._watcher being already defined
- new Watcher(vm, updateComponent, noop, null, true /* isRenderWatcher */);
- hydrating = false;
-
- // manually mounted instance, call mounted on self
- // mounted is called for render-created child components in its inserted hook
- if (vm.$vnode == null) {
- vm._isMounted = true;
- callHook(vm, 'mounted');
- }
- return vm
-}
-
-function updateChildComponent (
- vm,
- propsData,
- listeners,
- parentVnode,
- renderChildren
-) {
- if (process.env.NODE_ENV !== 'production') {
- isUpdatingChildComponent = true;
- }
-
- // determine whether component has slot children
- // we need to do this before overwriting $options._renderChildren
- var hasChildren = !!(
- renderChildren || // has new static slots
- vm.$options._renderChildren || // has old static slots
- parentVnode.data.scopedSlots || // has new scoped slots
- vm.$scopedSlots !== emptyObject // has old scoped slots
- );
-
- vm.$options._parentVnode = parentVnode;
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
-
- if (vm._vnode) { // update child tree's parent
- vm._vnode.parent = parentVnode;
- }
- vm.$options._renderChildren = renderChildren;
-
- // update $attrs and $listeners hash
- // these are also reactive so they may trigger child update if the child
- // used them during render
- vm.$attrs = parentVnode.data.attrs || emptyObject;
- vm.$listeners = listeners || emptyObject;
-
- // update props
- if (propsData && vm.$options.props) {
- toggleObserving(false);
- var props = vm._props;
- var propKeys = vm.$options._propKeys || [];
- for (var i = 0; i < propKeys.length; i++) {
- var key = propKeys[i];
- var propOptions = vm.$options.props; // wtf flow?
- props[key] = validateProp(key, propOptions, propsData, vm);
- }
- toggleObserving(true);
- // keep a copy of raw propsData
- vm.$options.propsData = propsData;
- }
-
- // update listeners
- listeners = listeners || emptyObject;
- var oldListeners = vm.$options._parentListeners;
- vm.$options._parentListeners = listeners;
- updateComponentListeners(vm, listeners, oldListeners);
-
- // resolve slots + force update if has children
- if (hasChildren) {
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
- vm.$forceUpdate();
- }
-
- if (process.env.NODE_ENV !== 'production') {
- isUpdatingChildComponent = false;
- }
-}
-
-function isInInactiveTree (vm) {
- while (vm && (vm = vm.$parent)) {
- if (vm._inactive) { return true }
- }
- return false
-}
-
-function activateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = false;
- if (isInInactiveTree(vm)) {
- return
- }
- } else if (vm._directInactive) {
- return
- }
- if (vm._inactive || vm._inactive === null) {
- vm._inactive = false;
- for (var i = 0; i < vm.$children.length; i++) {
- activateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'activated');
- }
-}
-
-function deactivateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = true;
- if (isInInactiveTree(vm)) {
- return
- }
- }
- if (!vm._inactive) {
- vm._inactive = true;
- for (var i = 0; i < vm.$children.length; i++) {
- deactivateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'deactivated');
- }
-}
-
-function callHook (vm, hook) {
- // #7573 disable dep collection when invoking lifecycle hooks
- pushTarget();
- var handlers = vm.$options[hook];
- if (handlers) {
- for (var i = 0, j = handlers.length; i < j; i++) {
- try {
- handlers[i].call(vm);
- } catch (e) {
- handleError(e, vm, (hook + " hook"));
- }
- }
- }
- if (vm._hasHookEvent) {
- vm.$emit('hook:' + hook);
- }
- popTarget();
-}
-
-/* */
-
-
-var MAX_UPDATE_COUNT = 100;
-
-var queue = [];
-var activatedChildren = [];
-var has = {};
-var circular = {};
-var waiting = false;
-var flushing = false;
-var index = 0;
-
-/**
- * Reset the scheduler's state.
- */
-function resetSchedulerState () {
- index = queue.length = activatedChildren.length = 0;
- has = {};
- if (process.env.NODE_ENV !== 'production') {
- circular = {};
- }
- waiting = flushing = false;
-}
-
-/**
- * Flush both queues and run the watchers.
- */
-function flushSchedulerQueue () {
- flushing = true;
- var watcher, id;
-
- // Sort queue before flush.
- // This ensures that:
- // 1. Components are updated from parent to child. (because parent is always
- // created before the child)
- // 2. A component's user watchers are run before its render watcher (because
- // user watchers are created before the render watcher)
- // 3. If a component is destroyed during a parent component's watcher run,
- // its watchers can be skipped.
- queue.sort(function (a, b) { return a.id - b.id; });
-
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (index = 0; index < queue.length; index++) {
- watcher = queue[index];
- id = watcher.id;
- has[id] = null;
- watcher.run();
- // in dev build, check and stop circular updates.
- if (process.env.NODE_ENV !== 'production' && has[id] != null) {
- circular[id] = (circular[id] || 0) + 1;
- if (circular[id] > MAX_UPDATE_COUNT) {
- warn(
- 'You may have an infinite update loop ' + (
- watcher.user
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
- : "in a component render function."
- ),
- watcher.vm
- );
- break
- }
- }
- }
-
- // keep copies of post queues before resetting state
- var activatedQueue = activatedChildren.slice();
- var updatedQueue = queue.slice();
-
- resetSchedulerState();
-
- // call component updated and activated hooks
- callActivatedHooks(activatedQueue);
- callUpdatedHooks(updatedQueue);
-
- // devtool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush');
- }
-}
-
-function callUpdatedHooks (queue) {
- var i = queue.length;
- while (i--) {
- var watcher = queue[i];
- var vm = watcher.vm;
- if (vm._watcher === watcher && vm._isMounted) {
- callHook(vm, 'updated');
- }
- }
-}
-
-/**
- * Queue a kept-alive component that was activated during patch.
- * The queue will be processed after the entire tree has been patched.
- */
-function queueActivatedComponent (vm) {
- // setting _inactive to false here so that a render function can
- // rely on checking whether it's in an inactive tree (e.g. router-view)
- vm._inactive = false;
- activatedChildren.push(vm);
-}
-
-function callActivatedHooks (queue) {
- for (var i = 0; i < queue.length; i++) {
- queue[i]._inactive = true;
- activateChildComponent(queue[i], true /* true */);
- }
-}
-
-/**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- */
-function queueWatcher (watcher) {
- var id = watcher.id;
- if (has[id] == null) {
- has[id] = true;
- if (!flushing) {
- queue.push(watcher);
- } else {
- // if already flushing, splice the watcher based on its id
- // if already past its id, it will be run next immediately.
- var i = queue.length - 1;
- while (i > index && queue[i].id > watcher.id) {
- i--;
- }
- queue.splice(i + 1, 0, watcher);
- }
- // queue the flush
- if (!waiting) {
- waiting = true;
- nextTick(flushSchedulerQueue);
- }
- }
-}
-
-/* */
-
-var uid$1 = 0;
-
-/**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- */
-var Watcher = function Watcher (
- vm,
- expOrFn,
- cb,
- options,
- isRenderWatcher
-) {
- this.vm = vm;
- if (isRenderWatcher) {
- vm._watcher = this;
- }
- vm._watchers.push(this);
- // options
- if (options) {
- this.deep = !!options.deep;
- this.user = !!options.user;
- this.lazy = !!options.lazy;
- this.sync = !!options.sync;
- } else {
- this.deep = this.user = this.lazy = this.sync = false;
- }
- this.cb = cb;
- this.id = ++uid$1; // uid for batching
- this.active = true;
- this.dirty = this.lazy; // for lazy watchers
- this.deps = [];
- this.newDeps = [];
- this.depIds = new _Set();
- this.newDepIds = new _Set();
- this.expression = process.env.NODE_ENV !== 'production'
- ? expOrFn.toString()
- : '';
- // parse expression for getter
- if (typeof expOrFn === 'function') {
- this.getter = expOrFn;
- } else {
- this.getter = parsePath(expOrFn);
- if (!this.getter) {
- this.getter = function () {};
- process.env.NODE_ENV !== 'production' && warn(
- "Failed watching path: \"" + expOrFn + "\" " +
- 'Watcher only accepts simple dot-delimited paths. ' +
- 'For full control, use a function instead.',
- vm
- );
- }
- }
- this.value = this.lazy
- ? undefined
- : this.get();
-};
-
-/**
- * Evaluate the getter, and re-collect dependencies.
- */
-Watcher.prototype.get = function get () {
- pushTarget(this);
- var value;
- var vm = this.vm;
- try {
- value = this.getter.call(vm, vm);
- } catch (e) {
- if (this.user) {
- handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
- } else {
- throw e
- }
- } finally {
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value);
- }
- popTarget();
- this.cleanupDeps();
- }
- return value
-};
-
-/**
- * Add a dependency to this directive.
- */
-Watcher.prototype.addDep = function addDep (dep) {
- var id = dep.id;
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id);
- this.newDeps.push(dep);
- if (!this.depIds.has(id)) {
- dep.addSub(this);
- }
- }
-};
-
-/**
- * Clean up for dependency collection.
- */
-Watcher.prototype.cleanupDeps = function cleanupDeps () {
- var this$1 = this;
-
- var i = this.deps.length;
- while (i--) {
- var dep = this$1.deps[i];
- if (!this$1.newDepIds.has(dep.id)) {
- dep.removeSub(this$1);
- }
- }
- var tmp = this.depIds;
- this.depIds = this.newDepIds;
- this.newDepIds = tmp;
- this.newDepIds.clear();
- tmp = this.deps;
- this.deps = this.newDeps;
- this.newDeps = tmp;
- this.newDeps.length = 0;
-};
-
-/**
- * Subscriber interface.
- * Will be called when a dependency changes.
- */
-Watcher.prototype.update = function update () {
- /* istanbul ignore else */
- if (this.lazy) {
- this.dirty = true;
- } else if (this.sync) {
- this.run();
- } else {
- queueWatcher(this);
- }
-};
-
-/**
- * Scheduler job interface.
- * Will be called by the scheduler.
- */
-Watcher.prototype.run = function run () {
- if (this.active) {
- var value = this.get();
- if (
- value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated.
- isObject(value) ||
- this.deep
- ) {
- // set new value
- var oldValue = this.value;
- this.value = value;
- if (this.user) {
- try {
- this.cb.call(this.vm, value, oldValue);
- } catch (e) {
- handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
- }
- } else {
- this.cb.call(this.vm, value, oldValue);
- }
- }
- }
-};
-
-/**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
-Watcher.prototype.evaluate = function evaluate () {
- this.value = this.get();
- this.dirty = false;
-};
-
-/**
- * Depend on all deps collected by this watcher.
- */
-Watcher.prototype.depend = function depend () {
- var this$1 = this;
-
- var i = this.deps.length;
- while (i--) {
- this$1.deps[i].depend();
- }
-};
-
-/**
- * Remove self from all dependencies' subscriber list.
- */
-Watcher.prototype.teardown = function teardown () {
- var this$1 = this;
-
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed.
- if (!this.vm._isBeingDestroyed) {
- remove(this.vm._watchers, this);
- }
- var i = this.deps.length;
- while (i--) {
- this$1.deps[i].removeSub(this$1);
- }
- this.active = false;
- }
-};
-
-/* */
-
-var sharedPropertyDefinition = {
- enumerable: true,
- configurable: true,
- get: noop,
- set: noop
-};
-
-function proxy (target, sourceKey, key) {
- sharedPropertyDefinition.get = function proxyGetter () {
- return this[sourceKey][key]
- };
- sharedPropertyDefinition.set = function proxySetter (val) {
- this[sourceKey][key] = val;
- };
- Object.defineProperty(target, key, sharedPropertyDefinition);
-}
-
-function initState (vm) {
- vm._watchers = [];
- var opts = vm.$options;
- if (opts.props) { initProps(vm, opts.props); }
- if (opts.methods) { initMethods(vm, opts.methods); }
- if (opts.data) {
- initData(vm);
- } else {
- observe(vm._data = {}, true /* asRootData */);
- }
- if (opts.computed) { initComputed(vm, opts.computed); }
- if (opts.watch && opts.watch !== nativeWatch) {
- initWatch(vm, opts.watch);
- }
-}
-
-function initProps (vm, propsOptions) {
- var propsData = vm.$options.propsData || {};
- var props = vm._props = {};
- // cache prop keys so that future props updates can iterate using Array
- // instead of dynamic object key enumeration.
- var keys = vm.$options._propKeys = [];
- var isRoot = !vm.$parent;
- // root instance props should be converted
- if (!isRoot) {
- toggleObserving(false);
- }
- var loop = function ( key ) {
- keys.push(key);
- var value = validateProp(key, propsOptions, propsData, vm);
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- var hyphenatedKey = hyphenate(key);
- if (isReservedAttribute(hyphenatedKey) ||
- config.isReservedAttr(hyphenatedKey)) {
- warn(
- ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
- vm
- );
- }
- defineReactive(props, key, value, function () {
- if (vm.$parent && !isUpdatingChildComponent) {
- warn(
- "Avoid mutating a prop directly since the value will be " +
- "overwritten whenever the parent component re-renders. " +
- "Instead, use a data or computed property based on the prop's " +
- "value. Prop being mutated: \"" + key + "\"",
- vm
- );
- }
- });
- } else {
- 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
- // instantiation here.
- if (!(key in vm)) {
- proxy(vm, "_props", key);
- }
- };
-
- for (var key in propsOptions) loop( key );
- toggleObserving(true);
-}
-
-function initData (vm) {
- var data = vm.$options.data;
- data = vm._data = typeof data === 'function'
- ? getData(data, vm)
- : data || {};
- if (!isPlainObject(data)) {
- data = {};
- process.env.NODE_ENV !== 'production' && warn(
- 'data functions should return an object:\n' +
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
- vm
- );
- }
- // proxy data on instance
- var keys = Object.keys(data);
- var props = vm.$options.props;
- var methods = vm.$options.methods;
- var i = keys.length;
- while (i--) {
- var key = keys[i];
- if (process.env.NODE_ENV !== 'production') {
- if (methods && hasOwn(methods, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a data property."),
- vm
- );
- }
- }
- if (props && hasOwn(props, key)) {
- process.env.NODE_ENV !== 'production' && warn(
- "The data property \"" + key + "\" is already declared as a prop. " +
- "Use prop default value instead.",
- vm
- );
- } else if (!isReserved(key)) {
- proxy(vm, "_data", key);
- }
- }
- // observe data
- observe(data, true /* asRootData */);
-}
-
-function getData (data, vm) {
- // #7573 disable dep collection when invoking data getters
- pushTarget();
- try {
- return data.call(vm, vm)
- } catch (e) {
- handleError(e, vm, "data()");
- return {}
- } finally {
- popTarget();
- }
-}
-
-var computedWatcherOptions = { lazy: true };
-
-function initComputed (vm, computed) {
- // $flow-disable-line
- var watchers = vm._computedWatchers = Object.create(null);
- // computed properties are just getters during SSR
- var isSSR = isServerRendering();
-
- for (var key in computed) {
- var userDef = computed[key];
- var getter = typeof userDef === 'function' ? userDef : userDef.get;
- if (process.env.NODE_ENV !== 'production' && getter == null) {
- warn(
- ("Getter is missing for computed property \"" + key + "\"."),
- vm
- );
- }
-
- if (!isSSR) {
- // create internal watcher for the computed property.
- watchers[key] = new Watcher(
- vm,
- getter || noop,
- noop,
- computedWatcherOptions
- );
- }
-
- // component-defined computed properties are already defined on the
- // component prototype. We only need to define computed properties defined
- // at instantiation here.
- if (!(key in vm)) {
- defineComputed(vm, key, userDef);
- } else if (process.env.NODE_ENV !== 'production') {
- if (key in vm.$data) {
- warn(("The computed property \"" + key + "\" is already defined in data."), vm);
- } else if (vm.$options.props && key in vm.$options.props) {
- warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
- }
- }
- }
-}
-
-function defineComputed (
- target,
- key,
- userDef
-) {
- var shouldCache = !isServerRendering();
- if (typeof userDef === 'function') {
- sharedPropertyDefinition.get = shouldCache
- ? createComputedGetter(key)
- : userDef;
- sharedPropertyDefinition.set = noop;
- } else {
- sharedPropertyDefinition.get = userDef.get
- ? shouldCache && userDef.cache !== false
- ? createComputedGetter(key)
- : userDef.get
- : noop;
- sharedPropertyDefinition.set = userDef.set
- ? userDef.set
- : noop;
- }
- if (process.env.NODE_ENV !== 'production' &&
- sharedPropertyDefinition.set === noop) {
- sharedPropertyDefinition.set = function () {
- warn(
- ("Computed property \"" + key + "\" was assigned to but it has no setter."),
- this
- );
- };
- }
- Object.defineProperty(target, key, sharedPropertyDefinition);
-}
-
-function createComputedGetter (key) {
- return function computedGetter () {
- var watcher = this._computedWatchers && this._computedWatchers[key];
- if (watcher) {
- if (watcher.dirty) {
- watcher.evaluate();
- }
- if (Dep.target) {
- watcher.depend();
- }
- return watcher.value
- }
- }
-}
-
-function initMethods (vm, methods) {
- var props = vm.$options.props;
- for (var key in methods) {
- if (process.env.NODE_ENV !== 'production') {
- if (methods[key] == null) {
- warn(
- "Method \"" + key + "\" has an undefined value in the component definition. " +
- "Did you reference the function correctly?",
- vm
- );
- }
- if (props && hasOwn(props, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a prop."),
- vm
- );
- }
- if ((key in vm) && isReserved(key)) {
- warn(
- "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
- "Avoid defining component methods that start with _ or $."
- );
- }
- }
- vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
- }
-}
-
-function initWatch (vm, watch) {
- for (var key in watch) {
- var handler = watch[key];
- if (Array.isArray(handler)) {
- for (var i = 0; i < handler.length; i++) {
- createWatcher(vm, key, handler[i]);
- }
- } else {
- createWatcher(vm, key, handler);
- }
- }
-}
-
-function createWatcher (
- vm,
- expOrFn,
- handler,
- options
-) {
- if (isPlainObject(handler)) {
- options = handler;
- handler = handler.handler;
- }
- if (typeof handler === 'string') {
- handler = vm[handler];
- }
- return vm.$watch(expOrFn, handler, options)
-}
-
-function stateMixin (Vue) {
- // flow somehow has problems with directly declared definition object
- // when using Object.defineProperty, so we have to procedurally build up
- // the object here.
- var dataDef = {};
- dataDef.get = function () { return this._data };
- var propsDef = {};
- propsDef.get = function () { return this._props };
- if (process.env.NODE_ENV !== 'production') {
- dataDef.set = function (newData) {
- warn(
- 'Avoid replacing instance root $data. ' +
- 'Use nested data properties instead.',
- this
- );
- };
- propsDef.set = function () {
- warn("$props is readonly.", this);
- };
- }
- Object.defineProperty(Vue.prototype, '$data', dataDef);
- Object.defineProperty(Vue.prototype, '$props', propsDef);
-
- Vue.prototype.$set = set;
- Vue.prototype.$delete = del;
-
- Vue.prototype.$watch = function (
- expOrFn,
- cb,
- options
- ) {
- var vm = this;
- if (isPlainObject(cb)) {
- return createWatcher(vm, expOrFn, cb, options)
- }
- options = options || {};
- options.user = true;
- var watcher = new Watcher(vm, expOrFn, cb, options);
- if (options.immediate) {
- cb.call(vm, watcher.value);
- }
- return function unwatchFn () {
- watcher.teardown();
- }
- };
-}
-
-/* */
-
-function initProvide (vm) {
- var provide = vm.$options.provide;
- if (provide) {
- vm._provided = typeof provide === 'function'
- ? provide.call(vm)
- : provide;
- }
-}
-
-function initInjections (vm) {
- var result = resolveInject(vm.$options.inject, vm);
- if (result) {
- toggleObserving(false);
- Object.keys(result).forEach(function (key) {
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- 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. " +
- "injection being mutated: \"" + key + "\"",
- vm
- );
- });
- } else {
- defineReactive(vm, key, result[key]);
- }
- });
- toggleObserving(true);
- }
-}
-
-function resolveInject (inject, vm) {
- if (inject) {
- // inject is :any because flow is not smart enough to figure out cached
- var result = Object.create(null);
- var keys = hasSymbol
- ? Reflect.ownKeys(inject).filter(function (key) {
- /* istanbul ignore next */
- return Object.getOwnPropertyDescriptor(inject, key).enumerable
- })
- : Object.keys(inject);
-
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- var provideKey = inject[key].from;
- var source = vm;
- while (source) {
- if (source._provided && hasOwn(source._provided, provideKey)) {
- result[key] = source._provided[provideKey];
- break
- }
- source = source.$parent;
- }
- if (!source) {
- if ('default' in inject[key]) {
- var provideDefault = inject[key].default;
- result[key] = typeof provideDefault === 'function'
- ? provideDefault.call(vm)
- : provideDefault;
- } else if (process.env.NODE_ENV !== 'production') {
- warn(("Injection \"" + key + "\" not found"), vm);
- }
- }
- }
- return result
- }
-}
-
-/* */
-
-/**
- * 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 <slot>
- */
-function renderSlot (
- name,
- fallback,
- props,
- bindObject
-) {
- var scopedSlotFn = this.$scopedSlots[name];
- var nodes;
- if (scopedSlotFn) { // scoped slot
- props = props || {};
- if (bindObject) {
- if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
- warn(
- 'slot v-bind without argument expects an Object',
- this
- );
- }
- props = extend(extend({}, bindObject), props);
- }
- nodes = scopedSlotFn(props) || fallback;
- } else {
- var slotNodes = this.$slots[name];
- // warn duplicate slot usage
- if (slotNodes) {
- if (process.env.NODE_ENV !== '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;
- }
- nodes = slotNodes || fallback;
- }
-
- var target = props && props.slot;
- if (target) {
- return this.$createElement('template', { slot: target }, nodes)
- } else {
- return nodes
- }
-}
-
-/* */
-
-/**
- * Runtime helper for resolving filters
- */
-function resolveFilter (id) {
- return resolveAsset(this.$options, 'filters', id, true) || identity
-}
-
-/* */
-
-function isKeyNotMatch (expect, actual) {
- if (Array.isArray(expect)) {
- return expect.indexOf(actual) === -1
- } else {
- return expect !== actual
- }
-}
-
-/**
- * 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,
- builtInKeyCode,
- eventKeyName,
- builtInKeyName
-) {
- var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
- if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
- return isKeyNotMatch(builtInKeyName, eventKeyName)
- } else if (mappedKeyCode) {
- return isKeyNotMatch(mappedKeyCode, 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)) {
- process.env.NODE_ENV !== '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 cached = this._staticTrees || (this._staticTrees = []);
- var tree = cached[index];
- // if has already-rendered static tree and not inside v-for,
- // we can reuse the same tree.
- if (tree && !isInFor) {
- return tree
- }
- // otherwise, render a fresh tree.
- tree = cached[index] = this.$options.staticRenderFns[index].call(
- this._renderProxy,
- null,
- this // for render fns generated for functional component templates
- );
- 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)) {
- process.env.NODE_ENV !== '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;
- // ensure the createElement function in functional components
- // gets a unique context - this is necessary for correct named slot check
- var contextVm;
- if (hasOwn(parent, '_uid')) {
- contextVm = Object.create(parent);
- // $flow-disable-line
- contextVm._original = parent;
- } else {
- // the context vm passed in is a functional context as well.
- // in this case we want to make sure we are able to get a hold to the
- // real context instance.
- contextVm = parent;
- // $flow-disable-line
- parent = parent._original;
- }
- var isCompiled = isTrue(options._compiled);
- var needNormalization = !isCompiled;
-
- 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); };
-
- // 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 && !Array.isArray(vnode)) {
- vnode.fnScopeId = options._scopeId;
- vnode.fnContext = 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,
- contextVm,
- children
-) {
- var options = Ctor.options;
- var props = {};
- var propOptions = options.props;
- if (isDef(propOptions)) {
- for (var key in propOptions) {
- props[key] = validateProp(key, propOptions, propsData || emptyObject);
- }
- } else {
- if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
- if (isDef(data.props)) { mergeProps(props, data.props); }
- }
-
- var renderContext = new FunctionalRenderContext(
- data,
- props,
- children,
- contextVm,
- Ctor
- );
-
- var vnode = options.render.call(null, renderContext._c, renderContext);
-
- if (vnode instanceof VNode) {
- return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options)
- } else if (Array.isArray(vnode)) {
- var vnodes = normalizeChildren(vnode) || [];
- var res = new Array(vnodes.length);
- for (var i = 0; i < vnodes.length; i++) {
- res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options);
- }
- return res
- }
-}
-
-function cloneAndMarkFunctionalResult (vnode, data, contextVm, options) {
- // #7817 clone node before setting fnContext, otherwise if the node is reused
- // (e.g. it was from a cached normal slot) the fnContext causes named slots
- // that should not be matched to match.
- var clone = cloneVNode(vnode);
- clone.fnContext = contextVm;
- clone.fnOptions = options;
- if (data.slot) {
- (clone.data || (clone.data = {})).slot = data.slot;
- }
- return clone
-}
-
-function mergeProps (to, from) {
- for (var key in from) {
- to[camelize(key)] = from[key];
- }
-}
-
-/* */
-
-
-var RECYCLE_LIST_MARKER = '@inRecycleList';
-
-// Register the component hook to weex native render engine.
-// The hook will be triggered by native, not javascript.
-function registerComponentHook (
- componentId,
- type, // hook type, could be "lifecycle" or "instance"
- hook, // hook name
- fn
-) {
- if (!document || !document.taskCenter) {
- warn("Can't find available \"document\" or \"taskCenter\".");
- return
- }
- if (typeof document.taskCenter.registerHook === 'function') {
- return document.taskCenter.registerHook(componentId, type, hook, fn)
- }
- warn(("Failed to register component hook \"" + type + "@" + hook + "#" + componentId + "\"."));
-}
-
-// Updates the state of the component to weex native render engine.
-function updateComponentData (
- componentId,
- newData,
- callback
-) {
- if (!document || !document.taskCenter) {
- warn("Can't find available \"document\" or \"taskCenter\".");
- return
- }
- if (typeof document.taskCenter.updateData === 'function') {
- return document.taskCenter.updateData(componentId, newData, callback)
- }
- warn(("Failed to update component data (" + componentId + ")."));
-}
-
-/* */
-
-// https://github.com/Hanks10100/weex-native-directive/tree/master/component
-
-var uid$2 = 0;
-
-// override Vue.prototype._init
-function initVirtualComponent (options) {
- if ( options === void 0 ) options = {};
-
- var vm = this;
- var componentId = options.componentId;
-
- // virtual component uid
- vm._uid = "virtual-component-" + (uid$2++);
-
- // a flag to avoid this being observed
- vm._isVue = true;
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options);
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- );
- }
-
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- initProxy(vm);
- } else {
- vm._renderProxy = vm;
- }
-
- vm._self = vm;
- initLifecycle(vm);
- initEvents(vm);
- initRender(vm);
- callHook(vm, 'beforeCreate');
- initInjections(vm); // resolve injections before data/props
- initState(vm);
- initProvide(vm); // resolve provide after data/props
- callHook(vm, 'created');
-
- // send initial data to native
- var data = vm.$options.data;
- var params = typeof data === 'function'
- ? getData(data, vm)
- : data || {};
- if (isPlainObject(params)) {
- updateComponentData(componentId, params);
- }
-
- registerComponentHook(componentId, 'lifecycle', 'attach', function () {
- callHook(vm, 'beforeMount');
-
- var updateComponent = function () {
- vm._update(vm._vnode, false);
- };
- new Watcher(vm, updateComponent, noop, null, true);
-
- vm._isMounted = true;
- callHook(vm, 'mounted');
- });
-
- registerComponentHook(componentId, 'lifecycle', 'detach', function () {
- vm.$destroy();
- });
-}
-
-// override Vue.prototype._update
-function updateVirtualComponent (vnode) {
- var vm = this;
- var componentId = vm.$options.componentId;
- if (vm._isMounted) {
- callHook(vm, 'beforeUpdate');
- }
- vm._vnode = vnode;
- if (vm._isMounted && componentId) {
- // TODO: data should be filtered and without bindings
- var data = Object.assign({}, vm._data);
- updateComponentData(componentId, data, function () {
- callHook(vm, 'updated');
- });
- }
-}
-
-// listening on native callback
-function resolveVirtualComponent (vnode) {
- var BaseCtor = vnode.componentOptions.Ctor;
- var VirtualComponent = BaseCtor.extend({});
- var cid = VirtualComponent.cid;
- VirtualComponent.prototype._init = initVirtualComponent;
- VirtualComponent.prototype._update = updateVirtualComponent;
-
- vnode.componentOptions.Ctor = BaseCtor.extend({
- beforeCreate: function beforeCreate () {
- // const vm: Component = this
-
- // TODO: listen on all events and dispatch them to the
- // corresponding virtual components according to the componentId.
- // vm._virtualComponents = {}
- var createVirtualComponent = function (componentId, propsData) {
- // create virtual component
- // const subVm =
- new VirtualComponent({
- componentId: componentId,
- propsData: propsData
- });
- // if (vm._virtualComponents) {
- // vm._virtualComponents[componentId] = subVm
- // }
- };
-
- registerComponentHook(cid, 'lifecycle', 'create', createVirtualComponent);
- },
- beforeDestroy: function beforeDestroy () {
- delete this._virtualComponents;
- }
- });
-}
-
-/* */
-
-function isRecyclableComponent (vnode) {
- return vnode.data.attrs
- ? (RECYCLE_LIST_MARKER in vnode.data.attrs)
- : false
-}
-
-function renderRecyclableComponentTemplate (vnode) {
- // $flow-disable-line
- delete vnode.data.attrs[RECYCLE_LIST_MARKER];
- resolveVirtualComponent(vnode);
- var vm = createComponentInstanceForVnode(vnode);
- var render = (vm.$options)['@render'];
- if (render) {
- try {
- return render.call(vm)
- } catch (err) {
- handleError(err, vm, "@render");
- }
- } else {
- warn(
- "@render function not defined on component used in <recycle-list>. " +
- "Make sure to declare `recyclable=\"true\"` on the component's template.",
- vm
- );
- }
-}
-
-/* */
-
-// inline hooks to be invoked on component VNodes during patch
-var componentVNodeHooks = {
- init: function init (
- vnode,
- hydrating,
- parentElm,
- refElm
- ) {
- if (
- vnode.componentInstance &&
- !vnode.componentInstance._isDestroyed &&
- vnode.data.keepAlive
- ) {
- // kept-alive components, treat as a patch
- var mountedNode = vnode; // work around flow
- componentVNodeHooks.prepatch(mountedNode, mountedNode);
- } else {
- var child = vnode.componentInstance = createComponentInstanceForVnode(
- vnode,
- activeInstance,
- parentElm,
- refElm
- );
- child.$mount(hydrating ? vnode.elm : undefined, hydrating);
- }
- },
-
- prepatch: function prepatch (oldVnode, vnode) {
- var options = vnode.componentOptions;
- var child = vnode.componentInstance = oldVnode.componentInstance;
- updateChildComponent(
- child,
- options.propsData, // updated props
- options.listeners, // updated listeners
- vnode, // new parent vnode
- options.children // new children
- );
- },
-
- insert: function insert (vnode) {
- var context = vnode.context;
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isMounted) {
- componentInstance._isMounted = true;
- callHook(componentInstance, 'mounted');
- }
- if (vnode.data.keepAlive) {
- if (context._isMounted) {
- // vue-router#1212
- // During updates, a kept-alive component's child components may
- // change, so directly walking the tree here may call activated hooks
- // on incorrect children. Instead we push them into a queue which will
- // be processed after the whole patch process ended.
- queueActivatedComponent(componentInstance);
- } else {
- activateChildComponent(componentInstance, true /* direct */);
- }
- }
- },
-
- destroy: function destroy (vnode) {
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isDestroyed) {
- if (!vnode.data.keepAlive) {
- componentInstance.$destroy();
- } else {
- deactivateChildComponent(componentInstance, true /* direct */);
- }
- }
- }
-};
-
-var hooksToMerge = Object.keys(componentVNodeHooks);
-
-function createComponent (
- Ctor,
- data,
- context,
- children,
- tag
-) {
- if (isUndef(Ctor)) {
- return
- }
-
- var baseCtor = context.$options._base;
-
- // plain options object: turn it into a constructor
- if (isObject(Ctor)) {
- Ctor = baseCtor.extend(Ctor);
- }
-
- // if at this stage it's not a constructor or an async component factory,
- // reject.
- if (typeof Ctor !== 'function') {
- if (process.env.NODE_ENV !== 'production') {
- warn(("Invalid Component definition: " + (String(Ctor))), context);
- }
- return
- }
-
- // async component
- var asyncFactory;
- if (isUndef(Ctor.cid)) {
- asyncFactory = Ctor;
- Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context);
- if (Ctor === undefined) {
- // return a placeholder node for async component, which is rendered
- // as a comment node but preserves all the raw information for the node.
- // the information will be used for async server-rendering and hydration.
- return createAsyncPlaceholder(
- asyncFactory,
- data,
- context,
- children,
- tag
- )
- }
- }
-
- data = data || {};
-
- // resolve constructor options in case global mixins are applied after
- // component constructor creation
- resolveConstructorOptions(Ctor);
-
- // transform component v-model data into props & events
- if (isDef(data.model)) {
- transformModel(Ctor.options, data);
- }
-
- // extract props
- var propsData = extractPropsFromVNodeData(data, Ctor, tag);
-
- // functional component
- if (isTrue(Ctor.options.functional)) {
- return createFunctionalComponent(Ctor, propsData, data, context, children)
- }
-
- // extract listeners, since these needs to be treated as
- // child component listeners instead of DOM listeners
- var listeners = data.on;
- // replace with listeners with .native modifier
- // so it gets processed during parent component patch.
- data.on = data.nativeOn;
-
- if (isTrue(Ctor.options.abstract)) {
- // abstract components do not keep anything
- // other than props & listeners & slot
-
- // work around flow
- var slot = data.slot;
- data = {};
- if (slot) {
- data.slot = slot;
- }
- }
-
- // install component management hooks onto the placeholder node
- installComponentHooks(data);
-
- // return a placeholder vnode
- var name = Ctor.options.name || tag;
- var vnode = new VNode(
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
- data, undefined, undefined, undefined, context,
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
- asyncFactory
- );
-
- // Weex specific: invoke recycle-list optimized @render function for
- // extracting cell-slot template.
- // https://github.com/Hanks10100/weex-native-directive/tree/master/component
- /* istanbul ignore if */
- if (true && isRecyclableComponent(vnode)) {
- return renderRecyclableComponentTemplate(vnode)
- }
-
- return vnode
-}
-
-function createComponentInstanceForVnode (
- vnode, // we know it's MountedComponentVNode but flow doesn't
- parent, // activeInstance in lifecycle state
- parentElm,
- refElm
-) {
- var options = {
- _isComponent: true,
- parent: parent,
- _parentVnode: vnode,
- _parentElm: parentElm || null,
- _refElm: refElm || null
- };
- // check inline-template render functions
- var inlineTemplate = vnode.data.inlineTemplate;
- if (isDef(inlineTemplate)) {
- options.render = inlineTemplate.render;
- options.staticRenderFns = inlineTemplate.staticRenderFns;
- }
- return new vnode.componentOptions.Ctor(options)
-}
-
-function installComponentHooks (data) {
- var hooks = data.hook || (data.hook = {});
- for (var i = 0; i < hooksToMerge.length; i++) {
- var key = hooksToMerge[i];
- hooks[key] = componentVNodeHooks[key];
- }
-}
-
-// transform component v-model info (value and callback) into
-// prop and event handler respectively.
-function transformModel (options, data) {
- var prop = (options.model && options.model.prop) || 'value';
- var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
- var on = data.on || (data.on = {});
- if (isDef(on[event])) {
- on[event] = [data.model.callback].concat(on[event]);
- } else {
- on[event] = data.model.callback;
- }
-}
-
-/* */
-
-var SIMPLE_NORMALIZE = 1;
-var ALWAYS_NORMALIZE = 2;
-
-// wrapper function for providing a more flexible interface
-// without getting yelled at by flow
-function createElement (
- context,
- tag,
- data,
- children,
- normalizationType,
- alwaysNormalize
-) {
- if (Array.isArray(data) || isPrimitive(data)) {
- normalizationType = children;
- children = data;
- data = undefined;
- }
- if (isTrue(alwaysNormalize)) {
- normalizationType = ALWAYS_NORMALIZE;
- }
- return _createElement(context, tag, data, children, normalizationType)
-}
-
-function _createElement (
- context,
- tag,
- data,
- children,
- normalizationType
-) {
- if (isDef(data) && isDef((data).__ob__)) {
- process.env.NODE_ENV !== 'production' && warn(
- "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
- 'Always create fresh vnode data objects in each render!',
- context
- );
- return createEmptyVNode()
- }
- // object syntax in v-bind
- if (isDef(data) && isDef(data.is)) {
- tag = data.is;
- }
- if (!tag) {
- // in case of component :is set to falsy value
- return createEmptyVNode()
- }
- // warn against non-primitive key
- if (process.env.NODE_ENV !== 'production' &&
- isDef(data) && isDef(data.key) && !isPrimitive(data.key)
- ) {
- if (!true || !('@binding' in data.key)) {
- warn(
- 'Avoid using non-primitive value as key, ' +
- 'use string/number value instead.',
- context
- );
- }
- }
- // support single function children as default scoped slot
- if (Array.isArray(children) &&
- typeof children[0] === 'function'
- ) {
- data = data || {};
- data.scopedSlots = { default: children[0] };
- children.length = 0;
- }
- if (normalizationType === ALWAYS_NORMALIZE) {
- children = normalizeChildren(children);
- } else if (normalizationType === SIMPLE_NORMALIZE) {
- children = simpleNormalizeChildren(children);
- }
- var vnode, ns;
- if (typeof tag === 'string') {
- var Ctor;
- ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
- if (config.isReservedTag(tag)) {
- // platform built-in elements
- vnode = new VNode(
- config.parsePlatformTagName(tag), data, children,
- undefined, undefined, context
- );
- } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
- // component
- vnode = createComponent(Ctor, data, context, children, tag);
- } else {
- // unknown or unlisted namespaced elements
- // check at runtime because it may get assigned a namespace when its
- // parent normalizes children
- vnode = new VNode(
- tag, data, children,
- undefined, undefined, context
- );
- }
- } else {
- // direct component options / constructor
- vnode = createComponent(tag, data, context, children);
- }
- if (Array.isArray(vnode)) {
- return vnode
- } else if (isDef(vnode)) {
- if (isDef(ns)) { applyNS(vnode, ns); }
- if (isDef(data)) { registerDeepBindings(data); }
- return vnode
- } else {
- return createEmptyVNode()
- }
-}
-
-function applyNS (vnode, ns, force) {
- vnode.ns = ns;
- if (vnode.tag === 'foreignObject') {
- // use default namespace inside foreignObject
- 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) || (isTrue(force) && child.tag !== 'svg'))) {
- applyNS(child, ns, force);
- }
- }
- }
-}
-
-// ref #5318
-// necessary to ensure parent re-render when deep bindings like :style and
-// :class are used on slot nodes
-function registerDeepBindings (data) {
- if (isObject(data.style)) {
- traverse(data.style);
- }
- if (isObject(data.class)) {
- traverse(data.class);
- }
-}
-
-/* */
-
-function initRender (vm) {
- vm._vnode = null; // the root of the child tree
- vm._staticTrees = null; // v-once cached trees
- var options = vm.$options;
- var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
- var renderContext = parentVnode && parentVnode.context;
- 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.
- // args order: tag, data, children, normalizationType, alwaysNormalize
- // internal version is used by render functions compiled from templates
- vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
- // normalization is always applied for the public version, used in
- // user-written render functions.
- vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
-
- // $attrs & $listeners are exposed for easier HOC creation.
- // they need to be reactive so that HOCs using them are always updated
- var parentData = parentVnode && parentVnode.data;
-
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
- !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
- }, true);
- defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
- !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
- }, true);
- } else {
- 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)
- };
-
- Vue.prototype._render = function () {
- var vm = this;
- var ref = vm.$options;
- var render = ref.render;
- var _parentVnode = ref._parentVnode;
-
- // reset _rendered flag on slots for duplicate slot check
- if (process.env.NODE_ENV !== 'production') {
- for (var key in vm.$slots) {
- // $flow-disable-line
- vm.$slots[key]._rendered = false;
- }
- }
-
- if (_parentVnode) {
- vm.$scopedSlots = _parentVnode.data.scopedSlots || emptyObject;
- }
-
- // set parent vnode. this allows render functions to have access
- // to the data on the placeholder node.
- vm.$vnode = _parentVnode;
- // render self
- var vnode;
- try {
- vnode = render.call(vm._renderProxy, vm.$createElement);
- } catch (e) {
- handleError(e, vm, "render");
- // return error render result,
- // or previous vnode to prevent render error causing blank component
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- 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;
- }
- }
- // return empty vnode in case the render function errored out
- if (!(vnode instanceof VNode)) {
- if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
- warn(
- 'Multiple root nodes returned from render function. Render function ' +
- 'should return a single root node.',
- vm
- );
- }
- vnode = createEmptyVNode();
- }
- // set parent
- vnode.parent = _parentVnode;
- return vnode
- };
-}
-
-/* */
-
-var uid$3 = 0;
-
-function initMixin (Vue) {
- Vue.prototype._init = function (options) {
- var vm = this;
- // a uid
- vm._uid = uid$3++;
-
- var startTag, endTag;
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- startTag = "vue-perf-start:" + (vm._uid);
- endTag = "vue-perf-end:" + (vm._uid);
- mark(startTag);
- }
-
- // a flag to avoid this being observed
- vm._isVue = true;
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options);
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- );
- }
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- initProxy(vm);
- } else {
- vm._renderProxy = vm;
- }
- // expose real self
- vm._self = vm;
- initLifecycle(vm);
- initEvents(vm);
- initRender(vm);
- callHook(vm, 'beforeCreate');
- initInjections(vm); // resolve injections before data/props
- initState(vm);
- initProvide(vm); // resolve provide after data/props
- callHook(vm, 'created');
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- vm._name = formatComponentName(vm, false);
- mark(endTag);
- measure(("vue " + (vm._name) + " init"), startTag, endTag);
- }
-
- if (vm.$options.el) {
- vm.$mount(vm.$options.el);
- }
- };
-}
-
-function initInternalComponent (vm, options) {
- var opts = vm.$options = Object.create(vm.constructor.options);
- // doing this because it's faster than dynamic enumeration.
- var parentVnode = options._parentVnode;
- opts.parent = options.parent;
- opts._parentVnode = parentVnode;
- opts._parentElm = options._parentElm;
- opts._refElm = options._refElm;
-
- var vnodeComponentOptions = parentVnode.componentOptions;
- opts.propsData = vnodeComponentOptions.propsData;
- opts._parentListeners = vnodeComponentOptions.listeners;
- opts._renderChildren = vnodeComponentOptions.children;
- opts._componentTag = vnodeComponentOptions.tag;
-
- if (options.render) {
- opts.render = options.render;
- opts.staticRenderFns = options.staticRenderFns;
- }
-}
-
-function resolveConstructorOptions (Ctor) {
- var options = Ctor.options;
- if (Ctor.super) {
- var superOptions = resolveConstructorOptions(Ctor.super);
- var cachedSuperOptions = Ctor.superOptions;
- if (superOptions !== cachedSuperOptions) {
- // super option changed,
- // need to resolve new options.
- Ctor.superOptions = superOptions;
- // check if there are any late-modified/attached options (#4976)
- var modifiedOptions = resolveModifiedOptions(Ctor);
- // update base extend options
- if (modifiedOptions) {
- extend(Ctor.extendOptions, modifiedOptions);
- }
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
- if (options.name) {
- options.components[options.name] = Ctor;
- }
- }
- }
- return options
-}
-
-function resolveModifiedOptions (Ctor) {
- var modified;
- var latest = Ctor.options;
- var extended = Ctor.extendOptions;
- var sealed = Ctor.sealedOptions;
- for (var key in latest) {
- if (latest[key] !== sealed[key]) {
- if (!modified) { modified = {}; }
- modified[key] = dedupe(latest[key], extended[key], sealed[key]);
- }
- }
- return modified
-}
-
-function dedupe (latest, extended, sealed) {
- // compare latest and sealed to ensure lifecycle hooks won't be duplicated
- // between merges
- if (Array.isArray(latest)) {
- var res = [];
- sealed = Array.isArray(sealed) ? sealed : [sealed];
- extended = Array.isArray(extended) ? extended : [extended];
- for (var i = 0; i < latest.length; i++) {
- // push original options and not sealed options to exclude duplicated options
- if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
- res.push(latest[i]);
- }
- }
- return res
- } else {
- return latest
- }
-}
-
-function Vue (options) {
- if (process.env.NODE_ENV !== 'production' &&
- !(this instanceof Vue)
- ) {
- warn('Vue is a constructor and should be called with the `new` keyword');
- }
- this._init(options);
-}
-
-initMixin(Vue);
-stateMixin(Vue);
-eventsMixin(Vue);
-lifecycleMixin(Vue);
-renderMixin(Vue);
-
-/* */
-
-function initUse (Vue) {
- Vue.use = function (plugin) {
- var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
- if (installedPlugins.indexOf(plugin) > -1) {
- return this
- }
-
- // additional parameters
- var args = toArray(arguments, 1);
- args.unshift(this);
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args);
- } else if (typeof plugin === 'function') {
- plugin.apply(null, args);
- }
- installedPlugins.push(plugin);
- return this
- };
-}
-
-/* */
-
-function initMixin$1 (Vue) {
- Vue.mixin = function (mixin) {
- this.options = mergeOptions(this.options, mixin);
- return this
- };
-}
-
-/* */
-
-function initExtend (Vue) {
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
- Vue.cid = 0;
- var cid = 1;
-
- /**
- * Class inheritance
- */
- Vue.extend = function (extendOptions) {
- extendOptions = extendOptions || {};
- var Super = this;
- var SuperId = Super.cid;
- var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
- if (cachedCtors[SuperId]) {
- return cachedCtors[SuperId]
- }
-
- var name = extendOptions.name || Super.options.name;
- if (process.env.NODE_ENV !== 'production' && name) {
- validateComponentName(name);
- }
-
- var Sub = function VueComponent (options) {
- this._init(options);
- };
- Sub.prototype = Object.create(Super.prototype);
- Sub.prototype.constructor = Sub;
- Sub.cid = cid++;
- Sub.options = mergeOptions(
- Super.options,
- extendOptions
- );
- Sub['super'] = Super;
-
- // For props and computed properties, we define the proxy getters on
- // the Vue instances at extension time, on the extended prototype. This
- // avoids Object.defineProperty calls for each instance created.
- if (Sub.options.props) {
- initProps$1(Sub);
- }
- if (Sub.options.computed) {
- initComputed$1(Sub);
- }
-
- // allow further extension/mixin/plugin usage
- Sub.extend = Super.extend;
- Sub.mixin = Super.mixin;
- Sub.use = Super.use;
-
- // create asset registers, so extended classes
- // can have their private assets too.
- ASSET_TYPES.forEach(function (type) {
- Sub[type] = Super[type];
- });
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub;
- }
-
- // keep a reference to the super options at extension time.
- // later at instantiation we can check if Super's options have
- // been updated.
- Sub.superOptions = Super.options;
- Sub.extendOptions = extendOptions;
- Sub.sealedOptions = extend({}, Sub.options);
-
- // cache constructor
- cachedCtors[SuperId] = Sub;
- return Sub
- };
-}
-
-function initProps$1 (Comp) {
- var props = Comp.options.props;
- for (var key in props) {
- proxy(Comp.prototype, "_props", key);
- }
-}
-
-function initComputed$1 (Comp) {
- var computed = Comp.options.computed;
- for (var key in computed) {
- defineComputed(Comp.prototype, key, computed[key]);
- }
-}
-
-/* */
-
-function initAssetRegisters (Vue) {
- /**
- * Create asset registration methods.
- */
- ASSET_TYPES.forEach(function (type) {
- Vue[type] = function (
- id,
- definition
- ) {
- if (!definition) {
- return this.options[type + 's'][id]
- } else {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && type === 'component') {
- validateComponentName(id);
- }
- if (type === 'component' && isPlainObject(definition)) {
- definition.name = definition.name || id;
- definition = this.options._base.extend(definition);
- }
- if (type === 'directive' && typeof definition === 'function') {
- definition = { bind: definition, update: definition };
- }
- this.options[type + 's'][id] = definition;
- return definition
- }
- };
- });
-}
-
-/* */
-
-function getComponentName (opts) {
- return opts && (opts.Ctor.options.name || opts.tag)
-}
-
-function matches (pattern, name) {
- if (Array.isArray(pattern)) {
- return pattern.indexOf(name) > -1
- } else if (typeof pattern === 'string') {
- return pattern.split(',').indexOf(name) > -1
- } else if (isRegExp(pattern)) {
- return pattern.test(name)
- }
- /* istanbul ignore next */
- return false
-}
-
-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)) {
- pruneCacheEntry(cache, key, keys, _vnode);
- }
- }
- }
-}
-
-function pruneCacheEntry (
- cache,
- key,
- keys,
- current
-) {
- var cached$$1 = cache[key];
- if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
- 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,
- 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, this$1.keys);
- }
- },
-
- mounted: function mounted () {
- var this$1 = this;
-
- this.$watch('include', function (val) {
- pruneCache(this$1, function (name) { return matches(val, name); });
- });
- this.$watch('exclude', function (val) {
- pruneCache(this$1, function (name) { return !matches(val, name); });
- });
- },
-
- render: function render () {
- var slot = this.$slots.default;
- var vnode = getFirstComponentChild(slot);
- var componentOptions = vnode && vnode.componentOptions;
- if (componentOptions) {
- // check pattern
- var name = getComponentName(componentOptions);
- var ref = this;
- var include = ref.include;
- var exclude = ref.exclude;
- if (
- // not included
- (include && (!name || !matches(include, name))) ||
- // excluded
- (exclude && name && matches(exclude, name))
- ) {
- return vnode
- }
-
- var ref$1 = this;
- var cache = ref$1.cache;
- var keys = ref$1.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 (cache[key]) {
- vnode.componentInstance = cache[key].componentInstance;
- // make current key freshest
- remove(keys, key);
- keys.push(key);
- } else {
- 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 || (slot && slot[0])
- }
-}
-
-var builtInComponents = {
- KeepAlive: KeepAlive
-}
-
-/* */
-
-function initGlobalAPI (Vue) {
- // config
- var configDef = {};
- configDef.get = function () { return config; };
- if (process.env.NODE_ENV !== 'production') {
- configDef.set = function () {
- warn(
- 'Do not replace the Vue.config object, set individual fields instead.'
- );
- };
- }
- Object.defineProperty(Vue, 'config', configDef);
-
- // exposed util methods.
- // NOTE: these are not considered part of the public API - avoid relying on
- // them unless you are aware of the risk.
- Vue.util = {
- warn: warn,
- extend: extend,
- mergeOptions: mergeOptions,
- defineReactive: defineReactive
- };
-
- Vue.set = set;
- Vue.delete = del;
- Vue.nextTick = nextTick;
-
- Vue.options = Object.create(null);
- ASSET_TYPES.forEach(function (type) {
- Vue.options[type + 's'] = Object.create(null);
- });
-
- // this is used to identify the "base" constructor to extend all plain-object
- // components with in Weex's multi-instance scenarios.
- Vue.options._base = Vue;
-
- extend(Vue.options.components, builtInComponents);
-
- initUse(Vue);
- initMixin$1(Vue);
- initExtend(Vue);
- initAssetRegisters(Vue);
-}
-
-initGlobalAPI(Vue);
-
-Object.defineProperty(Vue.prototype, '$isServer', {
- get: isServerRendering
-});
-
-Object.defineProperty(Vue.prototype, '$ssrContext', {
- get: function get () {
- /* istanbul ignore next */
- return this.$vnode && this.$vnode.ssrContext
- }
-});
-
-// expose FunctionalRenderContext for ssr runtime helper installation
-Object.defineProperty(Vue, 'FunctionalRenderContext', {
- value: FunctionalRenderContext
-});
-
-Vue.version = '2.5.15';
-
-var latestNodeId = 1;
-
-function TextNode (text) {
- this.instanceId = '';
- this.nodeId = latestNodeId++;
- this.parentNode = null;
- this.nodeType = 3;
- this.text = text;
-}
-
-/* */
-
-
-var namespaceMap = {};
-
-function createElement$1 (tagName) {
- return document.createElement(tagName)
-}
-
-function createElementNS (namespace, tagName) {
- return document.createElement(namespace + ':' + tagName)
-}
-
-function createTextNode (text) {
- return new TextNode(text)
-}
-
-function createComment (text) {
- return document.createComment(text)
-}
-
-function insertBefore (
- node,
- target,
- before
-) {
- if (target.nodeType === 3) {
- if (node.type === 'text') {
- node.setAttr('value', target.text);
- target.parentNode = node;
- } else {
- var text = createElement$1('text');
- text.setAttr('value', target.text);
- node.insertBefore(text, before);
- }
- return
- }
- node.insertBefore(target, before);
-}
-
-function removeChild (node, child) {
- if (child.nodeType === 3) {
- node.setAttr('value', '');
- return
- }
- node.removeChild(child);
-}
-
-function appendChild (node, child) {
- if (child.nodeType === 3) {
- if (node.type === 'text') {
- node.setAttr('value', child.text);
- child.parentNode = node;
- } else {
- var text = createElement$1('text');
- text.setAttr('value', child.text);
- node.appendChild(text);
- }
- return
- }
-
- node.appendChild(child);
-}
-
-function parentNode (node) {
- return node.parentNode
-}
-
-function nextSibling (node) {
- return node.nextSibling
-}
-
-function tagName (node) {
- return node.type
-}
-
-function setTextContent (node, text) {
- if (node.parentNode) {
- node.parentNode.setAttr('value', text);
- }
-}
-
-function setAttribute (node, key, val) {
- node.setAttr(key, val);
-}
-
-function setStyleScope (node, scopeId) {
- node.setAttr('@styleScope', scopeId);
-}
-
-
-var nodeOps = Object.freeze({
- namespaceMap: namespaceMap,
- createElement: createElement$1,
- createElementNS: createElementNS,
- createTextNode: createTextNode,
- createComment: createComment,
- insertBefore: insertBefore,
- removeChild: removeChild,
- appendChild: appendChild,
- parentNode: parentNode,
- nextSibling: nextSibling,
- tagName: tagName,
- setTextContent: setTextContent,
- setAttribute: setAttribute,
- setStyleScope: setStyleScope
-});
-
-/* */
-
-var ref = {
- create: function create (_, vnode) {
- registerRef(vnode);
- },
- update: function update (oldVnode, vnode) {
- if (oldVnode.data.ref !== vnode.data.ref) {
- registerRef(oldVnode, true);
- registerRef(vnode);
- }
- },
- destroy: function destroy (vnode) {
- registerRef(vnode, true);
- }
-}
-
-function registerRef (vnode, isRemoval) {
- var key = vnode.data.ref;
- if (!isDef(key)) { return }
-
- var vm = vnode.context;
- var ref = vnode.componentInstance || vnode.elm;
- var refs = vm.$refs;
- if (isRemoval) {
- if (Array.isArray(refs[key])) {
- remove(refs[key], ref);
- } else if (refs[key] === ref) {
- refs[key] = undefined;
- }
- } else {
- if (vnode.data.refInFor) {
- if (!Array.isArray(refs[key])) {
- refs[key] = [ref];
- } else if (refs[key].indexOf(ref) < 0) {
- // $flow-disable-line
- refs[key].push(ref);
- }
- } else {
- refs[key] = ref;
- }
- }
-}
-
-/* */
-
-
-
-var isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template,blockquote,iframe,tfoot'
-);
-
-// this map is intentionally selective, only covering SVG elements that may
-// contain child elements.
-var isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
-);
-
-
-
-
-
-
-
-
-
-var isTextInputType = makeMap('text,number,password,search,email,tel,url');
-
-/**
- * Virtual DOM patching algorithm based on Snabbdom by
- * Simon Friis Vindum (@paldepind)
- * Licensed under the MIT License
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
- *
- * modified by Evan You (@yyx990803)
- *
- * Not type-checking this because this file is perf-critical and the cost
- * of making flow understand it is not worth it.
- */
-
-var emptyNode = new VNode('', {}, []);
-
-var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
-
-function sameVnode (a, b) {
- return (
- a.key === b.key && (
- (
- a.tag === b.tag &&
- a.isComment === b.isComment &&
- isDef(a.data) === isDef(b.data) &&
- sameInputType(a, b)
- ) || (
- isTrue(a.isAsyncPlaceholder) &&
- a.asyncFactory === b.asyncFactory &&
- isUndef(b.asyncFactory.error)
- )
- )
- )
-}
-
-function sameInputType (a, b) {
- if (a.tag !== 'input') { return true }
- var i;
- var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
- var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
- return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
-}
-
-function createKeyToOldIdx (children, beginIdx, endIdx) {
- var i, key;
- var map = {};
- for (i = beginIdx; i <= endIdx; ++i) {
- key = children[i].key;
- if (isDef(key)) { map[key] = i; }
- }
- return map
-}
-
-function createPatchFunction (backend) {
- var i, j;
- var cbs = {};
-
- var modules = backend.modules;
- var nodeOps = backend.nodeOps;
-
- for (i = 0; i < hooks.length; ++i) {
- cbs[hooks[i]] = [];
- for (j = 0; j < modules.length; ++j) {
- if (isDef(modules[j][hooks[i]])) {
- cbs[hooks[i]].push(modules[j][hooks[i]]);
- }
- }
- }
-
- function emptyNodeAt (elm) {
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
- }
-
- function createRmCb (childElm, listeners) {
- function remove () {
- if (--remove.listeners === 0) {
- removeNode(childElm);
- }
- }
- remove.listeners = listeners;
- return remove
- }
-
- function removeNode (el) {
- var parent = nodeOps.parentNode(el);
- // element may have already been removed due to v-html / v-text
- if (isDef(parent)) {
- nodeOps.removeChild(parent, el);
- }
- }
-
- function isUnknownElement$$1 (vnode, inVPre) {
- return (
- !inVPre &&
- !vnode.ns &&
- !(
- config.ignoredElements.length &&
- config.ignoredElements.some(function (ignore) {
- return isRegExp(ignore)
- ? ignore.test(vnode.tag)
- : ignore === vnode.tag
- })
- ) &&
- config.isUnknownElement(vnode.tag)
- )
- }
-
- var creatingElmInVPre = 0;
-
- function createElm (
- vnode,
- insertedVnodeQueue,
- parentElm,
- refElm,
- nested,
- ownerArray,
- index
- ) {
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // This vnode was used in a previous render!
- // now it's used as a new node, overwriting its elm would cause
- // potential patch errors down the road when it's used as an insertion
- // reference node. Instead, we clone the node on-demand before creating
- // associated DOM element for it.
- vnode = ownerArray[index] = cloneVNode(vnode);
- }
-
- vnode.isRootInsert = !nested; // for transition enter check
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
- return
- }
-
- var data = vnode.data;
- var children = vnode.children;
- var tag = vnode.tag;
- if (isDef(tag)) {
- if (process.env.NODE_ENV !== 'production') {
- if (data && data.pre) {
- creatingElmInVPre++;
- }
- if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
- warn(
- 'Unknown custom element: <' + tag + '> - did you ' +
- 'register the component correctly? For recursive components, ' +
- 'make sure to provide the "name" option.',
- vnode.context
- );
- }
- }
-
- vnode.elm = vnode.ns
- ? nodeOps.createElementNS(vnode.ns, tag)
- : nodeOps.createElement(tag, vnode);
- setScope(vnode);
-
- /* istanbul ignore if */
- {
- // in Weex, the default insertion order is parent-first.
- // List items can be optimized to use children-first insertion
- // with append="tree".
- var appendAsTree = isDef(data) && isTrue(data.appendAsTree);
- if (!appendAsTree) {
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- }
- insert(parentElm, vnode.elm, refElm);
- }
- createChildren(vnode, children, insertedVnodeQueue);
- if (appendAsTree) {
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- }
- insert(parentElm, vnode.elm, refElm);
- }
- }
-
- if (process.env.NODE_ENV !== 'production' && data && data.pre) {
- creatingElmInVPre--;
- }
- } else if (isTrue(vnode.isComment)) {
- vnode.elm = nodeOps.createComment(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- } else {
- vnode.elm = nodeOps.createTextNode(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- }
- }
-
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i = vnode.data;
- if (isDef(i)) {
- var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
- if (isDef(i = i.hook) && isDef(i = i.init)) {
- i(vnode, false /* hydrating */, parentElm, refElm);
- }
- // after calling the init hook, if the vnode is a child component
- // it should've created a child instance and mounted it. the child
- // component also has set the placeholder vnode's elm.
- // in that case we can just return the element and be done.
- if (isDef(vnode.componentInstance)) {
- initComponent(vnode, insertedVnodeQueue);
- if (isTrue(isReactivated)) {
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
- }
- return true
- }
- }
- }
-
- function initComponent (vnode, insertedVnodeQueue) {
- if (isDef(vnode.data.pendingInsert)) {
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
- vnode.data.pendingInsert = null;
- }
- vnode.elm = vnode.componentInstance.$el;
- if (isPatchable(vnode)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- setScope(vnode);
- } else {
- // empty component root.
- // skip all element-related modules except for ref (#3455)
- registerRef(vnode);
- // make sure to invoke the insert hook
- insertedVnodeQueue.push(vnode);
- }
- }
-
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i;
- // hack for #4339: a reactivated component with inner transition
- // does not trigger because the inner node's created hooks are not called
- // again. It's not ideal to involve module-specific logic in here but
- // there doesn't seem to be a better way to do it.
- var innerNode = vnode;
- while (innerNode.componentInstance) {
- innerNode = innerNode.componentInstance._vnode;
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
- for (i = 0; i < cbs.activate.length; ++i) {
- cbs.activate[i](emptyNode, innerNode);
- }
- insertedVnodeQueue.push(innerNode);
- break
- }
- }
- // unlike a newly created component,
- // a reactivated keep-alive component doesn't insert itself
- insert(parentElm, vnode.elm, refElm);
- }
-
- function insert (parent, elm, ref$$1) {
- if (isDef(parent)) {
- if (isDef(ref$$1)) {
- if (ref$$1.parentNode === parent) {
- nodeOps.insertBefore(parent, elm, ref$$1);
- }
- } else {
- nodeOps.appendChild(parent, elm);
- }
- }
- }
-
- function createChildren (vnode, children, insertedVnodeQueue) {
- if (Array.isArray(children)) {
- if (process.env.NODE_ENV !== 'production') {
- checkDuplicateKeys(children);
- }
- for (var i = 0; i < children.length; ++i) {
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
- }
- } else if (isPrimitive(vnode.text)) {
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
- }
- }
-
- function isPatchable (vnode) {
- while (vnode.componentInstance) {
- vnode = vnode.componentInstance._vnode;
- }
- return isDef(vnode.tag)
- }
-
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, vnode);
- }
- i = vnode.data.hook; // Reuse variable
- if (isDef(i)) {
- if (isDef(i.create)) { i.create(emptyNode, vnode); }
- if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
- }
- }
-
- // set scope id attribute for scoped CSS.
- // this is implemented as a special case to avoid the overhead
- // of going through the normal attribute patching process.
- function setScope (vnode) {
- var i;
- if (isDef(i = vnode.fnScopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- } else {
- var ancestor = vnode;
- while (ancestor) {
- if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- 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.fnContext &&
- isDef(i = i.$options._scopeId)
- ) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- }
-
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
- for (; startIdx <= endIdx; ++startIdx) {
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
- }
- }
-
- function invokeDestroyHook (vnode) {
- var i, j;
- var data = vnode.data;
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
- for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
- }
- if (isDef(i = vnode.children)) {
- for (j = 0; j < vnode.children.length; ++j) {
- invokeDestroyHook(vnode.children[j]);
- }
- }
- }
-
- function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
- for (; startIdx <= endIdx; ++startIdx) {
- var ch = vnodes[startIdx];
- if (isDef(ch)) {
- if (isDef(ch.tag)) {
- removeAndInvokeRemoveHook(ch);
- invokeDestroyHook(ch);
- } else { // Text node
- removeNode(ch.elm);
- }
- }
- }
- }
-
- function removeAndInvokeRemoveHook (vnode, rm) {
- if (isDef(rm) || isDef(vnode.data)) {
- var i;
- var listeners = cbs.remove.length + 1;
- if (isDef(rm)) {
- // we have a recursively passed down rm callback
- // increase the listeners count
- rm.listeners += listeners;
- } else {
- // directly removing
- rm = createRmCb(vnode.elm, listeners);
- }
- // recursively invoke hooks on child component root node
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
- removeAndInvokeRemoveHook(i, rm);
- }
- for (i = 0; i < cbs.remove.length; ++i) {
- cbs.remove[i](vnode, rm);
- }
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
- i(vnode, rm);
- } else {
- rm();
- }
- } else {
- removeNode(vnode.elm);
- }
- }
-
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
- var oldStartIdx = 0;
- var newStartIdx = 0;
- var oldEndIdx = oldCh.length - 1;
- var oldStartVnode = oldCh[0];
- var oldEndVnode = oldCh[oldEndIdx];
- var newEndIdx = newCh.length - 1;
- var newStartVnode = newCh[0];
- var newEndVnode = newCh[newEndIdx];
- var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
-
- // removeOnly is a special flag used only by <transition-group>
- // to ensure removed elements stay in correct relative positions
- // during leaving transitions
- var canMove = !removeOnly;
-
- if (process.env.NODE_ENV !== 'production') {
- checkDuplicateKeys(newCh);
- }
-
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
- if (isUndef(oldStartVnode)) {
- oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
- } else if (isUndef(oldEndVnode)) {
- oldEndVnode = oldCh[--oldEndIdx];
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
- oldStartVnode = oldCh[++oldStartIdx];
- newStartVnode = newCh[++newStartIdx];
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
- oldEndVnode = oldCh[--oldEndIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
- oldStartVnode = oldCh[++oldStartIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
- oldEndVnode = oldCh[--oldEndIdx];
- newStartVnode = newCh[++newStartIdx];
- } else {
- if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
- idxInOld = isDef(newStartVnode.key)
- ? oldKeyToIdx[newStartVnode.key]
- : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
- if (isUndef(idxInOld)) { // New element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- } else {
- vnodeToMove = oldCh[idxInOld];
- if (sameVnode(vnodeToMove, newStartVnode)) {
- patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue);
- oldCh[idxInOld] = undefined;
- canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
- } else {
- // same key but different element. treat as new element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- }
- }
- newStartVnode = newCh[++newStartIdx];
- }
- }
- if (oldStartIdx > oldEndIdx) {
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
- } else if (newStartIdx > newEndIdx) {
- removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
- }
- }
-
- function checkDuplicateKeys (children) {
- var seenKeys = {};
- for (var i = 0; i < children.length; i++) {
- var vnode = children[i];
- var key = vnode.key;
- if (isDef(key)) {
- if (seenKeys[key]) {
- warn(
- ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
- vnode.context
- );
- } else {
- seenKeys[key] = true;
- }
- }
- }
- }
-
- function findIdxInOld (node, oldCh, start, end) {
- for (var i = start; i < end; i++) {
- var c = oldCh[i];
- if (isDef(c) && sameVnode(node, c)) { return i }
- }
- }
-
- function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
- if (oldVnode === vnode) {
- return
- }
-
- var elm = vnode.elm = oldVnode.elm;
-
- if (isTrue(oldVnode.isAsyncPlaceholder)) {
- if (isDef(vnode.asyncFactory.resolved)) {
- hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
- } else {
- vnode.isAsyncPlaceholder = true;
- }
- return
- }
-
- // reuse element for static trees.
- // note we only do this if the vnode is cloned -
- // if the new node is not cloned it means the render functions have been
- // reset by the hot-reload-api and we need to do a proper re-render.
- if (isTrue(vnode.isStatic) &&
- isTrue(oldVnode.isStatic) &&
- vnode.key === oldVnode.key &&
- (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
- ) {
- vnode.componentInstance = oldVnode.componentInstance;
- return
- }
-
- var i;
- var data = vnode.data;
- if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
- i(oldVnode, vnode);
- }
-
- var oldCh = oldVnode.children;
- var ch = vnode.children;
- if (isDef(data) && isPatchable(vnode)) {
- for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
- if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
- }
- if (isUndef(vnode.text)) {
- if (isDef(oldCh) && isDef(ch)) {
- if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
- } else if (isDef(ch)) {
- if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
- } else if (isDef(oldCh)) {
- removeVnodes(elm, oldCh, 0, oldCh.length - 1);
- } else if (isDef(oldVnode.text)) {
- nodeOps.setTextContent(elm, '');
- }
- } else if (oldVnode.text !== vnode.text) {
- nodeOps.setTextContent(elm, vnode.text);
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
- }
- }
-
- function invokeInsertHook (vnode, queue, initial) {
- // delay insert hooks for component root nodes, invoke them after the
- // element is really inserted
- if (isTrue(initial) && isDef(vnode.parent)) {
- vnode.parent.data.pendingInsert = queue;
- } else {
- for (var i = 0; i < queue.length; ++i) {
- queue[i].data.hook.insert(queue[i]);
- }
- }
- }
-
- var hydrationBailed = false;
- // list of modules that can skip create hook during hydration because they
- // are already rendered on the client or has no need for initialization
- // Note: style is excluded because it relies on initial clone for future
- // deep updates (#7063).
- var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
-
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
- function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
- var i;
- var tag = vnode.tag;
- var data = vnode.data;
- var children = vnode.children;
- inVPre = inVPre || (data && data.pre);
- vnode.elm = elm;
-
- if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
- vnode.isAsyncPlaceholder = true;
- return true
- }
- // assert node match
- if (process.env.NODE_ENV !== 'production') {
- if (!assertNodeMatch(elm, vnode, inVPre)) {
- return false
- }
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
- if (isDef(i = vnode.componentInstance)) {
- // child component. it should have hydrated its own tree.
- initComponent(vnode, insertedVnodeQueue);
- return true
- }
- }
- if (isDef(tag)) {
- if (isDef(children)) {
- // empty element, allow client to pick up and populate children
- if (!elm.hasChildNodes()) {
- createChildren(vnode, children, insertedVnodeQueue);
- } else {
- // v-html and domProps: innerHTML
- if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
- if (i !== elm.innerHTML) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' &&
- typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('server innerHTML: ', i);
- console.warn('client innerHTML: ', elm.innerHTML);
- }
- return false
- }
- } else {
- // iterate and compare children lists
- var childrenMatch = true;
- var childNode = elm.firstChild;
- for (var i$1 = 0; i$1 < children.length; i$1++) {
- if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
- childrenMatch = false;
- break
- }
- childNode = childNode.nextSibling;
- }
- // if childNode is not null, it means the actual childNodes list is
- // longer than the virtual children list.
- if (!childrenMatch || childNode) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' &&
- typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
- }
- return false
- }
- }
- }
- }
- if (isDef(data)) {
- var fullInvoke = false;
- for (var key in data) {
- if (!isRenderedModule(key)) {
- fullInvoke = true;
- invokeCreateHooks(vnode, insertedVnodeQueue);
- break
- }
- }
- if (!fullInvoke && data['class']) {
- // ensure collecting deps for deep class bindings for future updates
- traverse(data['class']);
- }
- }
- } else if (elm.data !== vnode.text) {
- elm.data = vnode.text;
- }
- return true
- }
-
- function assertNodeMatch (node, vnode, inVPre) {
- if (isDef(vnode.tag)) {
- return vnode.tag.indexOf('vue-component') === 0 || (
- !isUnknownElement$$1(vnode, inVPre) &&
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
- )
- } else {
- return node.nodeType === (vnode.isComment ? 8 : 3)
- }
- }
-
- return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
- if (isUndef(vnode)) {
- if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
- return
- }
-
- var isInitialPatch = false;
- var insertedVnodeQueue = [];
-
- if (isUndef(oldVnode)) {
- // empty mount (likely as component), create new root element
- isInitialPatch = true;
- createElm(vnode, insertedVnodeQueue, parentElm, refElm);
- } else {
- var isRealElement = isDef(oldVnode.nodeType);
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
- // patch existing root node
- patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
- } else {
- if (isRealElement) {
- // mounting to a real element
- // check if this is server-rendered content and if we can perform
- // a successful hydration.
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
- oldVnode.removeAttribute(SSR_ATTR);
- hydrating = true;
- }
- if (isTrue(hydrating)) {
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
- invokeInsertHook(vnode, insertedVnodeQueue, true);
- return oldVnode
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- 'The client-side rendered virtual DOM tree is not matching ' +
- 'server-rendered content. This is likely caused by incorrect ' +
- 'HTML markup, for example nesting block-level elements inside ' +
- '<p>, or missing <tbody>. Bailing hydration and performing ' +
- 'full client-side render.'
- );
- }
- }
- // either not server-rendered, or hydration failed.
- // create an empty node and replace it
- oldVnode = emptyNodeAt(oldVnode);
- }
-
- // replacing existing element
- var oldElm = oldVnode.elm;
- var parentElm$1 = nodeOps.parentNode(oldElm);
-
- // create new node
- createElm(
- vnode,
- insertedVnodeQueue,
- // extremely rare edge case: do not insert if old element is in a
- // leaving transition. Only happens when combining transition +
- // keep-alive + HOCs. (#4590)
- oldElm._leaveCb ? null : parentElm$1,
- nodeOps.nextSibling(oldElm)
- );
-
- // update parent placeholder node element, recursively
- if (isDef(vnode.parent)) {
- var ancestor = vnode.parent;
- var patchable = isPatchable(vnode);
- while (ancestor) {
- for (var i = 0; i < cbs.destroy.length; ++i) {
- cbs.destroy[i](ancestor);
- }
- ancestor.elm = vnode.elm;
- if (patchable) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, ancestor);
- }
- // #6513
- // invoke insert hooks that may have been merged by create hooks.
- // e.g. for directives that uses the "inserted" hook.
- var insert = ancestor.data.hook.insert;
- if (insert.merged) {
- // start at index 1 to avoid re-invoking component mounted hook
- for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
- insert.fns[i$2]();
- }
- }
- } else {
- registerRef(ancestor);
- }
- ancestor = ancestor.parent;
- }
- }
-
- // destroy old node
- if (isDef(parentElm$1)) {
- removeVnodes(parentElm$1, [oldVnode], 0, 0);
- } else if (isDef(oldVnode.tag)) {
- invokeDestroyHook(oldVnode);
- }
- }
- }
-
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
- return vnode.elm
- }
-}
-
-/* */
-
-var directives = {
- create: updateDirectives,
- update: updateDirectives,
- destroy: function unbindDirectives (vnode) {
- updateDirectives(vnode, emptyNode);
- }
-}
-
-function updateDirectives (oldVnode, vnode) {
- if (oldVnode.data.directives || vnode.data.directives) {
- _update(oldVnode, vnode);
- }
-}
-
-function _update (oldVnode, vnode) {
- var isCreate = oldVnode === emptyNode;
- var isDestroy = vnode === emptyNode;
- var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
- var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
-
- var dirsWithInsert = [];
- var dirsWithPostpatch = [];
-
- var key, oldDir, dir;
- for (key in newDirs) {
- oldDir = oldDirs[key];
- dir = newDirs[key];
- if (!oldDir) {
- // new directive, bind
- callHook$1(dir, 'bind', vnode, oldVnode);
- if (dir.def && dir.def.inserted) {
- dirsWithInsert.push(dir);
- }
- } else {
- // existing directive, update
- dir.oldValue = oldDir.value;
- callHook$1(dir, 'update', vnode, oldVnode);
- if (dir.def && dir.def.componentUpdated) {
- dirsWithPostpatch.push(dir);
- }
- }
- }
-
- if (dirsWithInsert.length) {
- var callInsert = function () {
- for (var i = 0; i < dirsWithInsert.length; i++) {
- callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
- }
- };
- if (isCreate) {
- mergeVNodeHook(vnode, 'insert', callInsert);
- } else {
- callInsert();
- }
- }
-
- if (dirsWithPostpatch.length) {
- mergeVNodeHook(vnode, 'postpatch', function () {
- for (var i = 0; i < dirsWithPostpatch.length; i++) {
- callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
- }
- });
- }
-
- if (!isCreate) {
- for (key in oldDirs) {
- if (!newDirs[key]) {
- // no longer present, unbind
- callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
- }
- }
- }
-}
-
-var emptyModifiers = Object.create(null);
-
-function normalizeDirectives$1 (
- dirs,
- vm
-) {
- var res = Object.create(null);
- if (!dirs) {
- // $flow-disable-line
- return res
- }
- var i, dir;
- for (i = 0; i < dirs.length; i++) {
- dir = dirs[i];
- if (!dir.modifiers) {
- // $flow-disable-line
- dir.modifiers = emptyModifiers;
- }
- res[getRawDirName(dir)] = dir;
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
- }
- // $flow-disable-line
- return res
-}
-
-function getRawDirName (dir) {
- return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
-}
-
-function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
- var fn = dir.def && dir.def[hook];
- if (fn) {
- try {
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
- } catch (e) {
- handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
- }
- }
-}
-
-var baseModules = [
- ref,
- directives
-]
-
-/* */
-
-function updateAttrs (oldVnode, vnode) {
- if (!oldVnode.data.attrs && !vnode.data.attrs) {
- return
- }
- var key, cur, old;
- var elm = vnode.elm;
- var oldAttrs = oldVnode.data.attrs || {};
- var attrs = vnode.data.attrs || {};
- // clone observed objects, as the user probably wants to mutate it
- if (attrs.__ob__) {
- attrs = vnode.data.attrs = extend({}, attrs);
- }
-
- var supportBatchUpdate = typeof elm.setAttrs === 'function';
- var batchedAttrs = {};
- for (key in attrs) {
- cur = attrs[key];
- old = oldAttrs[key];
- if (old !== cur) {
- supportBatchUpdate
- ? (batchedAttrs[key] = cur)
- : elm.setAttr(key, cur);
- }
- }
- for (key in oldAttrs) {
- if (attrs[key] == null) {
- supportBatchUpdate
- ? (batchedAttrs[key] = undefined)
- : elm.setAttr(key);
- }
- }
- if (supportBatchUpdate) {
- elm.setAttrs(batchedAttrs);
- }
-}
-
-var attrs = {
- create: updateAttrs,
- update: updateAttrs
-}
-
-/* */
-
-function updateClass (oldVnode, vnode) {
- var el = vnode.elm;
- var ctx = vnode.context;
-
- var data = vnode.data;
- var oldData = oldVnode.data;
- if (!data.staticClass &&
- !data.class &&
- (!oldData || (!oldData.staticClass && !oldData.class))
- ) {
- return
- }
-
- var oldClassList = [];
- // unlike web, weex vnode staticClass is an Array
- var oldStaticClass = oldData.staticClass;
- if (oldStaticClass) {
- oldClassList.push.apply(oldClassList, oldStaticClass);
- }
- if (oldData.class) {
- oldClassList.push.apply(oldClassList, oldData.class);
- }
-
- var classList = [];
- // unlike web, weex vnode staticClass is an Array
- var staticClass = data.staticClass;
- if (staticClass) {
- classList.push.apply(classList, staticClass);
- }
- if (data.class) {
- classList.push.apply(classList, data.class);
- }
-
- if (typeof el.setClassList === 'function') {
- el.setClassList(classList);
- } else {
- var style = getStyle(oldClassList, classList, ctx);
- if (typeof el.setStyles === 'function') {
- el.setStyles(style);
- } else {
- for (var key in style) {
- el.setStyle(key, style[key]);
- }
- }
- }
-}
-
-function getStyle (oldClassList, classList, ctx) {
- // style is a weex-only injected object
- // compiled from <style> tags in weex files
- var stylesheet = ctx.$options.style || {};
- var result = {};
- classList.forEach(function (name) {
- var style = stylesheet[name];
- extend(result, style);
- });
- oldClassList.forEach(function (name) {
- var style = stylesheet[name];
- for (var key in style) {
- if (!result.hasOwnProperty(key)) {
- result[key] = '';
- }
- }
- });
- return result
-}
-
-var klass = {
- create: updateClass,
- update: updateClass
-}
-
-/* */
-
-var target$1;
-
-function add$1 (
- event,
- handler,
- once,
- capture,
- passive,
- params
-) {
- if (capture) {
- console.log('Weex do not support event in bubble phase.');
- return
- }
- if (once) {
- 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, null, null, _target);
- }
- };
- }
- target$1.addEvent(event, handler, params);
-}
-
-function remove$2 (
- event,
- handler,
- capture,
- _target
-) {
- (_target || target$1).removeEvent(event);
-}
-
-function updateDOMListeners (oldVnode, vnode) {
- if (!oldVnode.data.on && !vnode.data.on) {
- return
- }
- var on = vnode.data.on || {};
- var oldOn = oldVnode.data.on || {};
- target$1 = vnode.elm;
- updateListeners(on, oldOn, add$1, remove$2, vnode.context);
- target$1 = undefined;
-}
-
-var events = {
- create: updateDOMListeners,
- update: updateDOMListeners
-}
-
-/* */
-
-var normalize = cached(camelize);
-
-function createStyle (oldVnode, vnode) {
- if (!vnode.data.staticStyle) {
- updateStyle(oldVnode, vnode);
- return
- }
- var elm = vnode.elm;
- var staticStyle = vnode.data.staticStyle;
- var supportBatchUpdate = typeof elm.setStyles === 'function';
- var batchedStyles = {};
- for (var name in staticStyle) {
- if (staticStyle[name]) {
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = staticStyle[name])
- : elm.setStyle(normalize(name), staticStyle[name]);
- }
- }
- if (supportBatchUpdate) {
- elm.setStyles(batchedStyles);
- }
- updateStyle(oldVnode, vnode);
-}
-
-function updateStyle (oldVnode, vnode) {
- if (!oldVnode.data.style && !vnode.data.style) {
- return
- }
- var cur, name;
- var elm = vnode.elm;
- var oldStyle = oldVnode.data.style || {};
- var style = vnode.data.style || {};
-
- var needClone = style.__ob__;
-
- // handle array syntax
- if (Array.isArray(style)) {
- style = vnode.data.style = toObject$1(style);
- }
-
- // clone the style for future updates,
- // in case the user mutates the style object in-place.
- if (needClone) {
- style = vnode.data.style = extend({}, style);
- }
-
- var supportBatchUpdate = typeof elm.setStyles === 'function';
- var batchedStyles = {};
- for (name in oldStyle) {
- if (!style[name]) {
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = '')
- : elm.setStyle(normalize(name), '');
- }
- }
- for (name in style) {
- cur = style[name];
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = cur)
- : elm.setStyle(normalize(name), cur);
- }
- if (supportBatchUpdate) {
- elm.setStyles(batchedStyles);
- }
-}
-
-function toObject$1 (arr) {
- var res = {};
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res
-}
-
-var style = {
- create: createStyle,
- update: updateStyle
-}
-
-/* */
-
-/**
- * Add class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
-
-
-/**
- * Remove class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
-
-/* */
-
-function resolveTransition (def) {
- if (!def) {
- return
- }
- /* istanbul ignore else */
- if (typeof def === 'object') {
- var res = {};
- if (def.css !== false) {
- extend(res, autoCssTransition(def.name || 'v'));
- }
- extend(res, def);
- return res
- } else if (typeof def === 'string') {
- return autoCssTransition(def)
- }
-}
-
-var autoCssTransition = cached(function (name) {
- return {
- enterClass: (name + "-enter"),
- enterToClass: (name + "-enter-to"),
- enterActiveClass: (name + "-enter-active"),
- leaveClass: (name + "-leave"),
- leaveToClass: (name + "-leave-to"),
- leaveActiveClass: (name + "-leave-active")
- }
-});
-
-var hasTransition = inBrowser && !isIE9;
-// Transition property/event sniffing
-
-
-
-
-if (hasTransition) {
- /* istanbul ignore if */
- if (window.ontransitionend === undefined &&
- window.onwebkittransitionend !== undefined
- ) {
-
- }
- if (window.onanimationend === undefined &&
- window.onwebkitanimationend !== undefined
- ) {
-
- }
-}
-
-// 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
- : /* istanbul ignore next */ function (fn) { return fn(); };
-
-var transition = {
- create: enter,
- activate: enter,
- remove: leave
-}
-
-function enter (_, vnode) {
- var el = vnode.elm;
-
- // call leave callback now
- if (el._leaveCb) {
- el._leaveCb.cancelled = true;
- el._leaveCb();
- }
-
- var data = resolveTransition(vnode.data.transition);
- if (!data) {
- return
- }
-
- /* istanbul ignore if */
- if (el._enterCb) {
- return
- }
-
- var enterClass = data.enterClass;
- var enterToClass = data.enterToClass;
- var enterActiveClass = data.enterActiveClass;
- var appearClass = data.appearClass;
- var appearToClass = data.appearToClass;
- var appearActiveClass = data.appearActiveClass;
- var beforeEnter = data.beforeEnter;
- var enter = data.enter;
- var afterEnter = data.afterEnter;
- var enterCancelled = data.enterCancelled;
- var beforeAppear = data.beforeAppear;
- var appear = data.appear;
- var afterAppear = data.afterAppear;
- var appearCancelled = data.appearCancelled;
-
- var context = activeInstance;
- var transitionNode = activeInstance.$vnode;
- while (transitionNode && transitionNode.parent) {
- transitionNode = transitionNode.parent;
- context = transitionNode.context;
- }
-
- var isAppear = !context._isMounted || !vnode.isRootInsert;
-
- if (isAppear && !appear && appear !== '') {
- return
- }
-
- var startClass = isAppear ? appearClass : enterClass;
- var toClass = isAppear ? appearToClass : enterToClass;
- var activeClass = isAppear ? appearActiveClass : enterActiveClass;
- var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
- var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
- var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
- var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
-
- var userWantsControl =
- enterHook &&
- // enterHook may be a bound method which exposes
- // the length of original fn as _length
- (enterHook._length || enterHook.length) > 1;
-
- var stylesheet = vnode.context.$options.style || {};
- var startState = stylesheet[startClass];
- var transitionProperties = (stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][activeClass]) || {};
- var endState = getEnterTargetState(el, stylesheet, startClass, toClass, activeClass, vnode.context);
- var needAnimation = Object.keys(endState).length > 0;
-
- var cb = el._enterCb = once(function () {
- if (cb.cancelled) {
- enterCancelledHook && enterCancelledHook(el);
- } else {
- afterEnterHook && afterEnterHook(el);
- }
- el._enterCb = null;
- });
-
- // We need to wait until the native element has been inserted, but currently
- // there's no API to do that. So we have to wait "one frame" - not entirely
- // sure if this is guaranteed to be enough (e.g. on slow devices?)
- setTimeout(function () {
- var parent = el.parentNode;
- var pendingNode = parent && parent._pending && parent._pending[vnode.key];
- if (pendingNode &&
- pendingNode.context === vnode.context &&
- pendingNode.tag === vnode.tag &&
- pendingNode.elm._leaveCb
- ) {
- pendingNode.elm._leaveCb();
- }
- enterHook && enterHook(el, cb);
-
- if (needAnimation) {
- var animation = vnode.context.$requireWeexModule('animation');
- animation.transition(el.ref, {
- styles: endState,
- duration: transitionProperties.duration || 0,
- delay: transitionProperties.delay || 0,
- timingFunction: transitionProperties.timingFunction || 'linear'
- }, userWantsControl ? noop : cb);
- } else if (!userWantsControl) {
- cb();
- }
- }, 16);
-
- // start enter transition
- beforeEnterHook && beforeEnterHook(el);
-
- if (startState) {
- if (typeof el.setStyles === 'function') {
- el.setStyles(startState);
- } else {
- for (var key in startState) {
- el.setStyle(key, startState[key]);
- }
- }
- }
-
- if (!needAnimation && !userWantsControl) {
- cb();
- }
-}
-
-function leave (vnode, rm) {
- var el = vnode.elm;
-
- // call enter callback now
- if (el._enterCb) {
- el._enterCb.cancelled = true;
- el._enterCb();
- }
-
- var data = resolveTransition(vnode.data.transition);
- if (!data) {
- return rm()
- }
-
- if (el._leaveCb) {
- return
- }
-
- var leaveClass = data.leaveClass;
- var leaveToClass = data.leaveToClass;
- var leaveActiveClass = data.leaveActiveClass;
- var beforeLeave = data.beforeLeave;
- var leave = data.leave;
- var afterLeave = data.afterLeave;
- var leaveCancelled = data.leaveCancelled;
- var delayLeave = data.delayLeave;
-
- var userWantsControl =
- leave &&
- // leave hook may be a bound method which exposes
- // the length of original fn as _length
- (leave._length || leave.length) > 1;
-
- var stylesheet = vnode.context.$options.style || {};
- var startState = stylesheet[leaveClass];
- var endState = stylesheet[leaveToClass] || stylesheet[leaveActiveClass];
- var transitionProperties = (stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][leaveActiveClass]) || {};
-
- var cb = el._leaveCb = once(function () {
- if (el.parentNode && el.parentNode._pending) {
- el.parentNode._pending[vnode.key] = null;
- }
- if (cb.cancelled) {
- leaveCancelled && leaveCancelled(el);
- } else {
- rm();
- afterLeave && afterLeave(el);
- }
- el._leaveCb = null;
- });
-
- if (delayLeave) {
- delayLeave(performLeave);
- } else {
- performLeave();
- }
-
- function performLeave () {
- var animation = vnode.context.$requireWeexModule('animation');
- // the delayed leave may have already been cancelled
- if (cb.cancelled) {
- return
- }
- // record leaving element
- if (!vnode.data.show) {
- (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
- }
- beforeLeave && beforeLeave(el);
-
- if (startState) {
- animation.transition(el.ref, {
- styles: startState
- }, next);
- } else {
- next();
- }
-
- function next () {
- animation.transition(el.ref, {
- styles: endState,
- duration: transitionProperties.duration || 0,
- delay: transitionProperties.delay || 0,
- timingFunction: transitionProperties.timingFunction || 'linear'
- }, userWantsControl ? noop : cb);
- }
-
- leave && leave(el, cb);
- if (!endState && !userWantsControl) {
- cb();
- }
- }
-}
-
-// determine the target animation style for an entering transition.
-function getEnterTargetState (el, stylesheet, startClass, endClass, activeClass, vm) {
- var targetState = {};
- var startState = stylesheet[startClass];
- var endState = stylesheet[endClass];
- var activeState = stylesheet[activeClass];
- // 1. fallback to element's default styling
- if (startState) {
- for (var key in startState) {
- targetState[key] = el.style[key];
- if (
- process.env.NODE_ENV !== 'production' &&
- targetState[key] == null &&
- (!activeState || activeState[key] == null) &&
- (!endState || endState[key] == null)
- ) {
- warn(
- "transition property \"" + key + "\" is declared in enter starting class (." + startClass + "), " +
- "but not declared anywhere in enter ending class (." + endClass + "), " +
- "enter active cass (." + activeClass + ") or the element's default styling. " +
- "Note in Weex, CSS properties need explicit values to be transitionable."
- );
- }
- }
- }
- // 2. if state is mixed in active state, extract them while excluding
- // transition properties
- if (activeState) {
- for (var key$1 in activeState) {
- if (key$1.indexOf('transition') !== 0) {
- targetState[key$1] = activeState[key$1];
- }
- }
- }
- // 3. explicit endState has highest priority
- if (endState) {
- extend(targetState, endState);
- }
- return targetState
-}
-
-var platformModules = [
- attrs,
- klass,
- events,
- style,
- transition
-]
-
-/* */
-
-// the directive module should be applied last, after all
-// built-in modules have been applied.
-var modules = platformModules.concat(baseModules);
-
-var patch = createPatchFunction({
- nodeOps: nodeOps,
- modules: modules,
- LONG_LIST_THRESHOLD: 10
-});
-
-var platformDirectives = {
-}
-
-/* */
-
-function getVNodeType (vnode) {
- if (!vnode.tag) {
- return ''
- }
- return vnode.tag.replace(/vue\-component\-(\d+\-)?/, '')
-}
-
-function isSimpleSpan (vnode) {
- return vnode.children &&
- vnode.children.length === 1 &&
- !vnode.children[0].tag
-}
-
-function parseStyle (vnode) {
- if (!vnode || !vnode.data) {
- return
- }
- var ref = vnode.data;
- var staticStyle = ref.staticStyle;
- var staticClass = ref.staticClass;
- if (vnode.data.style || vnode.data.class || staticStyle || staticClass) {
- var styles = Object.assign({}, staticStyle, vnode.data.style);
- var cssMap = vnode.context.$options.style || {};
- var classList = [].concat(staticClass, vnode.data.class);
- classList.forEach(function (name) {
- if (name && cssMap[name]) {
- Object.assign(styles, cssMap[name]);
- }
- });
- return styles
- }
-}
-
-function convertVNodeChildren (children) {
- if (!children.length) {
- return
- }
-
- return children.map(function (vnode) {
- var type = getVNodeType(vnode);
- var props = { type: type };
-
- // convert raw text node
- if (!type) {
- props.type = 'span';
- props.attr = {
- value: (vnode.text || '').trim()
- };
- } else {
- props.style = parseStyle(vnode);
- if (vnode.data) {
- props.attr = vnode.data.attrs;
- if (vnode.data.on) {
- props.events = vnode.data.on;
- }
- }
- if (type === 'span' && isSimpleSpan(vnode)) {
- props.attr = props.attr || {};
- props.attr.value = vnode.children[0].text.trim();
- return props
- }
- }
-
- if (vnode.children && vnode.children.length) {
- props.children = convertVNodeChildren(vnode.children);
- }
-
- return props
- })
-}
-
-var Richtext = {
- name: 'richtext',
- render: function render (h) {
- return h('weex:richtext', {
- on: this._events,
- attrs: {
- value: convertVNodeChildren(this.$options._renderChildren || [])
- }
- })
- }
-}
-
-/* */
-
-// Provides transition support for a single element/component.
-// supports transition mode (out-in / in-out)
-
-var transitionProps = {
- name: String,
- appear: Boolean,
- css: Boolean,
- mode: String,
- type: String,
- enterClass: String,
- leaveClass: String,
- enterToClass: String,
- leaveToClass: String,
- enterActiveClass: String,
- leaveActiveClass: String,
- appearClass: String,
- appearActiveClass: String,
- appearToClass: String,
- duration: [Number, String, Object]
-};
-
-// in case the child is also an abstract component, e.g. <keep-alive>
-// we want to recursively retrieve the real component to be rendered
-function getRealChild (vnode) {
- var compOptions = vnode && vnode.componentOptions;
- if (compOptions && compOptions.Ctor.options.abstract) {
- return getRealChild(getFirstComponentChild(compOptions.children))
- } else {
- return vnode
- }
-}
-
-function extractTransitionData (comp) {
- var data = {};
- var options = comp.$options;
- // props
- for (var key in options.propsData) {
- data[key] = comp[key];
- }
- // events.
- // extract listeners and pass them directly to the transition methods
- var listeners = options._parentListeners;
- for (var key$1 in listeners) {
- data[camelize(key$1)] = listeners[key$1];
- }
- return data
-}
-
-function placeholder (h, rawChild) {
- if (/\d-keep-alive$/.test(rawChild.tag)) {
- return h('keep-alive', {
- props: rawChild.componentOptions.propsData
- })
- }
-}
-
-function hasParentTransition (vnode) {
- while ((vnode = vnode.parent)) {
- if (vnode.data.transition) {
- return true
- }
- }
-}
-
-function isSameChild (child, oldChild) {
- return oldChild.key === child.key && oldChild.tag === child.tag
-}
-
-var Transition = {
- name: 'transition',
- props: transitionProps,
- abstract: true,
-
- render: function render (h) {
- var this$1 = this;
-
- var children = this.$slots.default;
- if (!children) {
- return
- }
-
- // filter out text nodes (possible whitespaces)
- children = children.filter(function (c) { return c.tag || isAsyncPlaceholder(c); });
- /* istanbul ignore if */
- if (!children.length) {
- return
- }
-
- // warn multiple elements
- if (process.env.NODE_ENV !== 'production' && children.length > 1) {
- warn(
- '<transition> can only be used on a single element. Use ' +
- '<transition-group> for lists.',
- this.$parent
- );
- }
-
- var mode = this.mode;
-
- // warn invalid mode
- if (process.env.NODE_ENV !== 'production' &&
- mode && mode !== 'in-out' && mode !== 'out-in'
- ) {
- warn(
- 'invalid <transition> mode: ' + mode,
- this.$parent
- );
- }
-
- var rawChild = children[0];
-
- // if this is a component root node and the component's
- // parent container node also has transition, skip.
- if (hasParentTransition(this.$vnode)) {
- return rawChild
- }
-
- // apply transition data to child
- // use getRealChild() to ignore abstract components e.g. keep-alive
- var child = getRealChild(rawChild);
- /* istanbul ignore if */
- if (!child) {
- return rawChild
- }
-
- if (this._leaving) {
- return placeholder(h, rawChild)
- }
-
- // ensure a key that is unique to the vnode type and to this transition
- // component instance. This key will be used to remove pending leaving nodes
- // during entering.
- var id = "__transition-" + (this._uid) + "-";
- child.key = child.key == null
- ? child.isComment
- ? id + 'comment'
- : id + child.tag
- : isPrimitive(child.key)
- ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
- : child.key;
-
- var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
- var oldRawChild = this._vnode;
- var oldChild = getRealChild(oldRawChild);
-
- // mark v-show
- // so that the transition module can hand over the control to the directive
- if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
- child.data.show = true;
- }
-
- if (
- oldChild &&
- oldChild.data &&
- !isSameChild(child, oldChild) &&
- !isAsyncPlaceholder(oldChild) &&
- // #6687 component root is a comment node
- !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
- ) {
- // replace old child transition data with fresh one
- // important for dynamic transitions!
- var oldData = oldChild.data.transition = extend({}, data);
- // handle transition mode
- if (mode === 'out-in') {
- // return placeholder node and queue update when leave finishes
- this._leaving = true;
- mergeVNodeHook(oldData, 'afterLeave', function () {
- this$1._leaving = false;
- this$1.$forceUpdate();
- });
- return placeholder(h, rawChild)
- } else if (mode === 'in-out') {
- if (isAsyncPlaceholder(child)) {
- return oldRawChild
- }
- var delayedLeave;
- var performLeave = function () { delayedLeave(); };
- mergeVNodeHook(data, 'afterEnter', performLeave);
- mergeVNodeHook(data, 'enterCancelled', performLeave);
- mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
- }
- }
-
- return rawChild
- }
-}
-
-// reuse same transition component logic from web
-
-var props = extend({
- tag: String,
- moveClass: String
-}, transitionProps);
-
-delete props.mode;
-
-var TransitionGroup = {
- props: props,
-
- created: function created () {
- var dom = this.$requireWeexModule('dom');
- this.getPosition = function (el) { return new Promise(function (resolve, reject) {
- dom.getComponentRect(el.ref, function (res) {
- if (!res.result) {
- reject(new Error(("failed to get rect for element: " + (el.tag))));
- } else {
- resolve(res.size);
- }
- });
- }); };
-
- var animation = this.$requireWeexModule('animation');
- this.animate = function (el, options) { return new Promise(function (resolve) {
- animation.transition(el.ref, options, resolve);
- }); };
- },
-
- render: function render (h) {
- var tag = this.tag || this.$vnode.data.tag || 'span';
- var map = Object.create(null);
- var prevChildren = this.prevChildren = this.children;
- var rawChildren = this.$slots.default || [];
- var children = this.children = [];
- var transitionData = extractTransitionData(this);
-
- for (var i = 0; i < rawChildren.length; i++) {
- var c = rawChildren[i];
- if (c.tag) {
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
- children.push(c);
- map[c.key] = c
- ;(c.data || (c.data = {})).transition = transitionData;
- } else if (process.env.NODE_ENV !== 'production') {
- var opts = c.componentOptions;
- var name = opts
- ? (opts.Ctor.options.name || opts.tag)
- : c.tag;
- warn(("<transition-group> children must be keyed: <" + name + ">"));
- }
- }
- }
-
- if (prevChildren) {
- var kept = [];
- var removed = [];
- prevChildren.forEach(function (c) {
- c.data.transition = transitionData;
-
- // TODO: record before patch positions
-
- if (map[c.key]) {
- kept.push(c);
- } else {
- removed.push(c);
- }
- });
- this.kept = h(tag, null, kept);
- this.removed = removed;
- }
-
- return h(tag, null, children)
- },
-
- beforeUpdate: function beforeUpdate () {
- // force removing pass
- this.__patch__(
- this._vnode,
- this.kept,
- false, // hydrating
- true // removeOnly (!important, avoids unnecessary moves)
- );
- this._vnode = this.kept;
- },
-
- updated: function updated () {
- var children = this.prevChildren;
- var moveClass = this.moveClass || ((this.name || 'v') + '-move');
- var moveData = children.length && this.getMoveData(children[0].context, moveClass);
- if (!moveData) {
- return
- }
-
- // TODO: finish implementing move animations once
- // we have access to sync getComponentRect()
-
- // children.forEach(callPendingCbs)
-
- // Promise.all(children.map(c => {
- // const oldPos = c.data.pos
- // const newPos = c.data.newPos
- // const dx = oldPos.left - newPos.left
- // const dy = oldPos.top - newPos.top
- // if (dx || dy) {
- // c.data.moved = true
- // return this.animate(c.elm, {
- // styles: {
- // transform: `translate(${dx}px,${dy}px)`
- // }
- // })
- // }
- // })).then(() => {
- // children.forEach(c => {
- // if (c.data.moved) {
- // this.animate(c.elm, {
- // styles: {
- // transform: ''
- // },
- // duration: moveData.duration || 0,
- // delay: moveData.delay || 0,
- // timingFunction: moveData.timingFunction || 'linear'
- // })
- // }
- // })
- // })
- },
-
- methods: {
- getMoveData: function getMoveData (context, moveClass) {
- var stylesheet = context.$options.style || {};
- return stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][moveClass]
- }
- }
-}
-
-// function callPendingCbs (c) {
-// /* istanbul ignore if */
-// if (c.elm._moveCb) {
-// c.elm._moveCb()
-// }
-// /* istanbul ignore if */
-// if (c.elm._enterCb) {
-// c.elm._enterCb()
-// }
-// }
-
-var platformComponents = {
- Richtext: Richtext,
- Transition: Transition,
- TransitionGroup: TransitionGroup
-}
-
-/* */
-
-// These util functions are split into its own file because Rollup cannot drop
-// makeMap() due to potential side effects, so these variables end up
-// bloating the web builds.
-
-var isReservedTag$1 = makeMap(
- 'template,script,style,element,content,slot,link,meta,svg,view,' +
- 'a,div,img,image,text,span,input,switch,textarea,spinner,select,' +
- 'slider,slider-neighbor,indicator,canvas,' +
- 'list,cell,header,loading,loading-indicator,refresh,scrollable,scroller,' +
- 'video,web,embed,tabbar,tabheader,datepicker,timepicker,marquee,countdown',
- true
-);
-
-// Elements that you can, intentionally, leave open (and which close themselves)
-// more flexible than web
-var canBeLeftOpenTag = makeMap(
- 'web,spinner,switch,video,textarea,canvas,' +
- 'indicator,marquee,countdown',
- true
-);
-
-var isRuntimeComponent = makeMap(
- 'richtext,transition,transition-group',
- true
-);
-
-var isUnaryTag = makeMap(
- 'embed,img,image,input,link,meta',
- true
-);
-
-function mustUseProp (tag, type, name) {
- return false
-}
-
-
-
-function isUnknownElement$1 (tag) {
- return false
-}
-
-function query (el, document) {
- // document is injected by weex factory wrapper
- var placeholder = document.createComment('root');
- placeholder.hasAttribute = placeholder.removeAttribute = function () {}; // hack for patch
- document.documentElement.appendChild(placeholder);
- return placeholder
-}
-
-/* */
-
-// install platform specific utils
-Vue.config.mustUseProp = mustUseProp;
-Vue.config.isReservedTag = isReservedTag$1;
-Vue.config.isRuntimeComponent = isRuntimeComponent;
-Vue.config.isUnknownElement = isUnknownElement$1;
-
-// install platform runtime directives and components
-Vue.options.directives = platformDirectives;
-Vue.options.components = platformComponents;
-
-// install platform patch function
-Vue.prototype.__patch__ = patch;
-
-// wrap mount
-Vue.prototype.$mount = function (
- el,
- hydrating
-) {
- return mountComponent(
- this,
- el && query(el, this.$document),
- hydrating
- )
-};
-
-// this entry is built and wrapped with a factory function
-// used to generate a fresh copy of Vue for every Weex instance.
-
-exports.Vue = Vue;
-
-}
+++ /dev/null
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-/* */
-
-// this will be preserved during build
-// $flow-disable-line
-var VueFactory = require('./factory');
-
-var instanceOptions = {};
-
-/**
- * Create instance context.
- */
-function createInstanceContext (
- instanceId,
- runtimeContext,
- data
-) {
- if ( data === void 0 ) data = {};
-
- var weex = runtimeContext.weex;
- var instance = instanceOptions[instanceId] = {
- instanceId: instanceId,
- config: weex.config,
- document: weex.document,
- data: data
- };
-
- // Each instance has a independent `Vue` module instance
- var Vue = instance.Vue = createVueModuleInstance(instanceId, weex);
-
- // DEPRECATED
- var timerAPIs = getInstanceTimer(instanceId, weex.requireModule);
-
- var instanceContext = Object.assign({ Vue: Vue }, timerAPIs);
- Object.freeze(instanceContext);
- return instanceContext
-}
-
-/**
- * Destroy an instance with id. It will make sure all memory of
- * this instance released and no more leaks.
- */
-function destroyInstance (instanceId) {
- var instance = instanceOptions[instanceId];
- if (instance && instance.app instanceof instance.Vue) {
- try {
- instance.app.$destroy();
- instance.document.destroy();
- } catch (e) {}
- delete instance.document;
- delete instance.app;
- }
- delete instanceOptions[instanceId];
-}
-
-/**
- * Refresh an instance with id and new top-level component data.
- * It will use `Vue.set` on all keys of the new data. So it's better
- * define all possible meaningful keys when instance created.
- */
-function refreshInstance (
- instanceId,
- data
-) {
- var instance = instanceOptions[instanceId];
- if (!instance || !(instance.app instanceof instance.Vue)) {
- return new Error(("refreshInstance: instance " + instanceId + " not found!"))
- }
- if (instance.Vue && instance.Vue.set) {
- for (var key in data) {
- instance.Vue.set(instance.app, key, data[key]);
- }
- }
- // Finally `refreshFinish` signal needed.
- instance.document.taskCenter.send('dom', { action: 'refreshFinish' }, []);
-}
-
-/**
- * Create a fresh instance of Vue for each Weex instance.
- */
-function createVueModuleInstance (
- instanceId,
- weex
-) {
- var exports = {};
- VueFactory(exports, weex.document);
- var Vue = exports.Vue;
-
- var instance = instanceOptions[instanceId];
-
- // patch reserved tag detection to account for dynamically registered
- // components
- var weexRegex = /^weex:/i;
- var isReservedTag = Vue.config.isReservedTag || (function () { return false; });
- var isRuntimeComponent = Vue.config.isRuntimeComponent || (function () { return false; });
- Vue.config.isReservedTag = function (name) {
- return (!isRuntimeComponent(name) && weex.supports(("@component/" + name))) ||
- isReservedTag(name) ||
- weexRegex.test(name)
- };
- Vue.config.parsePlatformTagName = function (name) { return name.replace(weexRegex, ''); };
-
- // expose weex-specific info
- Vue.prototype.$instanceId = instanceId;
- Vue.prototype.$document = instance.document;
-
- // expose weex native module getter on subVue prototype so that
- // vdom runtime modules can access native modules via vnode.context
- Vue.prototype.$requireWeexModule = weex.requireModule;
-
- // Hack `Vue` behavior to handle instance information and data
- // before root component created.
- Vue.mixin({
- beforeCreate: function beforeCreate () {
- var options = this.$options;
- // root component (vm)
- if (options.el) {
- // set external data of instance
- var dataOption = options.data;
- var internalData = (typeof dataOption === 'function' ? dataOption() : dataOption) || {};
- options.data = Object.assign(internalData, instance.data);
- // record instance by id
- instance.app = this;
- }
- },
- mounted: function mounted () {
- var options = this.$options;
- // root component (vm)
- if (options.el && weex.document && instance.app === this) {
- try {
- // Send "createFinish" signal to native.
- weex.document.taskCenter.send('dom', { action: 'createFinish' }, []);
- } catch (e) {}
- }
- }
- });
-
- /**
- * @deprecated Just instance variable `weex.config`
- * Get instance config.
- * @return {object}
- */
- Vue.prototype.$getConfig = function () {
- if (instance.app instanceof Vue) {
- return instance.config
- }
- };
-
- return Vue
-}
-
-/**
- * DEPRECATED
- * Generate HTML5 Timer APIs. An important point is that the callback
- * will be converted into callback id when sent to native. So the
- * framework can make sure no side effect of the callback happened after
- * an instance destroyed.
- */
-function getInstanceTimer (
- instanceId,
- moduleGetter
-) {
- var instance = instanceOptions[instanceId];
- var timer = moduleGetter('timer');
- var timerAPIs = {
- setTimeout: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var handler = function () {
- args[0].apply(args, args.slice(2));
- };
-
- timer.setTimeout(handler, args[1]);
- return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
- },
- setInterval: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var handler = function () {
- args[0].apply(args, args.slice(2));
- };
-
- timer.setInterval(handler, args[1]);
- return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
- },
- clearTimeout: function (n) {
- timer.clearTimeout(n);
- },
- clearInterval: function (n) {
- timer.clearInterval(n);
- }
- };
- return timerAPIs
-}
-
-exports.createInstanceContext = createInstanceContext;
-exports.destroyInstance = destroyInstance;
-exports.refreshInstance = refreshInstance;
+++ /dev/null
-{
- "name": "weex-vue-framework",
- "version": "2.4.2-weex.1",
- "description": "Vue 2.0 Framework for Weex",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/vuejs/vue.git"
- },
- "keywords": [
- "vue",
- "compiler"
- ],
- "author": "Evan You",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/vuejs/vue/issues"
- },
- "homepage": "https://github.com/vuejs/vue/tree/dev/packages/weex-vue-framework#readme"
-}
+++ /dev/null
-const path = require('path')
-
-const resolve = p => path.resolve(__dirname, '../', p)
-
-module.exports = {
- vue: resolve('src/platforms/web/entry-runtime-with-compiler'),
- compiler: resolve('src/compiler'),
- core: resolve('src/core'),
- shared: resolve('src/shared'),
- web: resolve('src/platforms/web'),
- weex: resolve('src/platforms/weex'),
- server: resolve('src/server'),
- entries: resolve('src/entries'),
- sfc: resolve('src/sfc')
-}
+++ /dev/null
-const fs = require('fs')
-const path = require('path')
-const zlib = require('zlib')
-const rollup = require('rollup')
-const uglify = require('uglify-js')
-
-if (!fs.existsSync('dist')) {
- fs.mkdirSync('dist')
-}
-
-let builds = require('./config').getAllBuilds()
-
-// filter builds via command line arg
-if (process.argv[2]) {
- const filters = process.argv[2].split(',')
- builds = builds.filter(b => {
- return filters.some(f => b.output.file.indexOf(f) > -1 || b._name.indexOf(f) > -1)
- })
-} else {
- // filter out weex builds by default
- builds = builds.filter(b => {
- return b.output.file.indexOf('weex') === -1
- })
-}
-
-build(builds)
-
-function build (builds) {
- let built = 0
- const total = builds.length
- const next = () => {
- buildEntry(builds[built]).then(() => {
- built++
- if (built < total) {
- next()
- }
- }).catch(logError)
- }
-
- next()
-}
-
-function buildEntry (config) {
- const output = config.output
- const { file, banner } = output
- const isProd = /min\.js$/.test(file)
- return rollup.rollup(config)
- .then(bundle => bundle.generate(output))
- .then(({ code }) => {
- if (isProd) {
- var minified = (banner ? banner + '\n' : '') + uglify.minify(code, {
- output: {
- ascii_only: true
- },
- compress: {
- pure_funcs: ['makeMap']
- }
- }).code
- return write(file, minified, true)
- } else {
- return write(file, code)
- }
- })
-}
-
-function write (dest, code, zip) {
- return new Promise((resolve, reject) => {
- function report (extra) {
- console.log(blue(path.relative(process.cwd(), dest)) + ' ' + getSize(code) + (extra || ''))
- resolve()
- }
-
- fs.writeFile(dest, code, err => {
- if (err) return reject(err)
- if (zip) {
- zlib.gzip(code, (err, zipped) => {
- if (err) return reject(err)
- report(' (gzipped: ' + getSize(zipped) + ')')
- })
- } else {
- report()
- }
- })
- })
-}
-
-function getSize (code) {
- return (code.length / 1024).toFixed(2) + 'kb'
-}
-
-function logError (e) {
- console.log(e)
-}
-
-function blue (str) {
- return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
-}
+++ /dev/null
-const path = require('path')
-const buble = require('rollup-plugin-buble')
-const alias = require('rollup-plugin-alias')
-const cjs = require('rollup-plugin-commonjs')
-const replace = require('rollup-plugin-replace')
-const node = require('rollup-plugin-node-resolve')
-const flow = require('rollup-plugin-flow-no-whitespace')
-const version = process.env.VERSION || require('../package.json').version
-const weexVersion = process.env.WEEX_VERSION || require('../packages/weex-vue-framework/package.json').version
-
-const banner =
- '/*!\n' +
- ' * Vue.js v' + version + '\n' +
- ' * (c) 2014-' + new Date().getFullYear() + ' Evan You\n' +
- ' * Released under the MIT License.\n' +
- ' */'
-
-const weexFactoryPlugin = {
- intro () {
- return 'module.exports = function weexFactory (exports, document) {'
- },
- outro () {
- return '}'
- }
-}
-
-const aliases = require('./alias')
-const resolve = p => {
- const base = p.split('/')[0]
- if (aliases[base]) {
- return path.resolve(aliases[base], p.slice(base.length + 1))
- } else {
- return path.resolve(__dirname, '../', p)
- }
-}
-
-const builds = {
- // Runtime only (CommonJS). Used by bundlers e.g. Webpack & Browserify
- 'web-runtime-cjs': {
- entry: resolve('web/entry-runtime.js'),
- dest: resolve('dist/vue.runtime.common.js'),
- format: 'cjs',
- banner
- },
- // Runtime+compiler CommonJS build (CommonJS)
- 'web-full-cjs': {
- entry: resolve('web/entry-runtime-with-compiler.js'),
- dest: resolve('dist/vue.common.js'),
- format: 'cjs',
- alias: { he: './entity-decoder' },
- banner
- },
- // Runtime only (ES Modules). Used by bundlers that support ES Modules,
- // e.g. Rollup & Webpack 2
- 'web-runtime-esm': {
- entry: resolve('web/entry-runtime.js'),
- dest: resolve('dist/vue.runtime.esm.js'),
- format: 'es',
- banner
- },
- // Runtime+compiler CommonJS build (ES Modules)
- 'web-full-esm': {
- entry: resolve('web/entry-runtime-with-compiler.js'),
- dest: resolve('dist/vue.esm.js'),
- format: 'es',
- alias: { he: './entity-decoder' },
- banner
- },
- // runtime-only build (Browser)
- 'web-runtime-dev': {
- entry: resolve('web/entry-runtime.js'),
- dest: resolve('dist/vue.runtime.js'),
- format: 'umd',
- env: 'development',
- banner
- },
- // runtime-only production build (Browser)
- 'web-runtime-prod': {
- entry: resolve('web/entry-runtime.js'),
- dest: resolve('dist/vue.runtime.min.js'),
- format: 'umd',
- env: 'production',
- banner
- },
- // Runtime+compiler development build (Browser)
- 'web-full-dev': {
- entry: resolve('web/entry-runtime-with-compiler.js'),
- dest: resolve('dist/vue.js'),
- format: 'umd',
- env: 'development',
- alias: { he: './entity-decoder' },
- banner
- },
- // Runtime+compiler production build (Browser)
- 'web-full-prod': {
- entry: resolve('web/entry-runtime-with-compiler.js'),
- dest: resolve('dist/vue.min.js'),
- format: 'umd',
- env: 'production',
- alias: { he: './entity-decoder' },
- banner
- },
- // Web compiler (CommonJS).
- 'web-compiler': {
- entry: resolve('web/entry-compiler.js'),
- dest: resolve('packages/vue-template-compiler/build.js'),
- format: 'cjs',
- external: Object.keys(require('../packages/vue-template-compiler/package.json').dependencies)
- },
- // Web compiler (UMD for in-browser use).
- 'web-compiler-browser': {
- entry: resolve('web/entry-compiler.js'),
- dest: resolve('packages/vue-template-compiler/browser.js'),
- format: 'umd',
- env: 'development',
- moduleName: 'VueTemplateCompiler',
- plugins: [node(), cjs()]
- },
- // Web server renderer (CommonJS).
- 'web-server-renderer': {
- entry: resolve('web/entry-server-renderer.js'),
- dest: resolve('packages/vue-server-renderer/build.js'),
- format: 'cjs',
- external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
- },
- 'web-server-renderer-basic': {
- entry: resolve('web/entry-server-basic-renderer.js'),
- dest: resolve('packages/vue-server-renderer/basic.js'),
- format: 'umd',
- env: 'development',
- moduleName: 'renderVueComponentToString',
- plugins: [node(), cjs()]
- },
- 'web-server-renderer-webpack-server-plugin': {
- entry: resolve('server/webpack-plugin/server.js'),
- dest: resolve('packages/vue-server-renderer/server-plugin.js'),
- format: 'cjs',
- external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
- },
- 'web-server-renderer-webpack-client-plugin': {
- entry: resolve('server/webpack-plugin/client.js'),
- dest: resolve('packages/vue-server-renderer/client-plugin.js'),
- format: 'cjs',
- external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
- },
- // Weex runtime factory
- 'weex-factory': {
- weex: true,
- entry: resolve('weex/entry-runtime-factory.js'),
- dest: resolve('packages/weex-vue-framework/factory.js'),
- format: 'cjs',
- plugins: [weexFactoryPlugin]
- },
- // Weex runtime framework (CommonJS).
- 'weex-framework': {
- weex: true,
- entry: resolve('weex/entry-framework.js'),
- dest: resolve('packages/weex-vue-framework/index.js'),
- format: 'cjs'
- },
- // Weex compiler (CommonJS). Used by Weex's Webpack loader.
- 'weex-compiler': {
- weex: true,
- entry: resolve('weex/entry-compiler.js'),
- dest: resolve('packages/weex-template-compiler/build.js'),
- format: 'cjs',
- external: Object.keys(require('../packages/weex-template-compiler/package.json').dependencies)
- }
-}
-
-function genConfig (name) {
- const opts = builds[name]
- const config = {
- input: opts.entry,
- external: opts.external,
- plugins: [
- replace({
- __WEEX__: !!opts.weex,
- __WEEX_VERSION__: weexVersion,
- __VERSION__: version
- }),
- flow(),
- buble(),
- alias(Object.assign({}, aliases, opts.alias))
- ].concat(opts.plugins || []),
- output: {
- file: opts.dest,
- format: opts.format,
- banner: opts.banner,
- name: opts.moduleName || 'Vue'
- }
- }
-
- if (opts.env) {
- config.plugins.push(replace({
- 'process.env.NODE_ENV': JSON.stringify(opts.env)
- }))
- }
-
- Object.defineProperty(config, '_name', {
- enumerable: false,
- value: name
- })
-
- return config
-}
-
-if (process.env.TARGET) {
- module.exports = genConfig(process.env.TARGET)
-} else {
- exports.getBuild = genConfig
- exports.getAllBuilds = () => Object.keys(builds).map(genConfig)
-}
+++ /dev/null
-const version = process.argv[2] || process.env.VERSION
-const cc = require('conventional-changelog')
-const file = `./RELEASE_NOTE${version ? `_${version}` : ``}.md`
-const fileStream = require('fs').createWriteStream(file)
-
-cc({
- preset: 'angular',
- pkg: {
- transform (pkg) {
- pkg.version = `v${version}`
- return pkg
- }
- }
-}).pipe(fileStream).on('close', () => {
- console.log(`Generated release note at ${file}`)
-})
+++ /dev/null
-var coreVersion = require('../package.json').version
-var weexVersion = require('../packages/weex-vue-framework/package.json').version
-var weexBaseVersion = weexVersion.match(/^[\d.]+/)[0]
-var weexSubVersion = Number(weexVersion.match(/-weex\.(\d+)$/)[1])
-
-if (weexBaseVersion === coreVersion) {
- // same core version, increment sub version
- weexSubVersion++
-} else {
- // new core version, reset sub version
- weexBaseVersion = coreVersion
- weexSubVersion = 1
-}
-
-if (process.argv[2] === '-c') {
- console.log(weexVersion)
-} else {
- console.log(weexBaseVersion + '-weex.' + weexSubVersion)
-}
-
-module.exports = {
- base: weexBaseVersion,
- sub: weexSubVersion
-}
+++ /dev/null
-#!/usr/bin/env bash
-
-# Validate commit log
-commit_regex='^Merge.+|(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|types)(\(.+\))?: .{1,50}'
-
-if ! grep -iqE "$commit_regex" "$1"; then
- echo
- echo " Error: proper commit message format is required for automated changelog generation."
- echo
- echo " - Use \`npm run commit\` to interactively generate a commit message."
- echo " - See .github/COMMIT_CONVENTION.md for more details."
- echo
- exit 1
-fi
+++ /dev/null
-#!/usr/bin/env bash
-
-files_to_lint=$(git diff --cached --name-only --diff-filter=ACM | grep '\.js$')
-
-if [ -n "$files_to_lint" ]; then
- NODE_ENV=production eslint --quiet $files_to_lint
-fi
+++ /dev/null
-set -e
-CUR_VERSION=`node build/get-weex-version.js -c`
-NEXT_VERSION=`node build/get-weex-version.js`
-
-echo "Current: $CUR_VERSION"
-read -p "Enter new version ($NEXT_VERSION): " -n 1 -r
-if ! [[ -z $REPLY ]]; then
- NEXT_VERSION=$REPLY
-fi
-
-read -p "Releasing weex-vue-framework@$NEXT_VERSION - are you sure? (y/n) " -n 1 -r
-echo
-if [[ $REPLY =~ ^[Yy]$ ]]; then
- echo "Releasing weex-vue-framework@$NEXT_VERSION ..."
- npm run lint
- npm run flow
- npm run test:weex
-
- # build
- WEEX_VERSION=$NEXT_VERSION npm run build:weex
-
- # update package
- cd packages/weex-vue-framework
- npm version $NEXT_VERSION
- npm publish
- cd -
-
- cd packages/weex-template-compiler
- npm version $NEXT_VERSION
- npm publish
- cd -
-
- # commit
- git add packages/weex*
- git commit -m "[release] weex-vue-framework@$NEXT_VERSION"
-fi
+++ /dev/null
-set -e
-
-if [[ -z $1 ]]; then
- echo "Enter new version: "
- read VERSION
-else
- VERSION=$1
-fi
-
-read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
-echo
-if [[ $REPLY =~ ^[Yy]$ ]]; then
- echo "Releasing $VERSION ..."
-
- if [[ -z $SKIP_TESTS ]]; then
- npm run lint
- npm run flow
- npm run test:cover
- npm run test:e2e -- --env phantomjs
- npm run test:ssr
- fi
-
- # Sauce Labs tests has a decent chance of failing
- # so we usually manually run them before running the release script.
-
- # if [[ -z $SKIP_SAUCE ]]; then
- # export SAUCE_BUILD_ID=$VERSION:`date +"%s"`
- # npm run test:sauce
- # fi
-
- # build
- VERSION=$VERSION npm run build
-
- # update packages
- cd packages/vue-template-compiler
- npm version $VERSION
- if [[ -z $RELEASE_TAG ]]; then
- npm publish
- else
- npm publish --tag $RELEASE_TAG
- fi
- cd -
-
- cd packages/vue-server-renderer
- npm version $VERSION
- if [[ -z $RELEASE_TAG ]]; then
- npm publish
- else
- npm publish --tag $RELEASE_TAG
- fi
- cd -
-
- # commit
- git add -A
- git add -f \
- dist/*.js \
- packages/vue-server-renderer/basic.js \
- packages/vue-server-renderer/build.js \
- packages/vue-server-renderer/server-plugin.js \
- packages/vue-server-renderer/client-plugin.js \
- packages/vue-template-compiler/build.js
- git commit -m "build: build $VERSION"
- # generate release note
- npm run release:note
- # tag version
- npm version $VERSION --message "build: release $VERSION"
-
- # publish
- git push origin refs/tags/v$VERSION
- git push
- if [[ -z $RELEASE_TAG ]]; then
- npm publish
- else
- npm publish --tag $RELEASE_TAG
- fi
-fi
+++ /dev/null
-const chalk = require('chalk')
-const msgPath = process.env.GIT_PARAMS
-const msg = require('fs').readFileSync(msgPath, 'utf-8').trim()
-
-const commitRE = /^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types|build)(\(.+\))?: .{1,50}/
-
-if (!commitRE.test(msg)) {
- console.log()
- console.error(
- ` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(`invalid commit message format.`)}\n\n` +
- chalk.red(` Proper commit message format is required for automated changelog generation. Examples:\n\n`) +
- ` ${chalk.green(`feat(compiler): add 'comments' option`)}\n` +
- ` ${chalk.green(`fix(v-model): handle events on blur (close #28)`)}\n\n` +
- chalk.red(` See .github/COMMIT_CONVENTION.md for more details.\n`) +
- chalk.red(` You can also use ${chalk.cyan(`npm run commit`)} to interactively generate a commit message.\n`)
- )
- process.exit(1)
-}
+++ /dev/null
-/* @flow */
-
-const fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/
-const simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/
-
-// KeyboardEvent.keyCode aliases
-const keyCodes: { [key: string]: number | Array<number> } = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- up: 38,
- left: 37,
- right: 39,
- down: 40,
- 'delete': [8, 46]
-}
-
-// KeyboardEvent.key aliases
-const keyNames: { [key: string]: string | Array<string> } = {
- esc: 'Escape',
- tab: 'Tab',
- enter: 'Enter',
- space: ' ',
- // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- 'delete': ['Backspace', 'Delete']
-}
-
-// #4868: modifiers that prevent the execution of the listener
-// need to explicitly return null so that we can determine whether to remove
-// the listener for .once
-const genGuard = condition => `if(${condition})return null;`
-
-const modifierCode: { [key: string]: string } = {
- stop: '$event.stopPropagation();',
- prevent: '$event.preventDefault();',
- self: genGuard(`$event.target !== $event.currentTarget`),
- ctrl: genGuard(`!$event.ctrlKey`),
- shift: genGuard(`!$event.shiftKey`),
- alt: genGuard(`!$event.altKey`),
- meta: genGuard(`!$event.metaKey`),
- left: genGuard(`'button' in $event && $event.button !== 0`),
- middle: genGuard(`'button' in $event && $event.button !== 1`),
- right: genGuard(`'button' in $event && $event.button !== 2`)
-}
-
-export function genHandlers (
- events: ASTElementHandlers,
- isNative: boolean,
- warn: Function
-): string {
- let res = isNative ? 'nativeOn:{' : 'on:{'
- for (const name in events) {
- res += `"${name}":${genHandler(name, events[name])},`
- }
- return res.slice(0, -1) + '}'
-}
-
-// Generate handler code with binding params on Weex
-/* istanbul ignore next */
-function genWeexHandler (params: Array<any>, handlerCode: string) {
- let innerHandlerCode = handlerCode
- const exps = params.filter(exp => simplePathRE.test(exp) && exp !== '$event')
- const bindings = exps.map(exp => ({ '@binding': exp }))
- const args = exps.map((exp, i) => {
- const key = `$_${i + 1}`
- innerHandlerCode = innerHandlerCode.replace(exp, key)
- return key
- })
- args.push('$event')
- return '{\n' +
- `handler:function(${args.join(',')}){${innerHandlerCode}},\n` +
- `params:${JSON.stringify(bindings)}\n` +
- '}'
-}
-
-function genHandler (
- name: string,
- handler: ASTElementHandler | Array<ASTElementHandler>
-): string {
- if (!handler) {
- return 'function(){}'
- }
-
- if (Array.isArray(handler)) {
- return `[${handler.map(handler => genHandler(name, handler)).join(',')}]`
- }
-
- const isMethodPath = simplePathRE.test(handler.value)
- const isFunctionExpression = fnExpRE.test(handler.value)
-
- if (!handler.modifiers) {
- if (isMethodPath || isFunctionExpression) {
- return handler.value
- }
- /* istanbul ignore if */
- if (__WEEX__ && handler.params) {
- return genWeexHandler(handler.params, handler.value)
- }
- return `function($event){${handler.value}}` // inline statement
- } else {
- let code = ''
- let genModifierCode = ''
- const keys = []
- for (const key in handler.modifiers) {
- if (modifierCode[key]) {
- genModifierCode += modifierCode[key]
- // left/right
- if (keyCodes[key]) {
- keys.push(key)
- }
- } else if (key === 'exact') {
- const modifiers: ASTModifiers = (handler.modifiers: any)
- genModifierCode += genGuard(
- ['ctrl', 'shift', 'alt', 'meta']
- .filter(keyModifier => !modifiers[keyModifier])
- .map(keyModifier => `$event.${keyModifier}Key`)
- .join('||')
- )
- } else {
- keys.push(key)
- }
- }
- if (keys.length) {
- code += genKeyFilter(keys)
- }
- // Make sure modifiers like prevent and stop get executed after key filtering
- if (genModifierCode) {
- code += genModifierCode
- }
- const handlerCode = isMethodPath
- ? `return ${handler.value}($event)`
- : isFunctionExpression
- ? `return (${handler.value})($event)`
- : handler.value
- /* istanbul ignore if */
- if (__WEEX__ && handler.params) {
- return genWeexHandler(handler.params, code + handlerCode)
- }
- return `function($event){${code}${handlerCode}}`
- }
-}
-
-function genKeyFilter (keys: Array<string>): string {
- return `if(!('button' in $event)&&${keys.map(genFilterCode).join('&&')})return null;`
-}
-
-function genFilterCode (key: string): string {
- const keyVal = parseInt(key, 10)
- if (keyVal) {
- return `$event.keyCode!==${keyVal}`
- }
- const keyCode = keyCodes[key]
- const keyName = keyNames[key]
- return (
- `_k($event.keyCode,` +
- `${JSON.stringify(key)},` +
- `${JSON.stringify(keyCode)},` +
- `$event.key,` +
- `${JSON.stringify(keyName)}` +
- `)`
- )
-}
+++ /dev/null
-/* @flow */
-
-import { genHandlers } from './events'
-import baseDirectives from '../directives/index'
-import { camelize, no, extend } from 'shared/util'
-import { baseWarn, pluckModuleFunction } from '../helpers'
-
-type TransformFunction = (el: ASTElement, code: string) => string;
-type DataGenFunction = (el: ASTElement) => string;
-type DirectiveFunction = (el: ASTElement, dir: ASTDirective, warn: Function) => boolean;
-
-export class CodegenState {
- options: CompilerOptions;
- warn: Function;
- transforms: Array<TransformFunction>;
- dataGenFns: Array<DataGenFunction>;
- directives: { [key: string]: DirectiveFunction };
- maybeComponent: (el: ASTElement) => boolean;
- onceId: number;
- staticRenderFns: Array<string>;
-
- constructor (options: CompilerOptions) {
- this.options = options
- this.warn = options.warn || baseWarn
- this.transforms = pluckModuleFunction(options.modules, 'transformCode')
- this.dataGenFns = pluckModuleFunction(options.modules, 'genData')
- this.directives = extend(extend({}, baseDirectives), options.directives)
- const isReservedTag = options.isReservedTag || no
- this.maybeComponent = (el: ASTElement) => !isReservedTag(el.tag)
- this.onceId = 0
- this.staticRenderFns = []
- }
-}
-
-export type CodegenResult = {
- render: string,
- staticRenderFns: Array<string>
-};
-
-export function generate (
- ast: ASTElement | void,
- options: CompilerOptions
-): CodegenResult {
- const state = new CodegenState(options)
- const code = ast ? genElement(ast, state) : '_c("div")'
- return {
- render: `with(this){return ${code}}`,
- staticRenderFns: state.staticRenderFns
- }
-}
-
-export function genElement (el: ASTElement, state: CodegenState): string {
- if (el.staticRoot && !el.staticProcessed) {
- return genStatic(el, state)
- } else if (el.once && !el.onceProcessed) {
- return genOnce(el, state)
- } else if (el.for && !el.forProcessed) {
- return genFor(el, state)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return genChildren(el, state) || 'void 0'
- } else if (el.tag === 'slot') {
- return genSlot(el, state)
- } else {
- // component or element
- let code
- if (el.component) {
- code = genComponent(el.component, el, state)
- } else {
- const data = el.plain ? undefined : genData(el, state)
-
- const children = el.inlineTemplate ? null : genChildren(el, state, true)
- code = `_c('${el.tag}'${
- data ? `,${data}` : '' // data
- }${
- children ? `,${children}` : '' // children
- })`
- }
- // module transforms
- for (let i = 0; i < state.transforms.length; i++) {
- code = state.transforms[i](el, code)
- }
- return code
- }
-}
-
-// hoist static sub-trees out
-function genStatic (el: ASTElement, state: CodegenState): string {
- el.staticProcessed = true
- state.staticRenderFns.push(`with(this){return ${genElement(el, state)}}`)
- return `_m(${
- state.staticRenderFns.length - 1
- }${
- el.staticInFor ? ',true' : ''
- })`
-}
-
-// v-once
-function genOnce (el: ASTElement, state: CodegenState): string {
- el.onceProcessed = true
- if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.staticInFor) {
- let key = ''
- let parent = el.parent
- while (parent) {
- if (parent.for) {
- key = parent.key
- break
- }
- parent = parent.parent
- }
- if (!key) {
- process.env.NODE_ENV !== 'production' && state.warn(
- `v-once can only be used inside v-for that is keyed. `
- )
- return genElement(el, state)
- }
- return `_o(${genElement(el, state)},${state.onceId++},${key})`
- } else {
- return genStatic(el, state)
- }
-}
-
-export function genIf (
- el: any,
- state: CodegenState,
- altGen?: Function,
- altEmpty?: string
-): string {
- el.ifProcessed = true // avoid recursion
- return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
-}
-
-function genIfConditions (
- conditions: ASTIfConditions,
- state: CodegenState,
- altGen?: Function,
- altEmpty?: string
-): string {
- if (!conditions.length) {
- return altEmpty || '_e()'
- }
-
- const condition = conditions.shift()
- if (condition.exp) {
- return `(${condition.exp})?${
- genTernaryExp(condition.block)
- }:${
- genIfConditions(conditions, state, altGen, altEmpty)
- }`
- } else {
- return `${genTernaryExp(condition.block)}`
- }
-
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
- function genTernaryExp (el) {
- return altGen
- ? altGen(el, state)
- : el.once
- ? genOnce(el, state)
- : genElement(el, state)
- }
-}
-
-export function genFor (
- el: any,
- state: CodegenState,
- altGen?: Function,
- altHelper?: string
-): string {
- const exp = el.for
- const alias = el.alias
- const iterator1 = el.iterator1 ? `,${el.iterator1}` : ''
- const iterator2 = el.iterator2 ? `,${el.iterator2}` : ''
-
- if (process.env.NODE_ENV !== 'production' &&
- state.maybeComponent(el) &&
- el.tag !== 'slot' &&
- el.tag !== 'template' &&
- !el.key
- ) {
- state.warn(
- `<${el.tag} v-for="${alias} in ${exp}">: component lists rendered with ` +
- `v-for should have explicit keys. ` +
- `See https://vuejs.org/guide/list.html#key for more info.`,
- true /* tip */
- )
- }
-
- el.forProcessed = true // avoid recursion
- return `${altHelper || '_l'}((${exp}),` +
- `function(${alias}${iterator1}${iterator2}){` +
- `return ${(altGen || genElement)(el, state)}` +
- '})'
-}
-
-export function genData (el: ASTElement, state: CodegenState): string {
- let data = '{'
-
- // directives first.
- // directives may mutate the el's other properties before they are generated.
- const dirs = genDirectives(el, state)
- if (dirs) data += dirs + ','
-
- // key
- if (el.key) {
- data += `key:${el.key},`
- }
- // ref
- if (el.ref) {
- data += `ref:${el.ref},`
- }
- if (el.refInFor) {
- data += `refInFor:true,`
- }
- // pre
- if (el.pre) {
- data += `pre:true,`
- }
- // record original tag name for components using "is" attribute
- if (el.component) {
- data += `tag:"${el.tag}",`
- }
- // module data generation functions
- for (let i = 0; i < state.dataGenFns.length; i++) {
- data += state.dataGenFns[i](el)
- }
- // attributes
- if (el.attrs) {
- data += `attrs:{${genProps(el.attrs)}},`
- }
- // DOM props
- if (el.props) {
- data += `domProps:{${genProps(el.props)}},`
- }
- // event handlers
- if (el.events) {
- data += `${genHandlers(el.events, false, state.warn)},`
- }
- if (el.nativeEvents) {
- data += `${genHandlers(el.nativeEvents, true, state.warn)},`
- }
- // slot target
- // only for non-scoped slots
- if (el.slotTarget && !el.slotScope) {
- data += `slot:${el.slotTarget},`
- }
- // scoped slots
- if (el.scopedSlots) {
- data += `${genScopedSlots(el.scopedSlots, state)},`
- }
- // component v-model
- if (el.model) {
- data += `model:{value:${
- el.model.value
- },callback:${
- el.model.callback
- },expression:${
- el.model.expression
- }},`
- }
- // inline-template
- if (el.inlineTemplate) {
- const inlineTemplate = genInlineTemplate(el, state)
- if (inlineTemplate) {
- data += `${inlineTemplate},`
- }
- }
- data = data.replace(/,$/, '') + '}'
- // v-bind data wrap
- if (el.wrapData) {
- data = el.wrapData(data)
- }
- // v-on data wrap
- if (el.wrapListeners) {
- data = el.wrapListeners(data)
- }
- return data
-}
-
-function genDirectives (el: ASTElement, state: CodegenState): string | void {
- const dirs = el.directives
- if (!dirs) return
- let res = 'directives:['
- let hasRuntime = false
- let i, l, dir, needRuntime
- for (i = 0, l = dirs.length; i < l; i++) {
- dir = dirs[i]
- needRuntime = true
- const gen: DirectiveFunction = state.directives[dir.name]
- if (gen) {
- // compile-time directive that manipulates AST.
- // returns true if it also needs a runtime counterpart.
- needRuntime = !!gen(el, dir, state.warn)
- }
- if (needRuntime) {
- hasRuntime = true
- res += `{name:"${dir.name}",rawName:"${dir.rawName}"${
- dir.value ? `,value:(${dir.value}),expression:${JSON.stringify(dir.value)}` : ''
- }${
- dir.arg ? `,arg:"${dir.arg}"` : ''
- }${
- dir.modifiers ? `,modifiers:${JSON.stringify(dir.modifiers)}` : ''
- }},`
- }
- }
- if (hasRuntime) {
- return res.slice(0, -1) + ']'
- }
-}
-
-function genInlineTemplate (el: ASTElement, state: CodegenState): ?string {
- const ast = el.children[0]
- if (process.env.NODE_ENV !== 'production' && (
- el.children.length !== 1 || ast.type !== 1
- )) {
- state.warn('Inline-template components must have exactly one child element.')
- }
- if (ast.type === 1) {
- const inlineRenderFns = generate(ast, state.options)
- return `inlineTemplate:{render:function(){${
- inlineRenderFns.render
- }},staticRenderFns:[${
- inlineRenderFns.staticRenderFns.map(code => `function(){${code}}`).join(',')
- }]}`
- }
-}
-
-function genScopedSlots (
- slots: { [key: string]: ASTElement },
- state: CodegenState
-): string {
- return `scopedSlots:_u([${
- Object.keys(slots).map(key => {
- return genScopedSlot(key, slots[key], state)
- }).join(',')
- }])`
-}
-
-function genScopedSlot (
- key: string,
- el: ASTElement,
- state: CodegenState
-): string {
- if (el.for && !el.forProcessed) {
- return genForScopedSlot(key, el, state)
- }
- const fn = `function(${String(el.slotScope)}){` +
- `return ${el.tag === 'template'
- ? el.if
- ? `${el.if}?${genChildren(el, state) || 'undefined'}:undefined`
- : genChildren(el, state) || 'undefined'
- : genElement(el, state)
- }}`
- return `{key:${key},fn:${fn}}`
-}
-
-function genForScopedSlot (
- key: string,
- el: any,
- state: CodegenState
-): string {
- const exp = el.for
- const alias = el.alias
- const iterator1 = el.iterator1 ? `,${el.iterator1}` : ''
- const iterator2 = el.iterator2 ? `,${el.iterator2}` : ''
- el.forProcessed = true // avoid recursion
- return `_l((${exp}),` +
- `function(${alias}${iterator1}${iterator2}){` +
- `return ${genScopedSlot(key, el, state)}` +
- '})'
-}
-
-export function genChildren (
- el: ASTElement,
- state: CodegenState,
- checkSkip?: boolean,
- altGenElement?: Function,
- altGenNode?: Function
-): string | void {
- const children = el.children
- if (children.length) {
- const el: any = children[0]
- // optimize single v-for
- if (children.length === 1 &&
- el.for &&
- el.tag !== 'template' &&
- el.tag !== 'slot'
- ) {
- return (altGenElement || genElement)(el, state)
- }
- const normalizationType = checkSkip
- ? getNormalizationType(children, state.maybeComponent)
- : 0
- const gen = altGenNode || genNode
- return `[${children.map(c => gen(c, state)).join(',')}]${
- normalizationType ? `,${normalizationType}` : ''
- }`
- }
-}
-
-// determine the normalization needed for the children array.
-// 0: no normalization needed
-// 1: simple normalization needed (possible 1-level deep nested array)
-// 2: full normalization needed
-function getNormalizationType (
- children: Array<ASTNode>,
- maybeComponent: (el: ASTElement) => boolean
-): number {
- let res = 0
- for (let i = 0; i < children.length; i++) {
- const el: ASTNode = children[i]
- if (el.type !== 1) {
- continue
- }
- if (needsNormalization(el) ||
- (el.ifConditions && el.ifConditions.some(c => needsNormalization(c.block)))) {
- res = 2
- break
- }
- if (maybeComponent(el) ||
- (el.ifConditions && el.ifConditions.some(c => maybeComponent(c.block)))) {
- res = 1
- }
- }
- return res
-}
-
-function needsNormalization (el: ASTElement): boolean {
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
-}
-
-function genNode (node: ASTNode, state: CodegenState): string {
- if (node.type === 1) {
- return genElement(node, state)
- } if (node.type === 3 && node.isComment) {
- return genComment(node)
- } else {
- return genText(node)
- }
-}
-
-export function genText (text: ASTText | ASTExpression): string {
- return `_v(${text.type === 2
- ? text.expression // no need for () because already wrapped in _s()
- : transformSpecialNewlines(JSON.stringify(text.text))
- })`
-}
-
-export function genComment (comment: ASTText): string {
- return `_e(${JSON.stringify(comment.text)})`
-}
-
-function genSlot (el: ASTElement, state: CodegenState): string {
- const slotName = el.slotName || '"default"'
- const children = genChildren(el, state)
- let res = `_t(${slotName}${children ? `,${children}` : ''}`
- const attrs = el.attrs && `{${el.attrs.map(a => `${camelize(a.name)}:${a.value}`).join(',')}}`
- const bind = el.attrsMap['v-bind']
- if ((attrs || bind) && !children) {
- res += `,null`
- }
- if (attrs) {
- res += `,${attrs}`
- }
- if (bind) {
- res += `${attrs ? '' : ',null'},${bind}`
- }
- return res + ')'
-}
-
-// componentName is el.component, take it as argument to shun flow's pessimistic refinement
-function genComponent (
- componentName: string,
- el: ASTElement,
- state: CodegenState
-): string {
- const children = el.inlineTemplate ? null : genChildren(el, state, true)
- return `_c(${componentName},${genData(el, state)}${
- children ? `,${children}` : ''
- })`
-}
-
-function genProps (props: Array<{ name: string, value: any }>): string {
- let res = ''
- for (let i = 0; i < props.length; i++) {
- const prop = props[i]
- /* istanbul ignore if */
- if (__WEEX__) {
- res += `"${prop.name}":${generateValue(prop.value)},`
- } else {
- res += `"${prop.name}":${transformSpecialNewlines(prop.value)},`
- }
- }
- return res.slice(0, -1)
-}
-
-/* istanbul ignore next */
-function generateValue (value) {
- if (typeof value === 'string') {
- return transformSpecialNewlines(value)
- }
- return JSON.stringify(value)
-}
-
-// #3895, #4268
-function transformSpecialNewlines (text: string): string {
- return text
- .replace(/\u2028/g, '\\u2028')
- .replace(/\u2029/g, '\\u2029')
-}
+++ /dev/null
-/* @flow */
-
-import { extend } from 'shared/util'
-import { detectErrors } from './error-detector'
-import { createCompileToFunctionFn } from './to-function'
-
-export function createCompilerCreator (baseCompile: Function): Function {
- return function createCompiler (baseOptions: CompilerOptions) {
- function compile (
- template: string,
- options?: CompilerOptions
- ): CompiledResult {
- const finalOptions = Object.create(baseOptions)
- const errors = []
- const tips = []
- finalOptions.warn = (msg, tip) => {
- (tip ? tips : errors).push(msg)
- }
-
- if (options) {
- // merge custom modules
- if (options.modules) {
- finalOptions.modules =
- (baseOptions.modules || []).concat(options.modules)
- }
- // merge custom directives
- if (options.directives) {
- finalOptions.directives = extend(
- Object.create(baseOptions.directives || null),
- options.directives
- )
- }
- // copy other options
- for (const key in options) {
- if (key !== 'modules' && key !== 'directives') {
- finalOptions[key] = options[key]
- }
- }
- }
-
- const compiled = baseCompile(template, finalOptions)
- if (process.env.NODE_ENV !== 'production') {
- errors.push.apply(errors, detectErrors(compiled.ast))
- }
- compiled.errors = errors
- compiled.tips = tips
- return compiled
- }
-
- return {
- compile,
- compileToFunctions: createCompileToFunctionFn(compile)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-export default function bind (el: ASTElement, dir: ASTDirective) {
- el.wrapData = (code: string) => {
- return `_b(${code},'${el.tag}',${dir.value},${
- dir.modifiers && dir.modifiers.prop ? 'true' : 'false'
- }${
- dir.modifiers && dir.modifiers.sync ? ',true' : ''
- })`
- }
-}
+++ /dev/null
-/* @flow */
-
-import on from './on'
-import bind from './bind'
-import { noop } from 'shared/util'
-
-export default {
- on,
- bind,
- cloak: noop
-}
+++ /dev/null
-/* @flow */
-
-/**
- * Cross-platform code generation for component v-model
- */
-export function genComponentModel (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-): ?boolean {
- const { number, trim } = modifiers || {}
-
- const baseValueExpression = '$$v'
- let valueExpression = baseValueExpression
- if (trim) {
- valueExpression =
- `(typeof ${baseValueExpression} === 'string'` +
- `? ${baseValueExpression}.trim()` +
- `: ${baseValueExpression})`
- }
- if (number) {
- valueExpression = `_n(${valueExpression})`
- }
- const assignment = genAssignmentCode(value, valueExpression)
-
- el.model = {
- value: `(${value})`,
- expression: `"${value}"`,
- callback: `function (${baseValueExpression}) {${assignment}}`
- }
-}
-
-/**
- * Cross-platform codegen helper for generating v-model value assignment code.
- */
-export function genAssignmentCode (
- value: string,
- assignment: string
-): string {
- const res = parseModel(value)
- if (res.key === null) {
- return `${value}=${assignment}`
- } else {
- return `$set(${res.exp}, ${res.key}, ${assignment})`
- }
-}
-
-/**
- * Parse a v-model expression into a base path and a final key segment.
- * Handles both dot-path and possible square brackets.
- *
- * Possible cases:
- *
- * - test
- * - test[key]
- * - test[test1[key]]
- * - test["a"][key]
- * - xxx.test[a[a].test1[key]]
- * - test.xxx.a["asa"][test1[key]]
- *
- */
-
-let len, str, chr, index, expressionPos, expressionEndPos
-
-type ModelParseResult = {
- exp: string,
- key: string | null
-}
-
-export function parseModel (val: string): ModelParseResult {
- // Fix https://github.com/vuejs/vue/pull/7730
- // allow v-model="obj.val " (trailing whitespace)
- val = val.trim()
- len = val.length
-
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
- index = val.lastIndexOf('.')
- if (index > -1) {
- return {
- exp: val.slice(0, index),
- key: '"' + val.slice(index + 1) + '"'
- }
- } else {
- return {
- exp: val,
- key: null
- }
- }
- }
-
- str = val
- index = expressionPos = expressionEndPos = 0
-
- while (!eof()) {
- chr = next()
- /* istanbul ignore if */
- if (isStringStart(chr)) {
- parseString(chr)
- } else if (chr === 0x5B) {
- parseBracket(chr)
- }
- }
-
- return {
- exp: val.slice(0, expressionPos),
- key: val.slice(expressionPos + 1, expressionEndPos)
- }
-}
-
-function next (): number {
- return str.charCodeAt(++index)
-}
-
-function eof (): boolean {
- return index >= len
-}
-
-function isStringStart (chr: number): boolean {
- return chr === 0x22 || chr === 0x27
-}
-
-function parseBracket (chr: number): void {
- let inBracket = 1
- expressionPos = index
- while (!eof()) {
- chr = next()
- if (isStringStart(chr)) {
- parseString(chr)
- continue
- }
- if (chr === 0x5B) inBracket++
- if (chr === 0x5D) inBracket--
- if (inBracket === 0) {
- expressionEndPos = index
- break
- }
- }
-}
-
-function parseString (chr: number): void {
- const stringQuote = chr
- while (!eof()) {
- chr = next()
- if (chr === stringQuote) {
- break
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { warn } from 'core/util/index'
-
-export default function on (el: ASTElement, dir: ASTDirective) {
- if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
- warn(`v-on without argument does not support modifiers.`)
- }
- el.wrapListeners = (code: string) => `_g(${code},${dir.value})`
-}
+++ /dev/null
-/* @flow */
-
-import { dirRE, onRE } from './parser/index'
-
-// these keywords should not appear inside expressions, but operators like
-// typeof, instanceof and in are allowed
-const prohibitedKeywordRE = new RegExp('\\b' + (
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments'
-).split(',').join('\\b|\\b') + '\\b')
-
-// these unary operators should not be used as property/method names
-const unaryOperatorsRE = new RegExp('\\b' + (
- 'delete,typeof,void'
-).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)')
-
-// strip strings in expressions
-const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g
-
-// detect problematic expressions in a template
-export function detectErrors (ast: ?ASTNode): Array<string> {
- const errors: Array<string> = []
- if (ast) {
- checkNode(ast, errors)
- }
- return errors
-}
-
-function checkNode (node: ASTNode, errors: Array<string>) {
- if (node.type === 1) {
- for (const name in node.attrsMap) {
- if (dirRE.test(name)) {
- const value = node.attrsMap[name]
- if (value) {
- if (name === 'v-for') {
- checkFor(node, `v-for="${value}"`, errors)
- } else if (onRE.test(name)) {
- checkEvent(value, `${name}="${value}"`, errors)
- } else {
- checkExpression(value, `${name}="${value}"`, errors)
- }
- }
- }
- }
- if (node.children) {
- for (let i = 0; i < node.children.length; i++) {
- checkNode(node.children[i], errors)
- }
- }
- } else if (node.type === 2) {
- checkExpression(node.expression, node.text, errors)
- }
-}
-
-function checkEvent (exp: string, text: string, errors: Array<string>) {
- const stipped = exp.replace(stripStringRE, '')
- const keywordMatch: any = stipped.match(unaryOperatorsRE)
- if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
- errors.push(
- `avoid using JavaScript unary operator as property name: ` +
- `"${keywordMatch[0]}" in expression ${text.trim()}`
- )
- }
- checkExpression(exp, text, errors)
-}
-
-function checkFor (node: ASTElement, text: string, errors: Array<string>) {
- checkExpression(node.for || '', text, errors)
- checkIdentifier(node.alias, 'v-for alias', text, errors)
- checkIdentifier(node.iterator1, 'v-for iterator', text, errors)
- checkIdentifier(node.iterator2, 'v-for iterator', text, errors)
-}
-
-function checkIdentifier (
- ident: ?string,
- type: string,
- text: string,
- errors: Array<string>
-) {
- if (typeof ident === 'string') {
- try {
- new Function(`var ${ident}=_`)
- } catch (e) {
- errors.push(`invalid ${type} "${ident}" in expression: ${text.trim()}`)
- }
- }
-}
-
-function checkExpression (exp: string, text: string, errors: Array<string>) {
- try {
- new Function(`return ${exp}`)
- } catch (e) {
- const keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE)
- if (keywordMatch) {
- errors.push(
- `avoid using JavaScript keyword as property name: ` +
- `"${keywordMatch[0]}"\n Raw expression: ${text.trim()}`
- )
- } else {
- errors.push(
- `invalid expression: ${e.message} in\n\n` +
- ` ${exp}\n\n` +
- ` Raw expression: ${text.trim()}\n`
- )
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { emptyObject } from 'shared/util'
-import { parseFilters } from './parser/filter-parser'
-
-export function baseWarn (msg: string) {
- console.error(`[Vue compiler]: ${msg}`)
-}
-
-export function pluckModuleFunction<F: Function> (
- modules: ?Array<Object>,
- key: string
-): Array<F> {
- return modules
- ? modules.map(m => m[key]).filter(_ => _)
- : []
-}
-
-export function addProp (el: ASTElement, name: string, value: string) {
- (el.props || (el.props = [])).push({ name, value })
- el.plain = false
-}
-
-export function addAttr (el: ASTElement, name: string, value: any) {
- (el.attrs || (el.attrs = [])).push({ name, value })
- el.plain = false
-}
-
-// add a raw attr (use this in preTransforms)
-export function addRawAttr (el: ASTElement, name: string, value: any) {
- el.attrsMap[name] = value
- el.attrsList.push({ name, value })
-}
-
-export function addDirective (
- el: ASTElement,
- name: string,
- rawName: string,
- value: string,
- arg: ?string,
- modifiers: ?ASTModifiers
-) {
- (el.directives || (el.directives = [])).push({ name, rawName, value, arg, modifiers })
- el.plain = false
-}
-
-export function addHandler (
- el: ASTElement,
- name: string,
- value: string,
- modifiers: ?ASTModifiers,
- important?: boolean,
- warn?: Function
-) {
- modifiers = modifiers || emptyObject
- // warn prevent and passive modifier
- /* istanbul ignore if */
- if (
- process.env.NODE_ENV !== 'production' && warn &&
- modifiers.prevent && modifiers.passive
- ) {
- warn(
- 'passive and prevent can\'t be used together. ' +
- 'Passive handler can\'t prevent default event.'
- )
- }
-
- // check capture modifier
- if (modifiers.capture) {
- delete modifiers.capture
- name = '!' + name // mark the event as captured
- }
- if (modifiers.once) {
- delete modifiers.once
- name = '~' + name // mark the event as once
- }
- /* istanbul ignore if */
- if (modifiers.passive) {
- delete modifiers.passive
- name = '&' + name // mark the event as passive
- }
-
- // normalize click.right and click.middle since they don't actually fire
- // this is technically browser-specific, but at least for now browsers are
- // the only target envs that have right/middle clicks.
- if (name === 'click') {
- if (modifiers.right) {
- name = 'contextmenu'
- delete modifiers.right
- } else if (modifiers.middle) {
- name = 'mouseup'
- }
- }
-
- let events
- if (modifiers.native) {
- delete modifiers.native
- events = el.nativeEvents || (el.nativeEvents = {})
- } else {
- events = el.events || (el.events = {})
- }
-
- const newHandler: any = {
- value: value.trim()
- }
- if (modifiers !== emptyObject) {
- newHandler.modifiers = modifiers
- }
-
- const handlers = events[name]
- /* istanbul ignore if */
- if (Array.isArray(handlers)) {
- important ? handlers.unshift(newHandler) : handlers.push(newHandler)
- } else if (handlers) {
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler]
- } else {
- events[name] = newHandler
- }
-
- el.plain = false
-}
-
-export function getBindingAttr (
- el: ASTElement,
- name: string,
- getStatic?: boolean
-): ?string {
- const dynamicValue =
- getAndRemoveAttr(el, ':' + name) ||
- getAndRemoveAttr(el, 'v-bind:' + name)
- if (dynamicValue != null) {
- return parseFilters(dynamicValue)
- } else if (getStatic !== false) {
- const staticValue = getAndRemoveAttr(el, name)
- if (staticValue != null) {
- return JSON.stringify(staticValue)
- }
- }
-}
-
-// 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.
-export function getAndRemoveAttr (
- el: ASTElement,
- name: string,
- removeFromMap?: boolean
-): ?string {
- let val
- if ((val = el.attrsMap[name]) != null) {
- const list = el.attrsList
- for (let i = 0, l = list.length; i < l; i++) {
- if (list[i].name === name) {
- list.splice(i, 1)
- break
- }
- }
- }
- if (removeFromMap) {
- delete el.attrsMap[name]
- }
- return val
-}
+++ /dev/null
-/* @flow */
-
-import { parse } from './parser/index'
-import { optimize } from './optimizer'
-import { generate } from './codegen/index'
-import { createCompilerCreator } from './create-compiler'
-
-// `createCompilerCreator` allows creating compilers that use alternative
-// parser/optimizer/codegen, e.g the SSR optimizing compiler.
-// Here we just export a default compiler using the default parts.
-export const createCompiler = createCompilerCreator(function baseCompile (
- template: string,
- options: CompilerOptions
-): CompiledResult {
- const ast = parse(template.trim(), options)
- if (options.optimize !== false) {
- optimize(ast, options)
- }
- const code = generate(ast, options)
- return {
- ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
-})
+++ /dev/null
-/* @flow */
-
-import { makeMap, isBuiltInTag, cached, no } from 'shared/util'
-
-let isStaticKey
-let isPlatformReservedTag
-
-const genStaticKeysCached = cached(genStaticKeys)
-
-/**
- * Goal of the optimizer: walk the generated template AST tree
- * and detect sub-trees that are purely static, i.e. parts of
- * the DOM that never needs to change.
- *
- * Once we detect these sub-trees, we can:
- *
- * 1. Hoist them into constants, so that we no longer need to
- * create fresh nodes for them on each re-render;
- * 2. Completely skip them in the patching process.
- */
-export function optimize (root: ?ASTElement, options: CompilerOptions) {
- if (!root) return
- isStaticKey = genStaticKeysCached(options.staticKeys || '')
- isPlatformReservedTag = options.isReservedTag || no
- // first pass: mark all non-static nodes.
- markStatic(root)
- // second pass: mark static roots.
- markStaticRoots(root, false)
-}
-
-function genStaticKeys (keys: string): Function {
- return makeMap(
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
- (keys ? ',' + keys : '')
- )
-}
-
-function markStatic (node: ASTNode) {
- node.static = isStatic(node)
- if (node.type === 1) {
- // do not make component slot content static. this avoids
- // 1. components not able to mutate slot nodes
- // 2. static slot content fails for hot-reloading
- if (
- !isPlatformReservedTag(node.tag) &&
- node.tag !== 'slot' &&
- node.attrsMap['inline-template'] == null
- ) {
- return
- }
- for (let i = 0, l = node.children.length; i < l; i++) {
- const child = node.children[i]
- markStatic(child)
- if (!child.static) {
- node.static = false
- }
- }
- if (node.ifConditions) {
- for (let i = 1, l = node.ifConditions.length; i < l; i++) {
- const block = node.ifConditions[i].block
- markStatic(block)
- if (!block.static) {
- node.static = false
- }
- }
- }
- }
-}
-
-function markStaticRoots (node: ASTNode, isInFor: boolean) {
- if (node.type === 1) {
- if (node.static || node.once) {
- node.staticInFor = isInFor
- }
- // For a node to qualify as a static root, it should have children that
- // are not just static text. Otherwise the cost of hoisting out will
- // outweigh the benefits and it's better off to just always render it fresh.
- if (node.static && node.children.length && !(
- node.children.length === 1 &&
- node.children[0].type === 3
- )) {
- node.staticRoot = true
- return
- } else {
- node.staticRoot = false
- }
- if (node.children) {
- for (let i = 0, l = node.children.length; i < l; i++) {
- markStaticRoots(node.children[i], isInFor || !!node.for)
- }
- }
- if (node.ifConditions) {
- for (let i = 1, l = node.ifConditions.length; i < l; i++) {
- markStaticRoots(node.ifConditions[i].block, isInFor)
- }
- }
- }
-}
-
-function isStatic (node: ASTNode): boolean {
- if (node.type === 2) { // expression
- return false
- }
- if (node.type === 3) { // text
- return true
- }
- return !!(node.pre || (
- !node.hasBindings && // no dynamic bindings
- !node.if && !node.for && // not v-if or v-for or v-else
- !isBuiltInTag(node.tag) && // not a built-in
- isPlatformReservedTag(node.tag) && // not a component
- !isDirectChildOfTemplateFor(node) &&
- Object.keys(node).every(isStaticKey)
- ))
-}
-
-function isDirectChildOfTemplateFor (node: ASTElement): boolean {
- while (node.parent) {
- node = node.parent
- if (node.tag !== 'template') {
- return false
- }
- if (node.for) {
- return true
- }
- }
- return false
-}
+++ /dev/null
-/* @flow */
-
-let decoder
-
-export default {
- decode (html: string): string {
- decoder = decoder || document.createElement('div')
- decoder.innerHTML = html
- return decoder.textContent
- }
-}
+++ /dev/null
-/* @flow */
-
-const validDivisionCharRE = /[\w).+\-_$\]]/
-
-export function parseFilters (exp: string): string {
- let inSingle = false
- let inDouble = false
- let inTemplateString = false
- let inRegex = false
- let curly = 0
- let square = 0
- let paren = 0
- let lastFilterIndex = 0
- let c, prev, i, expression, filters
-
- for (i = 0; i < exp.length; i++) {
- prev = c
- c = exp.charCodeAt(i)
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5C) inSingle = false
- } else if (inDouble) {
- if (c === 0x22 && prev !== 0x5C) inDouble = false
- } else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5C) inTemplateString = false
- } else if (inRegex) {
- if (c === 0x2f && prev !== 0x5C) inRegex = false
- } else if (
- c === 0x7C && // pipe
- exp.charCodeAt(i + 1) !== 0x7C &&
- exp.charCodeAt(i - 1) !== 0x7C &&
- !curly && !square && !paren
- ) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1
- expression = exp.slice(0, i).trim()
- } else {
- pushFilter()
- }
- } else {
- switch (c) {
- case 0x22: inDouble = true; break // "
- case 0x27: inSingle = true; break // '
- case 0x60: inTemplateString = true; break // `
- case 0x28: paren++; break // (
- case 0x29: paren--; break // )
- case 0x5B: square++; break // [
- case 0x5D: square--; break // ]
- case 0x7B: curly++; break // {
- case 0x7D: curly--; break // }
- }
- if (c === 0x2f) { // /
- let j = i - 1
- let p
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j)
- if (p !== ' ') break
- }
- if (!p || !validDivisionCharRE.test(p)) {
- inRegex = true
- }
- }
- }
- }
-
- if (expression === undefined) {
- expression = exp.slice(0, i).trim()
- } else if (lastFilterIndex !== 0) {
- pushFilter()
- }
-
- function pushFilter () {
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())
- lastFilterIndex = i + 1
- }
-
- if (filters) {
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i])
- }
- }
-
- return expression
-}
-
-function wrapFilter (exp: string, filter: string): string {
- const i = filter.indexOf('(')
- if (i < 0) {
- // _f: resolveFilter
- return `_f("${filter}")(${exp})`
- } else {
- const name = filter.slice(0, i)
- const args = filter.slice(i + 1)
- return `_f("${name}")(${exp}${args !== ')' ? ',' + args : args}`
- }
-}
+++ /dev/null
-/**
- * Not type-checking this file because it's mostly vendor code.
- */
-
-/*!
- * HTML Parser By John Resig (ejohn.org)
- * Modified by Juriy "kangax" Zaytsev
- * Original code by Erik Arvidsson, Mozilla Public License
- * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
- */
-
-import { makeMap, no } from 'shared/util'
-import { isNonPhrasingTag } from 'web/compiler/util'
-
-// Regular Expressions for parsing tags and attributes
-const attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/
-// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
-// but for Vue templates we can enforce a simple charset
-const ncname = '[a-zA-Z_][\\w\\-\\.]*'
-const qnameCapture = `((?:${ncname}\\:)?${ncname})`
-const startTagOpen = new RegExp(`^<${qnameCapture}`)
-const startTagClose = /^\s*(\/?)>/
-const endTag = new RegExp(`^<\\/${qnameCapture}[^>]*>`)
-const doctype = /^<!DOCTYPE [^>]+>/i
-// #7298: escape - to avoid being pased as HTML comment when inlined in page
-const comment = /^<!\--/
-const conditionalComment = /^<!\[/
-
-let IS_REGEX_CAPTURING_BROKEN = false
-'x'.replace(/x(.)?/g, function (m, g) {
- IS_REGEX_CAPTURING_BROKEN = g === ''
-})
-
-// Special Elements (can contain anything)
-export const isPlainTextElement = makeMap('script,style,textarea', true)
-const reCache = {}
-
-const decodingMap = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&',
- ' ': '\n',
- '	': '\t'
-}
-const encodedAttr = /&(?:lt|gt|quot|amp);/g
-const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g
-
-// #5992
-const isIgnoreNewlineTag = makeMap('pre,textarea', true)
-const shouldIgnoreFirstNewline = (tag, html) => tag && isIgnoreNewlineTag(tag) && html[0] === '\n'
-
-function decodeAttr (value, shouldDecodeNewlines) {
- const re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr
- return value.replace(re, match => decodingMap[match])
-}
-
-export function parseHTML (html, options) {
- const stack = []
- const expectHTML = options.expectHTML
- const isUnaryTag = options.isUnaryTag || no
- const canBeLeftOpenTag = options.canBeLeftOpenTag || no
- let index = 0
- let last, lastTag
- while (html) {
- last = html
- // Make sure we're not in a plaintext content element like script/style
- if (!lastTag || !isPlainTextElement(lastTag)) {
- let textEnd = html.indexOf('<')
- if (textEnd === 0) {
- // Comment:
- if (comment.test(html)) {
- const commentEnd = html.indexOf('-->')
-
- if (commentEnd >= 0) {
- if (options.shouldKeepComment) {
- options.comment(html.substring(4, commentEnd))
- }
- advance(commentEnd + 3)
- continue
- }
- }
-
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
- if (conditionalComment.test(html)) {
- const conditionalEnd = html.indexOf(']>')
-
- if (conditionalEnd >= 0) {
- advance(conditionalEnd + 2)
- continue
- }
- }
-
- // Doctype:
- const doctypeMatch = html.match(doctype)
- if (doctypeMatch) {
- advance(doctypeMatch[0].length)
- continue
- }
-
- // End tag:
- const endTagMatch = html.match(endTag)
- if (endTagMatch) {
- const curIndex = index
- advance(endTagMatch[0].length)
- parseEndTag(endTagMatch[1], curIndex, index)
- continue
- }
-
- // Start tag:
- const startTagMatch = parseStartTag()
- if (startTagMatch) {
- handleStartTag(startTagMatch)
- if (shouldIgnoreFirstNewline(lastTag, html)) {
- advance(1)
- }
- continue
- }
- }
-
- let text, rest, next
- if (textEnd >= 0) {
- rest = html.slice(textEnd)
- while (
- !endTag.test(rest) &&
- !startTagOpen.test(rest) &&
- !comment.test(rest) &&
- !conditionalComment.test(rest)
- ) {
- // < in plain text, be forgiving and treat it as text
- next = rest.indexOf('<', 1)
- if (next < 0) break
- textEnd += next
- rest = html.slice(textEnd)
- }
- text = html.substring(0, textEnd)
- advance(textEnd)
- }
-
- if (textEnd < 0) {
- text = html
- html = ''
- }
-
- if (options.chars && text) {
- options.chars(text)
- }
- } else {
- let endTagLength = 0
- const stackedTag = lastTag.toLowerCase()
- const reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'))
- const rest = html.replace(reStackedTag, function (all, text, endTag) {
- endTagLength = endTag.length
- if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
- text = text
- .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1')
- }
- if (shouldIgnoreFirstNewline(stackedTag, text)) {
- text = text.slice(1)
- }
- if (options.chars) {
- options.chars(text)
- }
- return ''
- })
- index += html.length - rest.length
- html = rest
- parseEndTag(stackedTag, index - endTagLength, index)
- }
-
- if (html === last) {
- options.chars && options.chars(html)
- if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) {
- options.warn(`Mal-formatted tag at end of template: "${html}"`)
- }
- break
- }
- }
-
- // Clean up any remaining tags
- parseEndTag()
-
- function advance (n) {
- index += n
- html = html.substring(n)
- }
-
- function parseStartTag () {
- const start = html.match(startTagOpen)
- if (start) {
- const match = {
- tagName: start[1],
- attrs: [],
- start: index
- }
- advance(start[0].length)
- let end, attr
- while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
- advance(attr[0].length)
- match.attrs.push(attr)
- }
- if (end) {
- match.unarySlash = end[1]
- advance(end[0].length)
- match.end = index
- return match
- }
- }
- }
-
- function handleStartTag (match) {
- const tagName = match.tagName
- const unarySlash = match.unarySlash
-
- if (expectHTML) {
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
- parseEndTag(lastTag)
- }
- if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
- parseEndTag(tagName)
- }
- }
-
- const unary = isUnaryTag(tagName) || !!unarySlash
-
- const l = match.attrs.length
- const attrs = new Array(l)
- for (let i = 0; i < l; i++) {
- const args = match.attrs[i]
- // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
- if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
- if (args[3] === '') { delete args[3] }
- if (args[4] === '') { delete args[4] }
- if (args[5] === '') { delete args[5] }
- }
- const value = args[3] || args[4] || args[5] || ''
- const shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
- ? options.shouldDecodeNewlinesForHref
- : options.shouldDecodeNewlines
- attrs[i] = {
- name: args[1],
- value: decodeAttr(value, shouldDecodeNewlines)
- }
- }
-
- if (!unary) {
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs })
- lastTag = tagName
- }
-
- if (options.start) {
- options.start(tagName, attrs, unary, match.start, match.end)
- }
- }
-
- function parseEndTag (tagName, start, end) {
- let pos, lowerCasedTagName
- if (start == null) start = index
- if (end == null) end = index
-
- if (tagName) {
- lowerCasedTagName = tagName.toLowerCase()
- }
-
- // Find the closest opened tag of the same type
- if (tagName) {
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
- break
- }
- }
- } else {
- // If no tag name is provided, clean shop
- pos = 0
- }
-
- if (pos >= 0) {
- // Close all the open elements, up the stack
- for (let i = stack.length - 1; i >= pos; i--) {
- if (process.env.NODE_ENV !== 'production' &&
- (i > pos || !tagName) &&
- options.warn
- ) {
- options.warn(
- `tag <${stack[i].tag}> has no matching end tag.`
- )
- }
- if (options.end) {
- options.end(stack[i].tag, start, end)
- }
- }
-
- // Remove the open elements from the stack
- stack.length = pos
- lastTag = pos && stack[pos - 1].tag
- } else if (lowerCasedTagName === 'br') {
- if (options.start) {
- options.start(tagName, [], true, start, end)
- }
- } else if (lowerCasedTagName === 'p') {
- if (options.start) {
- options.start(tagName, [], false, start, end)
- }
- if (options.end) {
- options.end(tagName, start, end)
- }
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import he from 'he'
-import { parseHTML } from './html-parser'
-import { parseText } from './text-parser'
-import { parseFilters } from './filter-parser'
-import { genAssignmentCode } from '../directives/model'
-import { extend, cached, no, camelize } from 'shared/util'
-import { isIE, isEdge, isServerRendering } from 'core/util/env'
-
-import {
- addProp,
- addAttr,
- baseWarn,
- addHandler,
- addDirective,
- getBindingAttr,
- getAndRemoveAttr,
- pluckModuleFunction
-} from '../helpers'
-
-export const onRE = /^@|^v-on:/
-export const dirRE = /^v-|^@|^:/
-export const forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/
-export const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
-const stripParensRE = /^\(|\)$/g
-
-const argRE = /:(.*)$/
-export const bindRE = /^:|^v-bind:/
-const modifierRE = /\.[^.]+/g
-
-const decodeHTMLCached = cached(he.decode)
-
-// configurable state
-export let warn: any
-let delimiters
-let transforms
-let preTransforms
-let postTransforms
-let platformIsPreTag
-let platformMustUseProp
-let platformGetTagNamespace
-
-type Attr = { name: string; value: string };
-
-export function createASTElement (
- tag: string,
- attrs: Array<Attr>,
- parent: ASTElement | void
-): ASTElement {
- return {
- type: 1,
- tag,
- attrsList: attrs,
- attrsMap: makeAttrsMap(attrs),
- parent,
- children: []
- }
-}
-
-/**
- * Convert HTML string to AST.
- */
-export function parse (
- template: string,
- options: CompilerOptions
-): ASTElement | void {
- warn = options.warn || baseWarn
-
- platformIsPreTag = options.isPreTag || no
- platformMustUseProp = options.mustUseProp || no
- platformGetTagNamespace = options.getTagNamespace || no
-
- transforms = pluckModuleFunction(options.modules, 'transformNode')
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode')
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode')
-
- delimiters = options.delimiters
-
- const stack = []
- const preserveWhitespace = options.preserveWhitespace !== false
- let root
- let currentParent
- let inVPre = false
- let inPre = false
- let warned = false
-
- function warnOnce (msg) {
- if (!warned) {
- warned = true
- warn(msg)
- }
- }
-
- function closeElement (element) {
- // check pre state
- if (element.pre) {
- inVPre = false
- }
- if (platformIsPreTag(element.tag)) {
- inPre = false
- }
- // apply post-transforms
- for (let i = 0; i < postTransforms.length; i++) {
- postTransforms[i](element, options)
- }
- }
-
- parseHTML(template, {
- warn,
- expectHTML: options.expectHTML,
- isUnaryTag: options.isUnaryTag,
- canBeLeftOpenTag: options.canBeLeftOpenTag,
- shouldDecodeNewlines: options.shouldDecodeNewlines,
- shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
- shouldKeepComment: options.comments,
- start (tag, attrs, unary) {
- // check namespace.
- // inherit parent ns if there is one
- const ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag)
-
- // handle IE svg bug
- /* istanbul ignore if */
- if (isIE && ns === 'svg') {
- attrs = guardIESVGBug(attrs)
- }
-
- let element: ASTElement = createASTElement(tag, attrs, currentParent)
- if (ns) {
- element.ns = ns
- }
-
- if (isForbiddenTag(element) && !isServerRendering()) {
- element.forbidden = true
- process.env.NODE_ENV !== 'production' && warn(
- 'Templates should only be responsible for mapping the state to the ' +
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
- `<${tag}>` + ', as they will not be parsed.'
- )
- }
-
- // apply pre-transforms
- for (let i = 0; i < preTransforms.length; i++) {
- element = preTransforms[i](element, options) || element
- }
-
- if (!inVPre) {
- processPre(element)
- if (element.pre) {
- inVPre = true
- }
- }
- if (platformIsPreTag(element.tag)) {
- inPre = true
- }
- if (inVPre) {
- processRawAttrs(element)
- } else if (!element.processed) {
- // structural directives
- processFor(element)
- processIf(element)
- processOnce(element)
- // element-scope stuff
- processElement(element, options)
- }
-
- function checkRootConstraints (el) {
- if (process.env.NODE_ENV !== 'production') {
- if (el.tag === 'slot' || el.tag === 'template') {
- warnOnce(
- `Cannot use <${el.tag}> as component root element because it may ` +
- 'contain multiple nodes.'
- )
- }
- if (el.attrsMap.hasOwnProperty('v-for')) {
- warnOnce(
- 'Cannot use v-for on stateful component root element because ' +
- 'it renders multiple elements.'
- )
- }
- }
- }
-
- // tree management
- if (!root) {
- root = element
- checkRootConstraints(root)
- } else if (!stack.length) {
- // allow root elements with v-if, v-else-if and v-else
- if (root.if && (element.elseif || element.else)) {
- checkRootConstraints(element)
- addIfCondition(root, {
- exp: element.elseif,
- block: element
- })
- } else if (process.env.NODE_ENV !== 'production') {
- warnOnce(
- `Component template should contain exactly one root element. ` +
- `If you are using v-if on multiple elements, ` +
- `use v-else-if to chain them instead.`
- )
- }
- }
- if (currentParent && !element.forbidden) {
- if (element.elseif || element.else) {
- processIfConditions(element, currentParent)
- } else if (element.slotScope) { // scoped slot
- currentParent.plain = false
- const name = element.slotTarget || '"default"'
- ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element
- } else {
- currentParent.children.push(element)
- element.parent = currentParent
- }
- }
- if (!unary) {
- currentParent = element
- stack.push(element)
- } else {
- closeElement(element)
- }
- },
-
- end () {
- // remove trailing whitespace
- const element = stack[stack.length - 1]
- const lastNode = element.children[element.children.length - 1]
- if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
- element.children.pop()
- }
- // pop stack
- stack.length -= 1
- currentParent = stack[stack.length - 1]
- closeElement(element)
- },
-
- chars (text: string) {
- if (!currentParent) {
- if (process.env.NODE_ENV !== 'production') {
- if (text === template) {
- warnOnce(
- 'Component template requires a root element, rather than just text.'
- )
- } else if ((text = text.trim())) {
- warnOnce(
- `text "${text}" outside root element will be ignored.`
- )
- }
- }
- return
- }
- // IE textarea placeholder bug
- /* istanbul ignore if */
- if (isIE &&
- currentParent.tag === 'textarea' &&
- currentParent.attrsMap.placeholder === text
- ) {
- return
- }
- const children = currentParent.children
- text = inPre || text.trim()
- ? isTextTag(currentParent) ? text : decodeHTMLCached(text)
- // only preserve whitespace if its not right after a starting tag
- : preserveWhitespace && children.length ? ' ' : ''
- if (text) {
- let res
- if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
- children.push({
- type: 2,
- expression: res.expression,
- tokens: res.tokens,
- text
- })
- } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
- children.push({
- type: 3,
- text
- })
- }
- }
- },
- comment (text: string) {
- currentParent.children.push({
- type: 3,
- text,
- isComment: true
- })
- }
- })
- return root
-}
-
-function processPre (el) {
- if (getAndRemoveAttr(el, 'v-pre') != null) {
- el.pre = true
- }
-}
-
-function processRawAttrs (el) {
- const l = el.attrsList.length
- if (l) {
- const attrs = el.attrs = new Array(l)
- for (let i = 0; i < l; i++) {
- attrs[i] = {
- name: el.attrsList[i].name,
- value: JSON.stringify(el.attrsList[i].value)
- }
- }
- } else if (!el.pre) {
- // non root node in pre blocks with no attributes
- el.plain = true
- }
-}
-
-export function processElement (element: ASTElement, options: CompilerOptions) {
- 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 (let i = 0; i < transforms.length; i++) {
- element = transforms[i](element, options) || element
- }
- processAttrs(element)
-}
-
-function processKey (el) {
- const exp = getBindingAttr(el, 'key')
- if (exp) {
- if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
- warn(`<template> cannot be keyed. Place the key on real elements instead.`)
- }
- el.key = exp
- }
-}
-
-function processRef (el) {
- const ref = getBindingAttr(el, 'ref')
- if (ref) {
- el.ref = ref
- el.refInFor = checkInFor(el)
- }
-}
-
-export function processFor (el: ASTElement) {
- let exp
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
- const res = parseFor(exp)
- if (res) {
- extend(el, res)
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- `Invalid v-for expression: ${exp}`
- )
- }
- }
-}
-
-type ForParseResult = {
- for: string;
- alias: string;
- iterator1?: string;
- iterator2?: string;
-};
-
-export function parseFor (exp: string): ?ForParseResult {
- const inMatch = exp.match(forAliasRE)
- if (!inMatch) return
- const res = {}
- res.for = inMatch[2].trim()
- const alias = inMatch[1].trim().replace(stripParensRE, '')
- const iteratorMatch = alias.match(forIteratorRE)
- if (iteratorMatch) {
- res.alias = alias.replace(forIteratorRE, '')
- res.iterator1 = iteratorMatch[1].trim()
- if (iteratorMatch[2]) {
- res.iterator2 = iteratorMatch[2].trim()
- }
- } else {
- res.alias = alias
- }
- return res
-}
-
-function processIf (el) {
- const exp = getAndRemoveAttr(el, 'v-if')
- if (exp) {
- el.if = exp
- addIfCondition(el, {
- exp: exp,
- block: el
- })
- } else {
- if (getAndRemoveAttr(el, 'v-else') != null) {
- el.else = true
- }
- const elseif = getAndRemoveAttr(el, 'v-else-if')
- if (elseif) {
- el.elseif = elseif
- }
- }
-}
-
-function processIfConditions (el, parent) {
- const prev = findPrevElement(parent.children)
- if (prev && prev.if) {
- addIfCondition(prev, {
- exp: el.elseif,
- block: el
- })
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- `v-${el.elseif ? ('else-if="' + el.elseif + '"') : 'else'} ` +
- `used on element <${el.tag}> without corresponding v-if.`
- )
- }
-}
-
-function findPrevElement (children: Array<any>): ASTElement | void {
- let i = children.length
- while (i--) {
- if (children[i].type === 1) {
- return children[i]
- } else {
- if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
- warn(
- `text "${children[i].text.trim()}" between v-if and v-else(-if) ` +
- `will be ignored.`
- )
- }
- children.pop()
- }
- }
-}
-
-export function addIfCondition (el: ASTElement, condition: ASTIfCondition) {
- if (!el.ifConditions) {
- el.ifConditions = []
- }
- el.ifConditions.push(condition)
-}
-
-function processOnce (el) {
- const once = getAndRemoveAttr(el, 'v-once')
- if (once != null) {
- el.once = true
- }
-}
-
-function processSlot (el) {
- if (el.tag === 'slot') {
- el.slotName = getBindingAttr(el, 'name')
- if (process.env.NODE_ENV !== 'production' && el.key) {
- warn(
- `\`key\` does not work on <slot> because slots are abstract outlets ` +
- `and can possibly expand into multiple elements. ` +
- `Use the key on a wrapping element instead.`
- )
- }
- } else {
- let slotScope
- if (el.tag === 'template') {
- slotScope = getAndRemoveAttr(el, 'scope')
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && slotScope) {
- warn(
- `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 <template> to ` +
- `denote scoped slots.`,
- true
- )
- }
- el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope')
- } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
- warn(
- `Ambiguous combined usage of slot-scope and v-for on <${el.tag}> ` +
- `(v-for takes higher priority). Use a wrapper <template> for the ` +
- `scoped slot to make it clearer.`,
- true
- )
- }
- el.slotScope = slotScope
- }
- const slotTarget = getBindingAttr(el, 'slot')
- if (slotTarget) {
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget
- // preserve slot as an attribute for native shadow DOM compat
- // only for non-scoped slots.
- if (el.tag !== 'template' && !el.slotScope) {
- addAttr(el, 'slot', slotTarget)
- }
- }
- }
-}
-
-function processComponent (el) {
- let binding
- if ((binding = getBindingAttr(el, 'is'))) {
- el.component = binding
- }
- if (getAndRemoveAttr(el, 'inline-template') != null) {
- el.inlineTemplate = true
- }
-}
-
-function processAttrs (el) {
- const list = el.attrsList
- let i, l, name, rawName, value, modifiers, isProp
- for (i = 0, l = list.length; i < l; i++) {
- name = rawName = list[i].name
- value = list[i].value
- if (dirRE.test(name)) {
- // mark element as dynamic
- el.hasBindings = true
- // modifiers
- modifiers = parseModifiers(name)
- if (modifiers) {
- name = name.replace(modifierRE, '')
- }
- if (bindRE.test(name)) { // v-bind
- name = name.replace(bindRE, '')
- value = parseFilters(value)
- isProp = false
- if (modifiers) {
- if (modifiers.prop) {
- isProp = true
- name = camelize(name)
- if (name === 'innerHtml') name = 'innerHTML'
- }
- if (modifiers.camel) {
- name = camelize(name)
- }
- if (modifiers.sync) {
- addHandler(
- el,
- `update:${camelize(name)}`,
- genAssignmentCode(value, `$event`)
- )
- }
- }
- if (isProp || (
- !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
- )) {
- addProp(el, name, value)
- } else {
- addAttr(el, name, value)
- }
- } else if (onRE.test(name)) { // v-on
- name = name.replace(onRE, '')
- addHandler(el, name, value, modifiers, false, warn)
- } else { // normal directives
- name = name.replace(dirRE, '')
- // parse arg
- const argMatch = name.match(argRE)
- const arg = argMatch && argMatch[1]
- if (arg) {
- name = name.slice(0, -(arg.length + 1))
- }
- addDirective(el, name, rawName, value, arg, modifiers)
- if (process.env.NODE_ENV !== 'production' && name === 'model') {
- checkForAliasModel(el, value)
- }
- }
- } else {
- // literal attribute
- if (process.env.NODE_ENV !== 'production') {
- const res = parseText(value, delimiters)
- if (res) {
- warn(
- `${name}="${value}": ` +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div id="{{ val }}">, use <div :id="val">.'
- )
- }
- }
- addAttr(el, name, JSON.stringify(value))
- // #6887 firefox doesn't update muted state if set via attribute
- // even immediately after element creation
- if (!el.component &&
- name === 'muted' &&
- platformMustUseProp(el.tag, el.attrsMap.type, name)) {
- addProp(el, name, 'true')
- }
- }
- }
-}
-
-function checkInFor (el: ASTElement): boolean {
- let parent = el
- while (parent) {
- if (parent.for !== undefined) {
- return true
- }
- parent = parent.parent
- }
- return false
-}
-
-function parseModifiers (name: string): Object | void {
- const match = name.match(modifierRE)
- if (match) {
- const ret = {}
- match.forEach(m => { ret[m.slice(1)] = true })
- return ret
- }
-}
-
-function makeAttrsMap (attrs: Array<Object>): Object {
- const map = {}
- for (let i = 0, l = attrs.length; i < l; i++) {
- if (
- process.env.NODE_ENV !== 'production' &&
- map[attrs[i].name] && !isIE && !isEdge
- ) {
- warn('duplicate attribute: ' + attrs[i].name)
- }
- map[attrs[i].name] = attrs[i].value
- }
- return map
-}
-
-// for script (e.g. type="x/template") or style, do not decode content
-function isTextTag (el): boolean {
- return el.tag === 'script' || el.tag === 'style'
-}
-
-function isForbiddenTag (el): boolean {
- return (
- el.tag === 'style' ||
- (el.tag === 'script' && (
- !el.attrsMap.type ||
- el.attrsMap.type === 'text/javascript'
- ))
- )
-}
-
-const ieNSBug = /^xmlns:NS\d+/
-const ieNSPrefix = /^NS\d+:/
-
-/* istanbul ignore next */
-function guardIESVGBug (attrs) {
- const res = []
- for (let i = 0; i < attrs.length; i++) {
- const attr = attrs[i]
- if (!ieNSBug.test(attr.name)) {
- attr.name = attr.name.replace(ieNSPrefix, '')
- res.push(attr)
- }
- }
- return res
-}
-
-function checkForAliasModel (el, value) {
- let _el = el
- while (_el) {
- if (_el.for && _el.alias === value) {
- warn(
- `<${el.tag} v-model="${value}">: ` +
- `You are binding v-model directly to a v-for iteration alias. ` +
- `This will not be able to modify the v-for source array because ` +
- `writing to the alias is like modifying a function local variable. ` +
- `Consider using an array of objects and use v-model on an object property instead.`
- )
- }
- _el = _el.parent
- }
-}
+++ /dev/null
-/* @flow */
-
-import { cached } from 'shared/util'
-import { parseFilters } from './filter-parser'
-
-const defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g
-const regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g
-
-const buildRegex = cached(delimiters => {
- const open = delimiters[0].replace(regexEscapeRE, '\\$&')
- const close = delimiters[1].replace(regexEscapeRE, '\\$&')
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
-})
-
-type TextParseResult = {
- expression: string,
- tokens: Array<string | { '@binding': string }>
-}
-
-export function parseText (
- text: string,
- delimiters?: [string, string]
-): TextParseResult | void {
- const tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE
- if (!tagRE.test(text)) {
- return
- }
- const tokens = []
- const rawTokens = []
- let lastIndex = tagRE.lastIndex = 0
- let match, index, tokenValue
- while ((match = tagRE.exec(text))) {
- index = match.index
- // push text token
- if (index > lastIndex) {
- rawTokens.push(tokenValue = text.slice(lastIndex, index))
- tokens.push(JSON.stringify(tokenValue))
- }
- // tag token
- const exp = parseFilters(match[1].trim())
- tokens.push(`_s(${exp})`)
- rawTokens.push({ '@binding': exp })
- lastIndex = index + match[0].length
- }
- if (lastIndex < text.length) {
- rawTokens.push(tokenValue = text.slice(lastIndex))
- tokens.push(JSON.stringify(tokenValue))
- }
- return {
- expression: tokens.join('+'),
- tokens: rawTokens
- }
-}
+++ /dev/null
-/* @flow */
-
-import { noop, extend } from 'shared/util'
-import { warn as baseWarn, tip } from 'core/util/debug'
-
-type CompiledFunctionResult = {
- render: Function;
- staticRenderFns: Array<Function>;
-};
-
-function createFunction (code, errors) {
- try {
- return new Function(code)
- } catch (err) {
- errors.push({ err, code })
- return noop
- }
-}
-
-export function createCompileToFunctionFn (compile: Function): Function {
- const cache = Object.create(null)
-
- return function compileToFunctions (
- template: string,
- options?: CompilerOptions,
- vm?: Component
- ): CompiledFunctionResult {
- options = extend({}, options)
- const warn = options.warn || baseWarn
- delete options.warn
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- // detect possible CSP restriction
- try {
- new Function('return 1')
- } catch (e) {
- if (e.toString().match(/unsafe-eval|CSP/)) {
- warn(
- 'It seems you are using the standalone build of Vue.js in an ' +
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
- 'The template compiler cannot work in this environment. Consider ' +
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
- 'templates into render functions.'
- )
- }
- }
- }
-
- // check cache
- const key = options.delimiters
- ? String(options.delimiters) + template
- : template
- if (cache[key]) {
- return cache[key]
- }
-
- // compile
- const compiled = compile(template, options)
-
- // check compilation errors/tips
- if (process.env.NODE_ENV !== 'production') {
- if (compiled.errors && compiled.errors.length) {
- warn(
- `Error compiling template:\n\n${template}\n\n` +
- compiled.errors.map(e => `- ${e}`).join('\n') + '\n',
- vm
- )
- }
- if (compiled.tips && compiled.tips.length) {
- compiled.tips.forEach(msg => tip(msg, vm))
- }
- }
-
- // turn code into functions
- const res = {}
- const fnGenErrors = []
- res.render = createFunction(compiled.render, fnGenErrors)
- res.staticRenderFns = compiled.staticRenderFns.map(code => {
- return createFunction(code, fnGenErrors)
- })
-
- // check function generation errors.
- // this should only happen if there is a bug in the compiler itself.
- // mostly for codegen development use
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
- warn(
- `Failed to generate render function:\n\n` +
- fnGenErrors.map(({ err, code }) => `${err.toString()} in\n\n${code}\n`).join('\n'),
- vm
- )
- }
- }
-
- return (cache[key] = res)
- }
-}
+++ /dev/null
-import KeepAlive from './keep-alive'
-
-export default {
- KeepAlive
-}
+++ /dev/null
-/* @flow */
-
-import { isRegExp, remove } from 'shared/util'
-import { getFirstComponentChild } from 'core/vdom/helpers/index'
-
-type VNodeCache = { [key: string]: ?VNode };
-
-function getComponentName (opts: ?VNodeComponentOptions): ?string {
- return opts && (opts.Ctor.options.name || opts.tag)
-}
-
-function matches (pattern: string | RegExp | Array<string>, name: string): boolean {
- if (Array.isArray(pattern)) {
- return pattern.indexOf(name) > -1
- } else if (typeof pattern === 'string') {
- return pattern.split(',').indexOf(name) > -1
- } else if (isRegExp(pattern)) {
- return pattern.test(name)
- }
- /* istanbul ignore next */
- return false
-}
-
-function pruneCache (keepAliveInstance: any, filter: Function) {
- const { cache, keys, _vnode } = keepAliveInstance
- for (const key in cache) {
- const cachedNode: ?VNode = cache[key]
- if (cachedNode) {
- const name: ?string = getComponentName(cachedNode.componentOptions)
- if (name && !filter(name)) {
- pruneCacheEntry(cache, key, keys, _vnode)
- }
- }
- }
-}
-
-function pruneCacheEntry (
- cache: VNodeCache,
- key: string,
- keys: Array<string>,
- current?: VNode
-) {
- const cached = cache[key]
- if (cached && (!current || cached.tag !== current.tag)) {
- cached.componentInstance.$destroy()
- }
- cache[key] = null
- remove(keys, key)
-}
-
-const patternTypes: Array<Function> = [String, RegExp, Array]
-
-export default {
- name: 'keep-alive',
- abstract: true,
-
- props: {
- include: patternTypes,
- exclude: patternTypes,
- max: [String, Number]
- },
-
- created () {
- this.cache = Object.create(null)
- this.keys = []
- },
-
- destroyed () {
- for (const key in this.cache) {
- pruneCacheEntry(this.cache, key, this.keys)
- }
- },
-
- mounted () {
- this.$watch('include', val => {
- pruneCache(this, name => matches(val, name))
- })
- this.$watch('exclude', val => {
- pruneCache(this, name => !matches(val, name))
- })
- },
-
- render () {
- const slot = this.$slots.default
- const vnode: VNode = getFirstComponentChild(slot)
- const componentOptions: ?VNodeComponentOptions = vnode && vnode.componentOptions
- if (componentOptions) {
- // check pattern
- const name: ?string = getComponentName(componentOptions)
- const { include, exclude } = this
- if (
- // not included
- (include && (!name || !matches(include, name))) ||
- // excluded
- (exclude && name && matches(exclude, name))
- ) {
- return vnode
- }
-
- const { cache, keys } = this
- const key: ?string = 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 (cache[key]) {
- vnode.componentInstance = cache[key].componentInstance
- // make current key freshest
- remove(keys, key)
- keys.push(key)
- } else {
- 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 || (slot && slot[0])
- }
-}
+++ /dev/null
-/* @flow */
-
-import {
- no,
- noop,
- identity
-} from 'shared/util'
-
-import { LIFECYCLE_HOOKS } from 'shared/constants'
-
-export type Config = {
- // user
- optionMergeStrategies: { [key: string]: Function };
- silent: boolean;
- productionTip: boolean;
- performance: boolean;
- devtools: boolean;
- errorHandler: ?(err: Error, vm: Component, info: string) => void;
- warnHandler: ?(msg: string, vm: Component, trace: string) => void;
- ignoredElements: Array<string | RegExp>;
- keyCodes: { [key: string]: number | Array<number> };
-
- // platform
- isReservedTag: (x?: string) => boolean;
- isReservedAttr: (x?: string) => boolean;
- parsePlatformTagName: (x: string) => string;
- isUnknownElement: (x?: string) => boolean;
- getTagNamespace: (x?: string) => string | void;
- mustUseProp: (tag: string, type: ?string, name: string) => boolean;
-
- // legacy
- _lifecycleHooks: Array<string>;
-};
-
-export default ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Show production mode tip message on boot?
- */
- productionTip: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to enable devtools
- */
- devtools: process.env.NODE_ENV !== 'production',
-
- /**
- * Whether to record perf
- */
- performance: false,
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
-}: Config)
+++ /dev/null
-/* @flow */
-
-import { ASSET_TYPES } from 'shared/constants'
-import { isPlainObject, validateComponentName } from '../util/index'
-
-export function initAssetRegisters (Vue: GlobalAPI) {
- /**
- * Create asset registration methods.
- */
- ASSET_TYPES.forEach(type => {
- Vue[type] = function (
- id: string,
- definition: Function | Object
- ): Function | Object | void {
- if (!definition) {
- return this.options[type + 's'][id]
- } else {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && type === 'component') {
- validateComponentName(id)
- }
- if (type === 'component' && isPlainObject(definition)) {
- definition.name = definition.name || id
- definition = this.options._base.extend(definition)
- }
- if (type === 'directive' && typeof definition === 'function') {
- definition = { bind: definition, update: definition }
- }
- this.options[type + 's'][id] = definition
- return definition
- }
- }
- })
-}
+++ /dev/null
-/* @flow */
-
-import { ASSET_TYPES } from 'shared/constants'
-import { defineComputed, proxy } from '../instance/state'
-import { extend, mergeOptions, validateComponentName } from '../util/index'
-
-export function initExtend (Vue: GlobalAPI) {
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
- Vue.cid = 0
- let cid = 1
-
- /**
- * Class inheritance
- */
- Vue.extend = function (extendOptions: Object): Function {
- extendOptions = extendOptions || {}
- const Super = this
- const SuperId = Super.cid
- const cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {})
- if (cachedCtors[SuperId]) {
- return cachedCtors[SuperId]
- }
-
- const name = extendOptions.name || Super.options.name
- if (process.env.NODE_ENV !== 'production' && name) {
- validateComponentName(name)
- }
-
- const Sub = function VueComponent (options) {
- this._init(options)
- }
- Sub.prototype = Object.create(Super.prototype)
- Sub.prototype.constructor = Sub
- Sub.cid = cid++
- Sub.options = mergeOptions(
- Super.options,
- extendOptions
- )
- Sub['super'] = Super
-
- // For props and computed properties, we define the proxy getters on
- // the Vue instances at extension time, on the extended prototype. This
- // avoids Object.defineProperty calls for each instance created.
- if (Sub.options.props) {
- initProps(Sub)
- }
- if (Sub.options.computed) {
- initComputed(Sub)
- }
-
- // allow further extension/mixin/plugin usage
- Sub.extend = Super.extend
- Sub.mixin = Super.mixin
- Sub.use = Super.use
-
- // create asset registers, so extended classes
- // can have their private assets too.
- ASSET_TYPES.forEach(function (type) {
- Sub[type] = Super[type]
- })
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub
- }
-
- // keep a reference to the super options at extension time.
- // later at instantiation we can check if Super's options have
- // been updated.
- Sub.superOptions = Super.options
- Sub.extendOptions = extendOptions
- Sub.sealedOptions = extend({}, Sub.options)
-
- // cache constructor
- cachedCtors[SuperId] = Sub
- return Sub
- }
-}
-
-function initProps (Comp) {
- const props = Comp.options.props
- for (const key in props) {
- proxy(Comp.prototype, `_props`, key)
- }
-}
-
-function initComputed (Comp) {
- const computed = Comp.options.computed
- for (const key in computed) {
- defineComputed(Comp.prototype, key, computed[key])
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import { initUse } from './use'
-import { initMixin } from './mixin'
-import { initExtend } from './extend'
-import { initAssetRegisters } from './assets'
-import { set, del } from '../observer/index'
-import { ASSET_TYPES } from 'shared/constants'
-import builtInComponents from '../components/index'
-
-import {
- warn,
- extend,
- nextTick,
- mergeOptions,
- defineReactive
-} from '../util/index'
-
-export function initGlobalAPI (Vue: GlobalAPI) {
- // config
- const configDef = {}
- configDef.get = () => config
- if (process.env.NODE_ENV !== 'production') {
- configDef.set = () => {
- warn(
- 'Do not replace the Vue.config object, set individual fields instead.'
- )
- }
- }
- Object.defineProperty(Vue, 'config', configDef)
-
- // exposed util methods.
- // NOTE: these are not considered part of the public API - avoid relying on
- // them unless you are aware of the risk.
- Vue.util = {
- warn,
- extend,
- mergeOptions,
- defineReactive
- }
-
- Vue.set = set
- Vue.delete = del
- Vue.nextTick = nextTick
-
- Vue.options = Object.create(null)
- ASSET_TYPES.forEach(type => {
- Vue.options[type + 's'] = Object.create(null)
- })
-
- // this is used to identify the "base" constructor to extend all plain-object
- // components with in Weex's multi-instance scenarios.
- Vue.options._base = Vue
-
- extend(Vue.options.components, builtInComponents)
-
- initUse(Vue)
- initMixin(Vue)
- initExtend(Vue)
- initAssetRegisters(Vue)
-}
+++ /dev/null
-/* @flow */
-
-import { mergeOptions } from '../util/index'
-
-export function initMixin (Vue: GlobalAPI) {
- Vue.mixin = function (mixin: Object) {
- this.options = mergeOptions(this.options, mixin)
- return this
- }
-}
+++ /dev/null
-/* @flow */
-
-import { toArray } from '../util/index'
-
-export function initUse (Vue: GlobalAPI) {
- Vue.use = function (plugin: Function | Object) {
- const installedPlugins = (this._installedPlugins || (this._installedPlugins = []))
- if (installedPlugins.indexOf(plugin) > -1) {
- return this
- }
-
- // additional parameters
- const args = toArray(arguments, 1)
- args.unshift(this)
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args)
- } else if (typeof plugin === 'function') {
- plugin.apply(null, args)
- }
- installedPlugins.push(plugin)
- return this
- }
-}
+++ /dev/null
-import Vue from './instance/index'
-import { initGlobalAPI } from './global-api/index'
-import { isServerRendering } from 'core/util/env'
-import { FunctionalRenderContext } from 'core/vdom/create-functional-component'
-
-initGlobalAPI(Vue)
-
-Object.defineProperty(Vue.prototype, '$isServer', {
- get: isServerRendering
-})
-
-Object.defineProperty(Vue.prototype, '$ssrContext', {
- get () {
- /* istanbul ignore next */
- return this.$vnode && this.$vnode.ssrContext
- }
-})
-
-// expose FunctionalRenderContext for ssr runtime helper installation
-Object.defineProperty(Vue, 'FunctionalRenderContext', {
- value: FunctionalRenderContext
-})
-
-Vue.version = '__VERSION__'
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import {
- tip,
- toArray,
- hyphenate,
- handleError,
- formatComponentName
-} from '../util/index'
-import { updateListeners } from '../vdom/helpers/index'
-
-export function initEvents (vm: Component) {
- vm._events = Object.create(null)
- vm._hasHookEvent = false
- // init parent attached events
- const listeners = vm.$options._parentListeners
- if (listeners) {
- updateComponentListeners(vm, listeners)
- }
-}
-
-let target: any
-
-function add (event, fn, once) {
- if (once) {
- target.$once(event, fn)
- } else {
- target.$on(event, fn)
- }
-}
-
-function remove (event, fn) {
- target.$off(event, fn)
-}
-
-export function updateComponentListeners (
- vm: Component,
- listeners: Object,
- oldListeners: ?Object
-) {
- target = vm
- updateListeners(listeners, oldListeners || {}, add, remove, vm)
- target = undefined
-}
-
-export function eventsMixin (Vue: Class<Component>) {
- const hookRE = /^hook:/
- Vue.prototype.$on = function (event: string | Array<string>, fn: Function): Component {
- const vm: Component = this
- if (Array.isArray(event)) {
- for (let i = 0, l = event.length; i < l; i++) {
- this.$on(event[i], fn)
- }
- } else {
- (vm._events[event] || (vm._events[event] = [])).push(fn)
- // optimize hook:event cost by using a boolean flag marked at registration
- // instead of a hash lookup
- if (hookRE.test(event)) {
- vm._hasHookEvent = true
- }
- }
- return vm
- }
-
- Vue.prototype.$once = function (event: string, fn: Function): Component {
- const vm: Component = this
- function on () {
- vm.$off(event, on)
- fn.apply(vm, arguments)
- }
- on.fn = fn
- vm.$on(event, on)
- return vm
- }
-
- Vue.prototype.$off = function (event?: string | Array<string>, fn?: Function): Component {
- const vm: Component = this
- // all
- if (!arguments.length) {
- vm._events = Object.create(null)
- return vm
- }
- // array of events
- if (Array.isArray(event)) {
- for (let i = 0, l = event.length; i < l; i++) {
- this.$off(event[i], fn)
- }
- return vm
- }
- // specific event
- const cbs = vm._events[event]
- if (!cbs) {
- return vm
- }
- if (!fn) {
- vm._events[event] = null
- return vm
- }
- if (fn) {
- // specific handler
- let cb
- let i = cbs.length
- while (i--) {
- cb = cbs[i]
- if (cb === fn || cb.fn === fn) {
- cbs.splice(i, 1)
- break
- }
- }
- }
- return vm
- }
-
- Vue.prototype.$emit = function (event: string): Component {
- const vm: Component = this
- if (process.env.NODE_ENV !== 'production') {
- const lowerCaseEvent = event.toLowerCase()
- if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
- tip(
- `Event "${lowerCaseEvent}" is emitted in component ` +
- `${formatComponentName(vm)} but the handler is registered for "${event}". ` +
- `Note that HTML attributes are case-insensitive and you cannot use ` +
- `v-on to listen to camelCase events when using in-DOM templates. ` +
- `You should probably use "${hyphenate(event)}" instead of "${event}".`
- )
- }
- }
- let cbs = vm._events[event]
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs
- const args = toArray(arguments, 1)
- for (let i = 0, l = cbs.length; i < l; i++) {
- try {
- cbs[i].apply(vm, args)
- } catch (e) {
- handleError(e, vm, `event handler for "${event}"`)
- }
- }
- }
- return vm
- }
-}
+++ /dev/null
-import { initMixin } from './init'
-import { stateMixin } from './state'
-import { renderMixin } from './render'
-import { eventsMixin } from './events'
-import { lifecycleMixin } from './lifecycle'
-import { warn } from '../util/index'
-
-function Vue (options) {
- if (process.env.NODE_ENV !== 'production' &&
- !(this instanceof Vue)
- ) {
- warn('Vue is a constructor and should be called with the `new` keyword')
- }
- this._init(options)
-}
-
-initMixin(Vue)
-stateMixin(Vue)
-eventsMixin(Vue)
-lifecycleMixin(Vue)
-renderMixin(Vue)
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import { initProxy } from './proxy'
-import { initState } from './state'
-import { initRender } from './render'
-import { initEvents } from './events'
-import { mark, measure } from '../util/perf'
-import { initLifecycle, callHook } from './lifecycle'
-import { initProvide, initInjections } from './inject'
-import { extend, mergeOptions, formatComponentName } from '../util/index'
-
-let uid = 0
-
-export function initMixin (Vue: Class<Component>) {
- Vue.prototype._init = function (options?: Object) {
- const vm: Component = this
- // a uid
- vm._uid = uid++
-
- let startTag, endTag
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- startTag = `vue-perf-start:${vm._uid}`
- endTag = `vue-perf-end:${vm._uid}`
- mark(startTag)
- }
-
- // a flag to avoid this being observed
- vm._isVue = true
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options)
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- )
- }
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- initProxy(vm)
- } else {
- vm._renderProxy = vm
- }
- // expose real self
- vm._self = vm
- initLifecycle(vm)
- initEvents(vm)
- initRender(vm)
- callHook(vm, 'beforeCreate')
- initInjections(vm) // resolve injections before data/props
- initState(vm)
- initProvide(vm) // resolve provide after data/props
- callHook(vm, 'created')
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- vm._name = formatComponentName(vm, false)
- mark(endTag)
- measure(`vue ${vm._name} init`, startTag, endTag)
- }
-
- if (vm.$options.el) {
- vm.$mount(vm.$options.el)
- }
- }
-}
-
-export function initInternalComponent (vm: Component, options: InternalComponentOptions) {
- const opts = vm.$options = Object.create(vm.constructor.options)
- // doing this because it's faster than dynamic enumeration.
- const parentVnode = options._parentVnode
- opts.parent = options.parent
- opts._parentVnode = parentVnode
- opts._parentElm = options._parentElm
- opts._refElm = options._refElm
-
- const vnodeComponentOptions = parentVnode.componentOptions
- opts.propsData = vnodeComponentOptions.propsData
- opts._parentListeners = vnodeComponentOptions.listeners
- opts._renderChildren = vnodeComponentOptions.children
- opts._componentTag = vnodeComponentOptions.tag
-
- if (options.render) {
- opts.render = options.render
- opts.staticRenderFns = options.staticRenderFns
- }
-}
-
-export function resolveConstructorOptions (Ctor: Class<Component>) {
- let options = Ctor.options
- if (Ctor.super) {
- const superOptions = resolveConstructorOptions(Ctor.super)
- const cachedSuperOptions = Ctor.superOptions
- if (superOptions !== cachedSuperOptions) {
- // super option changed,
- // need to resolve new options.
- Ctor.superOptions = superOptions
- // check if there are any late-modified/attached options (#4976)
- const modifiedOptions = resolveModifiedOptions(Ctor)
- // update base extend options
- if (modifiedOptions) {
- extend(Ctor.extendOptions, modifiedOptions)
- }
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions)
- if (options.name) {
- options.components[options.name] = Ctor
- }
- }
- }
- return options
-}
-
-function resolveModifiedOptions (Ctor: Class<Component>): ?Object {
- let modified
- const latest = Ctor.options
- const extended = Ctor.extendOptions
- const sealed = Ctor.sealedOptions
- for (const key in latest) {
- if (latest[key] !== sealed[key]) {
- if (!modified) modified = {}
- modified[key] = dedupe(latest[key], extended[key], sealed[key])
- }
- }
- return modified
-}
-
-function dedupe (latest, extended, sealed) {
- // compare latest and sealed to ensure lifecycle hooks won't be duplicated
- // between merges
- if (Array.isArray(latest)) {
- const res = []
- sealed = Array.isArray(sealed) ? sealed : [sealed]
- extended = Array.isArray(extended) ? extended : [extended]
- for (let i = 0; i < latest.length; i++) {
- // push original options and not sealed options to exclude duplicated options
- if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
- res.push(latest[i])
- }
- }
- return res
- } else {
- return latest
- }
-}
+++ /dev/null
-/* @flow */
-
-import { hasOwn } from 'shared/util'
-import { warn, hasSymbol } from '../util/index'
-import { defineReactive, toggleObserving } from '../observer/index'
-
-export function initProvide (vm: Component) {
- const provide = vm.$options.provide
- if (provide) {
- vm._provided = typeof provide === 'function'
- ? provide.call(vm)
- : provide
- }
-}
-
-export function initInjections (vm: Component) {
- const result = resolveInject(vm.$options.inject, vm)
- if (result) {
- toggleObserving(false)
- Object.keys(result).forEach(key => {
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- defineReactive(vm, key, result[key], () => {
- warn(
- `Avoid mutating an injected value directly since the changes will be ` +
- `overwritten whenever the provided component re-renders. ` +
- `injection being mutated: "${key}"`,
- vm
- )
- })
- } else {
- defineReactive(vm, key, result[key])
- }
- })
- toggleObserving(true)
- }
-}
-
-export function resolveInject (inject: any, vm: Component): ?Object {
- if (inject) {
- // inject is :any because flow is not smart enough to figure out cached
- const result = Object.create(null)
- const keys = hasSymbol
- ? Reflect.ownKeys(inject).filter(key => {
- /* istanbul ignore next */
- return Object.getOwnPropertyDescriptor(inject, key).enumerable
- })
- : Object.keys(inject)
-
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i]
- const provideKey = inject[key].from
- let source = vm
- while (source) {
- if (source._provided && hasOwn(source._provided, provideKey)) {
- result[key] = source._provided[provideKey]
- break
- }
- source = source.$parent
- }
- if (!source) {
- if ('default' in inject[key]) {
- const provideDefault = inject[key].default
- result[key] = typeof provideDefault === 'function'
- ? provideDefault.call(vm)
- : provideDefault
- } else if (process.env.NODE_ENV !== 'production') {
- warn(`Injection "${key}" not found`, vm)
- }
- }
- }
- return result
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import Watcher from '../observer/watcher'
-import { mark, measure } from '../util/perf'
-import { createEmptyVNode } from '../vdom/vnode'
-import { updateComponentListeners } from './events'
-import { resolveSlots } from './render-helpers/resolve-slots'
-import { toggleObserving } from '../observer/index'
-import { pushTarget, popTarget } from '../observer/dep'
-
-import {
- warn,
- noop,
- remove,
- handleError,
- emptyObject,
- validateProp
-} from '../util/index'
-
-export let activeInstance: any = null
-export let isUpdatingChildComponent: boolean = false
-
-export function initLifecycle (vm: Component) {
- const options = vm.$options
-
- // locate first non-abstract parent
- let parent = options.parent
- if (parent && !options.abstract) {
- while (parent.$options.abstract && parent.$parent) {
- parent = parent.$parent
- }
- parent.$children.push(vm)
- }
-
- vm.$parent = parent
- vm.$root = parent ? parent.$root : vm
-
- vm.$children = []
- vm.$refs = {}
-
- vm._watcher = null
- vm._inactive = null
- vm._directInactive = false
- vm._isMounted = false
- vm._isDestroyed = false
- vm._isBeingDestroyed = false
-}
-
-export function lifecycleMixin (Vue: Class<Component>) {
- Vue.prototype._update = function (vnode: VNode, hydrating?: boolean) {
- const vm: Component = this
- if (vm._isMounted) {
- callHook(vm, 'beforeUpdate')
- }
- const prevEl = vm.$el
- const prevVnode = vm._vnode
- const prevActiveInstance = activeInstance
- activeInstance = vm
- vm._vnode = vnode
- // Vue.prototype.__patch__ is injected in entry points
- // based on the rendering backend used.
- if (!prevVnode) {
- // initial render
- vm.$el = vm.__patch__(
- vm.$el, vnode, hydrating, false /* removeOnly */,
- vm.$options._parentElm,
- vm.$options._refElm
- )
- // no need for the ref nodes after initial patch
- // this prevents keeping a detached DOM tree in memory (#5851)
- vm.$options._parentElm = vm.$options._refElm = null
- } else {
- // updates
- vm.$el = vm.__patch__(prevVnode, vnode)
- }
- activeInstance = prevActiveInstance
- // update __vue__ reference
- if (prevEl) {
- prevEl.__vue__ = null
- }
- if (vm.$el) {
- vm.$el.__vue__ = vm
- }
- // if parent is an HOC, update its $el as well
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
- vm.$parent.$el = vm.$el
- }
- // updated hook is called by the scheduler to ensure that children are
- // updated in a parent's updated hook.
- }
-
- Vue.prototype.$forceUpdate = function () {
- const vm: Component = this
- if (vm._watcher) {
- vm._watcher.update()
- }
- }
-
- Vue.prototype.$destroy = function () {
- const vm: Component = this
- if (vm._isBeingDestroyed) {
- return
- }
- callHook(vm, 'beforeDestroy')
- vm._isBeingDestroyed = true
- // remove self from parent
- const parent = vm.$parent
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
- remove(parent.$children, vm)
- }
- // teardown watchers
- if (vm._watcher) {
- vm._watcher.teardown()
- }
- let i = vm._watchers.length
- while (i--) {
- vm._watchers[i].teardown()
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (vm._data.__ob__) {
- vm._data.__ob__.vmCount--
- }
- // call the last hook...
- vm._isDestroyed = true
- // invoke destroy hooks on current rendered tree
- vm.__patch__(vm._vnode, null)
- // fire destroyed hook
- callHook(vm, 'destroyed')
- // turn off all instance listeners.
- vm.$off()
- // remove __vue__ reference
- if (vm.$el) {
- vm.$el.__vue__ = null
- }
- // release circular reference (#6759)
- if (vm.$vnode) {
- vm.$vnode.parent = null
- }
- }
-}
-
-export function mountComponent (
- vm: Component,
- el: ?Element,
- hydrating?: boolean
-): Component {
- vm.$el = el
- if (!vm.$options.render) {
- vm.$options.render = createEmptyVNode
- if (process.env.NODE_ENV !== 'production') {
- /* istanbul ignore if */
- if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
- vm.$options.el || el) {
- warn(
- 'You are using the runtime-only build of Vue where the template ' +
- 'compiler is not available. Either pre-compile the templates into ' +
- 'render functions, or use the compiler-included build.',
- vm
- )
- } else {
- warn(
- 'Failed to mount component: template or render function not defined.',
- vm
- )
- }
- }
- }
- callHook(vm, 'beforeMount')
-
- let updateComponent
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- updateComponent = () => {
- const name = vm._name
- const id = vm._uid
- const startTag = `vue-perf-start:${id}`
- const endTag = `vue-perf-end:${id}`
-
- mark(startTag)
- const vnode = vm._render()
- mark(endTag)
- measure(`vue ${name} render`, startTag, endTag)
-
- mark(startTag)
- vm._update(vnode, hydrating)
- mark(endTag)
- measure(`vue ${name} patch`, startTag, endTag)
- }
- } else {
- updateComponent = () => {
- vm._update(vm._render(), hydrating)
- }
- }
-
- // we set this to vm._watcher inside the watcher's constructor
- // since the watcher's initial patch may call $forceUpdate (e.g. inside child
- // component's mounted hook), which relies on vm._watcher being already defined
- new Watcher(vm, updateComponent, noop, null, true /* isRenderWatcher */)
- hydrating = false
-
- // manually mounted instance, call mounted on self
- // mounted is called for render-created child components in its inserted hook
- if (vm.$vnode == null) {
- vm._isMounted = true
- callHook(vm, 'mounted')
- }
- return vm
-}
-
-export function updateChildComponent (
- vm: Component,
- propsData: ?Object,
- listeners: ?Object,
- parentVnode: MountedComponentVNode,
- renderChildren: ?Array<VNode>
-) {
- if (process.env.NODE_ENV !== 'production') {
- isUpdatingChildComponent = true
- }
-
- // determine whether component has slot children
- // we need to do this before overwriting $options._renderChildren
- const hasChildren = !!(
- renderChildren || // has new static slots
- vm.$options._renderChildren || // has old static slots
- parentVnode.data.scopedSlots || // has new scoped slots
- vm.$scopedSlots !== emptyObject // has old scoped slots
- )
-
- vm.$options._parentVnode = parentVnode
- vm.$vnode = parentVnode // update vm's placeholder node without re-render
-
- if (vm._vnode) { // update child tree's parent
- vm._vnode.parent = parentVnode
- }
- vm.$options._renderChildren = renderChildren
-
- // update $attrs and $listeners hash
- // these are also reactive so they may trigger child update if the child
- // used them during render
- vm.$attrs = parentVnode.data.attrs || emptyObject
- vm.$listeners = listeners || emptyObject
-
- // update props
- if (propsData && vm.$options.props) {
- toggleObserving(false)
- const props = vm._props
- const propKeys = vm.$options._propKeys || []
- for (let i = 0; i < propKeys.length; i++) {
- const key = propKeys[i]
- const propOptions: any = vm.$options.props // wtf flow?
- props[key] = validateProp(key, propOptions, propsData, vm)
- }
- toggleObserving(true)
- // keep a copy of raw propsData
- vm.$options.propsData = propsData
- }
-
- // update listeners
- listeners = listeners || emptyObject
- const oldListeners = vm.$options._parentListeners
- vm.$options._parentListeners = listeners
- updateComponentListeners(vm, listeners, oldListeners)
-
- // resolve slots + force update if has children
- if (hasChildren) {
- vm.$slots = resolveSlots(renderChildren, parentVnode.context)
- vm.$forceUpdate()
- }
-
- if (process.env.NODE_ENV !== 'production') {
- isUpdatingChildComponent = false
- }
-}
-
-function isInInactiveTree (vm) {
- while (vm && (vm = vm.$parent)) {
- if (vm._inactive) return true
- }
- return false
-}
-
-export function activateChildComponent (vm: Component, direct?: boolean) {
- if (direct) {
- vm._directInactive = false
- if (isInInactiveTree(vm)) {
- return
- }
- } else if (vm._directInactive) {
- return
- }
- if (vm._inactive || vm._inactive === null) {
- vm._inactive = false
- for (let i = 0; i < vm.$children.length; i++) {
- activateChildComponent(vm.$children[i])
- }
- callHook(vm, 'activated')
- }
-}
-
-export function deactivateChildComponent (vm: Component, direct?: boolean) {
- if (direct) {
- vm._directInactive = true
- if (isInInactiveTree(vm)) {
- return
- }
- }
- if (!vm._inactive) {
- vm._inactive = true
- for (let i = 0; i < vm.$children.length; i++) {
- deactivateChildComponent(vm.$children[i])
- }
- callHook(vm, 'deactivated')
- }
-}
-
-export function callHook (vm: Component, hook: string) {
- // #7573 disable dep collection when invoking lifecycle hooks
- pushTarget()
- const handlers = vm.$options[hook]
- if (handlers) {
- for (let i = 0, j = handlers.length; i < j; i++) {
- try {
- handlers[i].call(vm)
- } catch (e) {
- handleError(e, vm, `${hook} hook`)
- }
- }
- }
- if (vm._hasHookEvent) {
- vm.$emit('hook:' + hook)
- }
- popTarget()
-}
+++ /dev/null
-/* not type checking this file because flow doesn't play well with Proxy */
-
-import config from 'core/config'
-import { warn, makeMap, isNative } from '../util/index'
-
-let initProxy
-
-if (process.env.NODE_ENV !== 'production') {
- const allowedGlobals = makeMap(
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
- 'require' // for Webpack/Browserify
- )
-
- const warnNonPresent = (target, key) => {
- warn(
- `Property or method "${key}" is not defined on the instance but ` +
- '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
- )
- }
-
- const hasProxy =
- typeof Proxy !== 'undefined' && isNative(Proxy)
-
- if (hasProxy) {
- const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact')
- config.keyCodes = new Proxy(config.keyCodes, {
- set (target, key, value) {
- if (isBuiltInModifier(key)) {
- warn(`Avoid overwriting built-in modifier in config.keyCodes: .${key}`)
- return false
- } else {
- target[key] = value
- return true
- }
- }
- })
- }
-
- const hasHandler = {
- has (target, key) {
- const has = key in target
- const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'
- if (!has && !isAllowed) {
- warnNonPresent(target, key)
- }
- return has || !isAllowed
- }
- }
-
- const getHandler = {
- get (target, key) {
- if (typeof key === 'string' && !(key in target)) {
- warnNonPresent(target, key)
- }
- return target[key]
- }
- }
-
- initProxy = function initProxy (vm) {
- if (hasProxy) {
- // determine which proxy handler to use
- const options = vm.$options
- const handlers = options.render && options.render._withStripped
- ? getHandler
- : hasHandler
- vm._renderProxy = new Proxy(vm, handlers)
- } else {
- vm._renderProxy = vm
- }
- }
-}
-
-export { initProxy }
+++ /dev/null
-/* @flow */
-
-import { warn, extend, isPlainObject } from 'core/util/index'
-
-export function bindObjectListeners (data: any, value: any): VNodeData {
- if (value) {
- if (!isPlainObject(value)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'v-on without argument expects an Object value',
- this
- )
- } else {
- const on = data.on = data.on ? extend({}, data.on) : {}
- for (const key in value) {
- const existing = on[key]
- const ours = value[key]
- on[key] = existing ? [].concat(existing, ours) : ours
- }
- }
- }
- return data
-}
+++ /dev/null
-/* @flow */
-
-import config from 'core/config'
-
-import {
- warn,
- isObject,
- toObject,
- isReservedAttribute
-} from 'core/util/index'
-
-/**
- * Runtime helper for merging v-bind="object" into a VNode's data.
- */
-export function bindObjectProps (
- data: any,
- tag: string,
- value: any,
- asProp: boolean,
- isSync?: boolean
-): VNodeData {
- if (value) {
- if (!isObject(value)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'v-bind without argument expects an Object or Array value',
- this
- )
- } else {
- if (Array.isArray(value)) {
- value = toObject(value)
- }
- let hash
- for (const key in value) {
- if (
- key === 'class' ||
- key === 'style' ||
- isReservedAttribute(key)
- ) {
- hash = data
- } else {
- const 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) {
- const on = data.on || (data.on = {})
- on[`update:${key}`] = function ($event) {
- value[key] = $event
- }
- }
- }
- }
- }
- }
- return data
-}
+++ /dev/null
-/* @flow */
-
-import config from 'core/config'
-import { hyphenate } from 'shared/util'
-
-function isKeyNotMatch<T> (expect: T | Array<T>, actual: T): boolean {
- if (Array.isArray(expect)) {
- return expect.indexOf(actual) === -1
- } else {
- return expect !== actual
- }
-}
-
-/**
- * Runtime helper for checking keyCodes from config.
- * exposed as Vue.prototype._k
- * passing in eventKeyName as last argument separately for backwards compat
- */
-export function checkKeyCodes (
- eventKeyCode: number,
- key: string,
- builtInKeyCode?: number | Array<number>,
- eventKeyName?: string,
- builtInKeyName?: string | Array<string>
-): ?boolean {
- const mappedKeyCode = config.keyCodes[key] || builtInKeyCode
- if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
- return isKeyNotMatch(builtInKeyName, eventKeyName)
- } else if (mappedKeyCode) {
- return isKeyNotMatch(mappedKeyCode, eventKeyCode)
- } else if (eventKeyName) {
- return hyphenate(eventKeyName) !== key
- }
-}
+++ /dev/null
-/* @flow */
-
-import { toNumber, toString, looseEqual, looseIndexOf } from 'shared/util'
-import { createTextVNode, createEmptyVNode } from 'core/vdom/vnode'
-import { renderList } from './render-list'
-import { renderSlot } from './render-slot'
-import { resolveFilter } from './resolve-filter'
-import { checkKeyCodes } from './check-keycodes'
-import { bindObjectProps } from './bind-object-props'
-import { renderStatic, markOnce } from './render-static'
-import { bindObjectListeners } from './bind-object-listeners'
-import { resolveScopedSlots } from './resolve-slots'
-
-export function installRenderHelpers (target: any) {
- 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
-}
+++ /dev/null
-/* @flow */
-
-import { isObject, isDef } from 'core/util/index'
-
-/**
- * Runtime helper for rendering v-for lists.
- */
-export function renderList (
- val: any,
- render: (
- val: any,
- keyOrIndex: string | number,
- index?: number
- ) => VNode
-): ?Array<VNode> {
- let ret: ?Array<VNode>, 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: any)._isVList = true
- }
- return ret
-}
+++ /dev/null
-/* @flow */
-
-import { extend, warn, isObject } from 'core/util/index'
-
-/**
- * Runtime helper for rendering <slot>
- */
-export function renderSlot (
- name: string,
- fallback: ?Array<VNode>,
- props: ?Object,
- bindObject: ?Object
-): ?Array<VNode> {
- const scopedSlotFn = this.$scopedSlots[name]
- let nodes
- if (scopedSlotFn) { // scoped slot
- props = props || {}
- if (bindObject) {
- if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
- warn(
- 'slot v-bind without argument expects an Object',
- this
- )
- }
- props = extend(extend({}, bindObject), props)
- }
- nodes = scopedSlotFn(props) || fallback
- } else {
- const slotNodes = this.$slots[name]
- // warn duplicate slot usage
- if (slotNodes) {
- if (process.env.NODE_ENV !== '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
- }
- nodes = slotNodes || fallback
- }
-
- const target = props && props.slot
- if (target) {
- return this.$createElement('template', { slot: target }, nodes)
- } else {
- return nodes
- }
-}
+++ /dev/null
-/* @flow */
-
-/**
- * Runtime helper for rendering static trees.
- */
-export function renderStatic (
- index: number,
- isInFor: boolean
-): VNode | Array<VNode> {
- const cached = this._staticTrees || (this._staticTrees = [])
- let tree = cached[index]
- // if has already-rendered static tree and not inside v-for,
- // we can reuse the same tree.
- if (tree && !isInFor) {
- return tree
- }
- // otherwise, render a fresh tree.
- tree = cached[index] = this.$options.staticRenderFns[index].call(
- this._renderProxy,
- null,
- this // for render fns generated for functional component templates
- )
- markStatic(tree, `__static__${index}`, false)
- return tree
-}
-
-/**
- * Runtime helper for v-once.
- * Effectively it means marking the node as static with a unique key.
- */
-export function markOnce (
- tree: VNode | Array<VNode>,
- index: number,
- key: string
-) {
- markStatic(tree, `__once__${index}${key ? `_${key}` : ``}`, true)
- return tree
-}
-
-function markStatic (
- tree: VNode | Array<VNode>,
- key: string,
- isOnce: boolean
-) {
- if (Array.isArray(tree)) {
- for (let 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
-}
+++ /dev/null
-/* @flow */
-
-import { identity, resolveAsset } from 'core/util/index'
-
-/**
- * Runtime helper for resolving filters
- */
-export function resolveFilter (id: string): Function {
- return resolveAsset(this.$options, 'filters', id, true) || identity
-}
+++ /dev/null
-/* @flow */
-
-import type VNode from 'core/vdom/vnode'
-
-/**
- * Runtime helper for resolving raw children VNodes into a slot object.
- */
-export function resolveSlots (
- children: ?Array<VNode>,
- context: ?Component
-): { [key: string]: Array<VNode> } {
- const slots = {}
- if (!children) {
- return slots
- }
- for (let i = 0, l = children.length; i < l; i++) {
- const child = children[i]
- const data = child.data
- // remove slot attribute if the node is resolved as a Vue slot node
- if (data && data.attrs && data.attrs.slot) {
- delete data.attrs.slot
- }
- // named slots should only be respected if the vnode was rendered in the
- // same context.
- if ((child.context === context || child.fnContext === context) &&
- data && data.slot != null
- ) {
- const name = data.slot
- const slot = (slots[name] || (slots[name] = []))
- if (child.tag === 'template') {
- slot.push.apply(slot, child.children || [])
- } else {
- slot.push(child)
- }
- } else {
- (slots.default || (slots.default = [])).push(child)
- }
- }
- // ignore slots that contains only whitespace
- for (const name in slots) {
- if (slots[name].every(isWhitespace)) {
- delete slots[name]
- }
- }
- return slots
-}
-
-function isWhitespace (node: VNode): boolean {
- return (node.isComment && !node.asyncFactory) || node.text === ' '
-}
-
-export function resolveScopedSlots (
- fns: ScopedSlotsData, // see flow/vnode
- res?: Object
-): { [key: string]: Function } {
- res = res || {}
- for (let i = 0; i < fns.length; i++) {
- if (Array.isArray(fns[i])) {
- resolveScopedSlots(fns[i], res)
- } else {
- res[fns[i].key] = fns[i].fn
- }
- }
- return res
-}
+++ /dev/null
-/* @flow */
-
-import {
- warn,
- nextTick,
- emptyObject,
- handleError,
- defineReactive
-} from '../util/index'
-
-import { createElement } from '../vdom/create-element'
-import { installRenderHelpers } from './render-helpers/index'
-import { resolveSlots } from './render-helpers/resolve-slots'
-import VNode, { createEmptyVNode } from '../vdom/vnode'
-
-import { isUpdatingChildComponent } from './lifecycle'
-
-export function initRender (vm: Component) {
- vm._vnode = null // the root of the child tree
- vm._staticTrees = null // v-once cached trees
- const options = vm.$options
- const parentVnode = vm.$vnode = options._parentVnode // the placeholder node in parent tree
- const renderContext = parentVnode && parentVnode.context
- 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.
- // args order: tag, data, children, normalizationType, alwaysNormalize
- // internal version is used by render functions compiled from templates
- vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)
- // normalization is always applied for the public version, used in
- // user-written render functions.
- vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)
-
- // $attrs & $listeners are exposed for easier HOC creation.
- // they need to be reactive so that HOCs using them are always updated
- const parentData = parentVnode && parentVnode.data
-
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, () => {
- !isUpdatingChildComponent && warn(`$attrs is readonly.`, vm)
- }, true)
- defineReactive(vm, '$listeners', options._parentListeners || emptyObject, () => {
- !isUpdatingChildComponent && warn(`$listeners is readonly.`, vm)
- }, true)
- } else {
- defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true)
- defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true)
- }
-}
-
-export function renderMixin (Vue: Class<Component>) {
- // install runtime convenience helpers
- installRenderHelpers(Vue.prototype)
-
- Vue.prototype.$nextTick = function (fn: Function) {
- return nextTick(fn, this)
- }
-
- Vue.prototype._render = function (): VNode {
- const vm: Component = this
- const { render, _parentVnode } = vm.$options
-
- // reset _rendered flag on slots for duplicate slot check
- if (process.env.NODE_ENV !== 'production') {
- for (const key in vm.$slots) {
- // $flow-disable-line
- vm.$slots[key]._rendered = false
- }
- }
-
- if (_parentVnode) {
- vm.$scopedSlots = _parentVnode.data.scopedSlots || emptyObject
- }
-
- // set parent vnode. this allows render functions to have access
- // to the data on the placeholder node.
- vm.$vnode = _parentVnode
- // render self
- let vnode
- try {
- vnode = render.call(vm._renderProxy, vm.$createElement)
- } catch (e) {
- handleError(e, vm, `render`)
- // return error render result,
- // or previous vnode to prevent render error causing blank component
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- 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
- }
- }
- // return empty vnode in case the render function errored out
- if (!(vnode instanceof VNode)) {
- if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
- warn(
- 'Multiple root nodes returned from render function. Render function ' +
- 'should return a single root node.',
- vm
- )
- }
- vnode = createEmptyVNode()
- }
- // set parent
- vnode.parent = _parentVnode
- return vnode
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import Watcher from '../observer/watcher'
-import Dep, { pushTarget, popTarget } from '../observer/dep'
-import { isUpdatingChildComponent } from './lifecycle'
-
-import {
- set,
- del,
- observe,
- defineReactive,
- toggleObserving
-} from '../observer/index'
-
-import {
- warn,
- bind,
- noop,
- hasOwn,
- hyphenate,
- isReserved,
- handleError,
- nativeWatch,
- validateProp,
- isPlainObject,
- isServerRendering,
- isReservedAttribute
-} from '../util/index'
-
-const sharedPropertyDefinition = {
- enumerable: true,
- configurable: true,
- get: noop,
- set: noop
-}
-
-export function proxy (target: Object, sourceKey: string, key: string) {
- sharedPropertyDefinition.get = function proxyGetter () {
- return this[sourceKey][key]
- }
- sharedPropertyDefinition.set = function proxySetter (val) {
- this[sourceKey][key] = val
- }
- Object.defineProperty(target, key, sharedPropertyDefinition)
-}
-
-export function initState (vm: Component) {
- vm._watchers = []
- const opts = vm.$options
- if (opts.props) initProps(vm, opts.props)
- if (opts.methods) initMethods(vm, opts.methods)
- if (opts.data) {
- initData(vm)
- } else {
- observe(vm._data = {}, true /* asRootData */)
- }
- if (opts.computed) initComputed(vm, opts.computed)
- if (opts.watch && opts.watch !== nativeWatch) {
- initWatch(vm, opts.watch)
- }
-}
-
-function initProps (vm: Component, propsOptions: Object) {
- const propsData = vm.$options.propsData || {}
- const props = vm._props = {}
- // cache prop keys so that future props updates can iterate using Array
- // instead of dynamic object key enumeration.
- const keys = vm.$options._propKeys = []
- const isRoot = !vm.$parent
- // root instance props should be converted
- if (!isRoot) {
- toggleObserving(false)
- }
- for (const key in propsOptions) {
- keys.push(key)
- const value = validateProp(key, propsOptions, propsData, vm)
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- const hyphenatedKey = hyphenate(key)
- if (isReservedAttribute(hyphenatedKey) ||
- config.isReservedAttr(hyphenatedKey)) {
- warn(
- `"${hyphenatedKey}" is a reserved attribute and cannot be used as component prop.`,
- vm
- )
- }
- defineReactive(props, key, value, () => {
- if (vm.$parent && !isUpdatingChildComponent) {
- warn(
- `Avoid mutating a prop directly since the value will be ` +
- `overwritten whenever the parent component re-renders. ` +
- `Instead, use a data or computed property based on the prop's ` +
- `value. Prop being mutated: "${key}"`,
- vm
- )
- }
- })
- } else {
- 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
- // instantiation here.
- if (!(key in vm)) {
- proxy(vm, `_props`, key)
- }
- }
- toggleObserving(true)
-}
-
-function initData (vm: Component) {
- let data = vm.$options.data
- data = vm._data = typeof data === 'function'
- ? getData(data, vm)
- : data || {}
- if (!isPlainObject(data)) {
- data = {}
- process.env.NODE_ENV !== 'production' && warn(
- 'data functions should return an object:\n' +
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
- vm
- )
- }
- // proxy data on instance
- const keys = Object.keys(data)
- const props = vm.$options.props
- const methods = vm.$options.methods
- let i = keys.length
- while (i--) {
- const key = keys[i]
- if (process.env.NODE_ENV !== 'production') {
- if (methods && hasOwn(methods, key)) {
- warn(
- `Method "${key}" has already been defined as a data property.`,
- vm
- )
- }
- }
- if (props && hasOwn(props, key)) {
- process.env.NODE_ENV !== 'production' && warn(
- `The data property "${key}" is already declared as a prop. ` +
- `Use prop default value instead.`,
- vm
- )
- } else if (!isReserved(key)) {
- proxy(vm, `_data`, key)
- }
- }
- // observe data
- observe(data, true /* asRootData */)
-}
-
-export function getData (data: Function, vm: Component): any {
- // #7573 disable dep collection when invoking data getters
- pushTarget()
- try {
- return data.call(vm, vm)
- } catch (e) {
- handleError(e, vm, `data()`)
- return {}
- } finally {
- popTarget()
- }
-}
-
-const computedWatcherOptions = { lazy: true }
-
-function initComputed (vm: Component, computed: Object) {
- // $flow-disable-line
- const watchers = vm._computedWatchers = Object.create(null)
- // computed properties are just getters during SSR
- const isSSR = isServerRendering()
-
- for (const key in computed) {
- const userDef = computed[key]
- const getter = typeof userDef === 'function' ? userDef : userDef.get
- if (process.env.NODE_ENV !== 'production' && getter == null) {
- warn(
- `Getter is missing for computed property "${key}".`,
- vm
- )
- }
-
- if (!isSSR) {
- // create internal watcher for the computed property.
- watchers[key] = new Watcher(
- vm,
- getter || noop,
- noop,
- computedWatcherOptions
- )
- }
-
- // component-defined computed properties are already defined on the
- // component prototype. We only need to define computed properties defined
- // at instantiation here.
- if (!(key in vm)) {
- defineComputed(vm, key, userDef)
- } else if (process.env.NODE_ENV !== 'production') {
- if (key in vm.$data) {
- warn(`The computed property "${key}" is already defined in data.`, vm)
- } else if (vm.$options.props && key in vm.$options.props) {
- warn(`The computed property "${key}" is already defined as a prop.`, vm)
- }
- }
- }
-}
-
-export function defineComputed (
- target: any,
- key: string,
- userDef: Object | Function
-) {
- const shouldCache = !isServerRendering()
- if (typeof userDef === 'function') {
- sharedPropertyDefinition.get = shouldCache
- ? createComputedGetter(key)
- : userDef
- sharedPropertyDefinition.set = noop
- } else {
- sharedPropertyDefinition.get = userDef.get
- ? shouldCache && userDef.cache !== false
- ? createComputedGetter(key)
- : userDef.get
- : noop
- sharedPropertyDefinition.set = userDef.set
- ? userDef.set
- : noop
- }
- if (process.env.NODE_ENV !== 'production' &&
- sharedPropertyDefinition.set === noop) {
- sharedPropertyDefinition.set = function () {
- warn(
- `Computed property "${key}" was assigned to but it has no setter.`,
- this
- )
- }
- }
- Object.defineProperty(target, key, sharedPropertyDefinition)
-}
-
-function createComputedGetter (key) {
- return function computedGetter () {
- const watcher = this._computedWatchers && this._computedWatchers[key]
- if (watcher) {
- if (watcher.dirty) {
- watcher.evaluate()
- }
- if (Dep.target) {
- watcher.depend()
- }
- return watcher.value
- }
- }
-}
-
-function initMethods (vm: Component, methods: Object) {
- const props = vm.$options.props
- for (const key in methods) {
- if (process.env.NODE_ENV !== 'production') {
- if (methods[key] == null) {
- warn(
- `Method "${key}" has an undefined value in the component definition. ` +
- `Did you reference the function correctly?`,
- vm
- )
- }
- if (props && hasOwn(props, key)) {
- warn(
- `Method "${key}" has already been defined as a prop.`,
- vm
- )
- }
- if ((key in vm) && isReserved(key)) {
- warn(
- `Method "${key}" conflicts with an existing Vue instance method. ` +
- `Avoid defining component methods that start with _ or $.`
- )
- }
- }
- vm[key] = methods[key] == null ? noop : bind(methods[key], vm)
- }
-}
-
-function initWatch (vm: Component, watch: Object) {
- for (const key in watch) {
- const handler = watch[key]
- if (Array.isArray(handler)) {
- for (let i = 0; i < handler.length; i++) {
- createWatcher(vm, key, handler[i])
- }
- } else {
- createWatcher(vm, key, handler)
- }
- }
-}
-
-function createWatcher (
- vm: Component,
- expOrFn: string | Function,
- handler: any,
- options?: Object
-) {
- if (isPlainObject(handler)) {
- options = handler
- handler = handler.handler
- }
- if (typeof handler === 'string') {
- handler = vm[handler]
- }
- return vm.$watch(expOrFn, handler, options)
-}
-
-export function stateMixin (Vue: Class<Component>) {
- // flow somehow has problems with directly declared definition object
- // when using Object.defineProperty, so we have to procedurally build up
- // the object here.
- const dataDef = {}
- dataDef.get = function () { return this._data }
- const propsDef = {}
- propsDef.get = function () { return this._props }
- if (process.env.NODE_ENV !== 'production') {
- dataDef.set = function (newData: Object) {
- warn(
- 'Avoid replacing instance root $data. ' +
- 'Use nested data properties instead.',
- this
- )
- }
- propsDef.set = function () {
- warn(`$props is readonly.`, this)
- }
- }
- Object.defineProperty(Vue.prototype, '$data', dataDef)
- Object.defineProperty(Vue.prototype, '$props', propsDef)
-
- Vue.prototype.$set = set
- Vue.prototype.$delete = del
-
- Vue.prototype.$watch = function (
- expOrFn: string | Function,
- cb: any,
- options?: Object
- ): Function {
- const vm: Component = this
- if (isPlainObject(cb)) {
- return createWatcher(vm, expOrFn, cb, options)
- }
- options = options || {}
- options.user = true
- const watcher = new Watcher(vm, expOrFn, cb, options)
- if (options.immediate) {
- cb.call(vm, watcher.value)
- }
- return function unwatchFn () {
- watcher.teardown()
- }
- }
-}
+++ /dev/null
-/*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
-import { def } from '../util/index'
-
-const arrayProto = Array.prototype
-export const arrayMethods = Object.create(arrayProto)
-
-const methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
-]
-
-/**
- * Intercept mutating methods and emit events
- */
-methodsToPatch.forEach(function (method) {
- // cache original method
- const original = arrayProto[method]
- def(arrayMethods, method, function mutator (...args) {
- const result = original.apply(this, args)
- const ob = this.__ob__
- let inserted
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args
- break
- case 'splice':
- inserted = args.slice(2)
- break
- }
- if (inserted) ob.observeArray(inserted)
- // notify change
- ob.dep.notify()
- return result
- })
-})
+++ /dev/null
-/* @flow */
-
-import type Watcher from './watcher'
-import { remove } from '../util/index'
-
-let uid = 0
-
-/**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
-export default class Dep {
- static target: ?Watcher;
- id: number;
- subs: Array<Watcher>;
-
- constructor () {
- this.id = uid++
- this.subs = []
- }
-
- addSub (sub: Watcher) {
- this.subs.push(sub)
- }
-
- removeSub (sub: Watcher) {
- remove(this.subs, sub)
- }
-
- depend () {
- if (Dep.target) {
- Dep.target.addDep(this)
- }
- }
-
- notify () {
- // stabilize the subscriber list first
- const subs = this.subs.slice()
- for (let i = 0, l = subs.length; i < l; i++) {
- subs[i].update()
- }
- }
-}
-
-// the current target watcher being evaluated.
-// this is globally unique because there could be only one
-// watcher being evaluated at any time.
-Dep.target = null
-const targetStack = []
-
-export function pushTarget (_target: ?Watcher) {
- if (Dep.target) targetStack.push(Dep.target)
- Dep.target = _target
-}
-
-export function popTarget () {
- Dep.target = targetStack.pop()
-}
+++ /dev/null
-/* @flow */
-
-import Dep from './dep'
-import VNode from '../vdom/vnode'
-import { arrayMethods } from './array'
-import {
- def,
- warn,
- hasOwn,
- hasProto,
- isObject,
- isPlainObject,
- isPrimitive,
- isUndef,
- isValidArrayIndex,
- isServerRendering
-} from '../util/index'
-
-const arrayKeys = Object.getOwnPropertyNames(arrayMethods)
-
-/**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
-export let shouldObserve: boolean = true
-
-export function toggleObserving (value: boolean) {
- shouldObserve = value
-}
-
-/**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
-export class Observer {
- value: any;
- dep: Dep;
- vmCount: number; // number of vms that has this object as root $data
-
- constructor (value: any) {
- this.value = value
- this.dep = new Dep()
- this.vmCount = 0
- def(value, '__ob__', this)
- if (Array.isArray(value)) {
- const augment = hasProto
- ? protoAugment
- : copyAugment
- augment(value, arrayMethods, arrayKeys)
- this.observeArray(value)
- } else {
- this.walk(value)
- }
- }
-
- /**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
- walk (obj: Object) {
- const keys = Object.keys(obj)
- for (let i = 0; i < keys.length; i++) {
- defineReactive(obj, keys[i])
- }
- }
-
- /**
- * Observe a list of Array items.
- */
- observeArray (items: Array<any>) {
- for (let i = 0, l = items.length; i < l; i++) {
- observe(items[i])
- }
- }
-}
-
-// helpers
-
-/**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- */
-function protoAugment (target, src: Object, keys: any) {
- /* eslint-disable no-proto */
- target.__proto__ = src
- /* eslint-enable no-proto */
-}
-
-/**
- * Augment an target Object or Array by defining
- * hidden properties.
- */
-/* istanbul ignore next */
-function copyAugment (target: Object, src: Object, keys: Array<string>) {
- for (let i = 0, l = keys.length; i < l; i++) {
- const key = keys[i]
- def(target, key, src[key])
- }
-}
-
-/**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
-export function observe (value: any, asRootData: ?boolean): Observer | void {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- let ob: Observer | void
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value)
- }
- if (asRootData && ob) {
- ob.vmCount++
- }
- return ob
-}
-
-/**
- * Define a reactive property on an Object.
- */
-export function defineReactive (
- obj: Object,
- key: string,
- val: any,
- customSetter?: ?Function,
- shallow?: boolean
-) {
- const dep = new Dep()
-
- const property = Object.getOwnPropertyDescriptor(obj, key)
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- const getter = property && property.get
- if (!getter && arguments.length === 2) {
- val = obj[key]
- }
- const setter = property && property.set
-
- let childOb = !shallow && observe(val)
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- const value = getter ? getter.call(obj) : val
- if (Dep.target) {
- dep.depend()
- if (childOb) {
- childOb.dep.depend()
- if (Array.isArray(value)) {
- dependArray(value)
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- const value = getter ? getter.call(obj) : val
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if (process.env.NODE_ENV !== 'production' && customSetter) {
- customSetter()
- }
- if (setter) {
- setter.call(obj, newVal)
- } else {
- val = newVal
- }
- childOb = !shallow && observe(newVal)
- dep.notify()
- }
- })
-}
-
-/**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
-export function set (target: Array<any> | Object, key: any, val: any): any {
- if (process.env.NODE_ENV !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn(`Cannot set reactive property on undefined, null, or primitive value: ${(target: any)}`)
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key)
- target.splice(key, 1, val)
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val
- return val
- }
- const ob = (target: any).__ob__
- if (target._isVue || (ob && ob.vmCount)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- )
- return val
- }
- if (!ob) {
- target[key] = val
- return val
- }
- defineReactive(ob.value, key, val)
- ob.dep.notify()
- return val
-}
-
-/**
- * Delete a property and trigger change if necessary.
- */
-export function del (target: Array<any> | Object, key: any) {
- if (process.env.NODE_ENV !== 'production' &&
- (isUndef(target) || isPrimitive(target))
- ) {
- warn(`Cannot delete reactive property on undefined, null, or primitive value: ${(target: any)}`)
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.splice(key, 1)
- return
- }
- const ob = (target: any).__ob__
- if (target._isVue || (ob && ob.vmCount)) {
- process.env.NODE_ENV !== 'production' && warn(
- 'Avoid deleting properties on a Vue instance or its root $data ' +
- '- just set it to null.'
- )
- return
- }
- if (!hasOwn(target, key)) {
- return
- }
- delete target[key]
- if (!ob) {
- return
- }
- ob.dep.notify()
-}
-
-/**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
-function dependArray (value: Array<any>) {
- for (let e, i = 0, l = value.length; i < l; i++) {
- e = value[i]
- e && e.__ob__ && e.__ob__.dep.depend()
- if (Array.isArray(e)) {
- dependArray(e)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import type Watcher from './watcher'
-import config from '../config'
-import { callHook, activateChildComponent } from '../instance/lifecycle'
-
-import {
- warn,
- nextTick,
- devtools
-} from '../util/index'
-
-export const MAX_UPDATE_COUNT = 100
-
-const queue: Array<Watcher> = []
-const activatedChildren: Array<Component> = []
-let has: { [key: number]: ?true } = {}
-let circular: { [key: number]: number } = {}
-let waiting = false
-let flushing = false
-let index = 0
-
-/**
- * Reset the scheduler's state.
- */
-function resetSchedulerState () {
- index = queue.length = activatedChildren.length = 0
- has = {}
- if (process.env.NODE_ENV !== 'production') {
- circular = {}
- }
- waiting = flushing = false
-}
-
-/**
- * Flush both queues and run the watchers.
- */
-function flushSchedulerQueue () {
- flushing = true
- let watcher, id
-
- // Sort queue before flush.
- // This ensures that:
- // 1. Components are updated from parent to child. (because parent is always
- // created before the child)
- // 2. A component's user watchers are run before its render watcher (because
- // user watchers are created before the render watcher)
- // 3. If a component is destroyed during a parent component's watcher run,
- // its watchers can be skipped.
- queue.sort((a, b) => a.id - b.id)
-
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (index = 0; index < queue.length; index++) {
- watcher = queue[index]
- id = watcher.id
- has[id] = null
- watcher.run()
- // in dev build, check and stop circular updates.
- if (process.env.NODE_ENV !== 'production' && has[id] != null) {
- circular[id] = (circular[id] || 0) + 1
- if (circular[id] > MAX_UPDATE_COUNT) {
- warn(
- 'You may have an infinite update loop ' + (
- watcher.user
- ? `in watcher with expression "${watcher.expression}"`
- : `in a component render function.`
- ),
- watcher.vm
- )
- break
- }
- }
- }
-
- // keep copies of post queues before resetting state
- const activatedQueue = activatedChildren.slice()
- const updatedQueue = queue.slice()
-
- resetSchedulerState()
-
- // call component updated and activated hooks
- callActivatedHooks(activatedQueue)
- callUpdatedHooks(updatedQueue)
-
- // devtool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush')
- }
-}
-
-function callUpdatedHooks (queue) {
- let i = queue.length
- while (i--) {
- const watcher = queue[i]
- const vm = watcher.vm
- if (vm._watcher === watcher && vm._isMounted) {
- callHook(vm, 'updated')
- }
- }
-}
-
-/**
- * Queue a kept-alive component that was activated during patch.
- * The queue will be processed after the entire tree has been patched.
- */
-export function queueActivatedComponent (vm: Component) {
- // setting _inactive to false here so that a render function can
- // rely on checking whether it's in an inactive tree (e.g. router-view)
- vm._inactive = false
- activatedChildren.push(vm)
-}
-
-function callActivatedHooks (queue) {
- for (let i = 0; i < queue.length; i++) {
- queue[i]._inactive = true
- activateChildComponent(queue[i], true /* true */)
- }
-}
-
-/**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- */
-export function queueWatcher (watcher: Watcher) {
- const id = watcher.id
- if (has[id] == null) {
- has[id] = true
- if (!flushing) {
- queue.push(watcher)
- } else {
- // if already flushing, splice the watcher based on its id
- // if already past its id, it will be run next immediately.
- let i = queue.length - 1
- while (i > index && queue[i].id > watcher.id) {
- i--
- }
- queue.splice(i + 1, 0, watcher)
- }
- // queue the flush
- if (!waiting) {
- waiting = true
- nextTick(flushSchedulerQueue)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { _Set as Set, isObject } from '../util/index'
-import type { SimpleSet } from '../util/index'
-import VNode from '../vdom/vnode'
-
-const seenObjects = new Set()
-
-/**
- * Recursively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- */
-export function traverse (val: any) {
- _traverse(val, seenObjects)
- seenObjects.clear()
-}
-
-function _traverse (val: any, seen: SimpleSet) {
- let i, keys
- const isA = Array.isArray(val)
- if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
- return
- }
- if (val.__ob__) {
- const depId = val.__ob__.dep.id
- if (seen.has(depId)) {
- return
- }
- seen.add(depId)
- }
- if (isA) {
- i = val.length
- while (i--) _traverse(val[i], seen)
- } else {
- keys = Object.keys(val)
- i = keys.length
- while (i--) _traverse(val[keys[i]], seen)
- }
-}
+++ /dev/null
-/* @flow */
-
-import {
- warn,
- remove,
- isObject,
- parsePath,
- _Set as Set,
- handleError
-} from '../util/index'
-
-import { traverse } from './traverse'
-import { queueWatcher } from './scheduler'
-import Dep, { pushTarget, popTarget } from './dep'
-
-import type { SimpleSet } from '../util/index'
-
-let uid = 0
-
-/**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- */
-export default class Watcher {
- vm: Component;
- expression: string;
- cb: Function;
- id: number;
- deep: boolean;
- user: boolean;
- lazy: boolean;
- sync: boolean;
- dirty: boolean;
- active: boolean;
- deps: Array<Dep>;
- newDeps: Array<Dep>;
- depIds: SimpleSet;
- newDepIds: SimpleSet;
- getter: Function;
- value: any;
-
- constructor (
- vm: Component,
- expOrFn: string | Function,
- cb: Function,
- options?: ?Object,
- isRenderWatcher?: boolean
- ) {
- this.vm = vm
- if (isRenderWatcher) {
- vm._watcher = this
- }
- vm._watchers.push(this)
- // options
- if (options) {
- this.deep = !!options.deep
- this.user = !!options.user
- this.lazy = !!options.lazy
- this.sync = !!options.sync
- } else {
- this.deep = this.user = this.lazy = this.sync = false
- }
- this.cb = cb
- this.id = ++uid // uid for batching
- this.active = true
- this.dirty = this.lazy // for lazy watchers
- this.deps = []
- this.newDeps = []
- this.depIds = new Set()
- this.newDepIds = new Set()
- this.expression = process.env.NODE_ENV !== 'production'
- ? expOrFn.toString()
- : ''
- // parse expression for getter
- if (typeof expOrFn === 'function') {
- this.getter = expOrFn
- } else {
- this.getter = parsePath(expOrFn)
- if (!this.getter) {
- this.getter = function () {}
- process.env.NODE_ENV !== 'production' && warn(
- `Failed watching path: "${expOrFn}" ` +
- 'Watcher only accepts simple dot-delimited paths. ' +
- 'For full control, use a function instead.',
- vm
- )
- }
- }
- this.value = this.lazy
- ? undefined
- : this.get()
- }
-
- /**
- * Evaluate the getter, and re-collect dependencies.
- */
- get () {
- pushTarget(this)
- let value
- const vm = this.vm
- try {
- value = this.getter.call(vm, vm)
- } catch (e) {
- if (this.user) {
- handleError(e, vm, `getter for watcher "${this.expression}"`)
- } else {
- throw e
- }
- } finally {
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value)
- }
- popTarget()
- this.cleanupDeps()
- }
- return value
- }
-
- /**
- * Add a dependency to this directive.
- */
- addDep (dep: Dep) {
- const id = dep.id
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id)
- this.newDeps.push(dep)
- if (!this.depIds.has(id)) {
- dep.addSub(this)
- }
- }
- }
-
- /**
- * Clean up for dependency collection.
- */
- cleanupDeps () {
- let i = this.deps.length
- while (i--) {
- const dep = this.deps[i]
- if (!this.newDepIds.has(dep.id)) {
- dep.removeSub(this)
- }
- }
- let tmp = this.depIds
- this.depIds = this.newDepIds
- this.newDepIds = tmp
- this.newDepIds.clear()
- tmp = this.deps
- this.deps = this.newDeps
- this.newDeps = tmp
- this.newDeps.length = 0
- }
-
- /**
- * Subscriber interface.
- * Will be called when a dependency changes.
- */
- update () {
- /* istanbul ignore else */
- if (this.lazy) {
- this.dirty = true
- } else if (this.sync) {
- this.run()
- } else {
- queueWatcher(this)
- }
- }
-
- /**
- * Scheduler job interface.
- * Will be called by the scheduler.
- */
- run () {
- if (this.active) {
- const value = this.get()
- if (
- value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated.
- isObject(value) ||
- this.deep
- ) {
- // set new value
- const oldValue = this.value
- this.value = value
- if (this.user) {
- try {
- this.cb.call(this.vm, value, oldValue)
- } catch (e) {
- handleError(e, this.vm, `callback for watcher "${this.expression}"`)
- }
- } else {
- this.cb.call(this.vm, value, oldValue)
- }
- }
- }
- }
-
- /**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
- evaluate () {
- this.value = this.get()
- this.dirty = false
- }
-
- /**
- * Depend on all deps collected by this watcher.
- */
- depend () {
- let i = this.deps.length
- while (i--) {
- this.deps[i].depend()
- }
- }
-
- /**
- * Remove self from all dependencies' subscriber list.
- */
- teardown () {
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed.
- if (!this.vm._isBeingDestroyed) {
- remove(this.vm._watchers, this)
- }
- let i = this.deps.length
- while (i--) {
- this.deps[i].removeSub(this)
- }
- this.active = false
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import { noop } from 'shared/util'
-
-export let warn = noop
-export let tip = noop
-export let generateComponentTrace = (noop: any) // work around flow check
-export let formatComponentName = (noop: any)
-
-if (process.env.NODE_ENV !== 'production') {
- const hasConsole = typeof console !== 'undefined'
- const classifyRE = /(?:^|[-_])(\w)/g
- const classify = str => str
- .replace(classifyRE, c => c.toUpperCase())
- .replace(/[-_]/g, '')
-
- warn = (msg, vm) => {
- const 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 = (msg, vm) => {
- if (hasConsole && (!config.silent)) {
- console.warn(`[Vue tip]: ${msg}` + (
- vm ? generateComponentTrace(vm) : ''
- ))
- }
- }
-
- formatComponentName = (vm, includeFile) => {
- if (vm.$root === vm) {
- return '<Root>'
- }
- const options = typeof vm === 'function' && vm.cid != null
- ? vm.options
- : vm._isVue
- ? vm.$options || vm.constructor.options
- : vm || {}
- let name = options.name || options._componentTag
- const file = options.__file
- if (!name && file) {
- const match = file.match(/([^/\\]+)\.vue$/)
- name = match && match[1]
- }
-
- return (
- (name ? `<${classify(name)}>` : `<Anonymous>`) +
- (file && includeFile !== false ? ` at ${file}` : '')
- )
- }
-
- const repeat = (str, n) => {
- let res = ''
- while (n) {
- if (n % 2 === 1) res += str
- if (n > 1) str += str
- n >>= 1
- }
- return res
- }
-
- generateComponentTrace = vm => {
- if (vm._isVue && vm.$parent) {
- const tree = []
- let currentRecursiveSequence = 0
- while (vm) {
- if (tree.length > 0) {
- const 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((vm, i) => `${
- 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)})`
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-// can we use __proto__?
-export const hasProto = '__proto__' in {}
-
-// Browser environment sniffing
-export const inBrowser = typeof window !== 'undefined'
-export const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform
-export const weexPlatform = inWeex && WXEnvironment.platform.toLowerCase()
-export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
-export const isIE = UA && /msie|trident/.test(UA)
-export const isIE9 = UA && UA.indexOf('msie 9.0') > 0
-export const isEdge = UA && UA.indexOf('edge/') > 0
-export const isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android')
-export const isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios')
-export const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge
-
-// Firefox has a "watch" function on Object.prototype...
-export const nativeWatch = ({}).watch
-
-export let supportsPassive = false
-if (inBrowser) {
- try {
- const opts = {}
- Object.defineProperty(opts, 'passive', ({
- get () {
- /* istanbul ignore next */
- supportsPassive = true
- }
- }: Object)) // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts)
- } catch (e) {}
-}
-
-// this needs to be lazy-evaled because vue may be required before
-// vue-server-renderer can set VUE_ENV
-let _isServer
-export const isServerRendering = () => {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'].env.VUE_ENV === 'server'
- } else {
- _isServer = false
- }
- }
- return _isServer
-}
-
-// detect devtools
-export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
-
-/* istanbul ignore next */
-export function isNative (Ctor: any): boolean {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
-}
-
-export const hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys)
-
-let _Set
-/* istanbul ignore if */ // $flow-disable-line
-if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set
-} else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = class Set implements SimpleSet {
- set: Object;
- constructor () {
- this.set = Object.create(null)
- }
- has (key: string | number) {
- return this.set[key] === true
- }
- add (key: string | number) {
- this.set[key] = true
- }
- clear () {
- this.set = Object.create(null)
- }
- }
-}
-
-interface SimpleSet {
- has(key: string | number): boolean;
- add(key: string | number): mixed;
- clear(): void;
-}
-
-export { _Set }
-export type { SimpleSet }
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import { warn } from './debug'
-import { inBrowser, inWeex } from './env'
-
-export function handleError (err: Error, vm: any, info: string) {
- if (vm) {
- let cur = vm
- while ((cur = cur.$parent)) {
- const hooks = cur.$options.errorCaptured
- if (hooks) {
- for (let i = 0; i < hooks.length; i++) {
- try {
- const 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 (process.env.NODE_ENV !== 'production') {
- warn(`Error in ${info}: "${err.toString()}"`, vm)
- }
- /* istanbul ignore else */
- if ((inBrowser || inWeex) && typeof console !== 'undefined') {
- console.error(err)
- } else {
- throw err
- }
-}
+++ /dev/null
-/* @flow */
-
-export * from 'shared/util'
-export * from './lang'
-export * from './env'
-export * from './options'
-export * from './debug'
-export * from './props'
-export * from './error'
-export * from './next-tick'
-export { defineReactive } from '../observer/index'
+++ /dev/null
-/* @flow */
-
-/**
- * Check if a string starts with $ or _
- */
-export function isReserved (str: string): boolean {
- const c = (str + '').charCodeAt(0)
- return c === 0x24 || c === 0x5F
-}
-
-/**
- * Define a property.
- */
-export function def (obj: Object, key: string, val: any, enumerable?: boolean) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- })
-}
-
-/**
- * Parse simple path.
- */
-const bailRE = /[^\w.$]/
-export function parsePath (path: string): any {
- if (bailRE.test(path)) {
- return
- }
- const segments = path.split('.')
- return function (obj) {
- for (let i = 0; i < segments.length; i++) {
- if (!obj) return
- obj = obj[segments[i]]
- }
- return obj
- }
-}
+++ /dev/null
-/* @flow */
-/* globals MessageChannel */
-
-import { noop } from 'shared/util'
-import { handleError } from './error'
-import { isIOS, isNative } from './env'
-
-const callbacks = []
-let pending = false
-
-function flushCallbacks () {
- pending = false
- const copies = callbacks.slice(0)
- callbacks.length = 0
- for (let i = 0; i < copies.length; i++) {
- copies[i]()
- }
-}
-
-// Here we have async deferring wrappers using both microtasks and (macro) tasks.
-// In < 2.4 we used microtasks everywhere, but there are some scenarios where
-// microtasks have too high a priority and fire 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 microtask by default, but expose a way to force (macro) task when
-// needed (e.g. in event handlers attached by v-on).
-let microTimerFunc
-let macroTimerFunc
-let 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 = () => {
- setImmediate(flushCallbacks)
- }
-} else if (typeof MessageChannel !== 'undefined' && (
- isNative(MessageChannel) ||
- // PhantomJS
- MessageChannel.toString() === '[object MessageChannelConstructor]'
-)) {
- const channel = new MessageChannel()
- const port = channel.port2
- channel.port1.onmessage = flushCallbacks
- macroTimerFunc = () => {
- port.postMessage(1)
- }
-} else {
- /* istanbul ignore next */
- macroTimerFunc = () => {
- setTimeout(flushCallbacks, 0)
- }
-}
-
-// Determine microtask defer implementation.
-/* istanbul ignore next, $flow-disable-line */
-if (typeof Promise !== 'undefined' && isNative(Promise)) {
- const p = Promise.resolve()
- microTimerFunc = () => {
- 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 (macro) task instead of a microtask.
- */
-export function withMacroTask (fn: Function): Function {
- return fn._withTask || (fn._withTask = function () {
- useMacroTask = true
- const res = fn.apply(null, arguments)
- useMacroTask = false
- return res
- })
-}
-
-export function nextTick (cb?: Function, ctx?: Object) {
- let _resolve
- callbacks.push(() => {
- 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(resolve => {
- _resolve = resolve
- })
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import { warn } from './debug'
-import { nativeWatch } from './env'
-import { set } from '../observer/index'
-
-import {
- ASSET_TYPES,
- LIFECYCLE_HOOKS
-} from 'shared/constants'
-
-import {
- extend,
- hasOwn,
- camelize,
- toRawType,
- capitalize,
- isBuiltInTag,
- isPlainObject
-} from 'shared/util'
-
-/**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
-const strats = config.optionMergeStrategies
-
-/**
- * Options with restrictions
- */
-if (process.env.NODE_ENV !== 'production') {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- `option "${key}" can only be used during instance ` +
- 'creation with the `new` keyword.'
- )
- }
- return defaultStrat(parent, child)
- }
-}
-
-/**
- * Helper that recursively merges two data objects together.
- */
-function mergeData (to: Object, from: ?Object): Object {
- if (!from) return to
- let key, toVal, fromVal
- const keys = Object.keys(from)
- for (let i = 0; i < keys.length; i++) {
- key = keys[i]
- toVal = to[key]
- fromVal = from[key]
- if (!hasOwn(to, key)) {
- set(to, key, fromVal)
- } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
- mergeData(toVal, fromVal)
- }
- }
- return to
-}
-
-/**
- * Data
- */
-export function mergeDataOrFn (
- parentVal: any,
- childVal: any,
- vm?: Component
-): ?Function {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- const instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal
- const defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
-}
-
-strats.data = function (
- parentVal: any,
- childVal: any,
- vm?: Component
-): ?Function {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- process.env.NODE_ENV !== 'production' && warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- )
-
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
-
- return mergeDataOrFn(parentVal, childVal, vm)
-}
-
-/**
- * Hooks and props are merged as arrays.
- */
-function mergeHook (
- parentVal: ?Array<Function>,
- childVal: ?Function | ?Array<Function>
-): ?Array<Function> {
- return childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal
-}
-
-LIFECYCLE_HOOKS.forEach(hook => {
- strats[hook] = mergeHook
-})
-
-/**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
-function mergeAssets (
- parentVal: ?Object,
- childVal: ?Object,
- vm?: Component,
- key: string
-): Object {
- const res = Object.create(parentVal || null)
- if (childVal) {
- process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm)
- return extend(res, childVal)
- } else {
- return res
- }
-}
-
-ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets
-})
-
-/**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
-strats.watch = function (
- parentVal: ?Object,
- childVal: ?Object,
- vm?: Component,
- key: string
-): ?Object {
- // 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 (process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm)
- }
- if (!parentVal) return childVal
- const ret = {}
- extend(ret, parentVal)
- for (const key in childVal) {
- let parent = ret[key]
- const child = childVal[key]
- if (parent && !Array.isArray(parent)) {
- parent = [parent]
- }
- ret[key] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child]
- }
- return ret
-}
-
-/**
- * Other object hashes.
- */
-strats.props =
-strats.methods =
-strats.inject =
-strats.computed = function (
- parentVal: ?Object,
- childVal: ?Object,
- vm?: Component,
- key: string
-): ?Object {
- if (childVal && process.env.NODE_ENV !== 'production') {
- assertObjectType(key, childVal, vm)
- }
- if (!parentVal) return childVal
- const ret = Object.create(null)
- extend(ret, parentVal)
- if (childVal) extend(ret, childVal)
- return ret
-}
-strats.provide = mergeDataOrFn
-
-/**
- * Default strategy.
- */
-const defaultStrat = function (parentVal: any, childVal: any): any {
- return childVal === undefined
- ? parentVal
- : childVal
-}
-
-/**
- * Validate component names
- */
-function checkComponents (options: Object) {
- for (const key in options.components) {
- validateComponentName(key)
- }
-}
-
-export function validateComponentName (name: string) {
- if (!/^[a-zA-Z][\w-]*$/.test(name)) {
- warn(
- 'Invalid component name: "' + name + '". Component names ' +
- 'can only contain alphanumeric characters and the hyphen, ' +
- 'and must start with a letter.'
- )
- }
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + name
- )
- }
-}
-
-/**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- */
-function normalizeProps (options: Object, vm: ?Component) {
- const props = options.props
- if (!props) return
- const res = {}
- let i, val, name
- if (Array.isArray(props)) {
- i = props.length
- while (i--) {
- val = props[i]
- if (typeof val === 'string') {
- name = camelize(val)
- res[name] = { type: null }
- } else if (process.env.NODE_ENV !== 'production') {
- warn('props must be strings when using array syntax.')
- }
- }
- } else if (isPlainObject(props)) {
- for (const key in props) {
- val = props[key]
- name = camelize(key)
- res[name] = isPlainObject(val)
- ? val
- : { type: val }
- }
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- `Invalid value for option "props": expected an Array or an Object, ` +
- `but got ${toRawType(props)}.`,
- vm
- )
- }
- options.props = res
-}
-
-/**
- * Normalize all injections into Object-based format
- */
-function normalizeInject (options: Object, vm: ?Component) {
- const inject = options.inject
- if (!inject) return
- const normalized = options.inject = {}
- if (Array.isArray(inject)) {
- for (let i = 0; i < inject.length; i++) {
- normalized[inject[i]] = { from: inject[i] }
- }
- } else if (isPlainObject(inject)) {
- for (const key in inject) {
- const val = inject[key]
- normalized[key] = isPlainObject(val)
- ? extend({ from: key }, val)
- : { from: val }
- }
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- `Invalid value for option "inject": expected an Array or an Object, ` +
- `but got ${toRawType(inject)}.`,
- vm
- )
- }
-}
-
-/**
- * Normalize raw function directives into object format.
- */
-function normalizeDirectives (options: Object) {
- const dirs = options.directives
- if (dirs) {
- for (const key in dirs) {
- const def = dirs[key]
- if (typeof def === 'function') {
- dirs[key] = { bind: def, update: def }
- }
- }
- }
-}
-
-function assertObjectType (name: string, value: any, vm: ?Component) {
- 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.
- */
-export function mergeOptions (
- parent: Object,
- child: Object,
- vm?: Component
-): Object {
- if (process.env.NODE_ENV !== 'production') {
- checkComponents(child)
- }
-
- if (typeof child === 'function') {
- child = child.options
- }
-
- normalizeProps(child, vm)
- normalizeInject(child, vm)
- normalizeDirectives(child)
- const extendsFrom = child.extends
- if (extendsFrom) {
- parent = mergeOptions(parent, extendsFrom, vm)
- }
- if (child.mixins) {
- for (let i = 0, l = child.mixins.length; i < l; i++) {
- parent = mergeOptions(parent, child.mixins[i], vm)
- }
- }
- const options = {}
- let key
- for (key in parent) {
- mergeField(key)
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key)
- }
- }
- function mergeField (key) {
- const strat = strats[key] || defaultStrat
- options[key] = strat(parent[key], child[key], vm, key)
- }
- return options
-}
-
-/**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
-export function resolveAsset (
- options: Object,
- type: string,
- id: string,
- warnMissing?: boolean
-): any {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return
- }
- const assets = options[type]
- // check local registration variations first
- if (hasOwn(assets, id)) return assets[id]
- const camelizedId = camelize(id)
- if (hasOwn(assets, camelizedId)) return assets[camelizedId]
- const PascalCaseId = capitalize(camelizedId)
- if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]
- // fallback to prototype chain
- const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
- if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
- warn(
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
- options
- )
- }
- return res
-}
+++ /dev/null
-import { inBrowser } from './env'
-
-export let mark
-export let measure
-
-if (process.env.NODE_ENV !== 'production') {
- const perf = inBrowser && window.performance
- /* istanbul ignore if */
- if (
- perf &&
- perf.mark &&
- perf.measure &&
- perf.clearMarks &&
- perf.clearMeasures
- ) {
- mark = tag => perf.mark(tag)
- measure = (name, startTag, endTag) => {
- perf.measure(name, startTag, endTag)
- perf.clearMarks(startTag)
- perf.clearMarks(endTag)
- perf.clearMeasures(name)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { warn } from './debug'
-import { observe, toggleObserving, shouldObserve } from '../observer/index'
-import {
- hasOwn,
- isObject,
- toRawType,
- hyphenate,
- capitalize,
- isPlainObject
-} from 'shared/util'
-
-type PropOptions = {
- type: Function | Array<Function> | null,
- default: any,
- required: ?boolean,
- validator: ?Function
-};
-
-export function validateProp (
- key: string,
- propOptions: Object,
- propsData: Object,
- vm?: Component
-): any {
- const prop = propOptions[key]
- const absent = !hasOwn(propsData, key)
- let value = propsData[key]
- // boolean casting
- const booleanIndex = getTypeIndex(Boolean, prop.type)
- if (booleanIndex > -1) {
- if (absent && !hasOwn(prop, 'default')) {
- value = false
- } else if (value === '' || value === hyphenate(key)) {
- // only cast empty string / same name to boolean if
- // boolean has higher priority
- const stringIndex = getTypeIndex(String, prop.type)
- if (stringIndex < 0 || booleanIndex < stringIndex) {
- value = true
- }
- }
- }
- // check default value
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop, key)
- // since the default value is a fresh copy,
- // make sure to observe it.
- const prevShouldObserve = shouldObserve
- toggleObserving(true)
- observe(value)
- toggleObserving(prevShouldObserve)
- }
- if (
- process.env.NODE_ENV !== 'production' &&
- // skip validation for weex recycle-list child component props
- !(__WEEX__ && isObject(value) && ('@binding' in value))
- ) {
- assertProp(prop, key, value, vm, absent)
- }
- return value
-}
-
-/**
- * Get the default value of a prop.
- */
-function getPropDefaultValue (vm: ?Component, prop: PropOptions, key: string): any {
- // no default, return undefined
- if (!hasOwn(prop, 'default')) {
- return undefined
- }
- const def = prop.default
- // warn against non-factory defaults for Object & Array
- if (process.env.NODE_ENV !== 'production' && isObject(def)) {
- warn(
- 'Invalid default value for prop "' + key + '": ' +
- 'Props with type Object/Array must use a factory function ' +
- 'to return the default value.',
- vm
- )
- }
- // the raw prop value was also undefined from previous render,
- // return previous default value to avoid unnecessary watcher trigger
- if (vm && vm.$options.propsData &&
- vm.$options.propsData[key] === undefined &&
- vm._props[key] !== undefined
- ) {
- return vm._props[key]
- }
- // call factory function for non-Function types
- // a value is Function if its prototype is function even across different execution context
- return typeof def === 'function' && getType(prop.type) !== 'Function'
- ? def.call(vm)
- : def
-}
-
-/**
- * Assert whether a prop is valid.
- */
-function assertProp (
- prop: PropOptions,
- name: string,
- value: any,
- vm: ?Component,
- absent: boolean
-) {
- if (prop.required && absent) {
- warn(
- 'Missing required prop: "' + name + '"',
- vm
- )
- return
- }
- if (value == null && !prop.required) {
- return
- }
- let type = prop.type
- let valid = !type || type === true
- const expectedTypes = []
- if (type) {
- if (!Array.isArray(type)) {
- type = [type]
- }
- for (let i = 0; i < type.length && !valid; i++) {
- const assertedType = assertType(value, type[i])
- expectedTypes.push(assertedType.expectedType || '')
- valid = assertedType.valid
- }
- }
- if (!valid) {
- warn(
- `Invalid prop: type check failed for prop "${name}".` +
- ` Expected ${expectedTypes.map(capitalize).join(', ')}` +
- `, got ${toRawType(value)}.`,
- vm
- )
- return
- }
- const validator = prop.validator
- if (validator) {
- if (!validator(value)) {
- warn(
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
- vm
- )
- }
- }
-}
-
-const simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/
-
-function assertType (value: any, type: Function): {
- valid: boolean;
- expectedType: string;
-} {
- let valid
- const expectedType = getType(type)
- if (simpleCheckRE.test(expectedType)) {
- const t = typeof value
- valid = t === expectedType.toLowerCase()
- // for primitive wrapper objects
- if (!valid && t === 'object') {
- valid = value instanceof type
- }
- } else if (expectedType === 'Object') {
- valid = isPlainObject(value)
- } else if (expectedType === 'Array') {
- valid = Array.isArray(value)
- } else {
- valid = value instanceof type
- }
- return {
- valid,
- expectedType
- }
-}
-
-/**
- * Use function string name to check built-in types,
- * because a simple equality check will fail when running
- * across different vms / iframes.
- */
-function getType (fn) {
- const match = fn && fn.toString().match(/^\s*function (\w+)/)
- return match ? match[1] : ''
-}
-
-function isSameType (a, b) {
- return getType(a) === getType(b)
-}
-
-function getTypeIndex (type, expectedTypes): number {
- if (!Array.isArray(expectedTypes)) {
- return isSameType(expectedTypes, type) ? 0 : -1
- }
- for (let i = 0, len = expectedTypes.length; i < len; i++) {
- if (isSameType(expectedTypes[i], type)) {
- return i
- }
- }
- return -1
-}
+++ /dev/null
-/* @flow */
-
-import VNode from './vnode'
-import { resolveConstructorOptions } from 'core/instance/init'
-import { queueActivatedComponent } from 'core/observer/scheduler'
-import { createFunctionalComponent } from './create-functional-component'
-
-import {
- warn,
- isDef,
- isUndef,
- isTrue,
- isObject
-} from '../util/index'
-
-import {
- resolveAsyncComponent,
- createAsyncPlaceholder,
- extractPropsFromVNodeData
-} from './helpers/index'
-
-import {
- callHook,
- activeInstance,
- updateChildComponent,
- activateChildComponent,
- deactivateChildComponent
-} from '../instance/lifecycle'
-
-import {
- isRecyclableComponent,
- renderRecyclableComponentTemplate
-} from 'weex/runtime/recycle-list/render-component-template'
-
-// inline hooks to be invoked on component VNodes during patch
-const componentVNodeHooks = {
- init (
- vnode: VNodeWithData,
- hydrating: boolean,
- parentElm: ?Node,
- refElm: ?Node
- ): ?boolean {
- if (
- vnode.componentInstance &&
- !vnode.componentInstance._isDestroyed &&
- vnode.data.keepAlive
- ) {
- // kept-alive components, treat as a patch
- const mountedNode: any = vnode // work around flow
- componentVNodeHooks.prepatch(mountedNode, mountedNode)
- } else {
- const child = vnode.componentInstance = createComponentInstanceForVnode(
- vnode,
- activeInstance,
- parentElm,
- refElm
- )
- child.$mount(hydrating ? vnode.elm : undefined, hydrating)
- }
- },
-
- prepatch (oldVnode: MountedComponentVNode, vnode: MountedComponentVNode) {
- const options = vnode.componentOptions
- const child = vnode.componentInstance = oldVnode.componentInstance
- updateChildComponent(
- child,
- options.propsData, // updated props
- options.listeners, // updated listeners
- vnode, // new parent vnode
- options.children // new children
- )
- },
-
- insert (vnode: MountedComponentVNode) {
- const { context, componentInstance } = vnode
- if (!componentInstance._isMounted) {
- componentInstance._isMounted = true
- callHook(componentInstance, 'mounted')
- }
- if (vnode.data.keepAlive) {
- if (context._isMounted) {
- // vue-router#1212
- // During updates, a kept-alive component's child components may
- // change, so directly walking the tree here may call activated hooks
- // on incorrect children. Instead we push them into a queue which will
- // be processed after the whole patch process ended.
- queueActivatedComponent(componentInstance)
- } else {
- activateChildComponent(componentInstance, true /* direct */)
- }
- }
- },
-
- destroy (vnode: MountedComponentVNode) {
- const { componentInstance } = vnode
- if (!componentInstance._isDestroyed) {
- if (!vnode.data.keepAlive) {
- componentInstance.$destroy()
- } else {
- deactivateChildComponent(componentInstance, true /* direct */)
- }
- }
- }
-}
-
-const hooksToMerge = Object.keys(componentVNodeHooks)
-
-export function createComponent (
- Ctor: Class<Component> | Function | Object | void,
- data: ?VNodeData,
- context: Component,
- children: ?Array<VNode>,
- tag?: string
-): VNode | Array<VNode> | void {
- if (isUndef(Ctor)) {
- return
- }
-
- const baseCtor = context.$options._base
-
- // plain options object: turn it into a constructor
- if (isObject(Ctor)) {
- Ctor = baseCtor.extend(Ctor)
- }
-
- // if at this stage it's not a constructor or an async component factory,
- // reject.
- if (typeof Ctor !== 'function') {
- if (process.env.NODE_ENV !== 'production') {
- warn(`Invalid Component definition: ${String(Ctor)}`, context)
- }
- return
- }
-
- // async component
- let asyncFactory
- if (isUndef(Ctor.cid)) {
- asyncFactory = Ctor
- Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context)
- if (Ctor === undefined) {
- // return a placeholder node for async component, which is rendered
- // as a comment node but preserves all the raw information for the node.
- // the information will be used for async server-rendering and hydration.
- return createAsyncPlaceholder(
- asyncFactory,
- data,
- context,
- children,
- tag
- )
- }
- }
-
- data = data || {}
-
- // resolve constructor options in case global mixins are applied after
- // component constructor creation
- resolveConstructorOptions(Ctor)
-
- // transform component v-model data into props & events
- if (isDef(data.model)) {
- transformModel(Ctor.options, data)
- }
-
- // extract props
- const propsData = extractPropsFromVNodeData(data, Ctor, tag)
-
- // functional component
- if (isTrue(Ctor.options.functional)) {
- return createFunctionalComponent(Ctor, propsData, data, context, children)
- }
-
- // extract listeners, since these needs to be treated as
- // child component listeners instead of DOM listeners
- const listeners = data.on
- // replace with listeners with .native modifier
- // so it gets processed during parent component patch.
- data.on = data.nativeOn
-
- if (isTrue(Ctor.options.abstract)) {
- // abstract components do not keep anything
- // other than props & listeners & slot
-
- // work around flow
- const slot = data.slot
- data = {}
- if (slot) {
- data.slot = slot
- }
- }
-
- // install component management hooks onto the placeholder node
- installComponentHooks(data)
-
- // return a placeholder vnode
- const name = Ctor.options.name || tag
- const vnode = new VNode(
- `vue-component-${Ctor.cid}${name ? `-${name}` : ''}`,
- data, undefined, undefined, undefined, context,
- { Ctor, propsData, listeners, tag, children },
- asyncFactory
- )
-
- // Weex specific: invoke recycle-list optimized @render function for
- // extracting cell-slot template.
- // https://github.com/Hanks10100/weex-native-directive/tree/master/component
- /* istanbul ignore if */
- if (__WEEX__ && isRecyclableComponent(vnode)) {
- return renderRecyclableComponentTemplate(vnode)
- }
-
- return vnode
-}
-
-export function createComponentInstanceForVnode (
- vnode: any, // we know it's MountedComponentVNode but flow doesn't
- parent: any, // activeInstance in lifecycle state
- parentElm?: ?Node,
- refElm?: ?Node
-): Component {
- const options: InternalComponentOptions = {
- _isComponent: true,
- parent,
- _parentVnode: vnode,
- _parentElm: parentElm || null,
- _refElm: refElm || null
- }
- // check inline-template render functions
- const inlineTemplate = vnode.data.inlineTemplate
- if (isDef(inlineTemplate)) {
- options.render = inlineTemplate.render
- options.staticRenderFns = inlineTemplate.staticRenderFns
- }
- return new vnode.componentOptions.Ctor(options)
-}
-
-function installComponentHooks (data: VNodeData) {
- const hooks = data.hook || (data.hook = {})
- for (let i = 0; i < hooksToMerge.length; i++) {
- const key = hooksToMerge[i]
- hooks[key] = componentVNodeHooks[key]
- }
-}
-
-// transform component v-model info (value and callback) into
-// prop and event handler respectively.
-function transformModel (options, data: any) {
- const prop = (options.model && options.model.prop) || 'value'
- const event = (options.model && options.model.event) || 'input'
- ;(data.props || (data.props = {}))[prop] = data.model.value
- const on = data.on || (data.on = {})
- if (isDef(on[event])) {
- on[event] = [data.model.callback].concat(on[event])
- } else {
- on[event] = data.model.callback
- }
-}
+++ /dev/null
-/* @flow */
-
-import config from '../config'
-import VNode, { createEmptyVNode } from './vnode'
-import { createComponent } from './create-component'
-import { traverse } from '../observer/traverse'
-
-import {
- warn,
- isDef,
- isUndef,
- isTrue,
- isObject,
- isPrimitive,
- resolveAsset
-} from '../util/index'
-
-import {
- normalizeChildren,
- simpleNormalizeChildren
-} from './helpers/index'
-
-const SIMPLE_NORMALIZE = 1
-const ALWAYS_NORMALIZE = 2
-
-// wrapper function for providing a more flexible interface
-// without getting yelled at by flow
-export function createElement (
- context: Component,
- tag: any,
- data: any,
- children: any,
- normalizationType: any,
- alwaysNormalize: boolean
-): VNode | Array<VNode> {
- if (Array.isArray(data) || isPrimitive(data)) {
- normalizationType = children
- children = data
- data = undefined
- }
- if (isTrue(alwaysNormalize)) {
- normalizationType = ALWAYS_NORMALIZE
- }
- return _createElement(context, tag, data, children, normalizationType)
-}
-
-export function _createElement (
- context: Component,
- tag?: string | Class<Component> | Function | Object,
- data?: VNodeData,
- children?: any,
- normalizationType?: number
-): VNode | Array<VNode> {
- if (isDef(data) && isDef((data: any).__ob__)) {
- process.env.NODE_ENV !== 'production' && warn(
- `Avoid using observed data object as vnode data: ${JSON.stringify(data)}\n` +
- 'Always create fresh vnode data objects in each render!',
- context
- )
- return createEmptyVNode()
- }
- // object syntax in v-bind
- if (isDef(data) && isDef(data.is)) {
- tag = data.is
- }
- if (!tag) {
- // in case of component :is set to falsy value
- return createEmptyVNode()
- }
- // warn against non-primitive key
- if (process.env.NODE_ENV !== 'production' &&
- isDef(data) && isDef(data.key) && !isPrimitive(data.key)
- ) {
- if (!__WEEX__ || !('@binding' in data.key)) {
- warn(
- 'Avoid using non-primitive value as key, ' +
- 'use string/number value instead.',
- context
- )
- }
- }
- // support single function children as default scoped slot
- if (Array.isArray(children) &&
- typeof children[0] === 'function'
- ) {
- data = data || {}
- data.scopedSlots = { default: children[0] }
- children.length = 0
- }
- if (normalizationType === ALWAYS_NORMALIZE) {
- children = normalizeChildren(children)
- } else if (normalizationType === SIMPLE_NORMALIZE) {
- children = simpleNormalizeChildren(children)
- }
- let vnode, ns
- if (typeof tag === 'string') {
- let Ctor
- ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag)
- if (config.isReservedTag(tag)) {
- // platform built-in elements
- vnode = new VNode(
- config.parsePlatformTagName(tag), data, children,
- undefined, undefined, context
- )
- } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
- // component
- vnode = createComponent(Ctor, data, context, children, tag)
- } else {
- // unknown or unlisted namespaced elements
- // check at runtime because it may get assigned a namespace when its
- // parent normalizes children
- vnode = new VNode(
- tag, data, children,
- undefined, undefined, context
- )
- }
- } else {
- // direct component options / constructor
- vnode = createComponent(tag, data, context, children)
- }
- if (Array.isArray(vnode)) {
- return vnode
- } else if (isDef(vnode)) {
- if (isDef(ns)) applyNS(vnode, ns)
- if (isDef(data)) registerDeepBindings(data)
- return vnode
- } else {
- return createEmptyVNode()
- }
-}
-
-function applyNS (vnode, ns, force) {
- vnode.ns = ns
- if (vnode.tag === 'foreignObject') {
- // use default namespace inside foreignObject
- ns = undefined
- force = true
- }
- if (isDef(vnode.children)) {
- for (let i = 0, l = vnode.children.length; i < l; i++) {
- const child = vnode.children[i]
- if (isDef(child.tag) && (
- isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
- applyNS(child, ns, force)
- }
- }
- }
-}
-
-// ref #5318
-// necessary to ensure parent re-render when deep bindings like :style and
-// :class are used on slot nodes
-function registerDeepBindings (data) {
- if (isObject(data.style)) {
- traverse(data.style)
- }
- if (isObject(data.class)) {
- traverse(data.class)
- }
-}
+++ /dev/null
-/* @flow */
-
-import VNode, { cloneVNode } from './vnode'
-import { createElement } from './create-element'
-import { resolveInject } from '../instance/inject'
-import { normalizeChildren } from '../vdom/helpers/normalize-children'
-import { resolveSlots } from '../instance/render-helpers/resolve-slots'
-import { installRenderHelpers } from '../instance/render-helpers/index'
-
-import {
- isDef,
- isTrue,
- hasOwn,
- camelize,
- emptyObject,
- validateProp
-} from '../util/index'
-
-export function FunctionalRenderContext (
- data: VNodeData,
- props: Object,
- children: ?Array<VNode>,
- parent: Component,
- Ctor: Class<Component>
-) {
- const options = Ctor.options
- // ensure the createElement function in functional components
- // gets a unique context - this is necessary for correct named slot check
- let contextVm
- if (hasOwn(parent, '_uid')) {
- contextVm = Object.create(parent)
- // $flow-disable-line
- contextVm._original = parent
- } else {
- // the context vm passed in is a functional context as well.
- // in this case we want to make sure we are able to get a hold to the
- // real context instance.
- contextVm = parent
- // $flow-disable-line
- parent = parent._original
- }
- const isCompiled = isTrue(options._compiled)
- const needNormalization = !isCompiled
-
- 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 = () => resolveSlots(children, parent)
-
- // 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 = (a, b, c, d) => {
- const vnode = createElement(contextVm, a, b, c, d, needNormalization)
- if (vnode && !Array.isArray(vnode)) {
- vnode.fnScopeId = options._scopeId
- vnode.fnContext = parent
- }
- return vnode
- }
- } else {
- this._c = (a, b, c, d) => createElement(contextVm, a, b, c, d, needNormalization)
- }
-}
-
-installRenderHelpers(FunctionalRenderContext.prototype)
-
-export function createFunctionalComponent (
- Ctor: Class<Component>,
- propsData: ?Object,
- data: VNodeData,
- contextVm: Component,
- children: ?Array<VNode>
-): VNode | Array<VNode> | void {
- const options = Ctor.options
- const props = {}
- const propOptions = options.props
- if (isDef(propOptions)) {
- for (const key in propOptions) {
- props[key] = validateProp(key, propOptions, propsData || emptyObject)
- }
- } else {
- if (isDef(data.attrs)) mergeProps(props, data.attrs)
- if (isDef(data.props)) mergeProps(props, data.props)
- }
-
- const renderContext = new FunctionalRenderContext(
- data,
- props,
- children,
- contextVm,
- Ctor
- )
-
- const vnode = options.render.call(null, renderContext._c, renderContext)
-
- if (vnode instanceof VNode) {
- return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options)
- } else if (Array.isArray(vnode)) {
- const vnodes = normalizeChildren(vnode) || []
- const res = new Array(vnodes.length)
- for (let i = 0; i < vnodes.length; i++) {
- res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options)
- }
- return res
- }
-}
-
-function cloneAndMarkFunctionalResult (vnode, data, contextVm, options) {
- // #7817 clone node before setting fnContext, otherwise if the node is reused
- // (e.g. it was from a cached normal slot) the fnContext causes named slots
- // that should not be matched to match.
- const clone = cloneVNode(vnode)
- clone.fnContext = contextVm
- clone.fnOptions = options
- if (data.slot) {
- (clone.data || (clone.data = {})).slot = data.slot
- }
- return clone
-}
-
-function mergeProps (to, from) {
- for (const key in from) {
- to[camelize(key)] = from[key]
- }
-}
+++ /dev/null
-/* @flow */
-
-import {
- tip,
- hasOwn,
- isDef,
- isUndef,
- hyphenate,
- formatComponentName
-} from 'core/util/index'
-
-export function extractPropsFromVNodeData (
- data: VNodeData,
- Ctor: Class<Component>,
- tag?: string
-): ?Object {
- // we are only extracting raw values here.
- // validation and default values are handled in the child
- // component itself.
- const propOptions = Ctor.options.props
- if (isUndef(propOptions)) {
- return
- }
- const res = {}
- const { attrs, props } = data
- if (isDef(attrs) || isDef(props)) {
- for (const key in propOptions) {
- const altKey = hyphenate(key)
- if (process.env.NODE_ENV !== 'production') {
- const keyInLowerCase = key.toLowerCase()
- if (
- key !== keyInLowerCase &&
- attrs && hasOwn(attrs, keyInLowerCase)
- ) {
- tip(
- `Prop "${keyInLowerCase}" is passed to component ` +
- `${formatComponentName(tag || Ctor)}, but the declared prop name is` +
- ` "${key}". ` +
- `Note that HTML attributes are case-insensitive and camelCased ` +
- `props need to use their kebab-case equivalents when using in-DOM ` +
- `templates. You should probably use "${altKey}" instead of "${key}".`
- )
- }
- }
- checkProp(res, props, key, altKey, true) ||
- checkProp(res, attrs, key, altKey, false)
- }
- }
- return res
-}
-
-function checkProp (
- res: Object,
- hash: ?Object,
- key: string,
- altKey: string,
- preserve: boolean
-): boolean {
- if (isDef(hash)) {
- if (hasOwn(hash, key)) {
- res[key] = hash[key]
- if (!preserve) {
- delete hash[key]
- }
- return true
- } else if (hasOwn(hash, altKey)) {
- res[key] = hash[altKey]
- if (!preserve) {
- delete hash[altKey]
- }
- return true
- }
- }
- return false
-}
+++ /dev/null
-/* @flow */
-
-import { isDef } from 'shared/util'
-import { isAsyncPlaceholder } from './is-async-placeholder'
-
-export function getFirstComponentChild (children: ?Array<VNode>): ?VNode {
- if (Array.isArray(children)) {
- for (let i = 0; i < children.length; i++) {
- const c = children[i]
- if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
- return c
- }
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-export * from './merge-hook'
-export * from './extract-props'
-export * from './update-listeners'
-export * from './normalize-children'
-export * from './resolve-async-component'
-export * from './get-first-component-child'
-export * from './is-async-placeholder'
+++ /dev/null
-/* @flow */
-
-export function isAsyncPlaceholder (node: VNode): boolean {
- return node.isComment && node.asyncFactory
-}
+++ /dev/null
-/* @flow */
-
-import VNode from '../vnode'
-import { createFnInvoker } from './update-listeners'
-import { remove, isDef, isUndef, isTrue } from 'shared/util'
-
-export function mergeVNodeHook (def: Object, hookKey: string, hook: Function) {
- if (def instanceof VNode) {
- def = def.data.hook || (def.data.hook = {})
- }
- let invoker
- const oldHook = def[hookKey]
-
- function wrappedHook () {
- hook.apply(this, arguments)
- // important: remove merged hook to ensure it's called only once
- // and prevent memory leak
- remove(invoker.fns, wrappedHook)
- }
-
- if (isUndef(oldHook)) {
- // no existing hook
- invoker = createFnInvoker([wrappedHook])
- } else {
- /* istanbul ignore if */
- if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
- // already a merged invoker
- invoker = oldHook
- invoker.fns.push(wrappedHook)
- } else {
- // existing plain hook
- invoker = createFnInvoker([oldHook, wrappedHook])
- }
- }
-
- invoker.merged = true
- def[hookKey] = invoker
-}
+++ /dev/null
-/* @flow */
-
-import VNode, { createTextVNode } from 'core/vdom/vnode'
-import { isFalse, isTrue, isDef, isUndef, isPrimitive } from 'shared/util'
-
-// The template compiler attempts to minimize the need for normalization by
-// statically analyzing the template at compile time.
-//
-// For plain HTML markup, normalization can be completely skipped because the
-// generated render function is guaranteed to return Array<VNode>. There are
-// two cases where extra normalization is needed:
-
-// 1. When the children contains components - because a functional component
-// may return an Array instead of a single root. In this case, just a simple
-// normalization is needed - if any child is an Array, we flatten the whole
-// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
-// because functional components already normalize their own children.
-export function simpleNormalizeChildren (children: any) {
- for (let i = 0; i < children.length; i++) {
- if (Array.isArray(children[i])) {
- return Array.prototype.concat.apply([], children)
- }
- }
- return children
-}
-
-// 2. When the children contains constructs that always generated nested Arrays,
-// e.g. <template>, <slot>, v-for, or when the children is provided by user
-// with hand-written render functions / JSX. In such cases a full normalization
-// is needed to cater to all possible types of children values.
-export function normalizeChildren (children: any): ?Array<VNode> {
- return isPrimitive(children)
- ? [createTextVNode(children)]
- : Array.isArray(children)
- ? normalizeArrayChildren(children)
- : undefined
-}
-
-function isTextNode (node): boolean {
- return isDef(node) && isDef(node.text) && isFalse(node.isComment)
-}
-
-function normalizeArrayChildren (children: any, nestedIndex?: string): Array<VNode> {
- const res = []
- let i, c, lastIndex, last
- for (i = 0; i < children.length; i++) {
- c = children[i]
- if (isUndef(c) || typeof c === 'boolean') continue
- lastIndex = res.length - 1
- last = res[lastIndex]
- // nested
- if (Array.isArray(c)) {
- 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]: any).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
- res[lastIndex] = createTextVNode(last.text + c)
- } else if (c !== '') {
- // convert primitive to vnode
- res.push(createTextVNode(c))
- }
- } else {
- if (isTextNode(c) && isTextNode(last)) {
- // merge adjacent text nodes
- res[lastIndex] = createTextVNode(last.text + c.text)
- } else {
- // default key for nested array children (likely generated by v-for)
- if (isTrue(children._isVList) &&
- isDef(c.tag) &&
- isUndef(c.key) &&
- isDef(nestedIndex)) {
- c.key = `__vlist${nestedIndex}_${i}__`
- }
- res.push(c)
- }
- }
- }
- return res
-}
+++ /dev/null
-/* @flow */
-
-import {
- warn,
- once,
- isDef,
- isUndef,
- isTrue,
- isObject,
- hasSymbol
-} from 'core/util/index'
-
-import { createEmptyVNode } from 'core/vdom/vnode'
-
-function ensureCtor (comp: any, base) {
- if (
- comp.__esModule ||
- (hasSymbol && comp[Symbol.toStringTag] === 'Module')
- ) {
- comp = comp.default
- }
- return isObject(comp)
- ? base.extend(comp)
- : comp
-}
-
-export function createAsyncPlaceholder (
- factory: Function,
- data: ?VNodeData,
- context: Component,
- children: ?Array<VNode>,
- tag: ?string
-): VNode {
- const node = createEmptyVNode()
- node.asyncFactory = factory
- node.asyncMeta = { data, context, children, tag }
- return node
-}
-
-export function resolveAsyncComponent (
- factory: Function,
- baseCtor: Class<Component>,
- context: Component
-): Class<Component> | void {
- if (isTrue(factory.error) && isDef(factory.errorComp)) {
- return factory.errorComp
- }
-
- if (isDef(factory.resolved)) {
- return factory.resolved
- }
-
- if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
- return factory.loadingComp
- }
-
- if (isDef(factory.contexts)) {
- // already pending
- factory.contexts.push(context)
- } else {
- const contexts = factory.contexts = [context]
- let sync = true
-
- const forceRender = () => {
- for (let i = 0, l = contexts.length; i < l; i++) {
- contexts[i].$forceUpdate()
- }
- }
-
- const resolve = once((res: Object | Class<Component>) => {
- // cache resolved
- factory.resolved = ensureCtor(res, baseCtor)
- // invoke callbacks only if this is not a synchronous resolve
- // (async resolves are shimmed as synchronous during SSR)
- if (!sync) {
- forceRender()
- }
- })
-
- const reject = once(reason => {
- process.env.NODE_ENV !== 'production' && warn(
- `Failed to resolve async component: ${String(factory)}` +
- (reason ? `\nReason: ${reason}` : '')
- )
- if (isDef(factory.errorComp)) {
- factory.error = true
- forceRender()
- }
- })
-
- const res = factory(resolve, reject)
-
- if (isObject(res)) {
- if (typeof res.then === 'function') {
- // () => Promise
- if (isUndef(factory.resolved)) {
- res.then(resolve, reject)
- }
- } else if (isDef(res.component) && typeof res.component.then === 'function') {
- res.component.then(resolve, reject)
-
- if (isDef(res.error)) {
- factory.errorComp = ensureCtor(res.error, baseCtor)
- }
-
- if (isDef(res.loading)) {
- factory.loadingComp = ensureCtor(res.loading, baseCtor)
- if (res.delay === 0) {
- factory.loading = true
- } else {
- setTimeout(() => {
- if (isUndef(factory.resolved) && isUndef(factory.error)) {
- factory.loading = true
- forceRender()
- }
- }, res.delay || 200)
- }
- }
-
- if (isDef(res.timeout)) {
- setTimeout(() => {
- if (isUndef(factory.resolved)) {
- reject(
- process.env.NODE_ENV !== 'production'
- ? `timeout (${res.timeout}ms)`
- : null
- )
- }
- }, res.timeout)
- }
- }
- }
-
- sync = false
- // return in case resolved synchronously
- return factory.loading
- ? factory.loadingComp
- : factory.resolved
- }
-}
+++ /dev/null
-/* @flow */
-
-import { warn } from 'core/util/index'
-import { cached, isUndef, isPlainObject } from 'shared/util'
-
-const normalizeEvent = cached((name: string): {
- name: string,
- once: boolean,
- capture: boolean,
- passive: boolean,
- handler?: Function,
- params?: Array<any>
-} => {
- const passive = name.charAt(0) === '&'
- name = passive ? name.slice(1) : name
- const once = name.charAt(0) === '~' // Prefixed last, checked first
- name = once ? name.slice(1) : name
- const capture = name.charAt(0) === '!'
- name = capture ? name.slice(1) : name
- return {
- name,
- once,
- capture,
- passive
- }
-})
-
-export function createFnInvoker (fns: Function | Array<Function>): Function {
- function invoker () {
- const fns = invoker.fns
- if (Array.isArray(fns)) {
- const cloned = fns.slice()
- for (let i = 0; i < cloned.length; i++) {
- cloned[i].apply(null, arguments)
- }
- } else {
- // return handler return value for single handlers
- return fns.apply(null, arguments)
- }
- }
- invoker.fns = fns
- return invoker
-}
-
-export function updateListeners (
- on: Object,
- oldOn: Object,
- add: Function,
- remove: Function,
- vm: Component
-) {
- let name, def, cur, old, event
- for (name in on) {
- def = cur = on[name]
- old = oldOn[name]
- event = normalizeEvent(name)
- /* istanbul ignore if */
- if (__WEEX__ && isPlainObject(def)) {
- cur = def.handler
- event.params = def.params
- }
- if (isUndef(cur)) {
- process.env.NODE_ENV !== 'production' && warn(
- `Invalid handler for event "${event.name}": got ` + String(cur),
- vm
- )
- } else if (isUndef(old)) {
- if (isUndef(cur.fns)) {
- cur = on[name] = createFnInvoker(cur)
- }
- add(event.name, cur, event.once, event.capture, event.passive, event.params)
- } else if (cur !== old) {
- old.fns = cur
- on[name] = old
- }
- }
- for (name in oldOn) {
- if (isUndef(on[name])) {
- event = normalizeEvent(name)
- remove(event.name, oldOn[name], event.capture)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { emptyNode } from 'core/vdom/patch'
-import { resolveAsset, handleError } from 'core/util/index'
-import { mergeVNodeHook } from 'core/vdom/helpers/index'
-
-export default {
- create: updateDirectives,
- update: updateDirectives,
- destroy: function unbindDirectives (vnode: VNodeWithData) {
- updateDirectives(vnode, emptyNode)
- }
-}
-
-function updateDirectives (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (oldVnode.data.directives || vnode.data.directives) {
- _update(oldVnode, vnode)
- }
-}
-
-function _update (oldVnode, vnode) {
- const isCreate = oldVnode === emptyNode
- const isDestroy = vnode === emptyNode
- const oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context)
- const newDirs = normalizeDirectives(vnode.data.directives, vnode.context)
-
- const dirsWithInsert = []
- const dirsWithPostpatch = []
-
- let key, oldDir, dir
- for (key in newDirs) {
- oldDir = oldDirs[key]
- dir = newDirs[key]
- if (!oldDir) {
- // new directive, bind
- callHook(dir, 'bind', vnode, oldVnode)
- if (dir.def && dir.def.inserted) {
- dirsWithInsert.push(dir)
- }
- } else {
- // existing directive, update
- dir.oldValue = oldDir.value
- callHook(dir, 'update', vnode, oldVnode)
- if (dir.def && dir.def.componentUpdated) {
- dirsWithPostpatch.push(dir)
- }
- }
- }
-
- if (dirsWithInsert.length) {
- const callInsert = () => {
- for (let i = 0; i < dirsWithInsert.length; i++) {
- callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode)
- }
- }
- if (isCreate) {
- mergeVNodeHook(vnode, 'insert', callInsert)
- } else {
- callInsert()
- }
- }
-
- if (dirsWithPostpatch.length) {
- mergeVNodeHook(vnode, 'postpatch', () => {
- for (let i = 0; i < dirsWithPostpatch.length; i++) {
- callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode)
- }
- })
- }
-
- if (!isCreate) {
- for (key in oldDirs) {
- if (!newDirs[key]) {
- // no longer present, unbind
- callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy)
- }
- }
- }
-}
-
-const emptyModifiers = Object.create(null)
-
-function normalizeDirectives (
- dirs: ?Array<VNodeDirective>,
- vm: Component
-): { [key: string]: VNodeDirective } {
- const res = Object.create(null)
- if (!dirs) {
- // $flow-disable-line
- return res
- }
- let i, dir
- for (i = 0; i < dirs.length; i++) {
- dir = dirs[i]
- if (!dir.modifiers) {
- // $flow-disable-line
- dir.modifiers = emptyModifiers
- }
- res[getRawDirName(dir)] = dir
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true)
- }
- // $flow-disable-line
- return res
-}
-
-function getRawDirName (dir: VNodeDirective): string {
- return dir.rawName || `${dir.name}.${Object.keys(dir.modifiers || {}).join('.')}`
-}
-
-function callHook (dir, hook, vnode, oldVnode, isDestroy) {
- const fn = dir.def && dir.def[hook]
- if (fn) {
- try {
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy)
- } catch (e) {
- handleError(e, vnode.context, `directive ${dir.name} ${hook} hook`)
- }
- }
-}
+++ /dev/null
-import directives from './directives'
-import ref from './ref'
-
-export default [
- ref,
- directives
-]
+++ /dev/null
-/* @flow */
-
-import { remove, isDef } from 'shared/util'
-
-export default {
- create (_: any, vnode: VNodeWithData) {
- registerRef(vnode)
- },
- update (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (oldVnode.data.ref !== vnode.data.ref) {
- registerRef(oldVnode, true)
- registerRef(vnode)
- }
- },
- destroy (vnode: VNodeWithData) {
- registerRef(vnode, true)
- }
-}
-
-export function registerRef (vnode: VNodeWithData, isRemoval: ?boolean) {
- const key = vnode.data.ref
- if (!isDef(key)) return
-
- const vm = vnode.context
- const ref = vnode.componentInstance || vnode.elm
- const refs = vm.$refs
- if (isRemoval) {
- if (Array.isArray(refs[key])) {
- remove(refs[key], ref)
- } else if (refs[key] === ref) {
- refs[key] = undefined
- }
- } else {
- if (vnode.data.refInFor) {
- if (!Array.isArray(refs[key])) {
- refs[key] = [ref]
- } else if (refs[key].indexOf(ref) < 0) {
- // $flow-disable-line
- refs[key].push(ref)
- }
- } else {
- refs[key] = ref
- }
- }
-}
+++ /dev/null
-/**
- * Virtual DOM patching algorithm based on Snabbdom by
- * Simon Friis Vindum (@paldepind)
- * Licensed under the MIT License
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
- *
- * modified by Evan You (@yyx990803)
- *
- * Not type-checking this because this file is perf-critical and the cost
- * of making flow understand it is not worth it.
- */
-
-import VNode, { cloneVNode } from './vnode'
-import config from '../config'
-import { SSR_ATTR } from 'shared/constants'
-import { registerRef } from './modules/ref'
-import { traverse } from '../observer/traverse'
-import { activeInstance } from '../instance/lifecycle'
-import { isTextInputType } from 'web/util/element'
-
-import {
- warn,
- isDef,
- isUndef,
- isTrue,
- makeMap,
- isRegExp,
- isPrimitive
-} from '../util/index'
-
-export const emptyNode = new VNode('', {}, [])
-
-const hooks = ['create', 'activate', 'update', 'remove', 'destroy']
-
-function sameVnode (a, b) {
- return (
- a.key === b.key && (
- (
- a.tag === b.tag &&
- a.isComment === b.isComment &&
- isDef(a.data) === isDef(b.data) &&
- sameInputType(a, b)
- ) || (
- isTrue(a.isAsyncPlaceholder) &&
- a.asyncFactory === b.asyncFactory &&
- isUndef(b.asyncFactory.error)
- )
- )
- )
-}
-
-function sameInputType (a, b) {
- if (a.tag !== 'input') return true
- let i
- const typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type
- const typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type
- return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
-}
-
-function createKeyToOldIdx (children, beginIdx, endIdx) {
- let i, key
- const map = {}
- for (i = beginIdx; i <= endIdx; ++i) {
- key = children[i].key
- if (isDef(key)) map[key] = i
- }
- return map
-}
-
-export function createPatchFunction (backend) {
- let i, j
- const cbs = {}
-
- const { modules, nodeOps } = backend
-
- for (i = 0; i < hooks.length; ++i) {
- cbs[hooks[i]] = []
- for (j = 0; j < modules.length; ++j) {
- if (isDef(modules[j][hooks[i]])) {
- cbs[hooks[i]].push(modules[j][hooks[i]])
- }
- }
- }
-
- function emptyNodeAt (elm) {
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
- }
-
- function createRmCb (childElm, listeners) {
- function remove () {
- if (--remove.listeners === 0) {
- removeNode(childElm)
- }
- }
- remove.listeners = listeners
- return remove
- }
-
- function removeNode (el) {
- const parent = nodeOps.parentNode(el)
- // element may have already been removed due to v-html / v-text
- if (isDef(parent)) {
- nodeOps.removeChild(parent, el)
- }
- }
-
- function isUnknownElement (vnode, inVPre) {
- return (
- !inVPre &&
- !vnode.ns &&
- !(
- config.ignoredElements.length &&
- config.ignoredElements.some(ignore => {
- return isRegExp(ignore)
- ? ignore.test(vnode.tag)
- : ignore === vnode.tag
- })
- ) &&
- config.isUnknownElement(vnode.tag)
- )
- }
-
- let creatingElmInVPre = 0
-
- function createElm (
- vnode,
- insertedVnodeQueue,
- parentElm,
- refElm,
- nested,
- ownerArray,
- index
- ) {
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // This vnode was used in a previous render!
- // now it's used as a new node, overwriting its elm would cause
- // potential patch errors down the road when it's used as an insertion
- // reference node. Instead, we clone the node on-demand before creating
- // associated DOM element for it.
- vnode = ownerArray[index] = cloneVNode(vnode)
- }
-
- vnode.isRootInsert = !nested // for transition enter check
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
- return
- }
-
- const data = vnode.data
- const children = vnode.children
- const tag = vnode.tag
- if (isDef(tag)) {
- if (process.env.NODE_ENV !== 'production') {
- if (data && data.pre) {
- creatingElmInVPre++
- }
- if (isUnknownElement(vnode, creatingElmInVPre)) {
- warn(
- 'Unknown custom element: <' + tag + '> - did you ' +
- 'register the component correctly? For recursive components, ' +
- 'make sure to provide the "name" option.',
- vnode.context
- )
- }
- }
-
- vnode.elm = vnode.ns
- ? nodeOps.createElementNS(vnode.ns, tag)
- : nodeOps.createElement(tag, vnode)
- setScope(vnode)
-
- /* istanbul ignore if */
- if (__WEEX__) {
- // in Weex, the default insertion order is parent-first.
- // List items can be optimized to use children-first insertion
- // with append="tree".
- const appendAsTree = isDef(data) && isTrue(data.appendAsTree)
- if (!appendAsTree) {
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue)
- }
- insert(parentElm, vnode.elm, refElm)
- }
- createChildren(vnode, children, insertedVnodeQueue)
- if (appendAsTree) {
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue)
- }
- insert(parentElm, vnode.elm, refElm)
- }
- } else {
- createChildren(vnode, children, insertedVnodeQueue)
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue)
- }
- insert(parentElm, vnode.elm, refElm)
- }
-
- if (process.env.NODE_ENV !== 'production' && data && data.pre) {
- creatingElmInVPre--
- }
- } else if (isTrue(vnode.isComment)) {
- vnode.elm = nodeOps.createComment(vnode.text)
- insert(parentElm, vnode.elm, refElm)
- } else {
- vnode.elm = nodeOps.createTextNode(vnode.text)
- insert(parentElm, vnode.elm, refElm)
- }
- }
-
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- let i = vnode.data
- if (isDef(i)) {
- const isReactivated = isDef(vnode.componentInstance) && i.keepAlive
- if (isDef(i = i.hook) && isDef(i = i.init)) {
- i(vnode, false /* hydrating */, parentElm, refElm)
- }
- // after calling the init hook, if the vnode is a child component
- // it should've created a child instance and mounted it. the child
- // component also has set the placeholder vnode's elm.
- // in that case we can just return the element and be done.
- if (isDef(vnode.componentInstance)) {
- initComponent(vnode, insertedVnodeQueue)
- if (isTrue(isReactivated)) {
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm)
- }
- return true
- }
- }
- }
-
- function initComponent (vnode, insertedVnodeQueue) {
- if (isDef(vnode.data.pendingInsert)) {
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert)
- vnode.data.pendingInsert = null
- }
- vnode.elm = vnode.componentInstance.$el
- if (isPatchable(vnode)) {
- invokeCreateHooks(vnode, insertedVnodeQueue)
- setScope(vnode)
- } else {
- // empty component root.
- // skip all element-related modules except for ref (#3455)
- registerRef(vnode)
- // make sure to invoke the insert hook
- insertedVnodeQueue.push(vnode)
- }
- }
-
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- let i
- // hack for #4339: a reactivated component with inner transition
- // does not trigger because the inner node's created hooks are not called
- // again. It's not ideal to involve module-specific logic in here but
- // there doesn't seem to be a better way to do it.
- let innerNode = vnode
- while (innerNode.componentInstance) {
- innerNode = innerNode.componentInstance._vnode
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
- for (i = 0; i < cbs.activate.length; ++i) {
- cbs.activate[i](emptyNode, innerNode)
- }
- insertedVnodeQueue.push(innerNode)
- break
- }
- }
- // unlike a newly created component,
- // a reactivated keep-alive component doesn't insert itself
- insert(parentElm, vnode.elm, refElm)
- }
-
- function insert (parent, elm, ref) {
- if (isDef(parent)) {
- if (isDef(ref)) {
- if (ref.parentNode === parent) {
- nodeOps.insertBefore(parent, elm, ref)
- }
- } else {
- nodeOps.appendChild(parent, elm)
- }
- }
- }
-
- function createChildren (vnode, children, insertedVnodeQueue) {
- if (Array.isArray(children)) {
- if (process.env.NODE_ENV !== 'production') {
- checkDuplicateKeys(children)
- }
- for (let i = 0; i < children.length; ++i) {
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i)
- }
- } else if (isPrimitive(vnode.text)) {
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)))
- }
- }
-
- function isPatchable (vnode) {
- while (vnode.componentInstance) {
- vnode = vnode.componentInstance._vnode
- }
- return isDef(vnode.tag)
- }
-
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
- for (let i = 0; i < cbs.create.length; ++i) {
- cbs.create[i](emptyNode, vnode)
- }
- i = vnode.data.hook // Reuse variable
- if (isDef(i)) {
- if (isDef(i.create)) i.create(emptyNode, vnode)
- if (isDef(i.insert)) insertedVnodeQueue.push(vnode)
- }
- }
-
- // set scope id attribute for scoped CSS.
- // this is implemented as a special case to avoid the overhead
- // of going through the normal attribute patching process.
- function setScope (vnode) {
- let i
- if (isDef(i = vnode.fnScopeId)) {
- nodeOps.setStyleScope(vnode.elm, i)
- } else {
- let ancestor = vnode
- while (ancestor) {
- if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
- nodeOps.setStyleScope(vnode.elm, i)
- }
- 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.fnContext &&
- isDef(i = i.$options._scopeId)
- ) {
- nodeOps.setStyleScope(vnode.elm, i)
- }
- }
-
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
- for (; startIdx <= endIdx; ++startIdx) {
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx)
- }
- }
-
- function invokeDestroyHook (vnode) {
- let i, j
- const data = vnode.data
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.destroy)) i(vnode)
- for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode)
- }
- if (isDef(i = vnode.children)) {
- for (j = 0; j < vnode.children.length; ++j) {
- invokeDestroyHook(vnode.children[j])
- }
- }
- }
-
- function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
- for (; startIdx <= endIdx; ++startIdx) {
- const ch = vnodes[startIdx]
- if (isDef(ch)) {
- if (isDef(ch.tag)) {
- removeAndInvokeRemoveHook(ch)
- invokeDestroyHook(ch)
- } else { // Text node
- removeNode(ch.elm)
- }
- }
- }
- }
-
- function removeAndInvokeRemoveHook (vnode, rm) {
- if (isDef(rm) || isDef(vnode.data)) {
- let i
- const listeners = cbs.remove.length + 1
- if (isDef(rm)) {
- // we have a recursively passed down rm callback
- // increase the listeners count
- rm.listeners += listeners
- } else {
- // directly removing
- rm = createRmCb(vnode.elm, listeners)
- }
- // recursively invoke hooks on child component root node
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
- removeAndInvokeRemoveHook(i, rm)
- }
- for (i = 0; i < cbs.remove.length; ++i) {
- cbs.remove[i](vnode, rm)
- }
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
- i(vnode, rm)
- } else {
- rm()
- }
- } else {
- removeNode(vnode.elm)
- }
- }
-
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
- let oldStartIdx = 0
- let newStartIdx = 0
- let oldEndIdx = oldCh.length - 1
- let oldStartVnode = oldCh[0]
- let oldEndVnode = oldCh[oldEndIdx]
- let newEndIdx = newCh.length - 1
- let newStartVnode = newCh[0]
- let newEndVnode = newCh[newEndIdx]
- let oldKeyToIdx, idxInOld, vnodeToMove, refElm
-
- // removeOnly is a special flag used only by <transition-group>
- // to ensure removed elements stay in correct relative positions
- // during leaving transitions
- const canMove = !removeOnly
-
- if (process.env.NODE_ENV !== 'production') {
- checkDuplicateKeys(newCh)
- }
-
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
- if (isUndef(oldStartVnode)) {
- oldStartVnode = oldCh[++oldStartIdx] // Vnode has been moved left
- } else if (isUndef(oldEndVnode)) {
- oldEndVnode = oldCh[--oldEndIdx]
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue)
- oldStartVnode = oldCh[++oldStartIdx]
- newStartVnode = newCh[++newStartIdx]
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue)
- oldEndVnode = oldCh[--oldEndIdx]
- newEndVnode = newCh[--newEndIdx]
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue)
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm))
- oldStartVnode = oldCh[++oldStartIdx]
- newEndVnode = newCh[--newEndIdx]
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue)
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm)
- oldEndVnode = oldCh[--oldEndIdx]
- newStartVnode = newCh[++newStartIdx]
- } else {
- if (isUndef(oldKeyToIdx)) oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx)
- idxInOld = isDef(newStartVnode.key)
- ? oldKeyToIdx[newStartVnode.key]
- : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx)
- if (isUndef(idxInOld)) { // New element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx)
- } else {
- vnodeToMove = oldCh[idxInOld]
- if (sameVnode(vnodeToMove, newStartVnode)) {
- patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue)
- oldCh[idxInOld] = undefined
- canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm)
- } else {
- // same key but different element. treat as new element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx)
- }
- }
- newStartVnode = newCh[++newStartIdx]
- }
- }
- if (oldStartIdx > oldEndIdx) {
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue)
- } else if (newStartIdx > newEndIdx) {
- removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx)
- }
- }
-
- function checkDuplicateKeys (children) {
- const seenKeys = {}
- for (let i = 0; i < children.length; i++) {
- const vnode = children[i]
- const key = vnode.key
- if (isDef(key)) {
- if (seenKeys[key]) {
- warn(
- `Duplicate keys detected: '${key}'. This may cause an update error.`,
- vnode.context
- )
- } else {
- seenKeys[key] = true
- }
- }
- }
- }
-
- function findIdxInOld (node, oldCh, start, end) {
- for (let i = start; i < end; i++) {
- const c = oldCh[i]
- if (isDef(c) && sameVnode(node, c)) return i
- }
- }
-
- function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
- if (oldVnode === vnode) {
- return
- }
-
- const elm = vnode.elm = oldVnode.elm
-
- if (isTrue(oldVnode.isAsyncPlaceholder)) {
- if (isDef(vnode.asyncFactory.resolved)) {
- hydrate(oldVnode.elm, vnode, insertedVnodeQueue)
- } else {
- vnode.isAsyncPlaceholder = true
- }
- return
- }
-
- // reuse element for static trees.
- // note we only do this if the vnode is cloned -
- // if the new node is not cloned it means the render functions have been
- // reset by the hot-reload-api and we need to do a proper re-render.
- if (isTrue(vnode.isStatic) &&
- isTrue(oldVnode.isStatic) &&
- vnode.key === oldVnode.key &&
- (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
- ) {
- vnode.componentInstance = oldVnode.componentInstance
- return
- }
-
- let i
- const data = vnode.data
- if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
- i(oldVnode, vnode)
- }
-
- const oldCh = oldVnode.children
- const ch = vnode.children
- if (isDef(data) && isPatchable(vnode)) {
- for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode)
- if (isDef(i = data.hook) && isDef(i = i.update)) i(oldVnode, vnode)
- }
- if (isUndef(vnode.text)) {
- if (isDef(oldCh) && isDef(ch)) {
- if (oldCh !== ch) updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly)
- } else if (isDef(ch)) {
- if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '')
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue)
- } else if (isDef(oldCh)) {
- removeVnodes(elm, oldCh, 0, oldCh.length - 1)
- } else if (isDef(oldVnode.text)) {
- nodeOps.setTextContent(elm, '')
- }
- } else if (oldVnode.text !== vnode.text) {
- nodeOps.setTextContent(elm, vnode.text)
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) i(oldVnode, vnode)
- }
- }
-
- function invokeInsertHook (vnode, queue, initial) {
- // delay insert hooks for component root nodes, invoke them after the
- // element is really inserted
- if (isTrue(initial) && isDef(vnode.parent)) {
- vnode.parent.data.pendingInsert = queue
- } else {
- for (let i = 0; i < queue.length; ++i) {
- queue[i].data.hook.insert(queue[i])
- }
- }
- }
-
- let hydrationBailed = false
- // list of modules that can skip create hook during hydration because they
- // are already rendered on the client or has no need for initialization
- // Note: style is excluded because it relies on initial clone for future
- // deep updates (#7063).
- const isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key')
-
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
- function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
- let i
- const { tag, data, children } = vnode
- inVPre = inVPre || (data && data.pre)
- vnode.elm = elm
-
- if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
- vnode.isAsyncPlaceholder = true
- return true
- }
- // assert node match
- if (process.env.NODE_ENV !== 'production') {
- if (!assertNodeMatch(elm, vnode, inVPre)) {
- return false
- }
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.init)) i(vnode, true /* hydrating */)
- if (isDef(i = vnode.componentInstance)) {
- // child component. it should have hydrated its own tree.
- initComponent(vnode, insertedVnodeQueue)
- return true
- }
- }
- if (isDef(tag)) {
- if (isDef(children)) {
- // empty element, allow client to pick up and populate children
- if (!elm.hasChildNodes()) {
- createChildren(vnode, children, insertedVnodeQueue)
- } else {
- // v-html and domProps: innerHTML
- if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
- if (i !== elm.innerHTML) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' &&
- typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true
- console.warn('Parent: ', elm)
- console.warn('server innerHTML: ', i)
- console.warn('client innerHTML: ', elm.innerHTML)
- }
- return false
- }
- } else {
- // iterate and compare children lists
- let childrenMatch = true
- let childNode = elm.firstChild
- for (let i = 0; i < children.length; i++) {
- if (!childNode || !hydrate(childNode, children[i], insertedVnodeQueue, inVPre)) {
- childrenMatch = false
- break
- }
- childNode = childNode.nextSibling
- }
- // if childNode is not null, it means the actual childNodes list is
- // longer than the virtual children list.
- if (!childrenMatch || childNode) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' &&
- typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true
- console.warn('Parent: ', elm)
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children)
- }
- return false
- }
- }
- }
- }
- if (isDef(data)) {
- let fullInvoke = false
- for (const key in data) {
- if (!isRenderedModule(key)) {
- fullInvoke = true
- invokeCreateHooks(vnode, insertedVnodeQueue)
- break
- }
- }
- if (!fullInvoke && data['class']) {
- // ensure collecting deps for deep class bindings for future updates
- traverse(data['class'])
- }
- }
- } else if (elm.data !== vnode.text) {
- elm.data = vnode.text
- }
- return true
- }
-
- function assertNodeMatch (node, vnode, inVPre) {
- if (isDef(vnode.tag)) {
- return vnode.tag.indexOf('vue-component') === 0 || (
- !isUnknownElement(vnode, inVPre) &&
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
- )
- } else {
- return node.nodeType === (vnode.isComment ? 8 : 3)
- }
- }
-
- return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
- if (isUndef(vnode)) {
- if (isDef(oldVnode)) invokeDestroyHook(oldVnode)
- return
- }
-
- let isInitialPatch = false
- const insertedVnodeQueue = []
-
- if (isUndef(oldVnode)) {
- // empty mount (likely as component), create new root element
- isInitialPatch = true
- createElm(vnode, insertedVnodeQueue, parentElm, refElm)
- } else {
- const isRealElement = isDef(oldVnode.nodeType)
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
- // patch existing root node
- patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly)
- } else {
- if (isRealElement) {
- // mounting to a real element
- // check if this is server-rendered content and if we can perform
- // a successful hydration.
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
- oldVnode.removeAttribute(SSR_ATTR)
- hydrating = true
- }
- if (isTrue(hydrating)) {
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
- invokeInsertHook(vnode, insertedVnodeQueue, true)
- return oldVnode
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- 'The client-side rendered virtual DOM tree is not matching ' +
- 'server-rendered content. This is likely caused by incorrect ' +
- 'HTML markup, for example nesting block-level elements inside ' +
- '<p>, or missing <tbody>. Bailing hydration and performing ' +
- 'full client-side render.'
- )
- }
- }
- // either not server-rendered, or hydration failed.
- // create an empty node and replace it
- oldVnode = emptyNodeAt(oldVnode)
- }
-
- // replacing existing element
- const oldElm = oldVnode.elm
- const parentElm = nodeOps.parentNode(oldElm)
-
- // create new node
- createElm(
- vnode,
- insertedVnodeQueue,
- // extremely rare edge case: do not insert if old element is in a
- // leaving transition. Only happens when combining transition +
- // keep-alive + HOCs. (#4590)
- oldElm._leaveCb ? null : parentElm,
- nodeOps.nextSibling(oldElm)
- )
-
- // update parent placeholder node element, recursively
- if (isDef(vnode.parent)) {
- let ancestor = vnode.parent
- const patchable = isPatchable(vnode)
- while (ancestor) {
- for (let i = 0; i < cbs.destroy.length; ++i) {
- cbs.destroy[i](ancestor)
- }
- ancestor.elm = vnode.elm
- if (patchable) {
- for (let i = 0; i < cbs.create.length; ++i) {
- cbs.create[i](emptyNode, ancestor)
- }
- // #6513
- // invoke insert hooks that may have been merged by create hooks.
- // e.g. for directives that uses the "inserted" hook.
- const insert = ancestor.data.hook.insert
- if (insert.merged) {
- // start at index 1 to avoid re-invoking component mounted hook
- for (let i = 1; i < insert.fns.length; i++) {
- insert.fns[i]()
- }
- }
- } else {
- registerRef(ancestor)
- }
- ancestor = ancestor.parent
- }
- }
-
- // destroy old node
- if (isDef(parentElm)) {
- removeVnodes(parentElm, [oldVnode], 0, 0)
- } else if (isDef(oldVnode.tag)) {
- invokeDestroyHook(oldVnode)
- }
- }
- }
-
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch)
- return vnode.elm
- }
-}
+++ /dev/null
-/* @flow */
-
-export default class VNode {
- tag: string | void;
- data: VNodeData | void;
- children: ?Array<VNode>;
- text: string | void;
- elm: Node | void;
- ns: string | void;
- context: Component | void; // rendered in this component's scope
- key: string | number | void;
- componentOptions: VNodeComponentOptions | void;
- componentInstance: Component | void; // component instance
- parent: VNode | void; // component placeholder node
-
- // strictly internal
- raw: boolean; // contains raw HTML? (server only)
- isStatic: boolean; // hoisted static node
- isRootInsert: boolean; // necessary for enter transition check
- isComment: boolean; // empty comment placeholder?
- isCloned: boolean; // is a cloned node?
- isOnce: boolean; // is a v-once node?
- asyncFactory: Function | void; // async component factory function
- asyncMeta: Object | void;
- isAsyncPlaceholder: boolean;
- ssrContext: Object | void;
- fnContext: Component | void; // real context vm for functional nodes
- fnOptions: ?ComponentOptions; // for SSR caching
- fnScopeId: ?string; // functional scope id support
-
- constructor (
- tag?: string,
- data?: VNodeData,
- children?: ?Array<VNode>,
- text?: string,
- elm?: Node,
- context?: Component,
- componentOptions?: VNodeComponentOptions,
- asyncFactory?: Function
- ) {
- this.tag = tag
- this.data = data
- this.children = children
- this.text = text
- this.elm = elm
- this.ns = undefined
- this.context = context
- this.fnContext = undefined
- this.fnOptions = undefined
- this.fnScopeId = 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
- }
-
- // DEPRECATED: alias for componentInstance for backwards compat.
- /* istanbul ignore next */
- get child (): Component | void {
- return this.componentInstance
- }
-}
-
-export const createEmptyVNode = (text: string = '') => {
- const node = new VNode()
- node.text = text
- node.isComment = true
- return node
-}
-
-export function createTextVNode (val: string | number) {
- 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.
-export function cloneVNode (vnode: VNode): VNode {
- const 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.fnContext = vnode.fnContext
- cloned.fnOptions = vnode.fnOptions
- cloned.fnScopeId = vnode.fnScopeId
- cloned.isCloned = true
- return cloned
-}
+++ /dev/null
-/* @flow */
-
-import { addProp } from 'compiler/helpers'
-
-export default function html (el: ASTElement, dir: ASTDirective) {
- if (dir.value) {
- addProp(el, 'innerHTML', `_s(${dir.value})`)
- }
-}
+++ /dev/null
-import model from './model'
-import text from './text'
-import html from './html'
-
-export default {
- model,
- text,
- html
-}
+++ /dev/null
-/* @flow */
-
-import config from 'core/config'
-import { addHandler, addProp, getBindingAttr } from 'compiler/helpers'
-import { genComponentModel, genAssignmentCode } from 'compiler/directives/model'
-
-let warn
-
-// in some cases, the event used has to be determined at runtime
-// so we used some reserved tokens during compile.
-export const RANGE_TOKEN = '__r'
-export const CHECKBOX_RADIO_TOKEN = '__c'
-
-export default function model (
- el: ASTElement,
- dir: ASTDirective,
- _warn: Function
-): ?boolean {
- warn = _warn
- const value = dir.value
- const modifiers = dir.modifiers
- const tag = el.tag
- const type = el.attrsMap.type
-
- if (process.env.NODE_ENV !== 'production') {
- // inputs with type="file" are read only and setting the input's
- // value will throw an error.
- if (tag === 'input' && type === 'file') {
- warn(
- `<${el.tag} v-model="${value}" type="file">:\n` +
- `File inputs are read only. Use a v-on:change listener instead.`
- )
- }
- }
-
- if (el.component) {
- genComponentModel(el, value, modifiers)
- // component v-model doesn't need extra runtime
- return false
- } else if (tag === 'select') {
- genSelect(el, value, modifiers)
- } else if (tag === 'input' && type === 'checkbox') {
- genCheckboxModel(el, value, modifiers)
- } else if (tag === 'input' && type === 'radio') {
- genRadioModel(el, value, modifiers)
- } else if (tag === 'input' || tag === 'textarea') {
- genDefaultModel(el, value, modifiers)
- } else if (!config.isReservedTag(tag)) {
- genComponentModel(el, value, modifiers)
- // component v-model doesn't need extra runtime
- return false
- } else if (process.env.NODE_ENV !== 'production') {
- warn(
- `<${el.tag} v-model="${value}">: ` +
- `v-model is not supported on this element type. ` +
- 'If you are working with contenteditable, it\'s recommended to ' +
- 'wrap a library dedicated for that purpose inside a custom component.'
- )
- }
-
- // ensure runtime directive metadata
- return true
-}
-
-function genCheckboxModel (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-) {
- const number = modifiers && modifiers.number
- const valueBinding = getBindingAttr(el, 'value') || 'null'
- const trueValueBinding = getBindingAttr(el, 'true-value') || 'true'
- const falseValueBinding = getBindingAttr(el, 'false-value') || 'false'
- addProp(el, 'checked',
- `Array.isArray(${value})` +
- `?_i(${value},${valueBinding})>-1` + (
- trueValueBinding === 'true'
- ? `:(${value})`
- : `:_q(${value},${trueValueBinding})`
- )
- )
- addHandler(el, 'change',
- `var $$a=${value},` +
- '$$el=$event.target,' +
- `$$c=$$el.checked?(${trueValueBinding}):(${falseValueBinding});` +
- 'if(Array.isArray($$a)){' +
- `var $$v=${number ? '_n(' + valueBinding + ')' : valueBinding},` +
- '$$i=_i($$a,$$v);' +
- `if($$el.checked){$$i<0&&(${genAssignmentCode(value, '$$a.concat([$$v])')})}` +
- `else{$$i>-1&&(${genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')})}` +
- `}else{${genAssignmentCode(value, '$$c')}}`,
- null, true
- )
-}
-
-function genRadioModel (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-) {
- const number = modifiers && modifiers.number
- let valueBinding = getBindingAttr(el, 'value') || 'null'
- valueBinding = number ? `_n(${valueBinding})` : valueBinding
- addProp(el, 'checked', `_q(${value},${valueBinding})`)
- addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true)
-}
-
-function genSelect (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-) {
- const number = modifiers && modifiers.number
- const selectedVal = `Array.prototype.filter` +
- `.call($event.target.options,function(o){return o.selected})` +
- `.map(function(o){var val = "_value" in o ? o._value : o.value;` +
- `return ${number ? '_n(val)' : 'val'}})`
-
- const assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'
- let code = `var $$selectedVal = ${selectedVal};`
- code = `${code} ${genAssignmentCode(value, assignment)}`
- addHandler(el, 'change', code, null, true)
-}
-
-function genDefaultModel (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-): ?boolean {
- const type = el.attrsMap.type
-
- // warn if v-bind:value conflicts with v-model
- // except for inputs with v-bind:type
- if (process.env.NODE_ENV !== 'production') {
- const value = el.attrsMap['v-bind:value'] || el.attrsMap[':value']
- const typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']
- if (value && !typeBinding) {
- const binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'
- warn(
- `${binding}="${value}" conflicts with v-model on the same element ` +
- 'because the latter already expands to a value binding internally'
- )
- }
- }
-
- const { lazy, number, trim } = modifiers || {}
- const needCompositionGuard = !lazy && type !== 'range'
- const event = lazy
- ? 'change'
- : type === 'range'
- ? RANGE_TOKEN
- : 'input'
-
- let valueExpression = '$event.target.value'
- if (trim) {
- valueExpression = `$event.target.value.trim()`
- }
- if (number) {
- valueExpression = `_n(${valueExpression})`
- }
-
- let code = genAssignmentCode(value, valueExpression)
- if (needCompositionGuard) {
- code = `if($event.target.composing)return;${code}`
- }
-
- addProp(el, 'value', `(${value})`)
- addHandler(el, event, code, null, true)
- if (trim || number) {
- addHandler(el, 'blur', '$forceUpdate()')
- }
-}
+++ /dev/null
-/* @flow */
-
-import { addProp } from 'compiler/helpers'
-
-export default function text (el: ASTElement, dir: ASTDirective) {
- if (dir.value) {
- addProp(el, 'textContent', `_s(${dir.value})`)
- }
-}
+++ /dev/null
-/* @flow */
-
-import { baseOptions } from './options'
-import { createCompiler } from 'compiler/index'
-
-const { compile, compileToFunctions } = createCompiler(baseOptions)
-
-export { compile, compileToFunctions }
+++ /dev/null
-/* @flow */
-
-import { parseText } from 'compiler/parser/text-parser'
-import {
- getAndRemoveAttr,
- getBindingAttr,
- baseWarn
-} from 'compiler/helpers'
-
-function transformNode (el: ASTElement, options: CompilerOptions) {
- const warn = options.warn || baseWarn
- const staticClass = getAndRemoveAttr(el, 'class')
- if (process.env.NODE_ENV !== 'production' && staticClass) {
- const res = parseText(staticClass, options.delimiters)
- if (res) {
- warn(
- `class="${staticClass}": ` +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div class="{{ val }}">, use <div :class="val">.'
- )
- }
- }
- if (staticClass) {
- el.staticClass = JSON.stringify(staticClass)
- }
- const classBinding = getBindingAttr(el, 'class', false /* getStatic */)
- if (classBinding) {
- el.classBinding = classBinding
- }
-}
-
-function genData (el: ASTElement): string {
- let data = ''
- if (el.staticClass) {
- data += `staticClass:${el.staticClass},`
- }
- if (el.classBinding) {
- data += `class:${el.classBinding},`
- }
- return data
-}
-
-export default {
- staticKeys: ['staticClass'],
- transformNode,
- genData
-}
+++ /dev/null
-import klass from './class'
-import style from './style'
-import model from './model'
-
-export default [
- klass,
- style,
- model
-]
+++ /dev/null
-/* @flow */
-
-/**
- * Expand input[v-model] with dyanmic type bindings into v-if-else chains
- * Turn this:
- * <input v-model="data[type]" :type="type">
- * into this:
- * <input v-if="type === 'checkbox'" type="checkbox" v-model="data[type]">
- * <input v-else-if="type === 'radio'" type="radio" v-model="data[type]">
- * <input v-else :type="type" v-model="data[type]">
- */
-
-import {
- addRawAttr,
- getBindingAttr,
- getAndRemoveAttr
-} from 'compiler/helpers'
-
-import {
- processFor,
- processElement,
- addIfCondition,
- createASTElement
-} from 'compiler/parser/index'
-
-function preTransformNode (el: ASTElement, options: CompilerOptions) {
- if (el.tag === 'input') {
- const map = el.attrsMap
- if (!map['v-model']) {
- return
- }
-
- let typeBinding
- if (map[':type'] || map['v-bind:type']) {
- typeBinding = getBindingAttr(el, 'type')
- }
- if (!map.type && !typeBinding && map['v-bind']) {
- typeBinding = `(${map['v-bind']}).type`
- }
-
- if (typeBinding) {
- const ifCondition = getAndRemoveAttr(el, 'v-if', true)
- const ifConditionExtra = ifCondition ? `&&(${ifCondition})` : ``
- const hasElse = getAndRemoveAttr(el, 'v-else', true) != null
- const elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true)
- // 1. checkbox
- const branch0 = cloneASTElement(el)
- // process for on the main node
- processFor(branch0)
- addRawAttr(branch0, 'type', 'checkbox')
- processElement(branch0, options)
- branch0.processed = true // prevent it from double-processed
- branch0.if = `(${typeBinding})==='checkbox'` + ifConditionExtra
- addIfCondition(branch0, {
- exp: branch0.if,
- block: branch0
- })
- // 2. add radio else-if condition
- const branch1 = cloneASTElement(el)
- getAndRemoveAttr(branch1, 'v-for', true)
- addRawAttr(branch1, 'type', 'radio')
- processElement(branch1, options)
- addIfCondition(branch0, {
- exp: `(${typeBinding})==='radio'` + ifConditionExtra,
- block: branch1
- })
- // 3. other
- const branch2 = cloneASTElement(el)
- getAndRemoveAttr(branch2, 'v-for', true)
- addRawAttr(branch2, ':type', typeBinding)
- processElement(branch2, options)
- addIfCondition(branch0, {
- exp: ifCondition,
- block: branch2
- })
-
- if (hasElse) {
- branch0.else = true
- } else if (elseIfCondition) {
- branch0.elseif = elseIfCondition
- }
-
- return branch0
- }
- }
-}
-
-function cloneASTElement (el) {
- return createASTElement(el.tag, el.attrsList.slice(), el.parent)
-}
-
-export default {
- preTransformNode
-}
+++ /dev/null
-/* @flow */
-
-import { parseText } from 'compiler/parser/text-parser'
-import { parseStyleText } from 'web/util/style'
-import {
- getAndRemoveAttr,
- getBindingAttr,
- baseWarn
-} from 'compiler/helpers'
-
-function transformNode (el: ASTElement, options: CompilerOptions) {
- const warn = options.warn || baseWarn
- const staticStyle = getAndRemoveAttr(el, 'style')
- if (staticStyle) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- const res = parseText(staticStyle, options.delimiters)
- if (res) {
- warn(
- `style="${staticStyle}": ` +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div style="{{ val }}">, use <div :style="val">.'
- )
- }
- }
- el.staticStyle = JSON.stringify(parseStyleText(staticStyle))
- }
-
- const styleBinding = getBindingAttr(el, 'style', false /* getStatic */)
- if (styleBinding) {
- el.styleBinding = styleBinding
- }
-}
-
-function genData (el: ASTElement): string {
- let data = ''
- if (el.staticStyle) {
- data += `staticStyle:${el.staticStyle},`
- }
- if (el.styleBinding) {
- data += `style:(${el.styleBinding}),`
- }
- return data
-}
-
-export default {
- staticKeys: ['staticStyle'],
- transformNode,
- genData
-}
+++ /dev/null
-/* @flow */
-
-import {
- isPreTag,
- mustUseProp,
- isReservedTag,
- getTagNamespace
-} from '../util/index'
-
-import modules from './modules/index'
-import directives from './directives/index'
-import { genStaticKeys } from 'shared/util'
-import { isUnaryTag, canBeLeftOpenTag } from './util'
-
-export const baseOptions: CompilerOptions = {
- expectHTML: true,
- modules,
- directives,
- isPreTag,
- isUnaryTag,
- mustUseProp,
- canBeLeftOpenTag,
- isReservedTag,
- getTagNamespace,
- staticKeys: genStaticKeys(modules)
-}
+++ /dev/null
-/* @flow */
-
-import { makeMap } from 'shared/util'
-
-export const isUnaryTag = makeMap(
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
- 'link,meta,param,source,track,wbr'
-)
-
-// Elements that you can, intentionally, leave open
-// (and which close themselves)
-export const canBeLeftOpenTag = makeMap(
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
-)
-
-// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
-// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
-export const isNonPhrasingTag = makeMap(
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
- 'title,tr,track'
-)
+++ /dev/null
-/* @flow */
-
-export { parseComponent } from 'sfc/parser'
-export { compile, compileToFunctions } from './compiler/index'
-export { ssrCompile, ssrCompileToFunctions } from './server/compiler'
+++ /dev/null
-/* @flow */
-
-import config from 'core/config'
-import { warn, cached } from 'core/util/index'
-import { mark, measure } from 'core/util/perf'
-
-import Vue from './runtime/index'
-import { query } from './util/index'
-import { compileToFunctions } from './compiler/index'
-import { shouldDecodeNewlines, shouldDecodeNewlinesForHref } from './util/compat'
-
-const idToTemplate = cached(id => {
- const el = query(id)
- return el && el.innerHTML
-})
-
-const mount = Vue.prototype.$mount
-Vue.prototype.$mount = function (
- el?: string | Element,
- hydrating?: boolean
-): Component {
- el = el && query(el)
-
- /* istanbul ignore if */
- if (el === document.body || el === document.documentElement) {
- process.env.NODE_ENV !== 'production' && warn(
- `Do not mount Vue to <html> or <body> - mount to normal elements instead.`
- )
- return this
- }
-
- const options = this.$options
- // resolve template/el and convert to render function
- if (!options.render) {
- let template = options.template
- if (template) {
- if (typeof template === 'string') {
- if (template.charAt(0) === '#') {
- template = idToTemplate(template)
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && !template) {
- warn(
- `Template element not found or is empty: ${options.template}`,
- this
- )
- }
- }
- } else if (template.nodeType) {
- template = template.innerHTML
- } else {
- if (process.env.NODE_ENV !== 'production') {
- warn('invalid template option:' + template, this)
- }
- return this
- }
- } else if (el) {
- template = getOuterHTML(el)
- }
- if (template) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- mark('compile')
- }
-
- const { render, staticRenderFns } = compileToFunctions(template, {
- shouldDecodeNewlines,
- shouldDecodeNewlinesForHref,
- delimiters: options.delimiters,
- comments: options.comments
- }, this)
- options.render = render
- options.staticRenderFns = staticRenderFns
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
- mark('compile end')
- measure(`vue ${this._name} compile`, 'compile', 'compile end')
- }
- }
- }
- return mount.call(this, el, hydrating)
-}
-
-/**
- * Get outerHTML of elements, taking care
- * of SVG elements in IE as well.
- */
-function getOuterHTML (el: Element): string {
- if (el.outerHTML) {
- return el.outerHTML
- } else {
- const container = document.createElement('div')
- container.appendChild(el.cloneNode(true))
- return container.innerHTML
- }
-}
-
-Vue.compile = compileToFunctions
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import Vue from './runtime/index'
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import modules from './server/modules/index'
-import directives from './server/directives/index'
-import { isUnaryTag, canBeLeftOpenTag } from './compiler/util'
-import { createBasicRenderer } from 'server/create-basic-renderer'
-
-export default createBasicRenderer({
- modules,
- directives,
- isUnaryTag,
- canBeLeftOpenTag
-})
+++ /dev/null
-/* @flow */
-
-process.env.VUE_ENV = 'server'
-
-import { extend } from 'shared/util'
-import modules from './server/modules/index'
-import baseDirectives from './server/directives/index'
-import { isUnaryTag, canBeLeftOpenTag } from './compiler/util'
-
-import { createRenderer as _createRenderer } from 'server/create-renderer'
-import { createBundleRendererCreator } from 'server/bundle-renderer/create-bundle-renderer'
-
-export function createRenderer (options?: Object = {}): {
- renderToString: Function,
- renderToStream: Function
-} {
- return _createRenderer(extend(extend({}, options), {
- isUnaryTag,
- canBeLeftOpenTag,
- modules,
- // user can provide server-side implementations for custom directives
- // when creating the renderer.
- directives: extend(baseDirectives, options.directives)
- }))
-}
-
-export const createBundleRenderer = createBundleRendererCreator(createRenderer)
+++ /dev/null
-/* @flow */
-
-/**
- * Add class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
-export function addClass (el: HTMLElement, cls: ?string) {
- /* istanbul ignore if */
- if (!cls || !(cls = cls.trim())) {
- return
- }
-
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(/\s+/).forEach(c => el.classList.add(c))
- } else {
- el.classList.add(cls)
- }
- } else {
- const cur = ` ${el.getAttribute('class') || ''} `
- if (cur.indexOf(' ' + cls + ' ') < 0) {
- el.setAttribute('class', (cur + cls).trim())
- }
- }
-}
-
-/**
- * Remove class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
-export function removeClass (el: HTMLElement, cls: ?string) {
- /* istanbul ignore if */
- if (!cls || !(cls = cls.trim())) {
- return
- }
-
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(/\s+/).forEach(c => el.classList.remove(c))
- } else {
- el.classList.remove(cls)
- }
- if (!el.classList.length) {
- el.removeAttribute('class')
- }
- } else {
- let cur = ` ${el.getAttribute('class') || ''} `
- const tar = ' ' + cls + ' '
- while (cur.indexOf(tar) >= 0) {
- cur = cur.replace(tar, ' ')
- }
- cur = cur.trim()
- if (cur) {
- el.setAttribute('class', cur)
- } else {
- el.removeAttribute('class')
- }
- }
-}
+++ /dev/null
-import Transition from './transition'
-import TransitionGroup from './transition-group'
-
-export default {
- Transition,
- TransitionGroup
-}
+++ /dev/null
-/* @flow */
-
-// Provides transition support for list items.
-// supports move transitions using the FLIP technique.
-
-// Because the vdom's children update algorithm is "unstable" - i.e.
-// it doesn't guarantee the relative positioning of removed elements,
-// we force transition-group to update its children into two passes:
-// in the first pass, we remove all nodes that need to be removed,
-// triggering their leaving transition; in the second pass, we insert/move
-// into the final desired state. This way in the second pass removed
-// nodes will remain where they should be.
-
-import { warn, extend } from 'core/util/index'
-import { addClass, removeClass } from '../class-util'
-import { transitionProps, extractTransitionData } from './transition'
-
-import {
- hasTransition,
- getTransitionInfo,
- transitionEndEvent,
- addTransitionClass,
- removeTransitionClass
-} from '../transition-util'
-
-const props = extend({
- tag: String,
- moveClass: String
-}, transitionProps)
-
-delete props.mode
-
-export default {
- props,
-
- render (h: Function) {
- const tag: string = this.tag || this.$vnode.data.tag || 'span'
- const map: Object = Object.create(null)
- const prevChildren: Array<VNode> = this.prevChildren = this.children
- const rawChildren: Array<VNode> = this.$slots.default || []
- const children: Array<VNode> = this.children = []
- const transitionData: Object = extractTransitionData(this)
-
- for (let i = 0; i < rawChildren.length; i++) {
- const c: VNode = rawChildren[i]
- if (c.tag) {
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
- children.push(c)
- map[c.key] = c
- ;(c.data || (c.data = {})).transition = transitionData
- } else if (process.env.NODE_ENV !== 'production') {
- const opts: ?VNodeComponentOptions = c.componentOptions
- const name: string = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag
- warn(`<transition-group> children must be keyed: <${name}>`)
- }
- }
- }
-
- if (prevChildren) {
- const kept: Array<VNode> = []
- const removed: Array<VNode> = []
- for (let i = 0; i < prevChildren.length; i++) {
- const c: VNode = prevChildren[i]
- c.data.transition = transitionData
- c.data.pos = c.elm.getBoundingClientRect()
- if (map[c.key]) {
- kept.push(c)
- } else {
- removed.push(c)
- }
- }
- this.kept = h(tag, null, kept)
- this.removed = removed
- }
-
- return h(tag, null, children)
- },
-
- beforeUpdate () {
- // force removing pass
- this.__patch__(
- this._vnode,
- this.kept,
- false, // hydrating
- true // removeOnly (!important, avoids unnecessary moves)
- )
- this._vnode = this.kept
- },
-
- updated () {
- const children: Array<VNode> = this.prevChildren
- const moveClass: string = this.moveClass || ((this.name || 'v') + '-move')
- if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
- return
- }
-
- // we divide the work into three loops to avoid mixing DOM reads and writes
- // in each iteration - which helps prevent layout thrashing.
- children.forEach(callPendingCbs)
- children.forEach(recordPosition)
- children.forEach(applyTranslation)
-
- // force reflow to put everything in position
- // assign to this to avoid being removed in tree-shaking
- // $flow-disable-line
- this._reflow = document.body.offsetHeight
-
- children.forEach((c: VNode) => {
- if (c.data.moved) {
- var el: any = c.elm
- var s: any = el.style
- addTransitionClass(el, moveClass)
- s.transform = s.WebkitTransform = s.transitionDuration = ''
- el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
- if (!e || /transform$/.test(e.propertyName)) {
- el.removeEventListener(transitionEndEvent, cb)
- el._moveCb = null
- removeTransitionClass(el, moveClass)
- }
- })
- }
- })
- },
-
- methods: {
- hasMove (el: any, moveClass: string): boolean {
- /* istanbul ignore if */
- if (!hasTransition) {
- return false
- }
- /* istanbul ignore if */
- if (this._hasMove) {
- return this._hasMove
- }
- // Detect whether an element with the move class applied has
- // CSS transitions. Since the element may be inside an entering
- // transition at this very moment, we make a clone of it and remove
- // all other transition classes applied to ensure only the move class
- // is applied.
- const clone: HTMLElement = el.cloneNode()
- if (el._transitionClasses) {
- el._transitionClasses.forEach((cls: string) => { removeClass(clone, cls) })
- }
- addClass(clone, moveClass)
- clone.style.display = 'none'
- this.$el.appendChild(clone)
- const info: Object = getTransitionInfo(clone)
- this.$el.removeChild(clone)
- return (this._hasMove = info.hasTransform)
- }
- }
-}
-
-function callPendingCbs (c: VNode) {
- /* istanbul ignore if */
- if (c.elm._moveCb) {
- c.elm._moveCb()
- }
- /* istanbul ignore if */
- if (c.elm._enterCb) {
- c.elm._enterCb()
- }
-}
-
-function recordPosition (c: VNode) {
- c.data.newPos = c.elm.getBoundingClientRect()
-}
-
-function applyTranslation (c: VNode) {
- const oldPos = c.data.pos
- const newPos = c.data.newPos
- const dx = oldPos.left - newPos.left
- const dy = oldPos.top - newPos.top
- if (dx || dy) {
- c.data.moved = true
- const s = c.elm.style
- s.transform = s.WebkitTransform = `translate(${dx}px,${dy}px)`
- s.transitionDuration = '0s'
- }
-}
+++ /dev/null
-/* @flow */
-
-// Provides transition support for a single element/component.
-// supports transition mode (out-in / in-out)
-
-import { warn } from 'core/util/index'
-import { camelize, extend, isPrimitive } from 'shared/util'
-import {
- mergeVNodeHook,
- isAsyncPlaceholder,
- getFirstComponentChild
-} from 'core/vdom/helpers/index'
-
-export const transitionProps = {
- name: String,
- appear: Boolean,
- css: Boolean,
- mode: String,
- type: String,
- enterClass: String,
- leaveClass: String,
- enterToClass: String,
- leaveToClass: String,
- enterActiveClass: String,
- leaveActiveClass: String,
- appearClass: String,
- appearActiveClass: String,
- appearToClass: String,
- duration: [Number, String, Object]
-}
-
-// in case the child is also an abstract component, e.g. <keep-alive>
-// we want to recursively retrieve the real component to be rendered
-function getRealChild (vnode: ?VNode): ?VNode {
- const compOptions: ?VNodeComponentOptions = vnode && vnode.componentOptions
- if (compOptions && compOptions.Ctor.options.abstract) {
- return getRealChild(getFirstComponentChild(compOptions.children))
- } else {
- return vnode
- }
-}
-
-export function extractTransitionData (comp: Component): Object {
- const data = {}
- const options: ComponentOptions = comp.$options
- // props
- for (const key in options.propsData) {
- data[key] = comp[key]
- }
- // events.
- // extract listeners and pass them directly to the transition methods
- const listeners: ?Object = options._parentListeners
- for (const key in listeners) {
- data[camelize(key)] = listeners[key]
- }
- return data
-}
-
-function placeholder (h: Function, rawChild: VNode): ?VNode {
- if (/\d-keep-alive$/.test(rawChild.tag)) {
- return h('keep-alive', {
- props: rawChild.componentOptions.propsData
- })
- }
-}
-
-function hasParentTransition (vnode: VNode): ?boolean {
- while ((vnode = vnode.parent)) {
- if (vnode.data.transition) {
- return true
- }
- }
-}
-
-function isSameChild (child: VNode, oldChild: VNode): boolean {
- return oldChild.key === child.key && oldChild.tag === child.tag
-}
-
-export default {
- name: 'transition',
- props: transitionProps,
- abstract: true,
-
- render (h: Function) {
- let children: any = this.$slots.default
- if (!children) {
- return
- }
-
- // filter out text nodes (possible whitespaces)
- children = children.filter((c: VNode) => c.tag || isAsyncPlaceholder(c))
- /* istanbul ignore if */
- if (!children.length) {
- return
- }
-
- // warn multiple elements
- if (process.env.NODE_ENV !== 'production' && children.length > 1) {
- warn(
- '<transition> can only be used on a single element. Use ' +
- '<transition-group> for lists.',
- this.$parent
- )
- }
-
- const mode: string = this.mode
-
- // warn invalid mode
- if (process.env.NODE_ENV !== 'production' &&
- mode && mode !== 'in-out' && mode !== 'out-in'
- ) {
- warn(
- 'invalid <transition> mode: ' + mode,
- this.$parent
- )
- }
-
- const rawChild: VNode = children[0]
-
- // if this is a component root node and the component's
- // parent container node also has transition, skip.
- if (hasParentTransition(this.$vnode)) {
- return rawChild
- }
-
- // apply transition data to child
- // use getRealChild() to ignore abstract components e.g. keep-alive
- const child: ?VNode = getRealChild(rawChild)
- /* istanbul ignore if */
- if (!child) {
- return rawChild
- }
-
- if (this._leaving) {
- return placeholder(h, rawChild)
- }
-
- // ensure a key that is unique to the vnode type and to this transition
- // component instance. This key will be used to remove pending leaving nodes
- // during entering.
- const id: string = `__transition-${this._uid}-`
- child.key = child.key == null
- ? child.isComment
- ? id + 'comment'
- : id + child.tag
- : isPrimitive(child.key)
- ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
- : child.key
-
- const data: Object = (child.data || (child.data = {})).transition = extractTransitionData(this)
- const oldRawChild: VNode = this._vnode
- const oldChild: VNode = getRealChild(oldRawChild)
-
- // mark v-show
- // so that the transition module can hand over the control to the directive
- if (child.data.directives && child.data.directives.some(d => d.name === 'show')) {
- child.data.show = true
- }
-
- if (
- oldChild &&
- oldChild.data &&
- !isSameChild(child, oldChild) &&
- !isAsyncPlaceholder(oldChild) &&
- // #6687 component root is a comment node
- !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
- ) {
- // replace old child transition data with fresh one
- // important for dynamic transitions!
- const oldData: Object = oldChild.data.transition = extend({}, data)
- // handle transition mode
- if (mode === 'out-in') {
- // return placeholder node and queue update when leave finishes
- this._leaving = true
- mergeVNodeHook(oldData, 'afterLeave', () => {
- this._leaving = false
- this.$forceUpdate()
- })
- return placeholder(h, rawChild)
- } else if (mode === 'in-out') {
- if (isAsyncPlaceholder(child)) {
- return oldRawChild
- }
- let delayedLeave
- const performLeave = () => { delayedLeave() }
- mergeVNodeHook(data, 'afterEnter', performLeave)
- mergeVNodeHook(data, 'enterCancelled', performLeave)
- mergeVNodeHook(oldData, 'delayLeave', leave => { delayedLeave = leave })
- }
- }
-
- return rawChild
- }
-}
+++ /dev/null
-import model from './model'
-import show from './show'
-
-export default {
- model,
- show
-}
+++ /dev/null
-/**
- * Not type checking this file because flow doesn't like attaching
- * properties to Elements.
- */
-
-import { isTextInputType } from 'web/util/element'
-import { looseEqual, looseIndexOf } from 'shared/util'
-import { mergeVNodeHook } from 'core/vdom/helpers/index'
-import { warn, isIE9, isIE, isEdge } from 'core/util/index'
-
-/* istanbul ignore if */
-if (isIE9) {
- // http://www.matts411.com/post/internet-explorer-9-oninput/
- document.addEventListener('selectionchange', () => {
- const el = document.activeElement
- if (el && el.vmodel) {
- trigger(el, 'input')
- }
- })
-}
-
-const directive = {
- inserted (el, binding, vnode, oldVnode) {
- if (vnode.tag === 'select') {
- // #6903
- if (oldVnode.elm && !oldVnode.elm._vOptions) {
- mergeVNodeHook(vnode, 'postpatch', () => {
- directive.componentUpdated(el, binding, vnode)
- })
- } else {
- setSelected(el, binding, vnode.context)
- }
- el._vOptions = [].map.call(el.options, getValue)
- } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
- el._vModifiers = binding.modifiers
- if (!binding.modifiers.lazy) {
- el.addEventListener('compositionstart', onCompositionStart)
- el.addEventListener('compositionend', onCompositionEnd)
- // Safari < 10.2 & UIWebView doesn't fire compositionend when
- // switching focus before confirming composition choice
- // this also fixes the issue where some browsers e.g. iOS Chrome
- // fires "change" instead of "input" on autocomplete.
- el.addEventListener('change', onCompositionEnd)
- /* istanbul ignore if */
- if (isIE9) {
- el.vmodel = true
- }
- }
- }
- },
-
- componentUpdated (el, binding, vnode) {
- if (vnode.tag === 'select') {
- setSelected(el, binding, vnode.context)
- // in case the options rendered by v-for have changed,
- // it's possible that the value is out-of-sync with the rendered options.
- // detect such cases and filter out values that no longer has a matching
- // option in the DOM.
- const prevOptions = el._vOptions
- const curOptions = el._vOptions = [].map.call(el.options, getValue)
- if (curOptions.some((o, i) => !looseEqual(o, prevOptions[i]))) {
- // trigger change event if
- // no matching option found for at least one value
- const needReset = el.multiple
- ? binding.value.some(v => hasNoMatchingOption(v, curOptions))
- : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions)
- if (needReset) {
- trigger(el, 'change')
- }
- }
- }
- }
-}
-
-function setSelected (el, binding, vm) {
- actuallySetSelected(el, binding, vm)
- /* istanbul ignore if */
- if (isIE || isEdge) {
- setTimeout(() => {
- actuallySetSelected(el, binding, vm)
- }, 0)
- }
-}
-
-function actuallySetSelected (el, binding, vm) {
- const value = binding.value
- const isMultiple = el.multiple
- if (isMultiple && !Array.isArray(value)) {
- process.env.NODE_ENV !== 'production' && warn(
- `<select multiple v-model="${binding.expression}"> ` +
- `expects an Array value for its binding, but got ${
- Object.prototype.toString.call(value).slice(8, -1)
- }`,
- vm
- )
- return
- }
- let selected, option
- for (let i = 0, l = el.options.length; i < l; i++) {
- option = el.options[i]
- if (isMultiple) {
- selected = looseIndexOf(value, getValue(option)) > -1
- if (option.selected !== selected) {
- option.selected = selected
- }
- } else {
- if (looseEqual(getValue(option), value)) {
- if (el.selectedIndex !== i) {
- el.selectedIndex = i
- }
- return
- }
- }
- }
- if (!isMultiple) {
- el.selectedIndex = -1
- }
-}
-
-function hasNoMatchingOption (value, options) {
- return options.every(o => !looseEqual(o, value))
-}
-
-function getValue (option) {
- return '_value' in option
- ? option._value
- : option.value
-}
-
-function onCompositionStart (e) {
- e.target.composing = true
-}
-
-function onCompositionEnd (e) {
- // prevent triggering an input event for no reason
- if (!e.target.composing) return
- e.target.composing = false
- trigger(e.target, 'input')
-}
-
-function trigger (el, type) {
- const e = document.createEvent('HTMLEvents')
- e.initEvent(type, true, true)
- el.dispatchEvent(e)
-}
-
-export default directive
+++ /dev/null
-/* @flow */
-
-import { enter, leave } from '../modules/transition'
-
-// recursively search for possible transition defined inside the component root
-function locateNode (vnode: VNode): VNodeWithData {
- return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
- ? locateNode(vnode.componentInstance._vnode)
- : vnode
-}
-
-export default {
- bind (el: any, { value }: VNodeDirective, vnode: VNodeWithData) {
- vnode = locateNode(vnode)
- const transition = vnode.data && vnode.data.transition
- const originalDisplay = el.__vOriginalDisplay =
- el.style.display === 'none' ? '' : el.style.display
- if (value && transition) {
- vnode.data.show = true
- enter(vnode, () => {
- el.style.display = originalDisplay
- })
- } else {
- el.style.display = value ? originalDisplay : 'none'
- }
- },
-
- update (el: any, { value, oldValue }: VNodeDirective, vnode: VNodeWithData) {
- /* istanbul ignore if */
- if (!value === !oldValue) return
- vnode = locateNode(vnode)
- const transition = vnode.data && vnode.data.transition
- if (transition) {
- vnode.data.show = true
- if (value) {
- enter(vnode, () => {
- el.style.display = el.__vOriginalDisplay
- })
- } else {
- leave(vnode, () => {
- el.style.display = 'none'
- })
- }
- } else {
- el.style.display = value ? el.__vOriginalDisplay : 'none'
- }
- },
-
- unbind (
- el: any,
- binding: VNodeDirective,
- vnode: VNodeWithData,
- oldVnode: VNodeWithData,
- isDestroy: boolean
- ) {
- if (!isDestroy) {
- el.style.display = el.__vOriginalDisplay
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import Vue from 'core/index'
-import config from 'core/config'
-import { extend, noop } from 'shared/util'
-import { mountComponent } from 'core/instance/lifecycle'
-import { devtools, inBrowser, isChrome } from 'core/util/index'
-
-import {
- query,
- mustUseProp,
- isReservedTag,
- isReservedAttr,
- getTagNamespace,
- isUnknownElement
-} from 'web/util/index'
-
-import { patch } from './patch'
-import platformDirectives from './directives/index'
-import platformComponents from './components/index'
-
-// install platform specific utils
-Vue.config.mustUseProp = mustUseProp
-Vue.config.isReservedTag = isReservedTag
-Vue.config.isReservedAttr = isReservedAttr
-Vue.config.getTagNamespace = getTagNamespace
-Vue.config.isUnknownElement = isUnknownElement
-
-// install platform runtime directives & components
-extend(Vue.options.directives, platformDirectives)
-extend(Vue.options.components, platformComponents)
-
-// install platform patch function
-Vue.prototype.__patch__ = inBrowser ? patch : noop
-
-// public mount method
-Vue.prototype.$mount = function (
- el?: string | Element,
- hydrating?: boolean
-): Component {
- el = el && inBrowser ? query(el) : undefined
- return mountComponent(this, el, hydrating)
-}
-
-// devtools global hook
-/* istanbul ignore next */
-if (inBrowser) {
- setTimeout(() => {
- if (config.devtools) {
- if (devtools) {
- devtools.emit('init', Vue)
- } else if (
- process.env.NODE_ENV !== 'production' &&
- process.env.NODE_ENV !== 'test' &&
- isChrome
- ) {
- console[console.info ? 'info' : 'log'](
- 'Download the Vue Devtools extension for a better development experience:\n' +
- 'https://github.com/vuejs/vue-devtools'
- )
- }
- }
- if (process.env.NODE_ENV !== 'production' &&
- process.env.NODE_ENV !== 'test' &&
- config.productionTip !== false &&
- typeof console !== 'undefined'
- ) {
- console[console.info ? 'info' : 'log'](
- `You are running Vue in development mode.\n` +
- `Make sure to turn on production mode when deploying for production.\n` +
- `See more tips at https://vuejs.org/guide/deployment.html`
- )
- }
- }, 0)
-}
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import { isIE, isIE9, isEdge } from 'core/util/env'
-
-import {
- extend,
- isDef,
- isUndef
-} from 'shared/util'
-
-import {
- isXlink,
- xlinkNS,
- getXlinkProp,
- isBooleanAttr,
- isEnumeratedAttr,
- isFalsyAttrValue
-} from 'web/util/index'
-
-function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- const opts = vnode.componentOptions
- if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
- return
- }
- if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
- return
- }
- let key, cur, old
- const elm = vnode.elm
- const oldAttrs = oldVnode.data.attrs || {}
- let attrs: any = vnode.data.attrs || {}
- // clone observed objects, as the user probably wants to mutate it
- if (isDef(attrs.__ob__)) {
- attrs = vnode.data.attrs = extend({}, attrs)
- }
-
- for (key in attrs) {
- cur = attrs[key]
- old = oldAttrs[key]
- if (old !== cur) {
- setAttr(elm, key, cur)
- }
- }
- // #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 ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
- setAttr(elm, 'value', attrs.value)
- }
- for (key in oldAttrs) {
- if (isUndef(attrs[key])) {
- if (isXlink(key)) {
- elm.removeAttributeNS(xlinkNS, getXlinkProp(key))
- } else if (!isEnumeratedAttr(key)) {
- elm.removeAttribute(key)
- }
- }
- }
-}
-
-function setAttr (el: Element, key: string, value: any) {
- if (el.tagName.indexOf('-') > -1) {
- baseSetAttr(el, key, value)
- } else if (isBooleanAttr(key)) {
- // set attribute for blank value
- // e.g. <option disabled>Select one</option>
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key)
- } else {
- // technically allowfullscreen is a boolean attribute for <iframe>,
- // but Flash expects a value of "true" when used on <embed> tag
- value = key === 'allowfullscreen' && el.tagName === 'EMBED'
- ? 'true'
- : key
- el.setAttribute(key, value)
- }
- } else if (isEnumeratedAttr(key)) {
- el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true')
- } else if (isXlink(key)) {
- if (isFalsyAttrValue(value)) {
- el.removeAttributeNS(xlinkNS, getXlinkProp(key))
- } else {
- el.setAttributeNS(xlinkNS, key, value)
- }
- } else {
- baseSetAttr(el, key, value)
- }
-}
-
-function baseSetAttr (el, key, value) {
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key)
- } else {
- // #7138: IE10 & 11 fires input event when setting placeholder on
- // <textarea>... block the first input event and remove the blocker
- // immediately.
- /* istanbul ignore if */
- if (
- isIE && !isIE9 &&
- el.tagName === 'TEXTAREA' &&
- key === 'placeholder' && !el.__ieph
- ) {
- const blocker = e => {
- e.stopImmediatePropagation()
- el.removeEventListener('input', blocker)
- }
- el.addEventListener('input', blocker)
- // $flow-disable-line
- el.__ieph = true /* IE placeholder patched */
- }
- el.setAttribute(key, value)
- }
-}
-
-export default {
- create: updateAttrs,
- update: updateAttrs
-}
+++ /dev/null
-/* @flow */
-
-import {
- isDef,
- isUndef
-} from 'shared/util'
-
-import {
- concat,
- stringifyClass,
- genClassForVnode
-} from 'web/util/index'
-
-function updateClass (oldVnode: any, vnode: any) {
- const el = vnode.elm
- const data: VNodeData = vnode.data
- const oldData: VNodeData = oldVnode.data
- if (
- isUndef(data.staticClass) &&
- isUndef(data.class) && (
- isUndef(oldData) || (
- isUndef(oldData.staticClass) &&
- isUndef(oldData.class)
- )
- )
- ) {
- return
- }
-
- let cls = genClassForVnode(vnode)
-
- // handle transition classes
- const transitionClass = el._transitionClasses
- if (isDef(transitionClass)) {
- cls = concat(cls, stringifyClass(transitionClass))
- }
-
- // set the class
- if (cls !== el._prevClass) {
- el.setAttribute('class', cls)
- el._prevClass = cls
- }
-}
-
-export default {
- create: updateClass,
- update: updateClass
-}
+++ /dev/null
-/* @flow */
-
-import { isDef, isUndef, extend, toNumber } from 'shared/util'
-
-function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
- return
- }
- let key, cur
- const elm: any = vnode.elm
- const oldProps = oldVnode.data.domProps || {}
- let props = vnode.data.domProps || {}
- // clone observed objects, as the user probably wants to mutate it
- if (isDef(props.__ob__)) {
- props = vnode.data.domProps = extend({}, props)
- }
-
- for (key in oldProps) {
- if (isUndef(props[key])) {
- elm[key] = ''
- }
- }
- for (key in props) {
- cur = props[key]
- // ignore children if the node has textContent or innerHTML,
- // as these will throw away existing DOM nodes and cause removal errors
- // on subsequent patches (#3360)
- 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') {
- // store value as _value as well since
- // non-string values will be stringified
- elm._value = cur
- // avoid resetting cursor position when value is the same
- const strCur = isUndef(cur) ? '' : String(cur)
- if (shouldUpdateValue(elm, strCur)) {
- elm.value = strCur
- }
- } else {
- elm[key] = cur
- }
- }
-}
-
-// check platforms/web/util/attrs.js acceptValue
-type acceptValueElm = HTMLInputElement | HTMLSelectElement | HTMLOptionElement;
-
-function shouldUpdateValue (elm: acceptValueElm, checkVal: string): boolean {
- return (!elm.composing && (
- elm.tagName === 'OPTION' ||
- isNotInFocusAndDirty(elm, checkVal) ||
- isDirtyWithModifiers(elm, checkVal)
- ))
-}
-
-function isNotInFocusAndDirty (elm: acceptValueElm, checkVal: string): boolean {
- // return true when textbox (.number and .trim) loses focus and its value is
- // not equal to the updated value
- let notInFocus = true
- // #6157
- // work around IE bug when accessing document.activeElement in an iframe
- try { notInFocus = document.activeElement !== elm } catch (e) {}
- return notInFocus && elm.value !== checkVal
-}
-
-function isDirtyWithModifiers (elm: any, newVal: string): boolean {
- const value = elm.value
- const modifiers = elm._vModifiers // injected by v-model runtime
- if (isDef(modifiers)) {
- if (modifiers.lazy) {
- // inputs with lazy should only be updated when not in focus
- return false
- }
- if (modifiers.number) {
- return toNumber(value) !== toNumber(newVal)
- }
- if (modifiers.trim) {
- return value.trim() !== newVal.trim()
- }
- }
- return value !== newVal
-}
-
-export default {
- create: updateDOMProps,
- update: updateDOMProps
-}
+++ /dev/null
-/* @flow */
-
-import { isDef, isUndef } from 'shared/util'
-import { updateListeners } from 'core/vdom/helpers/index'
-import { withMacroTask, isIE, supportsPassive } from 'core/util/index'
-import { RANGE_TOKEN, CHECKBOX_RADIO_TOKEN } from 'web/compiler/directives/model'
-
-// normalize v-model event tokens that can only be determined at runtime.
-// it's important to place the event as the first in the array because
-// the whole point is ensuring the v-model callback gets called before
-// user-attached handlers.
-function normalizeEvents (on) {
- /* istanbul ignore if */
- if (isDef(on[RANGE_TOKEN])) {
- // IE input[type=range] only supports `change` event
- const 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])) {
- on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || [])
- delete on[CHECKBOX_RADIO_TOKEN]
- }
-}
-
-let target: any
-
-function createOnceHandler (handler, event, capture) {
- const _target = target // save current target element in closure
- return function onceHandler () {
- const res = handler.apply(null, arguments)
- if (res !== null) {
- remove(event, onceHandler, capture, _target)
- }
- }
-}
-
-function add (
- event: string,
- handler: Function,
- once: boolean,
- capture: boolean,
- passive: boolean
-) {
- handler = withMacroTask(handler)
- if (once) handler = createOnceHandler(handler, event, capture)
- target.addEventListener(
- event,
- handler,
- supportsPassive
- ? { capture, passive }
- : capture
- )
-}
-
-function remove (
- event: string,
- handler: Function,
- capture: boolean,
- _target?: HTMLElement
-) {
- (_target || target).removeEventListener(
- event,
- handler._withTask || handler,
- capture
- )
-}
-
-function updateDOMListeners (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
- return
- }
- const on = vnode.data.on || {}
- const oldOn = oldVnode.data.on || {}
- target = vnode.elm
- normalizeEvents(on)
- updateListeners(on, oldOn, add, remove, vnode.context)
- target = undefined
-}
-
-export default {
- create: updateDOMListeners,
- update: updateDOMListeners
-}
+++ /dev/null
-import attrs from './attrs'
-import klass from './class'
-import events from './events'
-import domProps from './dom-props'
-import style from './style'
-import transition from './transition'
-
-export default [
- attrs,
- klass,
- events,
- domProps,
- style,
- transition
-]
+++ /dev/null
-/* @flow */
-
-import { getStyle, normalizeStyleBinding } from 'web/util/style'
-import { cached, camelize, extend, isDef, isUndef } from 'shared/util'
-
-const cssVarRE = /^--/
-const importantRE = /\s*!important$/
-const setProp = (el, name, val) => {
- /* istanbul ignore if */
- if (cssVarRE.test(name)) {
- el.style.setProperty(name, val)
- } else if (importantRE.test(val)) {
- el.style.setProperty(name, val.replace(importantRE, ''), 'important')
- } else {
- const normalizedName = normalize(name)
- if (Array.isArray(val)) {
- // Support values array created by autoprefixer, e.g.
- // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
- // Set them one by one, and the browser will only set those it can recognize
- for (let i = 0, len = val.length; i < len; i++) {
- el.style[normalizedName] = val[i]
- }
- } else {
- el.style[normalizedName] = val
- }
- }
-}
-
-const vendorNames = ['Webkit', 'Moz', 'ms']
-
-let emptyStyle
-const normalize = cached(function (prop) {
- emptyStyle = emptyStyle || document.createElement('div').style
- prop = camelize(prop)
- if (prop !== 'filter' && (prop in emptyStyle)) {
- return prop
- }
- const capName = prop.charAt(0).toUpperCase() + prop.slice(1)
- for (let i = 0; i < vendorNames.length; i++) {
- const name = vendorNames[i] + capName
- if (name in emptyStyle) {
- return name
- }
- }
-})
-
-function updateStyle (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- const data = vnode.data
- const oldData = oldVnode.data
-
- if (isUndef(data.staticStyle) && isUndef(data.style) &&
- isUndef(oldData.staticStyle) && isUndef(oldData.style)
- ) {
- return
- }
-
- let cur, name
- const el: any = vnode.elm
- const oldStaticStyle: any = oldData.staticStyle
- const oldStyleBinding: any = oldData.normalizedStyle || oldData.style || {}
-
- // if static style exists, stylebinding already merged into it when doing normalizeStyleData
- const oldStyle = oldStaticStyle || oldStyleBinding
-
- const style = normalizeStyleBinding(vnode.data.style) || {}
-
- // store normalized style under a different key for next diff
- // make sure to clone it if it's reactive, since the user likely wants
- // to mutate it.
- vnode.data.normalizedStyle = isDef(style.__ob__)
- ? extend({}, style)
- : style
-
- const newStyle = getStyle(vnode, true)
-
- for (name in oldStyle) {
- if (isUndef(newStyle[name])) {
- setProp(el, name, '')
- }
- }
- for (name in newStyle) {
- cur = newStyle[name]
- if (cur !== oldStyle[name]) {
- // ie9 setting to null has no effect, must use empty string
- setProp(el, name, cur == null ? '' : cur)
- }
- }
-}
-
-export default {
- create: updateStyle,
- update: updateStyle
-}
+++ /dev/null
-/* @flow */
-
-import { inBrowser, isIE9, warn } from 'core/util/index'
-import { mergeVNodeHook } from 'core/vdom/helpers/index'
-import { activeInstance } from 'core/instance/lifecycle'
-
-import {
- once,
- isDef,
- isUndef,
- isObject,
- toNumber
-} from 'shared/util'
-
-import {
- nextFrame,
- resolveTransition,
- whenTransitionEnds,
- addTransitionClass,
- removeTransitionClass
-} from '../transition-util'
-
-export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
- const el: any = vnode.elm
-
- // call leave callback now
- if (isDef(el._leaveCb)) {
- el._leaveCb.cancelled = true
- el._leaveCb()
- }
-
- const data = resolveTransition(vnode.data.transition)
- if (isUndef(data)) {
- return
- }
-
- /* istanbul ignore if */
- if (isDef(el._enterCb) || el.nodeType !== 1) {
- return
- }
-
- const {
- css,
- type,
- enterClass,
- enterToClass,
- enterActiveClass,
- appearClass,
- appearToClass,
- appearActiveClass,
- beforeEnter,
- enter,
- afterEnter,
- enterCancelled,
- beforeAppear,
- appear,
- afterAppear,
- appearCancelled,
- duration
- } = data
-
- // activeInstance will always be the <transition> component managing this
- // transition. One edge case to check is when the <transition> is placed
- // as the root node of a child component. In that case we need to check
- // <transition>'s parent for appear check.
- let context = activeInstance
- let transitionNode = activeInstance.$vnode
- while (transitionNode && transitionNode.parent) {
- transitionNode = transitionNode.parent
- context = transitionNode.context
- }
-
- const isAppear = !context._isMounted || !vnode.isRootInsert
-
- if (isAppear && !appear && appear !== '') {
- return
- }
-
- const startClass = isAppear && appearClass
- ? appearClass
- : enterClass
- const activeClass = isAppear && appearActiveClass
- ? appearActiveClass
- : enterActiveClass
- const toClass = isAppear && appearToClass
- ? appearToClass
- : enterToClass
-
- const beforeEnterHook = isAppear
- ? (beforeAppear || beforeEnter)
- : beforeEnter
- const enterHook = isAppear
- ? (typeof appear === 'function' ? appear : enter)
- : enter
- const afterEnterHook = isAppear
- ? (afterAppear || afterEnter)
- : afterEnter
- const enterCancelledHook = isAppear
- ? (appearCancelled || enterCancelled)
- : enterCancelled
-
- const explicitEnterDuration: any = toNumber(
- isObject(duration)
- ? duration.enter
- : duration
- )
-
- if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
- checkDuration(explicitEnterDuration, 'enter', vnode)
- }
-
- const expectsCSS = css !== false && !isIE9
- const userWantsControl = getHookArgumentsLength(enterHook)
-
- const cb = el._enterCb = once(() => {
- if (expectsCSS) {
- removeTransitionClass(el, toClass)
- removeTransitionClass(el, activeClass)
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, startClass)
- }
- enterCancelledHook && enterCancelledHook(el)
- } else {
- afterEnterHook && afterEnterHook(el)
- }
- el._enterCb = null
- })
-
- if (!vnode.data.show) {
- // remove pending leave element on enter by injecting an insert hook
- mergeVNodeHook(vnode, 'insert', () => {
- const parent = el.parentNode
- const pendingNode = parent && parent._pending && parent._pending[vnode.key]
- if (pendingNode &&
- pendingNode.tag === vnode.tag &&
- pendingNode.elm._leaveCb
- ) {
- pendingNode.elm._leaveCb()
- }
- enterHook && enterHook(el, cb)
- })
- }
-
- // start enter transition
- beforeEnterHook && beforeEnterHook(el)
- if (expectsCSS) {
- addTransitionClass(el, startClass)
- addTransitionClass(el, activeClass)
- nextFrame(() => {
- removeTransitionClass(el, startClass)
- if (!cb.cancelled) {
- addTransitionClass(el, toClass)
- if (!userWantsControl) {
- if (isValidDuration(explicitEnterDuration)) {
- setTimeout(cb, explicitEnterDuration)
- } else {
- whenTransitionEnds(el, type, cb)
- }
- }
- }
- })
- }
-
- if (vnode.data.show) {
- toggleDisplay && toggleDisplay()
- enterHook && enterHook(el, cb)
- }
-
- if (!expectsCSS && !userWantsControl) {
- cb()
- }
-}
-
-export function leave (vnode: VNodeWithData, rm: Function) {
- const el: any = vnode.elm
-
- // call enter callback now
- if (isDef(el._enterCb)) {
- el._enterCb.cancelled = true
- el._enterCb()
- }
-
- const data = resolveTransition(vnode.data.transition)
- if (isUndef(data) || el.nodeType !== 1) {
- return rm()
- }
-
- /* istanbul ignore if */
- if (isDef(el._leaveCb)) {
- return
- }
-
- const {
- css,
- type,
- leaveClass,
- leaveToClass,
- leaveActiveClass,
- beforeLeave,
- leave,
- afterLeave,
- leaveCancelled,
- delayLeave,
- duration
- } = data
-
- const expectsCSS = css !== false && !isIE9
- const userWantsControl = getHookArgumentsLength(leave)
-
- const explicitLeaveDuration: any = toNumber(
- isObject(duration)
- ? duration.leave
- : duration
- )
-
- if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
- checkDuration(explicitLeaveDuration, 'leave', vnode)
- }
-
- const cb = el._leaveCb = once(() => {
- if (el.parentNode && el.parentNode._pending) {
- el.parentNode._pending[vnode.key] = null
- }
- if (expectsCSS) {
- removeTransitionClass(el, leaveToClass)
- removeTransitionClass(el, leaveActiveClass)
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, leaveClass)
- }
- leaveCancelled && leaveCancelled(el)
- } else {
- rm()
- afterLeave && afterLeave(el)
- }
- el._leaveCb = null
- })
-
- if (delayLeave) {
- delayLeave(performLeave)
- } else {
- performLeave()
- }
-
- function performLeave () {
- // the delayed leave may have already been cancelled
- if (cb.cancelled) {
- return
- }
- // record leaving element
- if (!vnode.data.show) {
- (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key: any)] = vnode
- }
- beforeLeave && beforeLeave(el)
- if (expectsCSS) {
- addTransitionClass(el, leaveClass)
- addTransitionClass(el, leaveActiveClass)
- nextFrame(() => {
- removeTransitionClass(el, leaveClass)
- if (!cb.cancelled) {
- addTransitionClass(el, leaveToClass)
- if (!userWantsControl) {
- if (isValidDuration(explicitLeaveDuration)) {
- setTimeout(cb, explicitLeaveDuration)
- } else {
- whenTransitionEnds(el, type, cb)
- }
- }
- }
- })
- }
- leave && leave(el, cb)
- if (!expectsCSS && !userWantsControl) {
- cb()
- }
- }
-}
-
-// only used in dev mode
-function checkDuration (val, name, vnode) {
- if (typeof val !== 'number') {
- warn(
- `<transition> explicit ${name} duration is not a valid number - ` +
- `got ${JSON.stringify(val)}.`,
- vnode.context
- )
- } else if (isNaN(val)) {
- warn(
- `<transition> explicit ${name} duration is NaN - ` +
- 'the duration expression might be incorrect.',
- vnode.context
- )
- }
-}
-
-function isValidDuration (val) {
- return typeof val === 'number' && !isNaN(val)
-}
-
-/**
- * Normalize a transition hook's argument length. The hook may be:
- * - a merged hook (invoker) with the original in .fns
- * - a wrapped component method (check ._length)
- * - a plain function (.length)
- */
-function getHookArgumentsLength (fn: Function): boolean {
- if (isUndef(fn)) {
- return false
- }
- const invokerFns = fn.fns
- if (isDef(invokerFns)) {
- // invoker
- return getHookArgumentsLength(
- Array.isArray(invokerFns)
- ? invokerFns[0]
- : invokerFns
- )
- } else {
- return (fn._length || fn.length) > 1
- }
-}
-
-function _enter (_: any, vnode: VNodeWithData) {
- if (vnode.data.show !== true) {
- enter(vnode)
- }
-}
-
-export default inBrowser ? {
- create: _enter,
- activate: _enter,
- remove (vnode: VNode, rm: Function) {
- /* istanbul ignore else */
- if (vnode.data.show !== true) {
- leave(vnode, rm)
- } else {
- rm()
- }
- }
-} : {}
+++ /dev/null
-/* @flow */
-
-import { namespaceMap } from 'web/util/index'
-
-export function createElement (tagName: string, vnode: VNode): Element {
- const elm = document.createElement(tagName)
- if (tagName !== 'select') {
- return elm
- }
- // false or null will remove the attribute but undefined will not
- if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
- elm.setAttribute('multiple', 'multiple')
- }
- return elm
-}
-
-export function createElementNS (namespace: string, tagName: string): Element {
- return document.createElementNS(namespaceMap[namespace], tagName)
-}
-
-export function createTextNode (text: string): Text {
- return document.createTextNode(text)
-}
-
-export function createComment (text: string): Comment {
- return document.createComment(text)
-}
-
-export function insertBefore (parentNode: Node, newNode: Node, referenceNode: Node) {
- parentNode.insertBefore(newNode, referenceNode)
-}
-
-export function removeChild (node: Node, child: Node) {
- node.removeChild(child)
-}
-
-export function appendChild (node: Node, child: Node) {
- node.appendChild(child)
-}
-
-export function parentNode (node: Node): ?Node {
- return node.parentNode
-}
-
-export function nextSibling (node: Node): ?Node {
- return node.nextSibling
-}
-
-export function tagName (node: Element): string {
- return node.tagName
-}
-
-export function setTextContent (node: Node, text: string) {
- node.textContent = text
-}
-
-export function setStyleScope (node: Element, scopeId: string) {
- node.setAttribute(scopeId, '')
-}
+++ /dev/null
-/* @flow */
-
-import * as nodeOps from 'web/runtime/node-ops'
-import { createPatchFunction } from 'core/vdom/patch'
-import baseModules from 'core/vdom/modules/index'
-import platformModules from 'web/runtime/modules/index'
-
-// the directive module should be applied last, after all
-// built-in modules have been applied.
-const modules = platformModules.concat(baseModules)
-
-export const patch: Function = createPatchFunction({ nodeOps, modules })
+++ /dev/null
-/* @flow */
-
-import { inBrowser, isIE9 } from 'core/util/index'
-import { addClass, removeClass } from './class-util'
-import { remove, extend, cached } from 'shared/util'
-
-export function resolveTransition (def?: string | Object): ?Object {
- if (!def) {
- return
- }
- /* istanbul ignore else */
- if (typeof def === 'object') {
- const res = {}
- if (def.css !== false) {
- extend(res, autoCssTransition(def.name || 'v'))
- }
- extend(res, def)
- return res
- } else if (typeof def === 'string') {
- return autoCssTransition(def)
- }
-}
-
-const autoCssTransition: (name: string) => Object = cached(name => {
- return {
- enterClass: `${name}-enter`,
- enterToClass: `${name}-enter-to`,
- enterActiveClass: `${name}-enter-active`,
- leaveClass: `${name}-leave`,
- leaveToClass: `${name}-leave-to`,
- leaveActiveClass: `${name}-leave-active`
- }
-})
-
-export const hasTransition = inBrowser && !isIE9
-const TRANSITION = 'transition'
-const ANIMATION = 'animation'
-
-// Transition property/event sniffing
-export let transitionProp = 'transition'
-export let transitionEndEvent = 'transitionend'
-export let animationProp = 'animation'
-export let animationEndEvent = 'animationend'
-if (hasTransition) {
- /* istanbul ignore if */
- if (window.ontransitionend === undefined &&
- window.onwebkittransitionend !== undefined
- ) {
- transitionProp = 'WebkitTransition'
- transitionEndEvent = 'webkitTransitionEnd'
- }
- if (window.onanimationend === undefined &&
- window.onwebkitanimationend !== undefined
- ) {
- animationProp = 'WebkitAnimation'
- animationEndEvent = 'webkitAnimationEnd'
- }
-}
-
-// binding to window is necessary to make hot reload work in IE in strict mode
-const raf = inBrowser
- ? window.requestAnimationFrame
- ? window.requestAnimationFrame.bind(window)
- : setTimeout
- : /* istanbul ignore next */ fn => fn()
-
-export function nextFrame (fn: Function) {
- raf(() => {
- raf(fn)
- })
-}
-
-export function addTransitionClass (el: any, cls: string) {
- const transitionClasses = el._transitionClasses || (el._transitionClasses = [])
- if (transitionClasses.indexOf(cls) < 0) {
- transitionClasses.push(cls)
- addClass(el, cls)
- }
-}
-
-export function removeTransitionClass (el: any, cls: string) {
- if (el._transitionClasses) {
- remove(el._transitionClasses, cls)
- }
- removeClass(el, cls)
-}
-
-export function whenTransitionEnds (
- el: Element,
- expectedType: ?string,
- cb: Function
-) {
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType)
- if (!type) return cb()
- const event: string = type === TRANSITION ? transitionEndEvent : animationEndEvent
- let ended = 0
- const end = () => {
- el.removeEventListener(event, onEnd)
- cb()
- }
- const onEnd = e => {
- if (e.target === el) {
- if (++ended >= propCount) {
- end()
- }
- }
- }
- setTimeout(() => {
- if (ended < propCount) {
- end()
- }
- }, timeout + 1)
- el.addEventListener(event, onEnd)
-}
-
-const transformRE = /\b(transform|all)(,|$)/
-
-export function getTransitionInfo (el: Element, expectedType?: ?string): {
- type: ?string;
- propCount: number;
- timeout: number;
- hasTransform: boolean;
-} {
- const styles: any = window.getComputedStyle(el)
- const transitionDelays: Array<string> = styles[transitionProp + 'Delay'].split(', ')
- const transitionDurations: Array<string> = styles[transitionProp + 'Duration'].split(', ')
- const transitionTimeout: number = getTimeout(transitionDelays, transitionDurations)
- const animationDelays: Array<string> = styles[animationProp + 'Delay'].split(', ')
- const animationDurations: Array<string> = styles[animationProp + 'Duration'].split(', ')
- const animationTimeout: number = getTimeout(animationDelays, animationDurations)
-
- let type: ?string
- let timeout = 0
- let propCount = 0
- /* istanbul ignore if */
- if (expectedType === TRANSITION) {
- if (transitionTimeout > 0) {
- type = TRANSITION
- timeout = transitionTimeout
- propCount = transitionDurations.length
- }
- } else if (expectedType === ANIMATION) {
- if (animationTimeout > 0) {
- type = ANIMATION
- timeout = animationTimeout
- propCount = animationDurations.length
- }
- } else {
- timeout = Math.max(transitionTimeout, animationTimeout)
- type = timeout > 0
- ? transitionTimeout > animationTimeout
- ? TRANSITION
- : ANIMATION
- : null
- propCount = type
- ? type === TRANSITION
- ? transitionDurations.length
- : animationDurations.length
- : 0
- }
- const hasTransform: boolean =
- type === TRANSITION &&
- transformRE.test(styles[transitionProp + 'Property'])
- return {
- type,
- timeout,
- propCount,
- hasTransform
- }
-}
-
-function getTimeout (delays: Array<string>, durations: Array<string>): number {
- /* istanbul ignore next */
- while (delays.length < durations.length) {
- delays = delays.concat(delays)
- }
-
- return Math.max.apply(null, durations.map((d, i) => {
- return toMs(d) + toMs(delays[i])
- }))
-}
-
-function toMs (s: string): number {
- return Number(s.slice(0, -1)) * 1000
-}
+++ /dev/null
-/* @flow */
-
-import { baseOptions } from '../compiler/options'
-import { createCompiler } from 'server/optimizing-compiler/index'
-
-const { compile, compileToFunctions } = createCompiler(baseOptions)
-
-export {
- compile as ssrCompile,
- compileToFunctions as ssrCompileToFunctions
-}
+++ /dev/null
-import show from './show'
-import model from './model'
-
-export default {
- show,
- model
-}
+++ /dev/null
-/* @flow */
-
-import { looseEqual, looseIndexOf } from 'shared/util'
-
-// this is only applied for <select v-model> because it is the only edge case
-// that must be done at runtime instead of compile time.
-export default function model (node: VNodeWithData, dir: VNodeDirective) {
- if (!node.children) return
- const value = dir.value
- const isMultiple = node.data.attrs && node.data.attrs.multiple
- for (let i = 0, l = node.children.length; i < l; i++) {
- const option = node.children[i]
- if (option.tag === 'option') {
- if (isMultiple) {
- const selected =
- Array.isArray(value) &&
- (looseIndexOf(value, getValue(option)) > -1)
- if (selected) {
- setSelected(option)
- }
- } else {
- if (looseEqual(value, getValue(option))) {
- setSelected(option)
- return
- }
- }
- }
- }
-}
-
-function getValue (option) {
- const data = option.data || {}
- return (
- (data.attrs && data.attrs.value) ||
- (data.domProps && data.domProps.value) ||
- (option.children && option.children[0] && option.children[0].text)
- )
-}
-
-function setSelected (option) {
- const data = option.data || (option.data = {})
- const attrs = data.attrs || (data.attrs = {})
- attrs.selected = ''
-}
+++ /dev/null
-/* @flow */
-
-export default function show (node: VNodeWithData, dir: VNodeDirective) {
- if (!dir.value) {
- const style: any = node.data.style || (node.data.style = {})
- if (Array.isArray(style)) {
- style.push({ display: 'none' })
- } else {
- style.display = 'none'
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { escape } from '../util'
-
-import {
- isDef,
- isUndef,
- extend
-} from 'shared/util'
-
-import {
- isBooleanAttr,
- isEnumeratedAttr,
- isFalsyAttrValue
-} from 'web/util/attrs'
-
-export default function renderAttrs (node: VNodeWithData): string {
- let attrs = node.data.attrs
- let res = ''
-
- const opts = node.parent && node.parent.componentOptions
- if (isUndef(opts) || opts.Ctor.options.inheritAttrs !== false) {
- let parent = node.parent
- while (isDef(parent)) {
- if (isDef(parent.data) && isDef(parent.data.attrs)) {
- attrs = extend(extend({}, attrs), parent.data.attrs)
- }
- parent = parent.parent
- }
- }
-
- if (isUndef(attrs)) {
- return res
- }
-
- for (const key in attrs) {
- if (key === 'style') {
- // leave it to the style module
- continue
- }
- res += renderAttr(key, attrs[key])
- }
- return res
-}
-
-export function renderAttr (key: string, value: string): string {
- if (isBooleanAttr(key)) {
- if (!isFalsyAttrValue(value)) {
- return ` ${key}="${key}"`
- }
- } else if (isEnumeratedAttr(key)) {
- return ` ${key}="${isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true'}"`
- } else if (!isFalsyAttrValue(value)) {
- return ` ${key}="${escape(String(value))}"`
- }
- return ''
-}
+++ /dev/null
-/* @flow */
-
-import { escape } from '../util'
-import { genClassForVnode } from 'web/util/index'
-
-export default function renderClass (node: VNodeWithData): ?string {
- const classList = genClassForVnode(node)
- if (classList !== '') {
- return ` class="${escape(classList)}"`
- }
-}
+++ /dev/null
-/* @flow */
-
-import VNode from 'core/vdom/vnode'
-import { renderAttr } from './attrs'
-import { isDef, isUndef, extend } from 'shared/util'
-import { propsToAttrMap, isRenderableAttr } from '../util'
-
-export default function renderDOMProps (node: VNodeWithData): string {
- let props = node.data.domProps
- let res = ''
-
- let parent = node.parent
- while (isDef(parent)) {
- if (parent.data && parent.data.domProps) {
- props = extend(extend({}, props), parent.data.domProps)
- }
- parent = parent.parent
- }
-
- if (isUndef(props)) {
- return res
- }
-
- const attrs = node.data.attrs
- for (const key in props) {
- if (key === 'innerHTML') {
- setText(node, props[key], true)
- } else if (key === 'textContent') {
- setText(node, props[key], false)
- } else if (key === 'value' && node.tag === 'textarea') {
- setText(node, props[key], false)
- } else {
- // $flow-disable-line (WTF?)
- const attr = propsToAttrMap[key] || key.toLowerCase()
- if (isRenderableAttr(attr) &&
- // avoid rendering double-bound props/attrs twice
- !(isDef(attrs) && isDef(attrs[attr]))
- ) {
- res += renderAttr(attr, props[key])
- }
- }
- }
- return res
-}
-
-function setText (node, text, raw) {
- const child = new VNode(undefined, undefined, undefined, text)
- child.raw = raw
- node.children = [child]
-}
+++ /dev/null
-import attrs from './attrs'
-import domProps from './dom-props'
-import klass from './class'
-import style from './style'
-
-export default [
- attrs,
- domProps,
- klass,
- style
-]
+++ /dev/null
-/* @flow */
-
-import { escape } from '../util'
-import { hyphenate } from 'shared/util'
-import { getStyle } from 'web/util/style'
-
-export function genStyle (style: Object): string {
- let styleText = ''
- for (const key in style) {
- const value = style[key]
- const hyphenatedKey = hyphenate(key)
- if (Array.isArray(value)) {
- for (let i = 0, len = value.length; i < len; i++) {
- styleText += `${hyphenatedKey}:${value[i]};`
- }
- } else {
- styleText += `${hyphenatedKey}:${value};`
- }
- }
- return styleText
-}
-
-export default function renderStyle (vnode: VNodeWithData): ?string {
- const styleText = genStyle(getStyle(vnode, false))
- if (styleText !== '') {
- return ` style=${JSON.stringify(escape(styleText))}`
- }
-}
+++ /dev/null
-/* @flow */
-
-import { makeMap } from 'shared/util'
-
-const isAttr = makeMap(
- 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
- 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
- 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' +
- 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' +
- 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' +
- 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' +
- 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
- 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
- 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
- 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
- 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
- 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
- 'target,title,type,usemap,value,width,wrap'
-)
-
-/* istanbul ignore next */
-const isRenderableAttr = (name: string): boolean => {
- return (
- isAttr(name) ||
- name.indexOf('data-') === 0 ||
- name.indexOf('aria-') === 0
- )
-}
-export { isRenderableAttr }
-
-export const propsToAttrMap = {
- acceptCharset: 'accept-charset',
- className: 'class',
- htmlFor: 'for',
- httpEquiv: 'http-equiv'
-}
-
-const ESC = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&'
-}
-
-export function escape (s: string) {
- return s.replace(/[<>"&]/g, escapeChar)
-}
-
-function escapeChar (a) {
- return ESC[a] || a
-}
+++ /dev/null
-/* @flow */
-
-import { makeMap } from 'shared/util'
-
-// these are reserved for web because they are directly compiled away
-// during template compilation
-export const isReservedAttr = makeMap('style,class')
-
-// attributes that should be using props for binding
-const acceptValue = makeMap('input,textarea,option,select,progress')
-export const mustUseProp = (tag: string, type: ?string, attr: string): boolean => {
- return (
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
- (attr === 'selected' && tag === 'option') ||
- (attr === 'checked' && tag === 'input') ||
- (attr === 'muted' && tag === 'video')
- )
-}
-
-export const isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck')
-
-export const isBooleanAttr = makeMap(
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
- 'truespeed,typemustmatch,visible'
-)
-
-export const xlinkNS = 'http://www.w3.org/1999/xlink'
-
-export const isXlink = (name: string): boolean => {
- return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
-}
-
-export const getXlinkProp = (name: string): string => {
- return isXlink(name) ? name.slice(6, name.length) : ''
-}
-
-export const isFalsyAttrValue = (val: any): boolean => {
- return val == null || val === false
-}
+++ /dev/null
-/* @flow */
-
-import { isDef, isObject } from 'shared/util'
-
-export function genClassForVnode (vnode: VNodeWithData): string {
- let data = vnode.data
- let parentNode = vnode
- let childNode = vnode
- while (isDef(childNode.componentInstance)) {
- childNode = childNode.componentInstance._vnode
- if (childNode && childNode.data) {
- data = mergeClassData(childNode.data, data)
- }
- }
- while (isDef(parentNode = parentNode.parent)) {
- if (parentNode && parentNode.data) {
- data = mergeClassData(data, parentNode.data)
- }
- }
- return renderClass(data.staticClass, data.class)
-}
-
-function mergeClassData (child: VNodeData, parent: VNodeData): {
- staticClass: string,
- class: any
-} {
- return {
- staticClass: concat(child.staticClass, parent.staticClass),
- class: isDef(child.class)
- ? [child.class, parent.class]
- : parent.class
- }
-}
-
-export function renderClass (
- staticClass: ?string,
- dynamicClass: any
-): string {
- if (isDef(staticClass) || isDef(dynamicClass)) {
- return concat(staticClass, stringifyClass(dynamicClass))
- }
- /* istanbul ignore next */
- return ''
-}
-
-export function concat (a: ?string, b: ?string): string {
- return a ? b ? (a + ' ' + b) : a : (b || '')
-}
-
-export function stringifyClass (value: any): string {
- if (Array.isArray(value)) {
- return stringifyArray(value)
- }
- if (isObject(value)) {
- return stringifyObject(value)
- }
- if (typeof value === 'string') {
- return value
- }
- /* istanbul ignore next */
- return ''
-}
-
-function stringifyArray (value: Array<any>): string {
- let res = ''
- let stringified
- for (let i = 0, l = value.length; i < l; i++) {
- if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
- if (res) res += ' '
- res += stringified
- }
- }
- return res
-}
-
-function stringifyObject (value: Object): string {
- let res = ''
- for (const key in value) {
- if (value[key]) {
- if (res) res += ' '
- res += key
- }
- }
- return res
-}
+++ /dev/null
-/* @flow */
-
-import { inBrowser } from 'core/util/index'
-
-// check whether current browser encodes a char inside attribute values
-let div
-function getShouldDecode (href: boolean): boolean {
- div = div || document.createElement('div')
- div.innerHTML = href ? `<a href="\n"/>` : `<div a="\n"/>`
- return div.innerHTML.indexOf(' ') > 0
-}
-
-// #3663: IE encodes newlines inside attribute values while other browsers don't
-export const shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false
-// #6828: chrome encodes content in a[href]
-export const shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false
+++ /dev/null
-/* @flow */
-
-import { inBrowser } from 'core/util/env'
-import { makeMap } from 'shared/util'
-
-export const namespaceMap = {
- svg: 'http://www.w3.org/2000/svg',
- math: 'http://www.w3.org/1998/Math/MathML'
-}
-
-export const isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template,blockquote,iframe,tfoot'
-)
-
-// this map is intentionally selective, only covering SVG elements that may
-// contain child elements.
-export const isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
-)
-
-export const isPreTag = (tag: ?string): boolean => tag === 'pre'
-
-export const isReservedTag = (tag: string): ?boolean => {
- return isHTMLTag(tag) || isSVG(tag)
-}
-
-export function getTagNamespace (tag: string): ?string {
- if (isSVG(tag)) {
- return 'svg'
- }
- // basic support for MathML
- // note it doesn't support other MathML elements being component roots
- if (tag === 'math') {
- return 'math'
- }
-}
-
-const unknownElementCache = Object.create(null)
-export function isUnknownElement (tag: string): boolean {
- /* istanbul ignore if */
- if (!inBrowser) {
- return true
- }
- if (isReservedTag(tag)) {
- return false
- }
- tag = tag.toLowerCase()
- /* istanbul ignore if */
- if (unknownElementCache[tag] != null) {
- return unknownElementCache[tag]
- }
- const el = document.createElement(tag)
- if (tag.indexOf('-') > -1) {
- // http://stackoverflow.com/a/28210364/1070244
- return (unknownElementCache[tag] = (
- el.constructor === window.HTMLUnknownElement ||
- el.constructor === window.HTMLElement
- ))
- } else {
- return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
- }
-}
-
-export const isTextInputType = makeMap('text,number,password,search,email,tel,url')
+++ /dev/null
-/* @flow */
-
-import { warn } from 'core/util/index'
-
-export * from './attrs'
-export * from './class'
-export * from './element'
-
-/**
- * Query an element selector if it's not an element already.
- */
-export function query (el: string | Element): Element {
- if (typeof el === 'string') {
- const selected = document.querySelector(el)
- if (!selected) {
- process.env.NODE_ENV !== 'production' && warn(
- 'Cannot find element: ' + el
- )
- return document.createElement('div')
- }
- return selected
- } else {
- return el
- }
-}
+++ /dev/null
-/* @flow */
-
-import { cached, extend, toObject } from 'shared/util'
-
-export const parseStyleText = cached(function (cssText) {
- const res = {}
- const listDelimiter = /;(?![^(]*\))/g
- const propertyDelimiter = /:(.+)/
- cssText.split(listDelimiter).forEach(function (item) {
- if (item) {
- var tmp = item.split(propertyDelimiter)
- tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim())
- }
- })
- return res
-})
-
-// merge static and dynamic style data on the same vnode
-function normalizeStyleData (data: VNodeData): ?Object {
- const style = normalizeStyleBinding(data.style)
- // static style is pre-processed into an object during compilation
- // and is always a fresh object, so it's safe to merge into it
- return data.staticStyle
- ? extend(data.staticStyle, style)
- : style
-}
-
-// normalize possible array / string values into Object
-export function normalizeStyleBinding (bindingStyle: any): ?Object {
- if (Array.isArray(bindingStyle)) {
- return toObject(bindingStyle)
- }
- if (typeof bindingStyle === 'string') {
- return parseStyleText(bindingStyle)
- }
- return bindingStyle
-}
-
-/**
- * parent component style should be after child's
- * so that parent component's style could override it
- */
-export function getStyle (vnode: VNodeWithData, checkChild: boolean): Object {
- const res = {}
- let styleData
-
- if (checkChild) {
- let childNode = vnode
- while (childNode.componentInstance) {
- childNode = childNode.componentInstance._vnode
- if (
- childNode && childNode.data &&
- (styleData = normalizeStyleData(childNode.data))
- ) {
- extend(res, styleData)
- }
- }
- }
-
- if ((styleData = normalizeStyleData(vnode.data))) {
- extend(res, styleData)
- }
-
- let parentNode = vnode
- while ((parentNode = parentNode.parent)) {
- if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
- extend(res, styleData)
- }
- }
- return res
-}
-
+++ /dev/null
-import model from './model'
-
-export default {
- model
-}
+++ /dev/null
-/* @flow */
-
-import { addHandler, addAttr } from 'compiler/helpers'
-import { genComponentModel, genAssignmentCode } from 'compiler/directives/model'
-
-export default function model (
- el: ASTElement,
- dir: ASTDirective,
- _warn: Function
-): ?boolean {
- if (el.tag === 'input' || el.tag === 'textarea') {
- genDefaultModel(el, dir.value, dir.modifiers)
- } else {
- genComponentModel(el, dir.value, dir.modifiers)
- }
-}
-
-function genDefaultModel (
- el: ASTElement,
- value: string,
- modifiers: ?ASTModifiers
-): ?boolean {
- const { lazy, trim, number } = modifiers || {}
- const event = lazy ? 'change' : 'input'
-
- let valueExpression = `$event.target.attr.value${trim ? '.trim()' : ''}`
- if (number) {
- valueExpression = `_n(${valueExpression})`
- }
-
- const code = genAssignmentCode(value, valueExpression)
- addAttr(el, 'value', `(${value})`)
- addHandler(el, event, code, null, true)
-}
+++ /dev/null
-/* @flow */
-
-import { genStaticKeys } from 'shared/util'
-import { createCompiler } from 'compiler/index'
-
-import modules from './modules/index'
-import directives from './directives/index'
-
-import {
- isUnaryTag,
- mustUseProp,
- isReservedTag,
- canBeLeftOpenTag,
- getTagNamespace
-} from '../util/element'
-
-export const baseOptions: WeexCompilerOptions = {
- modules,
- directives,
- isUnaryTag,
- mustUseProp,
- canBeLeftOpenTag,
- isReservedTag,
- getTagNamespace,
- preserveWhitespace: false,
- recyclable: false,
- staticKeys: genStaticKeys(modules)
-}
-
-const compiler = createCompiler(baseOptions)
-
-export function compile (
- template: string,
- options?: WeexCompilerOptions
-): WeexCompiledResult {
- let generateAltRender = false
- if (options && options.recyclable === true) {
- generateAltRender = true
- options.recyclable = false
- }
- const result = compiler.compile(template, options)
-
- // generate @render function for <recycle-list>
- if (options && generateAltRender) {
- options.recyclable = true
- // disable static optimizations
- options.optimize = false
- const { render } = compiler.compile(template, options)
- result['@render'] = render
- }
- return result
-}
+++ /dev/null
-/* @flow */
-
-import { makeMap } from 'shared/util'
-
-// The "unitary tag" means that the tag node and its children
-// must be sent to the native together.
-const isUnitaryTag = makeMap('cell,header,cell-slot,recycle-list', true)
-
-function preTransformNode (el: ASTElement, options: CompilerOptions) {
- if (isUnitaryTag(el.tag) && !el.attrsList.some(item => item.name === 'append')) {
- el.attrsMap.append = 'tree'
- el.attrsList.push({ name: 'append', value: 'tree' })
- }
- if (el.attrsMap.append === 'tree') {
- el.appendAsTree = true
- }
-}
-
-function genData (el: ASTElement): string {
- return el.appendAsTree ? `appendAsTree:true,` : ''
-}
-
-export default {
- staticKeys: ['appendAsTree'],
- preTransformNode,
- genData
-}
+++ /dev/null
-/* @flow */
-
-import { parseText } from 'compiler/parser/text-parser'
-import {
- getAndRemoveAttr,
- getBindingAttr,
- baseWarn
-} from 'compiler/helpers'
-
-type StaticClassResult = {
- dynamic: boolean,
- classResult: string
-};
-
-function transformNode (el: ASTElement, options: CompilerOptions) {
- const warn = options.warn || baseWarn
- const staticClass = getAndRemoveAttr(el, 'class')
- const { dynamic, classResult } = parseStaticClass(staticClass, options)
- if (process.env.NODE_ENV !== 'production' && dynamic && staticClass) {
- warn(
- `class="${staticClass}": ` +
- 'Interpolation inside attributes has been deprecated. ' +
- 'Use v-bind or the colon shorthand instead.'
- )
- }
- if (!dynamic && classResult) {
- el.staticClass = classResult
- }
- const classBinding = getBindingAttr(el, 'class', false /* getStatic */)
- if (classBinding) {
- el.classBinding = classBinding
- } else if (dynamic) {
- el.classBinding = classResult
- }
-}
-
-function genData (el: ASTElement): string {
- let data = ''
- if (el.staticClass) {
- data += `staticClass:${el.staticClass},`
- }
- if (el.classBinding) {
- data += `class:${el.classBinding},`
- }
- return data
-}
-
-function parseStaticClass (staticClass: ?string, options: CompilerOptions): StaticClassResult {
- // "a b c" -> ["a", "b", "c"] => staticClass: ["a", "b", "c"]
- // "a {{x}} c" -> ["a", x, "c"] => classBinding: '["a", x, "c"]'
- let dynamic = false
- let classResult = ''
- if (staticClass) {
- const classList = staticClass.trim().split(' ').map(name => {
- const result = parseText(name, options.delimiters)
- if (result) {
- dynamic = true
- return result.expression
- }
- return JSON.stringify(name)
- })
- if (classList.length) {
- classResult = '[' + classList.join(',') + ']'
- }
- }
- return { dynamic, classResult }
-}
-
-export default {
- staticKeys: ['staticClass'],
- transformNode,
- genData
-}
+++ /dev/null
-import klass from './class'
-import style from './style'
-import props from './props'
-import append from './append'
-import recycleList from './recycle-list/index'
-
-export default [
- recycleList,
- klass,
- style,
- props,
- append
-]
+++ /dev/null
-/* @flow */
-
-import { cached, camelize } from 'shared/util'
-
-const normalize = cached(camelize)
-
-function normalizeKeyName (str: string): string {
- if (str.match(/^v\-/)) {
- return str.replace(/(v-[a-z\-]+\:)([a-z\-]+)$/i, ($, directive, prop) => {
- return directive + normalize(prop)
- })
- }
- return normalize(str)
-}
-
-function transformNode (el: ASTElement, options: CompilerOptions) {
- if (Array.isArray(el.attrsList)) {
- el.attrsList.forEach(attr => {
- if (attr.name && attr.name.match(/\-/)) {
- const realName = normalizeKeyName(attr.name)
- if (el.attrsMap) {
- el.attrsMap[realName] = el.attrsMap[attr.name]
- delete el.attrsMap[attr.name]
- }
- attr.name = realName
- }
- })
- }
-}
-export default {
- transformNode
-}
+++ /dev/null
-/* @flow */
-
-import { addAttr } from 'compiler/helpers'
-
-// mark component root nodes as
-export function postTransformComponentRoot (
- el: ASTElement,
- options: WeexCompilerOptions
-) {
- if (!el.parent) {
- // component root
- addAttr(el, '@isComponentRoot', 'true')
- addAttr(el, '@templateId', '_uid')
- addAttr(el, '@componentProps', '$props || {}')
- }
-}
+++ /dev/null
-/* @flow */
-
-import { addAttr } from 'compiler/helpers'
-import { RECYCLE_LIST_MARKER } from 'weex/util/index'
-
-// mark components as inside recycle-list so that we know we need to invoke
-// their special @render function instead of render in create-component.js
-export function postTransformComponent (
- el: ASTElement,
- options: WeexCompilerOptions
-) {
- // $flow-disable-line (we know isReservedTag is there)
- if (!options.isReservedTag(el.tag) && el.tag !== 'cell-slot') {
- addAttr(el, RECYCLE_LIST_MARKER, 'true')
- }
-}
+++ /dev/null
-/* @flow */
-
-import { preTransformRecycleList } from './recycle-list'
-import { postTransformComponent } from './component'
-import { postTransformComponentRoot } from './component-root'
-import { postTransformText } from './text'
-import { preTransformVBind } from './v-bind'
-import { preTransformVIf } from './v-if'
-import { preTransformVFor } from './v-for'
-import { postTransformVOn } from './v-on'
-import { preTransformVOnce } from './v-once'
-
-let currentRecycleList = null
-
-function shouldCompile (el: ASTElement, options: WeexCompilerOptions) {
- return options.recyclable ||
- (currentRecycleList && el !== currentRecycleList)
-}
-
-function preTransformNode (el: ASTElement, options: WeexCompilerOptions) {
- if (el.tag === 'recycle-list') {
- preTransformRecycleList(el, options)
- currentRecycleList = el
- }
- if (shouldCompile(el, options)) {
- preTransformVBind(el, options)
- preTransformVIf(el, options) // also v-else-if and v-else
- preTransformVFor(el, options)
- preTransformVOnce(el, options)
- }
-}
-
-function transformNode (el: ASTElement, options: WeexCompilerOptions) {
- if (shouldCompile(el, options)) {
- // do nothing yet
- }
-}
-
-function postTransformNode (el: ASTElement, options: WeexCompilerOptions) {
- if (shouldCompile(el, options)) {
- // mark child component in parent template
- postTransformComponent(el, options)
- // mark root in child component template
- postTransformComponentRoot(el, options)
- // <text>: transform children text into value attr
- if (el.tag === 'text') {
- postTransformText(el, options)
- }
- postTransformVOn(el, options)
- }
- if (el === currentRecycleList) {
- currentRecycleList = null
- }
-}
-
-export default {
- preTransformNode,
- transformNode,
- postTransformNode
-}
+++ /dev/null
-/* @flow */
-
-import { parseFor } from 'compiler/parser/index'
-import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
-
-/**
- * Map the following syntax to corresponding attrs:
- *
- * <recycle-list for="(item, i) in longList" switch="cellType">
- * <cell-slot case="A"> ... </cell-slot>
- * <cell-slot case="B"> ... </cell-slot>
- * </recycle-list>
- */
-
-export function preTransformRecycleList (
- el: ASTElement,
- options: WeexCompilerOptions
-) {
- const exp = getAndRemoveAttr(el, 'for')
- if (!exp) {
- if (options.warn) {
- options.warn(`Invalid <recycle-list> syntax: missing "for" expression.`)
- }
- return
- }
-
- const res = parseFor(exp)
- if (!res) {
- if (options.warn) {
- options.warn(`Invalid <recycle-list> syntax: ${exp}.`)
- }
- return
- }
-
- addRawAttr(el, ':list-data', res.for)
- addRawAttr(el, 'binding-expression', res.for)
- addRawAttr(el, 'alias', res.alias)
- if (res.iterator2) {
- // (item, key, index) for object iteration
- // is this even supported?
- addRawAttr(el, 'index', res.iterator2)
- } else if (res.iterator1) {
- addRawAttr(el, 'index', res.iterator1)
- }
-
- const switchKey = getAndRemoveAttr(el, 'switch')
- if (switchKey) {
- addRawAttr(el, 'switch', switchKey)
- }
-}
+++ /dev/null
-/* @flow */
-
-import { addAttr } from 'compiler/helpers'
-
-function genText (node: ASTNode) {
- const value = node.type === 3
- ? node.text
- : node.type === 2
- ? node.tokens.length === 1
- ? node.tokens[0]
- : node.tokens
- : ''
- return JSON.stringify(value)
-}
-
-export function postTransformText (el: ASTElement, options: WeexCompilerOptions) {
- // weex <text> can only contain text, so the parser
- // always generates a single child.
- if (el.children.length) {
- addAttr(el, 'value', genText(el.children[0]))
- el.children = []
- }
-}
+++ /dev/null
-/* @flow */
-
-import { camelize } from 'shared/util'
-import { generateBinding } from 'weex/util/parser'
-import { bindRE } from 'compiler/parser/index'
-import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
-
-function parseAttrName (name: string): string {
- return camelize(name.replace(bindRE, ''))
-}
-
-export function preTransformVBind (el: ASTElement, options: WeexCompilerOptions) {
- for (const attr in el.attrsMap) {
- if (bindRE.test(attr)) {
- const name: string = parseAttrName(attr)
- const value = generateBinding(getAndRemoveAttr(el, attr))
- delete el.attrsMap[attr]
- addRawAttr(el, name, value)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { parseFor } from 'compiler/parser/index'
-import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
-
-export function preTransformVFor (el: ASTElement, options: WeexCompilerOptions) {
- const exp = getAndRemoveAttr(el, 'v-for')
- if (!exp) {
- return
- }
-
- const res = parseFor(exp)
- if (!res) {
- if (process.env.NODE_ENV !== 'production' && options.warn) {
- options.warn(`Invalid v-for expression: ${exp}`)
- }
- return
- }
-
- const desc: Object = {
- '@expression': res.for,
- '@alias': res.alias
- }
- if (res.iterator2) {
- desc['@key'] = res.iterator1
- desc['@index'] = res.iterator2
- } else {
- desc['@index'] = res.iterator1
- }
-
- delete el.attrsMap['v-for']
- addRawAttr(el, '[[repeat]]', desc)
-}
+++ /dev/null
-/* @flow */
-
-import { addIfCondition } from 'compiler/parser/index'
-import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
-
-function hasConditionDirective (el: ASTElement): boolean {
- for (const attr in el.attrsMap) {
- if (/^v\-if|v\-else|v\-else\-if$/.test(attr)) {
- return true
- }
- }
- return false
-}
-
-function getPreviousConditions (el: ASTElement): Array<string> {
- const conditions = []
- if (el.parent && el.parent.children) {
- for (let c = 0, n = el.parent.children.length; c < n; ++c) {
- // $flow-disable-line
- const ifConditions = el.parent.children[c].ifConditions
- if (ifConditions) {
- for (let i = 0, l = ifConditions.length; i < l; ++i) {
- const condition = ifConditions[i]
- if (condition && condition.exp) {
- conditions.push(condition.exp)
- }
- }
- }
- }
- }
- return conditions
-}
-
-export function preTransformVIf (el: ASTElement, options: WeexCompilerOptions) {
- if (hasConditionDirective(el)) {
- let exp
- const ifExp = getAndRemoveAttr(el, 'v-if', true /* remove from attrsMap */)
- const elseifExp = getAndRemoveAttr(el, 'v-else-if', true)
- // don't need the value, but remove it to avoid being generated as a
- // custom directive
- getAndRemoveAttr(el, 'v-else', true)
- if (ifExp) {
- exp = ifExp
- addIfCondition(el, { exp: ifExp, block: el })
- } else {
- elseifExp && addIfCondition(el, { exp: elseifExp, block: el })
- const prevConditions = getPreviousConditions(el)
- if (prevConditions.length) {
- const prevMatch = prevConditions.join(' || ')
- exp = elseifExp
- ? `!(${prevMatch}) && (${elseifExp})` // v-else-if
- : `!(${prevMatch})` // v-else
- } else if (process.env.NODE_ENV !== 'production' && options.warn) {
- options.warn(
- `v-${elseifExp ? ('else-if="' + elseifExp + '"') : 'else'} ` +
- `used on element <${el.tag}> without corresponding v-if.`
- )
- return
- }
- }
- addRawAttr(el, '[[match]]', exp)
- }
-}
+++ /dev/null
-/* @flow */
-
-const inlineStatementRE = /^\s*([A-Za-z_$0-9\['\."\]]+)*\s*\(\s*(([A-Za-z_$0-9\['\."\]]+)?(\s*,\s*([A-Za-z_$0-9\['\."\]]+))*)\s*\)$/
-
-function parseHandlerParams (handler: ASTElementHandler) {
- const res = inlineStatementRE.exec(handler.value)
- if (res && res[2]) {
- handler.params = res[2].split(/\s*,\s*/)
- }
-}
-
-export function postTransformVOn (el: ASTElement, options: WeexCompilerOptions) {
- const events: ASTElementHandlers | void = el.events
- if (!events) {
- return
- }
- for (const name in events) {
- const handler: ASTElementHandler | Array<ASTElementHandler> = events[name]
- if (Array.isArray(handler)) {
- handler.map(fn => parseHandlerParams(fn))
- } else {
- parseHandlerParams(handler)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
-
-function containVOnce (el: ASTElement): boolean {
- for (const attr in el.attrsMap) {
- if (/^v\-once$/i.test(attr)) {
- return true
- }
- }
- return false
-}
-
-export function preTransformVOnce (el: ASTElement, options: WeexCompilerOptions) {
- if (containVOnce(el)) {
- getAndRemoveAttr(el, 'v-once', true)
- addRawAttr(el, '[[once]]', true)
- }
-}
+++ /dev/null
-/* @flow */
-
-import { cached, camelize, isPlainObject } from 'shared/util'
-import { parseText } from 'compiler/parser/text-parser'
-import {
- getAndRemoveAttr,
- getBindingAttr,
- baseWarn
-} from 'compiler/helpers'
-
-type StaticStyleResult = {
- dynamic: boolean,
- styleResult: string | Object | void
-};
-
-const normalize = cached(camelize)
-
-function transformNode (el: ASTElement, options: CompilerOptions) {
- const warn = options.warn || baseWarn
- const staticStyle = getAndRemoveAttr(el, 'style')
- const { dynamic, styleResult } = parseStaticStyle(staticStyle, options)
- if (process.env.NODE_ENV !== 'production' && dynamic) {
- warn(
- `style="${String(staticStyle)}": ` +
- 'Interpolation inside attributes has been deprecated. ' +
- 'Use v-bind or the colon shorthand instead.'
- )
- }
- if (!dynamic && styleResult) {
- // $flow-disable-line
- el.staticStyle = styleResult
- }
- const styleBinding = getBindingAttr(el, 'style', false /* getStatic */)
- if (styleBinding) {
- el.styleBinding = styleBinding
- } else if (dynamic) {
- // $flow-disable-line
- el.styleBinding = styleResult
- }
-}
-
-function genData (el: ASTElement): string {
- let data = ''
- if (el.staticStyle) {
- data += `staticStyle:${el.staticStyle},`
- }
- if (el.styleBinding) {
- data += `style:${el.styleBinding},`
- }
- return data
-}
-
-function parseStaticStyle (staticStyle: ?string, options: CompilerOptions): StaticStyleResult {
- // "width: 200px; height: 200px;" -> {width: 200, height: 200}
- // "width: 200px; height: {{y}}" -> {width: 200, height: y}
- let dynamic = false
- let styleResult = ''
- if (typeof staticStyle === 'string') {
- const styleList = staticStyle.trim().split(';').map(style => {
- const result = style.trim().split(':')
- if (result.length !== 2) {
- return
- }
- const key = normalize(result[0].trim())
- const value = result[1].trim()
- const dynamicValue = parseText(value, options.delimiters)
- if (dynamicValue) {
- dynamic = true
- return key + ':' + dynamicValue.expression
- }
- return key + ':' + JSON.stringify(value)
- }).filter(result => result)
- if (styleList.length) {
- styleResult = '{' + styleList.join(',') + '}'
- }
- } else if (isPlainObject(staticStyle)) {
- styleResult = JSON.stringify(staticStyle) || ''
- }
- return { dynamic, styleResult }
-}
-
-export default {
- staticKeys: ['staticStyle'],
- transformNode,
- genData
-}
+++ /dev/null
-export { compile } from 'weex/compiler/index'
+++ /dev/null
-/* @flow */
-
-// this will be preserved during build
-// $flow-disable-line
-const VueFactory = require('./factory')
-
-const instanceOptions: { [key: string]: WeexInstanceOption } = {}
-
-/**
- * Create instance context.
- */
-export function createInstanceContext (
- instanceId: string,
- runtimeContext: WeexRuntimeContext,
- data: Object = {}
-): WeexInstanceContext {
- const weex: Weex = runtimeContext.weex
- const instance: WeexInstanceOption = instanceOptions[instanceId] = {
- instanceId,
- config: weex.config,
- document: weex.document,
- data
- }
-
- // Each instance has a independent `Vue` module instance
- const Vue = instance.Vue = createVueModuleInstance(instanceId, weex)
-
- // DEPRECATED
- const timerAPIs = getInstanceTimer(instanceId, weex.requireModule)
-
- const instanceContext = Object.assign({ Vue }, timerAPIs)
- Object.freeze(instanceContext)
- return instanceContext
-}
-
-/**
- * Destroy an instance with id. It will make sure all memory of
- * this instance released and no more leaks.
- */
-export function destroyInstance (instanceId: string): void {
- const instance = instanceOptions[instanceId]
- if (instance && instance.app instanceof instance.Vue) {
- try {
- instance.app.$destroy()
- instance.document.destroy()
- } catch (e) {}
- delete instance.document
- delete instance.app
- }
- delete instanceOptions[instanceId]
-}
-
-/**
- * Refresh an instance with id and new top-level component data.
- * It will use `Vue.set` on all keys of the new data. So it's better
- * define all possible meaningful keys when instance created.
- */
-export function refreshInstance (
- instanceId: string,
- data: Object
-): Error | void {
- const instance = instanceOptions[instanceId]
- if (!instance || !(instance.app instanceof instance.Vue)) {
- return new Error(`refreshInstance: instance ${instanceId} not found!`)
- }
- if (instance.Vue && instance.Vue.set) {
- for (const key in data) {
- instance.Vue.set(instance.app, key, data[key])
- }
- }
- // Finally `refreshFinish` signal needed.
- instance.document.taskCenter.send('dom', { action: 'refreshFinish' }, [])
-}
-
-/**
- * Create a fresh instance of Vue for each Weex instance.
- */
-function createVueModuleInstance (
- instanceId: string,
- weex: Weex
-): GlobalAPI {
- const exports = {}
- VueFactory(exports, weex.document)
- const Vue = exports.Vue
-
- const instance = instanceOptions[instanceId]
-
- // patch reserved tag detection to account for dynamically registered
- // components
- const weexRegex = /^weex:/i
- const isReservedTag = Vue.config.isReservedTag || (() => false)
- const isRuntimeComponent = Vue.config.isRuntimeComponent || (() => false)
- Vue.config.isReservedTag = name => {
- return (!isRuntimeComponent(name) && weex.supports(`@component/${name}`)) ||
- isReservedTag(name) ||
- weexRegex.test(name)
- }
- Vue.config.parsePlatformTagName = name => name.replace(weexRegex, '')
-
- // expose weex-specific info
- Vue.prototype.$instanceId = instanceId
- Vue.prototype.$document = instance.document
-
- // expose weex native module getter on subVue prototype so that
- // vdom runtime modules can access native modules via vnode.context
- Vue.prototype.$requireWeexModule = weex.requireModule
-
- // Hack `Vue` behavior to handle instance information and data
- // before root component created.
- Vue.mixin({
- beforeCreate () {
- const options = this.$options
- // root component (vm)
- if (options.el) {
- // set external data of instance
- const dataOption = options.data
- const internalData = (typeof dataOption === 'function' ? dataOption() : dataOption) || {}
- options.data = Object.assign(internalData, instance.data)
- // record instance by id
- instance.app = this
- }
- },
- mounted () {
- const options = this.$options
- // root component (vm)
- if (options.el && weex.document && instance.app === this) {
- try {
- // Send "createFinish" signal to native.
- weex.document.taskCenter.send('dom', { action: 'createFinish' }, [])
- } catch (e) {}
- }
- }
- })
-
- /**
- * @deprecated Just instance variable `weex.config`
- * Get instance config.
- * @return {object}
- */
- Vue.prototype.$getConfig = function () {
- if (instance.app instanceof Vue) {
- return instance.config
- }
- }
-
- return Vue
-}
-
-/**
- * DEPRECATED
- * Generate HTML5 Timer APIs. An important point is that the callback
- * will be converted into callback id when sent to native. So the
- * framework can make sure no side effect of the callback happened after
- * an instance destroyed.
- */
-function getInstanceTimer (
- instanceId: string,
- moduleGetter: Function
-): Object {
- const instance = instanceOptions[instanceId]
- const timer = moduleGetter('timer')
- const timerAPIs = {
- setTimeout: (...args) => {
- const handler = function () {
- args[0](...args.slice(2))
- }
-
- timer.setTimeout(handler, args[1])
- return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
- },
- setInterval: (...args) => {
- const handler = function () {
- args[0](...args.slice(2))
- }
-
- timer.setInterval(handler, args[1])
- return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
- },
- clearTimeout: (n) => {
- timer.clearTimeout(n)
- },
- clearInterval: (n) => {
- timer.clearInterval(n)
- }
- }
- return timerAPIs
-}
+++ /dev/null
-// this entry is built and wrapped with a factory function
-// used to generate a fresh copy of Vue for every Weex instance.
-
-import Vue from './runtime/index'
-
-exports.Vue = Vue
+++ /dev/null
-import Richtext from './richtext'
-import Transition from './transition'
-import TransitionGroup from './transition-group'
-
-export default {
- Richtext,
- Transition,
- TransitionGroup
-}
+++ /dev/null
-/* @flow */
-
-function getVNodeType (vnode: VNode): string {
- if (!vnode.tag) {
- return ''
- }
- return vnode.tag.replace(/vue\-component\-(\d+\-)?/, '')
-}
-
-function isSimpleSpan (vnode: VNode): boolean {
- return vnode.children &&
- vnode.children.length === 1 &&
- !vnode.children[0].tag
-}
-
-function parseStyle (vnode: VNode): Object | void {
- if (!vnode || !vnode.data) {
- return
- }
- const { staticStyle, staticClass } = vnode.data
- if (vnode.data.style || vnode.data.class || staticStyle || staticClass) {
- const styles = Object.assign({}, staticStyle, vnode.data.style)
- const cssMap = vnode.context.$options.style || {}
- const classList = [].concat(staticClass, vnode.data.class)
- classList.forEach(name => {
- if (name && cssMap[name]) {
- Object.assign(styles, cssMap[name])
- }
- })
- return styles
- }
-}
-
-function convertVNodeChildren (children: Array<VNode>): Array<VNode> | void {
- if (!children.length) {
- return
- }
-
- return children.map(vnode => {
- const type: string = getVNodeType(vnode)
- const props: Object = { type }
-
- // convert raw text node
- if (!type) {
- props.type = 'span'
- props.attr = {
- value: (vnode.text || '').trim()
- }
- } else {
- props.style = parseStyle(vnode)
- if (vnode.data) {
- props.attr = vnode.data.attrs
- if (vnode.data.on) {
- props.events = vnode.data.on
- }
- }
- if (type === 'span' && isSimpleSpan(vnode)) {
- props.attr = props.attr || {}
- props.attr.value = vnode.children[0].text.trim()
- return props
- }
- }
-
- if (vnode.children && vnode.children.length) {
- props.children = convertVNodeChildren(vnode.children)
- }
-
- return props
- })
-}
-
-export default {
- name: 'richtext',
- render (h: Function) {
- return h('weex:richtext', {
- on: this._events,
- attrs: {
- value: convertVNodeChildren(this.$options._renderChildren || [])
- }
- })
- }
-}
+++ /dev/null
-import { warn, extend } from 'core/util/index'
-import { transitionProps, extractTransitionData } from './transition'
-
-const props = extend({
- tag: String,
- moveClass: String
-}, transitionProps)
-
-delete props.mode
-
-export default {
- props,
-
- created () {
- const dom = this.$requireWeexModule('dom')
- this.getPosition = el => new Promise((resolve, reject) => {
- dom.getComponentRect(el.ref, res => {
- if (!res.result) {
- reject(new Error(`failed to get rect for element: ${el.tag}`))
- } else {
- resolve(res.size)
- }
- })
- })
-
- const animation = this.$requireWeexModule('animation')
- this.animate = (el, options) => new Promise(resolve => {
- animation.transition(el.ref, options, resolve)
- })
- },
-
- render (h) {
- const tag = this.tag || this.$vnode.data.tag || 'span'
- const map = Object.create(null)
- const prevChildren = this.prevChildren = this.children
- const rawChildren = this.$slots.default || []
- const children = this.children = []
- const transitionData = extractTransitionData(this)
-
- for (let i = 0; i < rawChildren.length; i++) {
- const c = rawChildren[i]
- if (c.tag) {
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
- children.push(c)
- map[c.key] = c
- ;(c.data || (c.data = {})).transition = transitionData
- } else if (process.env.NODE_ENV !== 'production') {
- const opts = c.componentOptions
- const name = opts
- ? (opts.Ctor.options.name || opts.tag)
- : c.tag
- warn(`<transition-group> children must be keyed: <${name}>`)
- }
- }
- }
-
- if (prevChildren) {
- const kept = []
- const removed = []
- prevChildren.forEach(c => {
- c.data.transition = transitionData
-
- // TODO: record before patch positions
-
- if (map[c.key]) {
- kept.push(c)
- } else {
- removed.push(c)
- }
- })
- this.kept = h(tag, null, kept)
- this.removed = removed
- }
-
- return h(tag, null, children)
- },
-
- beforeUpdate () {
- // force removing pass
- this.__patch__(
- this._vnode,
- this.kept,
- false, // hydrating
- true // removeOnly (!important, avoids unnecessary moves)
- )
- this._vnode = this.kept
- },
-
- updated () {
- const children = this.prevChildren
- const moveClass = this.moveClass || ((this.name || 'v') + '-move')
- const moveData = children.length && this.getMoveData(children[0].context, moveClass)
- if (!moveData) {
- return
- }
-
- // TODO: finish implementing move animations once
- // we have access to sync getComponentRect()
-
- // children.forEach(callPendingCbs)
-
- // Promise.all(children.map(c => {
- // const oldPos = c.data.pos
- // const newPos = c.data.newPos
- // const dx = oldPos.left - newPos.left
- // const dy = oldPos.top - newPos.top
- // if (dx || dy) {
- // c.data.moved = true
- // return this.animate(c.elm, {
- // styles: {
- // transform: `translate(${dx}px,${dy}px)`
- // }
- // })
- // }
- // })).then(() => {
- // children.forEach(c => {
- // if (c.data.moved) {
- // this.animate(c.elm, {
- // styles: {
- // transform: ''
- // },
- // duration: moveData.duration || 0,
- // delay: moveData.delay || 0,
- // timingFunction: moveData.timingFunction || 'linear'
- // })
- // }
- // })
- // })
- },
-
- methods: {
- getMoveData (context, moveClass) {
- const stylesheet = context.$options.style || {}
- return stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][moveClass]
- }
- }
-}
-
-// function callPendingCbs (c) {
-// /* istanbul ignore if */
-// if (c.elm._moveCb) {
-// c.elm._moveCb()
-// }
-// /* istanbul ignore if */
-// if (c.elm._enterCb) {
-// c.elm._enterCb()
-// }
-// }
+++ /dev/null
-// reuse same transition component logic from web
-export {
- transitionProps,
- extractTransitionData
-} from 'web/runtime/components/transition'
-
-import Transition from 'web/runtime/components/transition'
-
-export default Transition
+++ /dev/null
-export default {
-}
+++ /dev/null
-/* @flow */
-
-import Vue from 'core/index'
-import { patch } from 'weex/runtime/patch'
-import { mountComponent } from 'core/instance/lifecycle'
-import platformDirectives from 'weex/runtime/directives/index'
-import platformComponents from 'weex/runtime/components/index'
-
-import {
- query,
- mustUseProp,
- isReservedTag,
- isRuntimeComponent,
- isUnknownElement
-} from 'weex/util/element'
-
-// install platform specific utils
-Vue.config.mustUseProp = mustUseProp
-Vue.config.isReservedTag = isReservedTag
-Vue.config.isRuntimeComponent = isRuntimeComponent
-Vue.config.isUnknownElement = isUnknownElement
-
-// install platform runtime directives and components
-Vue.options.directives = platformDirectives
-Vue.options.components = platformComponents
-
-// install platform patch function
-Vue.prototype.__patch__ = patch
-
-// wrap mount
-Vue.prototype.$mount = function (
- el?: any,
- hydrating?: boolean
-): Component {
- return mountComponent(
- this,
- el && query(el, this.$document),
- hydrating
- )
-}
-
-export default Vue
+++ /dev/null
-/* @flow */
-
-import { extend } from 'shared/util'
-
-function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (!oldVnode.data.attrs && !vnode.data.attrs) {
- return
- }
- let key, cur, old
- const elm = vnode.elm
- const oldAttrs = oldVnode.data.attrs || {}
- let attrs = vnode.data.attrs || {}
- // clone observed objects, as the user probably wants to mutate it
- if (attrs.__ob__) {
- attrs = vnode.data.attrs = extend({}, attrs)
- }
-
- const supportBatchUpdate = typeof elm.setAttrs === 'function'
- const batchedAttrs = {}
- for (key in attrs) {
- cur = attrs[key]
- old = oldAttrs[key]
- if (old !== cur) {
- supportBatchUpdate
- ? (batchedAttrs[key] = cur)
- : elm.setAttr(key, cur)
- }
- }
- for (key in oldAttrs) {
- if (attrs[key] == null) {
- supportBatchUpdate
- ? (batchedAttrs[key] = undefined)
- : elm.setAttr(key)
- }
- }
- if (supportBatchUpdate) {
- elm.setAttrs(batchedAttrs)
- }
-}
-
-export default {
- create: updateAttrs,
- update: updateAttrs
-}
+++ /dev/null
-/* @flow */
-
-import { extend } from 'shared/util'
-
-function updateClass (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- const el = vnode.elm
- const ctx = vnode.context
-
- const data: VNodeData = vnode.data
- const oldData: VNodeData = oldVnode.data
- if (!data.staticClass &&
- !data.class &&
- (!oldData || (!oldData.staticClass && !oldData.class))
- ) {
- return
- }
-
- const oldClassList = []
- // unlike web, weex vnode staticClass is an Array
- const oldStaticClass: any = oldData.staticClass
- if (oldStaticClass) {
- oldClassList.push.apply(oldClassList, oldStaticClass)
- }
- if (oldData.class) {
- oldClassList.push.apply(oldClassList, oldData.class)
- }
-
- const classList = []
- // unlike web, weex vnode staticClass is an Array
- const staticClass: any = data.staticClass
- if (staticClass) {
- classList.push.apply(classList, staticClass)
- }
- if (data.class) {
- classList.push.apply(classList, data.class)
- }
-
- if (typeof el.setClassList === 'function') {
- el.setClassList(classList)
- } else {
- const style = getStyle(oldClassList, classList, ctx)
- if (typeof el.setStyles === 'function') {
- el.setStyles(style)
- } else {
- for (const key in style) {
- el.setStyle(key, style[key])
- }
- }
- }
-}
-
-function getStyle (oldClassList: Array<string>, classList: Array<string>, ctx: Component): Object {
- // style is a weex-only injected object
- // compiled from <style> tags in weex files
- const stylesheet: any = ctx.$options.style || {}
- const result = {}
- classList.forEach(name => {
- const style = stylesheet[name]
- extend(result, style)
- })
- oldClassList.forEach(name => {
- const style = stylesheet[name]
- for (const key in style) {
- if (!result.hasOwnProperty(key)) {
- result[key] = ''
- }
- }
- })
- return result
-}
-
-export default {
- create: updateClass,
- update: updateClass
-}
+++ /dev/null
-/* @flow */
-
-import { updateListeners } from 'core/vdom/helpers/update-listeners'
-
-let target: any
-
-function add (
- event: string,
- handler: Function,
- once: boolean,
- capture: boolean,
- passive?: boolean,
- params?: Array<any>
-) {
- if (capture) {
- console.log('Weex do not support event in bubble phase.')
- return
- }
- if (once) {
- const oldHandler = handler
- const _target = target // save current target element in closure
- handler = function (ev) {
- const res = arguments.length === 1
- ? oldHandler(ev)
- : oldHandler.apply(null, arguments)
- if (res !== null) {
- remove(event, null, null, _target)
- }
- }
- }
- target.addEvent(event, handler, params)
-}
-
-function remove (
- event: string,
- handler: any,
- capture: any,
- _target?: any
-) {
- (_target || target).removeEvent(event)
-}
-
-function updateDOMListeners (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (!oldVnode.data.on && !vnode.data.on) {
- return
- }
- const on = vnode.data.on || {}
- const oldOn = oldVnode.data.on || {}
- target = vnode.elm
- updateListeners(on, oldOn, add, remove, vnode.context)
- target = undefined
-}
-
-export default {
- create: updateDOMListeners,
- update: updateDOMListeners
-}
+++ /dev/null
-import attrs from './attrs'
-import klass from './class'
-import events from './events'
-import style from './style'
-import transition from './transition'
-
-export default [
- attrs,
- klass,
- events,
- style,
- transition
-]
+++ /dev/null
-/* @flow */
-
-import { extend, cached, camelize } from 'shared/util'
-
-const normalize = cached(camelize)
-
-function createStyle (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (!vnode.data.staticStyle) {
- updateStyle(oldVnode, vnode)
- return
- }
- const elm = vnode.elm
- const staticStyle = vnode.data.staticStyle
- const supportBatchUpdate = typeof elm.setStyles === 'function'
- const batchedStyles = {}
- for (const name in staticStyle) {
- if (staticStyle[name]) {
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = staticStyle[name])
- : elm.setStyle(normalize(name), staticStyle[name])
- }
- }
- if (supportBatchUpdate) {
- elm.setStyles(batchedStyles)
- }
- updateStyle(oldVnode, vnode)
-}
-
-function updateStyle (oldVnode: VNodeWithData, vnode: VNodeWithData) {
- if (!oldVnode.data.style && !vnode.data.style) {
- return
- }
- let cur, name
- const elm = vnode.elm
- const oldStyle: any = oldVnode.data.style || {}
- let style: any = vnode.data.style || {}
-
- const needClone = style.__ob__
-
- // handle array syntax
- if (Array.isArray(style)) {
- style = vnode.data.style = toObject(style)
- }
-
- // clone the style for future updates,
- // in case the user mutates the style object in-place.
- if (needClone) {
- style = vnode.data.style = extend({}, style)
- }
-
- const supportBatchUpdate = typeof elm.setStyles === 'function'
- const batchedStyles = {}
- for (name in oldStyle) {
- if (!style[name]) {
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = '')
- : elm.setStyle(normalize(name), '')
- }
- }
- for (name in style) {
- cur = style[name]
- supportBatchUpdate
- ? (batchedStyles[normalize(name)] = cur)
- : elm.setStyle(normalize(name), cur)
- }
- if (supportBatchUpdate) {
- elm.setStyles(batchedStyles)
- }
-}
-
-function toObject (arr) {
- const res = {}
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i])
- }
- }
- return res
-}
-
-export default {
- create: createStyle,
- update: updateStyle
-}
+++ /dev/null
-import { warn } from 'core/util/debug'
-import { extend, once, noop } from 'shared/util'
-import { activeInstance } from 'core/instance/lifecycle'
-import { resolveTransition } from 'web/runtime/transition-util'
-
-export default {
- create: enter,
- activate: enter,
- remove: leave
-}
-
-function enter (_, vnode) {
- const el = vnode.elm
-
- // call leave callback now
- if (el._leaveCb) {
- el._leaveCb.cancelled = true
- el._leaveCb()
- }
-
- const data = resolveTransition(vnode.data.transition)
- if (!data) {
- return
- }
-
- /* istanbul ignore if */
- if (el._enterCb) {
- return
- }
-
- const {
- enterClass,
- enterToClass,
- enterActiveClass,
- appearClass,
- appearToClass,
- appearActiveClass,
- beforeEnter,
- enter,
- afterEnter,
- enterCancelled,
- beforeAppear,
- appear,
- afterAppear,
- appearCancelled
- } = data
-
- let context = activeInstance
- let transitionNode = activeInstance.$vnode
- while (transitionNode && transitionNode.parent) {
- transitionNode = transitionNode.parent
- context = transitionNode.context
- }
-
- const isAppear = !context._isMounted || !vnode.isRootInsert
-
- if (isAppear && !appear && appear !== '') {
- return
- }
-
- const startClass = isAppear ? appearClass : enterClass
- const toClass = isAppear ? appearToClass : enterToClass
- const activeClass = isAppear ? appearActiveClass : enterActiveClass
- const beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter
- const enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter
- const afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter
- const enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled
-
- const userWantsControl =
- enterHook &&
- // enterHook may be a bound method which exposes
- // the length of original fn as _length
- (enterHook._length || enterHook.length) > 1
-
- const stylesheet = vnode.context.$options.style || {}
- const startState = stylesheet[startClass]
- const transitionProperties = (stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][activeClass]) || {}
- const endState = getEnterTargetState(el, stylesheet, startClass, toClass, activeClass, vnode.context)
- const needAnimation = Object.keys(endState).length > 0
-
- const cb = el._enterCb = once(() => {
- if (cb.cancelled) {
- enterCancelledHook && enterCancelledHook(el)
- } else {
- afterEnterHook && afterEnterHook(el)
- }
- el._enterCb = null
- })
-
- // We need to wait until the native element has been inserted, but currently
- // there's no API to do that. So we have to wait "one frame" - not entirely
- // sure if this is guaranteed to be enough (e.g. on slow devices?)
- setTimeout(() => {
- const parent = el.parentNode
- const pendingNode = parent && parent._pending && parent._pending[vnode.key]
- if (pendingNode &&
- pendingNode.context === vnode.context &&
- pendingNode.tag === vnode.tag &&
- pendingNode.elm._leaveCb
- ) {
- pendingNode.elm._leaveCb()
- }
- enterHook && enterHook(el, cb)
-
- if (needAnimation) {
- const animation = vnode.context.$requireWeexModule('animation')
- animation.transition(el.ref, {
- styles: endState,
- duration: transitionProperties.duration || 0,
- delay: transitionProperties.delay || 0,
- timingFunction: transitionProperties.timingFunction || 'linear'
- }, userWantsControl ? noop : cb)
- } else if (!userWantsControl) {
- cb()
- }
- }, 16)
-
- // start enter transition
- beforeEnterHook && beforeEnterHook(el)
-
- if (startState) {
- if (typeof el.setStyles === 'function') {
- el.setStyles(startState)
- } else {
- for (const key in startState) {
- el.setStyle(key, startState[key])
- }
- }
- }
-
- if (!needAnimation && !userWantsControl) {
- cb()
- }
-}
-
-function leave (vnode, rm) {
- const el = vnode.elm
-
- // call enter callback now
- if (el._enterCb) {
- el._enterCb.cancelled = true
- el._enterCb()
- }
-
- const data = resolveTransition(vnode.data.transition)
- if (!data) {
- return rm()
- }
-
- if (el._leaveCb) {
- return
- }
-
- const {
- leaveClass,
- leaveToClass,
- leaveActiveClass,
- beforeLeave,
- leave,
- afterLeave,
- leaveCancelled,
- delayLeave
- } = data
-
- const userWantsControl =
- leave &&
- // leave hook may be a bound method which exposes
- // the length of original fn as _length
- (leave._length || leave.length) > 1
-
- const stylesheet = vnode.context.$options.style || {}
- const startState = stylesheet[leaveClass]
- const endState = stylesheet[leaveToClass] || stylesheet[leaveActiveClass]
- const transitionProperties = (stylesheet['@TRANSITION'] && stylesheet['@TRANSITION'][leaveActiveClass]) || {}
-
- const cb = el._leaveCb = once(() => {
- if (el.parentNode && el.parentNode._pending) {
- el.parentNode._pending[vnode.key] = null
- }
- if (cb.cancelled) {
- leaveCancelled && leaveCancelled(el)
- } else {
- rm()
- afterLeave && afterLeave(el)
- }
- el._leaveCb = null
- })
-
- if (delayLeave) {
- delayLeave(performLeave)
- } else {
- performLeave()
- }
-
- function performLeave () {
- const animation = vnode.context.$requireWeexModule('animation')
- // the delayed leave may have already been cancelled
- if (cb.cancelled) {
- return
- }
- // record leaving element
- if (!vnode.data.show) {
- (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode
- }
- beforeLeave && beforeLeave(el)
-
- if (startState) {
- animation.transition(el.ref, {
- styles: startState
- }, next)
- } else {
- next()
- }
-
- function next () {
- animation.transition(el.ref, {
- styles: endState,
- duration: transitionProperties.duration || 0,
- delay: transitionProperties.delay || 0,
- timingFunction: transitionProperties.timingFunction || 'linear'
- }, userWantsControl ? noop : cb)
- }
-
- leave && leave(el, cb)
- if (!endState && !userWantsControl) {
- cb()
- }
- }
-}
-
-// determine the target animation style for an entering transition.
-function getEnterTargetState (el, stylesheet, startClass, endClass, activeClass, vm) {
- const targetState = {}
- const startState = stylesheet[startClass]
- const endState = stylesheet[endClass]
- const activeState = stylesheet[activeClass]
- // 1. fallback to element's default styling
- if (startState) {
- for (const key in startState) {
- targetState[key] = el.style[key]
- if (
- process.env.NODE_ENV !== 'production' &&
- targetState[key] == null &&
- (!activeState || activeState[key] == null) &&
- (!endState || endState[key] == null)
- ) {
- warn(
- `transition property "${key}" is declared in enter starting class (.${startClass}), ` +
- `but not declared anywhere in enter ending class (.${endClass}), ` +
- `enter active cass (.${activeClass}) or the element's default styling. ` +
- `Note in Weex, CSS properties need explicit values to be transitionable.`
- )
- }
- }
- }
- // 2. if state is mixed in active state, extract them while excluding
- // transition properties
- if (activeState) {
- for (const key in activeState) {
- if (key.indexOf('transition') !== 0) {
- targetState[key] = activeState[key]
- }
- }
- }
- // 3. explicit endState has highest priority
- if (endState) {
- extend(targetState, endState)
- }
- return targetState
-}
+++ /dev/null
-/* @flow */
-declare var document: WeexDocument;
-
-import TextNode from 'weex/runtime/text-node'
-
-export const namespaceMap = {}
-
-export function createElement (tagName: string): WeexElement {
- return document.createElement(tagName)
-}
-
-export function createElementNS (namespace: string, tagName: string): WeexElement {
- return document.createElement(namespace + ':' + tagName)
-}
-
-export function createTextNode (text: string) {
- return new TextNode(text)
-}
-
-export function createComment (text: string) {
- return document.createComment(text)
-}
-
-export function insertBefore (
- node: WeexElement,
- target: WeexElement,
- before: WeexElement
-) {
- if (target.nodeType === 3) {
- if (node.type === 'text') {
- node.setAttr('value', target.text)
- target.parentNode = node
- } else {
- const text = createElement('text')
- text.setAttr('value', target.text)
- node.insertBefore(text, before)
- }
- return
- }
- node.insertBefore(target, before)
-}
-
-export function removeChild (node: WeexElement, child: WeexElement) {
- if (child.nodeType === 3) {
- node.setAttr('value', '')
- return
- }
- node.removeChild(child)
-}
-
-export function appendChild (node: WeexElement, child: WeexElement) {
- if (child.nodeType === 3) {
- if (node.type === 'text') {
- node.setAttr('value', child.text)
- child.parentNode = node
- } else {
- const text = createElement('text')
- text.setAttr('value', child.text)
- node.appendChild(text)
- }
- return
- }
-
- node.appendChild(child)
-}
-
-export function parentNode (node: WeexElement): WeexElement | void {
- return node.parentNode
-}
-
-export function nextSibling (node: WeexElement): WeexElement | void {
- return node.nextSibling
-}
-
-export function tagName (node: WeexElement): string {
- return node.type
-}
-
-export function setTextContent (node: WeexElement, text: string) {
- if (node.parentNode) {
- node.parentNode.setAttr('value', text)
- }
-}
-
-export function setAttribute (node: WeexElement, key: string, val: any) {
- node.setAttr(key, val)
-}
-
-export function setStyleScope (node: WeexElement, scopeId: string) {
- node.setAttr('@styleScope', scopeId)
-}
+++ /dev/null
-/* @flow */
-
-import * as nodeOps from 'weex/runtime/node-ops'
-import { createPatchFunction } from 'core/vdom/patch'
-import baseModules from 'core/vdom/modules/index'
-import platformModules from 'weex/runtime/modules/index'
-
-// the directive module should be applied last, after all
-// built-in modules have been applied.
-const modules = platformModules.concat(baseModules)
-
-export const patch: Function = createPatchFunction({
- nodeOps,
- modules,
- LONG_LIST_THRESHOLD: 10
-})
+++ /dev/null
-/* @flow */
-
-import { warn } from 'core/util/debug'
-import { handleError } from 'core/util/error'
-import { RECYCLE_LIST_MARKER } from 'weex/util/index'
-import { createComponentInstanceForVnode } from 'core/vdom/create-component'
-import { resolveVirtualComponent } from './virtual-component'
-
-export function isRecyclableComponent (vnode: VNodeWithData): boolean {
- return vnode.data.attrs
- ? (RECYCLE_LIST_MARKER in vnode.data.attrs)
- : false
-}
-
-export function renderRecyclableComponentTemplate (vnode: MountedComponentVNode): VNode {
- // $flow-disable-line
- delete vnode.data.attrs[RECYCLE_LIST_MARKER]
- resolveVirtualComponent(vnode)
- const vm = createComponentInstanceForVnode(vnode)
- const render = (vm.$options: any)['@render']
- if (render) {
- try {
- return render.call(vm)
- } catch (err) {
- handleError(err, vm, `@render`)
- }
- } else {
- warn(
- `@render function not defined on component used in <recycle-list>. ` +
- `Make sure to declare \`recyclable="true"\` on the component's template.`,
- vm
- )
- }
-}
+++ /dev/null
-/* @flow */
-
-// https://github.com/Hanks10100/weex-native-directive/tree/master/component
-
-import { mergeOptions, isPlainObject, noop } from 'core/util/index'
-import Watcher from 'core/observer/watcher'
-import { initProxy } from 'core/instance/proxy'
-import { initState, getData } from 'core/instance/state'
-import { initRender } from 'core/instance/render'
-import { initEvents } from 'core/instance/events'
-import { initProvide, initInjections } from 'core/instance/inject'
-import { initLifecycle, callHook } from 'core/instance/lifecycle'
-import { initInternalComponent, resolveConstructorOptions } from 'core/instance/init'
-import { registerComponentHook, updateComponentData } from '../../util/index'
-
-let uid = 0
-
-// override Vue.prototype._init
-function initVirtualComponent (options: Object = {}) {
- const vm: Component = this
- const componentId = options.componentId
-
- // virtual component uid
- vm._uid = `virtual-component-${uid++}`
-
- // a flag to avoid this being observed
- vm._isVue = true
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options)
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- )
- }
-
- /* istanbul ignore else */
- if (process.env.NODE_ENV !== 'production') {
- initProxy(vm)
- } else {
- vm._renderProxy = vm
- }
-
- vm._self = vm
- initLifecycle(vm)
- initEvents(vm)
- initRender(vm)
- callHook(vm, 'beforeCreate')
- initInjections(vm) // resolve injections before data/props
- initState(vm)
- initProvide(vm) // resolve provide after data/props
- callHook(vm, 'created')
-
- // send initial data to native
- const data = vm.$options.data
- const params = typeof data === 'function'
- ? getData(data, vm)
- : data || {}
- if (isPlainObject(params)) {
- updateComponentData(componentId, params)
- }
-
- registerComponentHook(componentId, 'lifecycle', 'attach', () => {
- callHook(vm, 'beforeMount')
-
- const updateComponent = () => {
- vm._update(vm._vnode, false)
- }
- new Watcher(vm, updateComponent, noop, null, true)
-
- vm._isMounted = true
- callHook(vm, 'mounted')
- })
-
- registerComponentHook(componentId, 'lifecycle', 'detach', () => {
- vm.$destroy()
- })
-}
-
-// override Vue.prototype._update
-function updateVirtualComponent (vnode?: VNode) {
- const vm: Component = this
- const componentId = vm.$options.componentId
- if (vm._isMounted) {
- callHook(vm, 'beforeUpdate')
- }
- vm._vnode = vnode
- if (vm._isMounted && componentId) {
- // TODO: data should be filtered and without bindings
- const data = Object.assign({}, vm._data)
- updateComponentData(componentId, data, () => {
- callHook(vm, 'updated')
- })
- }
-}
-
-// listening on native callback
-export function resolveVirtualComponent (vnode: MountedComponentVNode): VNode {
- const BaseCtor = vnode.componentOptions.Ctor
- const VirtualComponent = BaseCtor.extend({})
- const cid = VirtualComponent.cid
- VirtualComponent.prototype._init = initVirtualComponent
- VirtualComponent.prototype._update = updateVirtualComponent
-
- vnode.componentOptions.Ctor = BaseCtor.extend({
- beforeCreate () {
- // const vm: Component = this
-
- // TODO: listen on all events and dispatch them to the
- // corresponding virtual components according to the componentId.
- // vm._virtualComponents = {}
- const createVirtualComponent = (componentId, propsData) => {
- // create virtual component
- // const subVm =
- new VirtualComponent({
- componentId,
- propsData
- })
- // if (vm._virtualComponents) {
- // vm._virtualComponents[componentId] = subVm
- // }
- }
-
- registerComponentHook(cid, 'lifecycle', 'create', createVirtualComponent)
- },
- beforeDestroy () {
- delete this._virtualComponents
- }
- })
-}
-
+++ /dev/null
-let latestNodeId = 1
-
-export default function TextNode (text) {
- this.instanceId = ''
- this.nodeId = latestNodeId++
- this.parentNode = null
- this.nodeType = 3
- this.text = text
-}
+++ /dev/null
-/* @flow */
-
-// These util functions are split into its own file because Rollup cannot drop
-// makeMap() due to potential side effects, so these variables end up
-// bloating the web builds.
-
-import { makeMap } from 'shared/util'
-
-export const isReservedTag = makeMap(
- 'template,script,style,element,content,slot,link,meta,svg,view,' +
- 'a,div,img,image,text,span,input,switch,textarea,spinner,select,' +
- 'slider,slider-neighbor,indicator,canvas,' +
- 'list,cell,header,loading,loading-indicator,refresh,scrollable,scroller,' +
- 'video,web,embed,tabbar,tabheader,datepicker,timepicker,marquee,countdown',
- true
-)
-
-// Elements that you can, intentionally, leave open (and which close themselves)
-// more flexible than web
-export const canBeLeftOpenTag = makeMap(
- 'web,spinner,switch,video,textarea,canvas,' +
- 'indicator,marquee,countdown',
- true
-)
-
-export const isRuntimeComponent = makeMap(
- 'richtext,transition,transition-group',
- true
-)
-
-export const isUnaryTag = makeMap(
- 'embed,img,image,input,link,meta',
- true
-)
-
-export function mustUseProp (tag: string, type: ?string, name: string): boolean {
- return false
-}
-
-export function getTagNamespace (tag?: string): string | void { }
-
-export function isUnknownElement (tag?: string): boolean {
- return false
-}
-
-export function query (el: string | Element, document: Object) {
- // document is injected by weex factory wrapper
- const placeholder = document.createComment('root')
- placeholder.hasAttribute = placeholder.removeAttribute = function () {} // hack for patch
- document.documentElement.appendChild(placeholder)
- return placeholder
-}
+++ /dev/null
-/* @flow */
-declare var document: WeexDocument;
-
-import { warn } from 'core/util/index'
-
-export const RECYCLE_LIST_MARKER = '@inRecycleList'
-
-// Register the component hook to weex native render engine.
-// The hook will be triggered by native, not javascript.
-export function registerComponentHook (
- componentId: string,
- type: string, // hook type, could be "lifecycle" or "instance"
- hook: string, // hook name
- fn: Function
-) {
- if (!document || !document.taskCenter) {
- warn(`Can't find available "document" or "taskCenter".`)
- return
- }
- if (typeof document.taskCenter.registerHook === 'function') {
- return document.taskCenter.registerHook(componentId, type, hook, fn)
- }
- warn(`Failed to register component hook "${type}@${hook}#${componentId}".`)
-}
-
-// Updates the state of the component to weex native render engine.
-export function updateComponentData (
- componentId: string,
- newData: Object | void,
- callback?: Function
-) {
- if (!document || !document.taskCenter) {
- warn(`Can't find available "document" or "taskCenter".`)
- return
- }
- if (typeof document.taskCenter.updateData === 'function') {
- return document.taskCenter.updateData(componentId, newData, callback)
- }
- warn(`Failed to update component data (${componentId}).`)
-}
+++ /dev/null
-/* @flow */
-
-// import { warn } from 'core/util/index'
-
-// this will be preserved during build
-// $flow-disable-line
-const acorn = require('acorn') // $flow-disable-line
-const walk = require('acorn/dist/walk') // $flow-disable-line
-const escodegen = require('escodegen')
-
-export function nodeToBinding (node: Object): any {
- switch (node.type) {
- case 'Literal': return node.value
- case 'Identifier':
- case 'UnaryExpression':
- case 'BinaryExpression':
- case 'LogicalExpression':
- case 'ConditionalExpression':
- case 'MemberExpression': return { '@binding': escodegen.generate(node) }
- case 'ArrayExpression': return node.elements.map(_ => nodeToBinding(_))
- case 'ObjectExpression': {
- const object = {}
- node.properties.forEach(prop => {
- if (!prop.key || prop.key.type !== 'Identifier') {
- return
- }
- const key = escodegen.generate(prop.key)
- const value = nodeToBinding(prop.value)
- if (key && value) {
- object[key] = value
- }
- })
- return object
- }
- default: {
- // warn(`Not support ${node.type}: "${escodegen.generate(node)}"`)
- return ''
- }
- }
-}
-
-export function generateBinding (exp: ?string): any {
- if (exp && typeof exp === 'string') {
- let ast = null
- try {
- ast = acorn.parse(`(${exp})`)
- } catch (e) {
- // warn(`Failed to parse the expression: "${exp}"`)
- return ''
- }
-
- let output = ''
- walk.simple(ast, {
- Expression (node) {
- output = nodeToBinding(node)
- }
- })
- return output
- }
-}
+++ /dev/null
-/* @flow */
-
-import { createPromiseCallback } from '../util'
-import { createBundleRunner } from './create-bundle-runner'
-import type { Renderer, RenderOptions } from '../create-renderer'
-import { createSourceMapConsumers, rewriteErrorTrace } from './source-map-support'
-
-const fs = require('fs')
-const path = require('path')
-const PassThrough = require('stream').PassThrough
-
-const INVALID_MSG =
- 'Invalid server-rendering bundle format. Should be a string ' +
- 'or a bundle Object of type:\n\n' +
-`{
- entry: string;
- files: { [filename: string]: string; };
- maps: { [filename: string]: string; };
-}\n`
-
-// The render bundle can either be a string (single bundled file)
-// or a bundle manifest object generated by vue-ssr-webpack-plugin.
-type RenderBundle = {
- basedir?: string;
- entry: string;
- files: { [filename: string]: string; };
- maps: { [filename: string]: string; };
- modules?: { [filename: string]: Array<string> };
-};
-
-export function createBundleRendererCreator (
- createRenderer: (options?: RenderOptions) => Renderer
-) {
- return function createBundleRenderer (
- bundle: string | RenderBundle,
- rendererOptions?: RenderOptions = {}
- ) {
- let files, entry, maps
- let basedir = rendererOptions.basedir
-
- // load bundle if given filepath
- if (
- typeof bundle === 'string' &&
- /\.js(on)?$/.test(bundle) &&
- path.isAbsolute(bundle)
- ) {
- if (fs.existsSync(bundle)) {
- const isJSON = /\.json$/.test(bundle)
- basedir = basedir || path.dirname(bundle)
- bundle = fs.readFileSync(bundle, 'utf-8')
- if (isJSON) {
- try {
- bundle = JSON.parse(bundle)
- } catch (e) {
- throw new Error(`Invalid JSON bundle file: ${bundle}`)
- }
- }
- } else {
- throw new Error(`Cannot locate bundle file: ${bundle}`)
- }
- }
-
- if (typeof bundle === 'object') {
- entry = bundle.entry
- files = bundle.files
- basedir = basedir || bundle.basedir
- maps = createSourceMapConsumers(bundle.maps)
- if (typeof entry !== 'string' || typeof files !== 'object') {
- throw new Error(INVALID_MSG)
- }
- } else if (typeof bundle === 'string') {
- entry = '__vue_ssr_bundle__'
- files = { '__vue_ssr_bundle__': bundle }
- maps = {}
- } else {
- throw new Error(INVALID_MSG)
- }
-
- const renderer = createRenderer(rendererOptions)
-
- const run = createBundleRunner(
- entry,
- files,
- basedir,
- rendererOptions.runInNewContext
- )
-
- return {
- renderToString: (context?: Object, cb: any) => {
- if (typeof context === 'function') {
- cb = context
- context = {}
- }
-
- let promise
- if (!cb) {
- ({ promise, cb } = createPromiseCallback())
- }
-
- run(context).catch(err => {
- rewriteErrorTrace(err, maps)
- cb(err)
- }).then(app => {
- if (app) {
- renderer.renderToString(app, context, (err, res) => {
- rewriteErrorTrace(err, maps)
- cb(err, res)
- })
- }
- })
-
- return promise
- },
-
- renderToStream: (context?: Object) => {
- const res = new PassThrough()
- run(context).catch(err => {
- rewriteErrorTrace(err, maps)
- // avoid emitting synchronously before user can
- // attach error listener
- process.nextTick(() => {
- res.emit('error', err)
- })
- }).then(app => {
- if (app) {
- const renderStream = renderer.renderToStream(app, context)
-
- renderStream.on('error', err => {
- rewriteErrorTrace(err, maps)
- res.emit('error', err)
- })
-
- // relay HTMLStream special events
- if (rendererOptions && rendererOptions.template) {
- renderStream.on('beforeStart', () => {
- res.emit('beforeStart')
- })
- renderStream.on('beforeEnd', () => {
- res.emit('beforeEnd')
- })
- }
-
- renderStream.pipe(res)
- }
- })
-
- return res
- }
- }
- }
-}
+++ /dev/null
-import { isPlainObject } from 'shared/util'
-
-const vm = require('vm')
-const path = require('path')
-const resolve = require('resolve')
-const NativeModule = require('module')
-
-function createSandbox (context) {
- const sandbox = {
- Buffer,
- console,
- process,
- setTimeout,
- setInterval,
- setImmediate,
- clearTimeout,
- clearInterval,
- clearImmediate,
- __VUE_SSR_CONTEXT__: context
- }
- sandbox.global = sandbox
- return sandbox
-}
-
-function compileModule (files, basedir, runInNewContext) {
- const compiledScripts = {}
- const resolvedModules = {}
-
- function getCompiledScript (filename) {
- if (compiledScripts[filename]) {
- return compiledScripts[filename]
- }
- const code = files[filename]
- const wrapper = NativeModule.wrap(code)
- const script = new vm.Script(wrapper, {
- filename,
- displayErrors: true
- })
- compiledScripts[filename] = script
- return script
- }
-
- function evaluateModule (filename, sandbox, evaluatedFiles = {}) {
- if (evaluatedFiles[filename]) {
- return evaluatedFiles[filename]
- }
-
- const script = getCompiledScript(filename)
- const compiledWrapper = runInNewContext === false
- ? script.runInThisContext()
- : script.runInNewContext(sandbox)
- const m = { exports: {}}
- const r = file => {
- file = path.posix.join('.', file)
- if (files[file]) {
- return evaluateModule(file, sandbox, evaluatedFiles)
- } else if (basedir) {
- return require(
- resolvedModules[file] ||
- (resolvedModules[file] = resolve.sync(file, { basedir }))
- )
- } else {
- return require(file)
- }
- }
- compiledWrapper.call(m.exports, m.exports, r, m)
-
- const res = Object.prototype.hasOwnProperty.call(m.exports, 'default')
- ? m.exports.default
- : m.exports
- evaluatedFiles[filename] = res
- return res
- }
- return evaluateModule
-}
-
-function deepClone (val) {
- if (isPlainObject(val)) {
- const res = {}
- for (const key in val) {
- res[key] = deepClone(val[key])
- }
- return res
- } else if (Array.isArray(val)) {
- return val.slice()
- } else {
- return val
- }
-}
-
-export function createBundleRunner (entry, files, basedir, runInNewContext) {
- const evaluate = compileModule(files, basedir, runInNewContext)
- if (runInNewContext !== false && runInNewContext !== 'once') {
- // new context mode: creates a fresh context and re-evaluate the bundle
- // on each render. Ensures entire application state is fresh for each
- // render, but incurs extra evaluation cost.
- return (userContext = {}) => new Promise(resolve => {
- userContext._registeredComponents = new Set()
- const res = evaluate(entry, createSandbox(userContext))
- resolve(typeof res === 'function' ? res(userContext) : res)
- })
- } else {
- // direct mode: instead of re-evaluating the whole bundle on
- // each render, it simply calls the exported function. This avoids the
- // module evaluation costs but requires the source code to be structured
- // slightly differently.
- let runner // lazy creation so that errors can be caught by user
- let initialContext
- return (userContext = {}) => new Promise(resolve => {
- if (!runner) {
- const sandbox = runInNewContext === 'once'
- ? createSandbox()
- : global
- // the initial context is only used for collecting possible non-component
- // styles injected by vue-style-loader.
- initialContext = sandbox.__VUE_SSR_CONTEXT__ = {}
- runner = evaluate(entry, sandbox)
- // On subsequent renders, __VUE_SSR_CONTEXT__ will not be available
- // to prevent cross-request pollution.
- delete sandbox.__VUE_SSR_CONTEXT__
- if (typeof runner !== 'function') {
- throw new Error(
- 'bundle export should be a function when using ' +
- '{ runInNewContext: false }.'
- )
- }
- }
- userContext._registeredComponents = new Set()
-
- // vue-style-loader styles imported outside of component lifecycle hooks
- if (initialContext._styles) {
- userContext._styles = deepClone(initialContext._styles)
- // #6353 ensure "styles" is exposed even if no styles are injected
- // in component lifecycles.
- // the renderStyles fn is exposed by vue-style-loader >= 3.0.3
- const renderStyles = initialContext._renderStyles
- if (renderStyles) {
- Object.defineProperty(userContext, 'styles', {
- enumerable: true,
- get () {
- return renderStyles(userContext._styles)
- }
- })
- }
- }
-
- resolve(runner(userContext))
- })
- }
-}
+++ /dev/null
-/* @flow */
-
-const SourceMapConsumer = require('source-map').SourceMapConsumer
-
-const filenameRE = /\(([^)]+\.js):(\d+):(\d+)\)$/
-
-export function createSourceMapConsumers (rawMaps: Object) {
- const maps = {}
- Object.keys(rawMaps).forEach(file => {
- maps[file] = new SourceMapConsumer(rawMaps[file])
- })
- return maps
-}
-
-export function rewriteErrorTrace (e: any, mapConsumers: {
- [key: string]: SourceMapConsumer
-}) {
- if (e && typeof e.stack === 'string') {
- e.stack = e.stack.split('\n').map(line => {
- return rewriteTraceLine(line, mapConsumers)
- }).join('\n')
- }
-}
-
-function rewriteTraceLine (trace: string, mapConsumers: {
- [key: string]: SourceMapConsumer
-}) {
- const m = trace.match(filenameRE)
- const map = m && mapConsumers[m[1]]
- if (m != null && map) {
- const originalPosition = map.originalPositionFor({
- line: Number(m[2]),
- column: Number(m[3])
- })
- if (originalPosition.source != null) {
- const { source, line, column } = originalPosition
- const mappedPosition = `(${source.replace(/^webpack:\/\/\//, '')}:${String(line)}:${String(column)})`
- return trace.replace(filenameRE, mappedPosition)
- } else {
- return trace
- }
- } else {
- return trace
- }
-}
+++ /dev/null
-/* @flow */
-
-import { createWriteFunction } from './write'
-import { createRenderFunction } from './render'
-import type { RenderOptions } from './create-renderer'
-
-export function createBasicRenderer ({
- modules = [],
- directives = {},
- isUnaryTag = (() => false),
- cache
-}: RenderOptions = {}) {
- const render = createRenderFunction(modules, directives, isUnaryTag, cache)
-
- return function renderToString (
- component: Component,
- context: any,
- done: any
- ): void {
- if (typeof context === 'function') {
- done = context
- context = {}
- }
- let result = ''
- const write = createWriteFunction(text => {
- result += text
- return false
- }, done)
- try {
- render(component, write, context, () => {
- done(null, result)
- })
- } catch (e) {
- done(e)
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import RenderStream from './render-stream'
-import { createWriteFunction } from './write'
-import { createRenderFunction } from './render'
-import { createPromiseCallback } from './util'
-import TemplateRenderer from './template-renderer/index'
-import type { ClientManifest } from './template-renderer/index'
-
-export type Renderer = {
- renderToString: (component: Component, context: any, cb: any) => ?Promise<string>;
- renderToStream: (component: Component, context?: Object) => stream$Readable;
-};
-
-type RenderCache = {
- get: (key: string, cb?: Function) => string | void;
- set: (key: string, val: string) => void;
- has?: (key: string, cb?: Function) => boolean | void;
-};
-
-export type RenderOptions = {
- modules?: Array<(vnode: VNode) => ?string>;
- directives?: Object;
- isUnaryTag?: Function;
- cache?: RenderCache;
- template?: string;
- inject?: boolean;
- basedir?: string;
- shouldPreload?: Function;
- shouldPrefetch?: Function;
- clientManifest?: ClientManifest;
- runInNewContext?: boolean | 'once';
-};
-
-export function createRenderer ({
- modules = [],
- directives = {},
- isUnaryTag = (() => false),
- template,
- inject,
- cache,
- shouldPreload,
- shouldPrefetch,
- clientManifest
-}: RenderOptions = {}): Renderer {
- const render = createRenderFunction(modules, directives, isUnaryTag, cache)
- const templateRenderer = new TemplateRenderer({
- template,
- inject,
- shouldPreload,
- shouldPrefetch,
- clientManifest
- })
-
- return {
- renderToString (
- component: Component,
- context: any,
- cb: any
- ): ?Promise<string> {
- if (typeof context === 'function') {
- cb = context
- context = {}
- }
- if (context) {
- templateRenderer.bindRenderFns(context)
- }
-
- // no callback, return Promise
- let promise
- if (!cb) {
- ({ promise, cb } = createPromiseCallback())
- }
-
- let result = ''
- const write = createWriteFunction(text => {
- result += text
- return false
- }, cb)
- try {
- render(component, write, context, err => {
- if (template) {
- result = templateRenderer.renderSync(result, context)
- }
- if (err) {
- cb(err)
- } else {
- cb(null, result)
- }
- })
- } catch (e) {
- cb(e)
- }
-
- return promise
- },
-
- renderToStream (
- component: Component,
- context?: Object
- ): stream$Readable {
- if (context) {
- templateRenderer.bindRenderFns(context)
- }
- const renderStream = new RenderStream((write, done) => {
- render(component, write, context, done)
- })
- if (!template) {
- return renderStream
- } else {
- const templateStream = templateRenderer.createStream(context)
- renderStream.on('error', err => {
- templateStream.emit('error', err)
- })
- renderStream.pipe(templateStream)
- return templateStream
- }
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-// The SSR codegen is essentially extending the default codegen to handle
-// SSR-optimizable nodes and turn them into string render fns. In cases where
-// a node is not optimizable it simply falls back to the default codegen.
-
-import {
- genIf,
- genFor,
- genData,
- genText,
- genElement,
- genChildren,
- CodegenState
-} from 'compiler/codegen/index'
-
-import {
- genAttrSegments,
- genDOMPropSegments,
- genClassSegments,
- genStyleSegments,
- applyModelTransform
-} from './modules'
-
-import { escape } from 'web/server/util'
-import { optimizability } from './optimizer'
-import type { CodegenResult } from 'compiler/codegen/index'
-
-export type StringSegment = {
- type: number;
- value: string;
-};
-
-// segment types
-export const RAW = 0
-export const INTERPOLATION = 1
-export const EXPRESSION = 2
-
-export function generate (
- ast: ASTElement | void,
- options: CompilerOptions
-): CodegenResult {
- const state = new CodegenState(options)
- const code = ast ? genSSRElement(ast, state) : '_c("div")'
- return {
- render: `with(this){return ${code}}`,
- staticRenderFns: state.staticRenderFns
- }
-}
-
-function genSSRElement (el: ASTElement, state: CodegenState): string {
- if (el.for && !el.forProcessed) {
- return genFor(el, state, genSSRElement)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state, genSSRElement)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return el.ssrOptimizability === optimizability.FULL
- ? genChildrenAsStringNode(el, state)
- : genSSRChildren(el, state) || 'void 0'
- }
-
- switch (el.ssrOptimizability) {
- case optimizability.FULL:
- // stringify whole tree
- return genStringElement(el, state)
- case optimizability.SELF:
- // stringify self and check children
- return genStringElementWithChildren(el, state)
- case optimizability.CHILDREN:
- // generate self as VNode and stringify children
- return genNormalElement(el, state, true)
- case optimizability.PARTIAL:
- // generate self as VNode and check children
- return genNormalElement(el, state, false)
- default:
- // bail whole tree
- return genElement(el, state)
- }
-}
-
-function genNormalElement (el, state, stringifyChildren) {
- const data = el.plain ? undefined : genData(el, state)
- const children = stringifyChildren
- ? `[${genChildrenAsStringNode(el, state)}]`
- : genSSRChildren(el, state, true)
- return `_c('${el.tag}'${
- data ? `,${data}` : ''
- }${
- children ? `,${children}` : ''
- })`
-}
-
-function genSSRChildren (el, state, checkSkip) {
- return genChildren(el, state, checkSkip, genSSRElement, genSSRNode)
-}
-
-function genSSRNode (el, state) {
- return el.type === 1
- ? genSSRElement(el, state)
- : genText(el)
-}
-
-function genChildrenAsStringNode (el, state) {
- return el.children.length
- ? `_ssrNode(${flattenSegments(childrenToSegments(el, state))})`
- : ''
-}
-
-function genStringElement (el, state) {
- return `_ssrNode(${elementToString(el, state)})`
-}
-
-function genStringElementWithChildren (el, state) {
- const children = genSSRChildren(el, state, true)
- return `_ssrNode(${
- flattenSegments(elementToOpenTagSegments(el, state))
- },"</${el.tag}>"${
- children ? `,${children}` : ''
- })`
-}
-
-function elementToString (el, state) {
- return `(${flattenSegments(elementToSegments(el, state))})`
-}
-
-function elementToSegments (el, state): Array<StringSegment> {
- // v-for / v-if
- if (el.for && !el.forProcessed) {
- el.forProcessed = true
- return [{
- type: EXPRESSION,
- value: genFor(el, state, elementToString, '_ssrList')
- }]
- } else if (el.if && !el.ifProcessed) {
- el.ifProcessed = true
- return [{
- type: EXPRESSION,
- value: genIf(el, state, elementToString, '"<!---->"')
- }]
- } else if (el.tag === 'template') {
- return childrenToSegments(el, state)
- }
-
- const openSegments = elementToOpenTagSegments(el, state)
- const childrenSegments = childrenToSegments(el, state)
- const { isUnaryTag } = state.options
- const close = (isUnaryTag && isUnaryTag(el.tag))
- ? []
- : [{ type: RAW, value: `</${el.tag}>` }]
- return openSegments.concat(childrenSegments, close)
-}
-
-function elementToOpenTagSegments (el, state): Array<StringSegment> {
- applyModelTransform(el, state)
- let binding
- const segments = [{ type: RAW, value: `<${el.tag}` }]
- // attrs
- if (el.attrs) {
- segments.push.apply(segments, genAttrSegments(el.attrs))
- }
- // domProps
- if (el.props) {
- segments.push.apply(segments, genDOMPropSegments(el.props, el.attrs))
- }
- // v-bind="object"
- if ((binding = el.attrsMap['v-bind'])) {
- segments.push({ type: EXPRESSION, value: `_ssrAttrs(${binding})` })
- }
- // v-bind.prop="object"
- if ((binding = el.attrsMap['v-bind.prop'])) {
- segments.push({ type: EXPRESSION, value: `_ssrDOMProps(${binding})` })
- }
- // class
- if (el.staticClass || el.classBinding) {
- segments.push.apply(
- segments,
- genClassSegments(el.staticClass, el.classBinding)
- )
- }
- // style & v-show
- if (el.staticStyle || el.styleBinding || el.attrsMap['v-show']) {
- segments.push.apply(
- segments,
- genStyleSegments(
- el.attrsMap.style,
- el.staticStyle,
- el.styleBinding,
- el.attrsMap['v-show']
- )
- )
- }
- // _scopedId
- if (state.options.scopeId) {
- segments.push({ type: RAW, value: ` ${state.options.scopeId}` })
- }
- segments.push({ type: RAW, value: `>` })
- return segments
-}
-
-function childrenToSegments (el, state): Array<StringSegment> {
- let binding
- if ((binding = el.attrsMap['v-html'])) {
- return [{ type: EXPRESSION, value: `_s(${binding})` }]
- }
- if ((binding = el.attrsMap['v-text'])) {
- return [{ type: INTERPOLATION, value: `_s(${binding})` }]
- }
- if (el.tag === 'textarea' && (binding = el.attrsMap['v-model'])) {
- return [{ type: INTERPOLATION, value: `_s(${binding})` }]
- }
- return el.children
- ? nodesToSegments(el.children, state)
- : []
-}
-
-function nodesToSegments (
- children: Array<ASTNode>,
- state: CodegenState
-): Array<StringSegment> {
- const segments = []
- for (let i = 0; i < children.length; i++) {
- const c = children[i]
- if (c.type === 1) {
- segments.push.apply(segments, elementToSegments(c, state))
- } else if (c.type === 2) {
- segments.push({ type: INTERPOLATION, value: c.expression })
- } else if (c.type === 3) {
- segments.push({ type: RAW, value: escape(c.text) })
- }
- }
- return segments
-}
-
-function flattenSegments (segments: Array<StringSegment>): string {
- const mergedSegments = []
- let textBuffer = ''
-
- const pushBuffer = () => {
- if (textBuffer) {
- mergedSegments.push(JSON.stringify(textBuffer))
- textBuffer = ''
- }
- }
-
- for (let i = 0; i < segments.length; i++) {
- const s = segments[i]
- if (s.type === RAW) {
- textBuffer += s.value
- } else if (s.type === INTERPOLATION) {
- pushBuffer()
- mergedSegments.push(`_ssrEscape(${s.value})`)
- } else if (s.type === EXPRESSION) {
- pushBuffer()
- mergedSegments.push(`(${s.value})`)
- }
- }
- pushBuffer()
-
- return mergedSegments.join('+')
-}
+++ /dev/null
-/* @flow */
-
-import { parse } from 'compiler/parser/index'
-import { generate } from './codegen'
-import { optimize } from './optimizer'
-import { createCompilerCreator } from 'compiler/create-compiler'
-
-export const createCompiler = createCompilerCreator(function baseCompile (
- template: string,
- options: CompilerOptions
-): CompiledResult {
- const ast = parse(template.trim(), options)
- optimize(ast, options)
- const code = generate(ast, options)
- return {
- ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
-})
+++ /dev/null
-/* @flow */
-
-import {
- RAW,
- // INTERPOLATION,
- EXPRESSION
-} from './codegen'
-
-import {
- propsToAttrMap,
- isRenderableAttr
-} from 'web/server/util'
-
-import {
- isBooleanAttr,
- isEnumeratedAttr
-} from 'web/util/attrs'
-
-import type { StringSegment } from './codegen'
-import type { CodegenState } from 'compiler/codegen/index'
-
-type Attr = { name: string; value: string };
-
-const plainStringRE = /^"(?:[^"\\]|\\.)*"$|^'(?:[^'\\]|\\.)*'$/
-
-// let the model AST transform translate v-model into appropriate
-// props bindings
-export function applyModelTransform (el: ASTElement, state: CodegenState) {
- if (el.directives) {
- for (let i = 0; i < el.directives.length; i++) {
- const dir = el.directives[i]
- if (dir.name === 'model') {
- state.directives.model(el, dir, state.warn)
- // remove value for textarea as its converted to text
- if (el.tag === 'textarea' && el.props) {
- el.props = el.props.filter(p => p.name !== 'value')
- }
- break
- }
- }
- }
-}
-
-export function genAttrSegments (
- attrs: Array<Attr>
-): Array<StringSegment> {
- return attrs.map(({ name, value }) => genAttrSegment(name, value))
-}
-
-export function genDOMPropSegments (
- props: Array<Attr>,
- attrs: ?Array<Attr>
-): Array<StringSegment> {
- const segments = []
- props.forEach(({ name, value }) => {
- name = propsToAttrMap[name] || name.toLowerCase()
- if (isRenderableAttr(name) &&
- !(attrs && attrs.some(a => a.name === name))
- ) {
- segments.push(genAttrSegment(name, value))
- }
- })
- return segments
-}
-
-function genAttrSegment (name: string, value: string): StringSegment {
- if (plainStringRE.test(value)) {
- // force double quote
- value = value.replace(/^'|'$/g, '"')
- // force enumerated attr to "true"
- if (isEnumeratedAttr(name) && value !== `"false"`) {
- value = `"true"`
- }
- return {
- type: RAW,
- value: isBooleanAttr(name)
- ? ` ${name}="${name}"`
- : value === '""'
- ? ` ${name}`
- : ` ${name}="${JSON.parse(value)}"`
- }
- } else {
- return {
- type: EXPRESSION,
- value: `_ssrAttr(${JSON.stringify(name)},${value})`
- }
- }
-}
-
-export function genClassSegments (
- staticClass: ?string,
- classBinding: ?string
-): Array<StringSegment> {
- if (staticClass && !classBinding) {
- return [{ type: RAW, value: ` class=${staticClass}` }]
- } else {
- return [{
- type: EXPRESSION,
- value: `_ssrClass(${staticClass || 'null'},${classBinding || 'null'})`
- }]
- }
-}
-
-export function genStyleSegments (
- staticStyle: ?string,
- parsedStaticStyle: ?string,
- styleBinding: ?string,
- vShowExpression: ?string
-): Array<StringSegment> {
- if (staticStyle && !styleBinding && !vShowExpression) {
- return [{ type: RAW, value: ` style=${JSON.stringify(staticStyle)}` }]
- } else {
- return [{
- type: EXPRESSION,
- value: `_ssrStyle(${
- parsedStaticStyle || 'null'
- },${
- styleBinding || 'null'
- }, ${
- vShowExpression
- ? `{ display: (${vShowExpression}) ? '' : 'none' }`
- : 'null'
- })`
- }]
- }
-}
+++ /dev/null
-/* @flow */
-
-/**
- * In SSR, the vdom tree is generated only once and never patched, so
- * we can optimize most element / trees into plain string render functions.
- * The SSR optimizer walks the AST tree to detect optimizable elements and trees.
- *
- * The criteria for SSR optimizability is quite a bit looser than static tree
- * detection (which is designed for client re-render). In SSR we bail only for
- * components/slots/custom directives.
- */
-
-import { no, makeMap, isBuiltInTag } from 'shared/util'
-
-// optimizability constants
-export const optimizability = {
- FALSE: 0, // whole sub tree un-optimizable
- FULL: 1, // whole sub tree optimizable
- SELF: 2, // self optimizable but has some un-optimizable children
- CHILDREN: 3, // self un-optimizable but have fully optimizable children
- PARTIAL: 4 // self un-optimizable with some un-optimizable children
-}
-
-let isPlatformReservedTag
-
-export function optimize (root: ?ASTElement, options: CompilerOptions) {
- if (!root) return
- isPlatformReservedTag = options.isReservedTag || no
- walk(root, true)
-}
-
-function walk (node: ASTNode, isRoot?: boolean) {
- if (isUnOptimizableTree(node)) {
- node.ssrOptimizability = optimizability.FALSE
- return
- }
- // root node or nodes with custom directives should always be a VNode
- const selfUnoptimizable = isRoot || hasCustomDirective(node)
- const check = child => {
- if (child.ssrOptimizability !== optimizability.FULL) {
- node.ssrOptimizability = selfUnoptimizable
- ? optimizability.PARTIAL
- : optimizability.SELF
- }
- }
- if (selfUnoptimizable) {
- node.ssrOptimizability = optimizability.CHILDREN
- }
- if (node.type === 1) {
- for (let i = 0, l = node.children.length; i < l; i++) {
- const child = node.children[i]
- walk(child)
- check(child)
- }
- if (node.ifConditions) {
- for (let i = 1, l = node.ifConditions.length; i < l; i++) {
- const block = node.ifConditions[i].block
- walk(block, isRoot)
- check(block)
- }
- }
- if (node.ssrOptimizability == null ||
- (!isRoot && (node.attrsMap['v-html'] || node.attrsMap['v-text']))
- ) {
- node.ssrOptimizability = optimizability.FULL
- } else {
- node.children = optimizeSiblings(node)
- }
- } else {
- node.ssrOptimizability = optimizability.FULL
- }
-}
-
-function optimizeSiblings (el) {
- const children = el.children
- const optimizedChildren = []
-
- let currentOptimizableGroup = []
- const pushGroup = () => {
- if (currentOptimizableGroup.length) {
- optimizedChildren.push({
- type: 1,
- parent: el,
- tag: 'template',
- attrsList: [],
- attrsMap: {},
- children: currentOptimizableGroup,
- ssrOptimizability: optimizability.FULL
- })
- }
- currentOptimizableGroup = []
- }
-
- for (let i = 0; i < children.length; i++) {
- const c = children[i]
- if (c.ssrOptimizability === optimizability.FULL) {
- currentOptimizableGroup.push(c)
- } else {
- // wrap fully-optimizable adjacent siblings inside a template tag
- // so that they can be optimized into a single ssrNode by codegen
- pushGroup()
- optimizedChildren.push(c)
- }
- }
- pushGroup()
- return optimizedChildren
-}
-
-function isUnOptimizableTree (node: ASTNode): boolean {
- if (node.type === 2 || node.type === 3) { // text or expression
- return false
- }
- return (
- isBuiltInTag(node.tag) || // built-in (slot, component)
- !isPlatformReservedTag(node.tag) || // custom component
- !!node.component || // "is" component
- isSelectWithModel(node) // <select v-model> requires runtime inspection
- )
-}
-
-const isBuiltInDir = makeMap('text,html,show,on,bind,model,pre,cloak,once')
-
-function hasCustomDirective (node: ASTNode): ?boolean {
- return (
- node.type === 1 &&
- node.directives &&
- node.directives.some(d => !isBuiltInDir(d.name))
- )
-}
-
-// <select v-model> cannot be optimized because it requires a runtime check
-// to determine proper selected option
-function isSelectWithModel (node: ASTNode): boolean {
- return (
- node.type === 1 &&
- node.tag === 'select' &&
- node.directives != null &&
- node.directives.some(d => d.name === 'model')
- )
-}
+++ /dev/null
-/* @flow */
-
-import { escape } from 'web/server/util'
-import { isObject, extend } from 'shared/util'
-import { renderAttr } from 'web/server/modules/attrs'
-import { renderClass } from 'web/util/class'
-import { genStyle } from 'web/server/modules/style'
-import { normalizeStyleBinding } from 'web/util/style'
-
-import {
- normalizeChildren,
- simpleNormalizeChildren
-} from 'core/vdom/helpers/normalize-children'
-
-import {
- propsToAttrMap,
- isRenderableAttr
-} from 'web/server/util'
-
-const ssrHelpers = {
- _ssrEscape: escape,
- _ssrNode: renderStringNode,
- _ssrList: renderStringList,
- _ssrAttr: renderAttr,
- _ssrAttrs: renderAttrs,
- _ssrDOMProps: renderDOMProps,
- _ssrClass: renderSSRClass,
- _ssrStyle: renderSSRStyle
-}
-
-export function installSSRHelpers (vm: Component) {
- if (vm._ssrNode) {
- return
- }
- let Vue = vm.constructor
- while (Vue.super) {
- Vue = Vue.super
- }
- extend(Vue.prototype, ssrHelpers)
- if (Vue.FunctionalRenderContext) {
- extend(Vue.FunctionalRenderContext.prototype, ssrHelpers)
- }
-}
-
-class StringNode {
- isString: boolean;
- open: string;
- close: ?string;
- children: ?Array<any>;
-
- constructor (
- open: string,
- close?: string,
- children?: Array<any>,
- normalizationType?: number
- ) {
- this.isString = true
- this.open = open
- this.close = close
- if (children) {
- this.children = normalizationType === 1
- ? simpleNormalizeChildren(children)
- : normalizationType === 2
- ? normalizeChildren(children)
- : children
- } else {
- this.children = void 0
- }
- }
-}
-
-function renderStringNode (
- open: string,
- close?: string,
- children?: Array<any>,
- normalizationType?: number
-): StringNode {
- return new StringNode(open, close, children, normalizationType)
-}
-
-function renderStringList (
- val: any,
- render: (
- val: any,
- keyOrIndex: string | number,
- index?: number
- ) => string
-): string {
- let ret = ''
- let i, l, keys, key
- if (Array.isArray(val) || typeof val === 'string') {
- for (i = 0, l = val.length; i < l; i++) {
- ret += render(val[i], i)
- }
- } else if (typeof val === 'number') {
- for (i = 0; i < val; i++) {
- ret += render(i + 1, i)
- }
- } else if (isObject(val)) {
- keys = Object.keys(val)
- for (i = 0, l = keys.length; i < l; i++) {
- key = keys[i]
- ret += render(val[key], key, i)
- }
- }
- return ret
-}
-
-function renderAttrs (obj: Object): string {
- let res = ''
- for (const key in obj) {
- res += renderAttr(key, obj[key])
- }
- return res
-}
-
-function renderDOMProps (obj: Object): string {
- let res = ''
- for (const key in obj) {
- const attr = propsToAttrMap[key] || key.toLowerCase()
- if (isRenderableAttr(attr)) {
- res += renderAttr(attr, obj[key])
- }
- }
- return res
-}
-
-function renderSSRClass (
- staticClass: ?string,
- dynamic: any
-): string {
- const res = renderClass(staticClass, dynamic)
- return res === '' ? res : ` class="${escape(res)}"`
-}
-
-function renderSSRStyle (
- staticStyle: ?Object,
- dynamic: any,
- extra: ?Object
-): string {
- const style = {}
- if (staticStyle) extend(style, staticStyle)
- if (dynamic) extend(style, normalizeStyleBinding(dynamic))
- if (extra) extend(style, extra)
- const res = genStyle(style)
- return res === '' ? res : ` style=${JSON.stringify(escape(res))}`
-}
+++ /dev/null
-/* @flow */
-
-import { isUndef } from 'shared/util'
-
-type RenderState = {
- type: 'Element';
- rendered: number;
- total: number;
- children: Array<VNode>;
- endTag: string;
-} | {
- type: 'Fragment';
- rendered: number;
- total: number;
- children: Array<VNode>;
-} | {
- type: 'Component';
- prevActive: Component;
-} | {
- type: 'ComponentWithCache';
- buffer: Array<string>;
- bufferIndex: number;
- componentBuffer: Array<Set<Class<Component>>>;
- key: string;
-};
-
-export class RenderContext {
- userContext: ?Object;
- activeInstance: Component;
- renderStates: Array<RenderState>;
- write: (text: string, next: Function) => void;
- renderNode: (node: VNode, isRoot: boolean, context: RenderContext) => void;
- next: () => void;
- done: (err: ?Error) => void;
-
- modules: Array<(node: VNode) => ?string>;
- directives: Object;
- isUnaryTag: (tag: string) => boolean;
-
- cache: any;
- get: ?(key: string, cb: Function) => void;
- has: ?(key: string, cb: Function) => void;
-
- constructor (options: Object) {
- this.userContext = options.userContext
- this.activeInstance = options.activeInstance
- this.renderStates = []
-
- this.write = options.write
- this.done = options.done
- this.renderNode = options.renderNode
-
- this.isUnaryTag = options.isUnaryTag
- this.modules = options.modules
- this.directives = options.directives
-
- const cache = options.cache
- if (cache && (!cache.get || !cache.set)) {
- throw new Error('renderer cache must implement at least get & set.')
- }
- this.cache = cache
- this.get = cache && normalizeAsync(cache, 'get')
- this.has = cache && normalizeAsync(cache, 'has')
-
- this.next = this.next.bind(this)
- }
-
- next () {
- const lastState = this.renderStates[this.renderStates.length - 1]
- if (isUndef(lastState)) {
- return this.done()
- }
- switch (lastState.type) {
- case 'Element':
- case 'Fragment':
- const { children, total } = lastState
- const rendered = lastState.rendered++
- if (rendered < total) {
- this.renderNode(children[rendered], false, this)
- } else {
- this.renderStates.pop()
- if (lastState.type === 'Element') {
- this.write(lastState.endTag, this.next)
- } else {
- this.next()
- }
- }
- break
- case 'Component':
- this.renderStates.pop()
- this.activeInstance = lastState.prevActive
- this.next()
- break
- case 'ComponentWithCache':
- this.renderStates.pop()
- const { buffer, bufferIndex, componentBuffer, key } = lastState
- const result = {
- html: buffer[bufferIndex],
- components: componentBuffer[bufferIndex]
- }
- this.cache.set(key, result)
- if (bufferIndex === 0) {
- // this is a top-level cached component,
- // exit caching mode.
- this.write.caching = false
- } else {
- // parent component is also being cached,
- // merge self into parent's result
- buffer[bufferIndex - 1] += result.html
- const prev = componentBuffer[bufferIndex - 1]
- result.components.forEach(c => prev.add(c))
- }
- buffer.length = bufferIndex
- componentBuffer.length = bufferIndex
- this.next()
- break
- }
- }
-}
-
-function normalizeAsync (cache, method) {
- const fn = cache[method]
- if (isUndef(fn)) {
- return
- } else if (fn.length > 1) {
- return (key, cb) => fn.call(cache, key, cb)
- } else {
- return (key, cb) => cb(fn.call(cache, key))
- }
-}
+++ /dev/null
-/* @flow */
-
-/**
- * Original RenderStream implementation by Sasha Aickin (@aickin)
- * Licensed under the Apache License, Version 2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Modified by Evan You (@yyx990803)
- */
-
-const stream = require('stream')
-
-import { isTrue, isUndef } from 'shared/util'
-import { createWriteFunction } from './write'
-
-export default class RenderStream extends stream.Readable {
- buffer: string;
- render: (write: Function, done: Function) => void;
- expectedSize: number;
- write: Function;
- next: Function;
- end: Function;
- done: boolean;
-
- constructor (render: Function) {
- super()
- this.buffer = ''
- this.render = render
- this.expectedSize = 0
-
- this.write = createWriteFunction((text, next) => {
- const n = this.expectedSize
- this.buffer += text
- if (this.buffer.length >= n) {
- this.next = next
- this.pushBySize(n)
- return true // we will decide when to call next
- }
- return false
- }, err => {
- this.emit('error', err)
- })
-
- this.end = () => {
- // the rendering is finished; we should push out the last of the buffer.
- this.done = true
- this.push(this.buffer)
- }
- }
-
- pushBySize (n: number) {
- const bufferToPush = this.buffer.substring(0, n)
- this.buffer = this.buffer.substring(n)
- this.push(bufferToPush)
- }
-
- tryRender () {
- try {
- this.render(this.write, this.end)
- } catch (e) {
- this.emit('error', e)
- }
- }
-
- tryNext () {
- try {
- this.next()
- } catch (e) {
- this.emit('error', e)
- }
- }
-
- _read (n: number) {
- this.expectedSize = n
- // it's possible that the last chunk added bumped the buffer up to > 2 * n,
- // which means we will need to go through multiple read calls to drain it
- // down to < n.
- if (isTrue(this.done)) {
- this.push(null)
- return
- }
- if (this.buffer.length >= n) {
- this.pushBySize(n)
- return
- }
- if (isUndef(this.next)) {
- // start the rendering chain.
- this.tryRender()
- } else {
- // continue with the rendering.
- this.tryNext()
- }
- }
-}
+++ /dev/null
-/* @flow */
-
-import { escape } from 'web/server/util'
-import { SSR_ATTR } from 'shared/constants'
-import { RenderContext } from './render-context'
-import { generateComponentTrace } from 'core/util/debug'
-import { ssrCompileToFunctions } from 'web/server/compiler'
-import { installSSRHelpers } from './optimizing-compiler/runtime-helpers'
-
-import { isDef, isUndef, isTrue } from 'shared/util'
-
-import {
- createComponent,
- createComponentInstanceForVnode
-} from 'core/vdom/create-component'
-
-let warned = Object.create(null)
-const warnOnce = msg => {
- if (!warned[msg]) {
- warned[msg] = true
- console.warn(`\n\u001b[31m${msg}\u001b[39m\n`)
- }
-}
-
-const onCompilationError = (err, vm) => {
- const trace = vm ? generateComponentTrace(vm) : ''
- throw new Error(`\n\u001b[31m${err}${trace}\u001b[39m\n`)
-}
-
-const normalizeRender = vm => {
- const { render, template, _scopeId } = vm.$options
- if (isUndef(render)) {
- if (template) {
- const compiled = ssrCompileToFunctions(template, {
- scopeId: _scopeId,
- warn: onCompilationError
- }, vm)
-
- vm.$options.render = compiled.render
- vm.$options.staticRenderFns = compiled.staticRenderFns
- } else {
- throw new Error(
- `render function or template not defined in component: ${
- vm.$options.name || vm.$options._componentTag || 'anonymous'
- }`
- )
- }
- }
-}
-
-function renderNode (node, isRoot, context) {
- if (node.isString) {
- renderStringNode(node, context)
- } else if (isDef(node.componentOptions)) {
- renderComponent(node, isRoot, context)
- } else if (isDef(node.tag)) {
- renderElement(node, isRoot, context)
- } else if (isTrue(node.isComment)) {
- if (isDef(node.asyncFactory)) {
- // async component
- renderAsyncComponent(node, isRoot, context)
- } else {
- context.write(`<!--${node.text}-->`, context.next)
- }
- } else {
- context.write(
- node.raw ? node.text : escape(String(node.text)),
- context.next
- )
- }
-}
-
-function registerComponentForCache (options, write) {
- // exposed by vue-loader, need to call this if cache hit because
- // component lifecycle hooks will not be called.
- const register = options._ssrRegister
- if (write.caching && isDef(register)) {
- write.componentBuffer[write.componentBuffer.length - 1].add(register)
- }
- return register
-}
-
-function renderComponent (node, isRoot, context) {
- const { write, next, userContext } = context
-
- // check cache hit
- const Ctor = node.componentOptions.Ctor
- const getKey = Ctor.options.serverCacheKey
- const name = Ctor.options.name
- const cache = context.cache
- const registerComponent = registerComponentForCache(Ctor.options, write)
-
- if (isDef(getKey) && isDef(cache) && isDef(name)) {
- const key = name + '::' + getKey(node.componentOptions.propsData)
- const { has, get } = context
- if (isDef(has)) {
- has(key, hit => {
- if (hit === true && isDef(get)) {
- get(key, res => {
- if (isDef(registerComponent)) {
- registerComponent(userContext)
- }
- res.components.forEach(register => register(userContext))
- write(res.html, next)
- })
- } else {
- renderComponentWithCache(node, isRoot, key, context)
- }
- })
- } else if (isDef(get)) {
- get(key, res => {
- if (isDef(res)) {
- if (isDef(registerComponent)) {
- registerComponent(userContext)
- }
- res.components.forEach(register => register(userContext))
- write(res.html, next)
- } else {
- renderComponentWithCache(node, isRoot, key, context)
- }
- })
- }
- } else {
- if (isDef(getKey) && isUndef(cache)) {
- warnOnce(
- `[vue-server-renderer] Component ${
- Ctor.options.name || '(anonymous)'
- } implemented serverCacheKey, ` +
- 'but no cache was provided to the renderer.'
- )
- }
- if (isDef(getKey) && isUndef(name)) {
- warnOnce(
- `[vue-server-renderer] Components that implement "serverCacheKey" ` +
- `must also define a unique "name" option.`
- )
- }
- renderComponentInner(node, isRoot, context)
- }
-}
-
-function renderComponentWithCache (node, isRoot, key, context) {
- const write = context.write
- write.caching = true
- const buffer = write.cacheBuffer
- const bufferIndex = buffer.push('') - 1
- const componentBuffer = write.componentBuffer
- componentBuffer.push(new Set())
- context.renderStates.push({
- type: 'ComponentWithCache',
- key,
- buffer,
- bufferIndex,
- componentBuffer
- })
- renderComponentInner(node, isRoot, context)
-}
-
-function renderComponentInner (node, isRoot, context) {
- const prevActive = context.activeInstance
- // expose userContext on vnode
- node.ssrContext = context.userContext
- const child = context.activeInstance = createComponentInstanceForVnode(
- node,
- context.activeInstance
- )
- normalizeRender(child)
- const childNode = child._render()
- childNode.parent = node
- context.renderStates.push({
- type: 'Component',
- prevActive
- })
- renderNode(childNode, isRoot, context)
-}
-
-function renderAsyncComponent (node, isRoot, context) {
- const factory = node.asyncFactory
-
- const resolve = comp => {
- if (comp.__esModule && comp.default) {
- comp = comp.default
- }
- const { data, children, tag } = node.asyncMeta
- const nodeContext = node.asyncMeta.context
- const resolvedNode: any = createComponent(
- comp,
- data,
- nodeContext,
- children,
- tag
- )
- if (resolvedNode) {
- if (resolvedNode.componentOptions) {
- // normal component
- renderComponent(resolvedNode, isRoot, context)
- } else if (!Array.isArray(resolvedNode)) {
- // single return node from functional component
- renderNode(resolvedNode, isRoot, context)
- } else {
- // multiple return nodes from functional component
- context.renderStates.push({
- type: 'Fragment',
- children: resolvedNode,
- rendered: 0,
- total: resolvedNode.length
- })
- context.next()
- }
- } else {
- // invalid component, but this does not throw on the client
- // so render empty comment node
- context.write(`<!---->`, context.next)
- }
- }
-
- if (factory.resolved) {
- resolve(factory.resolved)
- return
- }
-
- const reject = context.done
- let res
- try {
- res = factory(resolve, reject)
- } catch (e) {
- reject(e)
- }
- if (res) {
- if (typeof res.then === 'function') {
- res.then(resolve, reject).catch(reject)
- } else {
- // new syntax in 2.3
- const comp = res.component
- if (comp && typeof comp.then === 'function') {
- comp.then(resolve, reject).catch(reject)
- }
- }
- }
-}
-
-function renderStringNode (el, context) {
- const { write, next } = context
- if (isUndef(el.children) || el.children.length === 0) {
- write(el.open + (el.close || ''), next)
- } else {
- const children: Array<VNode> = el.children
- context.renderStates.push({
- type: 'Element',
- children,
- rendered: 0,
- total: children.length,
- endTag: el.close
- })
- write(el.open, next)
- }
-}
-
-function renderElement (el, isRoot, context) {
- const { write, next } = context
-
- if (isTrue(isRoot)) {
- if (!el.data) el.data = {}
- if (!el.data.attrs) el.data.attrs = {}
- el.data.attrs[SSR_ATTR] = 'true'
- }
-
- if (el.fnOptions) {
- registerComponentForCache(el.fnOptions, write)
- }
-
- const startTag = renderStartingTag(el, context)
- const endTag = `</${el.tag}>`
- if (context.isUnaryTag(el.tag)) {
- write(startTag, next)
- } else if (isUndef(el.children) || el.children.length === 0) {
- write(startTag + endTag, next)
- } else {
- const children: Array<VNode> = el.children
- context.renderStates.push({
- type: 'Element',
- children,
- rendered: 0,
- total: children.length,
- endTag
- })
- write(startTag, next)
- }
-}
-
-function hasAncestorData (node: VNode) {
- const parentNode = node.parent
- return isDef(parentNode) && (isDef(parentNode.data) || hasAncestorData(parentNode))
-}
-
-function getVShowDirectiveInfo (node: VNode): ?VNodeDirective {
- let dir: VNodeDirective
- let tmp
-
- while (isDef(node)) {
- if (node.data && node.data.directives) {
- tmp = node.data.directives.find(dir => dir.name === 'show')
- if (tmp) {
- dir = tmp
- }
- }
- node = node.parent
- }
- return dir
-}
-
-function renderStartingTag (node: VNode, context) {
- let markup = `<${node.tag}`
- const { directives, modules } = context
-
- // construct synthetic data for module processing
- // because modules like style also produce code by parent VNode data
- if (isUndef(node.data) && hasAncestorData(node)) {
- node.data = {}
- }
- if (isDef(node.data)) {
- // check directives
- const dirs = node.data.directives
- if (dirs) {
- for (let i = 0; i < dirs.length; i++) {
- const name = dirs[i].name
- const dirRenderer = directives[name]
- if (dirRenderer && name !== 'show') {
- // directives mutate the node's data
- // which then gets rendered by modules
- dirRenderer(node, dirs[i])
- }
- }
- }
-
- // v-show directive needs to be merged from parent to child
- const vshowDirectiveInfo = getVShowDirectiveInfo(node)
- if (vshowDirectiveInfo) {
- directives.show(node, vshowDirectiveInfo)
- }
-
- // apply other modules
- for (let i = 0; i < modules.length; i++) {
- const res = modules[i](node)
- if (res) {
- markup += res
- }
- }
- }
- // attach scoped CSS ID
- let scopeId
- const activeInstance = context.activeInstance
- if (isDef(activeInstance) &&
- activeInstance !== node.context &&
- isDef(scopeId = activeInstance.$options._scopeId)
- ) {
- markup += ` ${(scopeId: any)}`
- }
- if (isDef(node.fnScopeId)) {
- markup += ` ${node.fnScopeId}`
- } else {
- while (isDef(node)) {
- if (isDef(scopeId = node.context.$options._scopeId)) {
- markup += ` ${scopeId}`
- }
- node = node.parent
- }
- }
- return markup + '>'
-}
-
-export function createRenderFunction (
- modules: Array<(node: VNode) => ?string>,
- directives: Object,
- isUnaryTag: Function,
- cache: any
-) {
- return function render (
- component: Component,
- write: (text: string, next: Function) => void,
- userContext: ?Object,
- done: Function
- ) {
- warned = Object.create(null)
- const context = new RenderContext({
- activeInstance: component,
- userContext,
- write, done, renderNode,
- isUnaryTag, modules, directives,
- cache
- })
- installSSRHelpers(component)
- normalizeRender(component)
- renderNode(component._render(), true, context)
- }
-}
+++ /dev/null
-/* @flow */
-
-/**
- * Creates a mapper that maps components used during a server-side render
- * to async chunk files in the client-side build, so that we can inline them
- * directly in the rendered HTML to avoid waterfall requests.
- */
-
-import type { ClientManifest } from './index'
-
-export type AsyncFileMapper = (files: Array<string>) => Array<string>;
-
-export function createMapper (
- clientManifest: ClientManifest
-): AsyncFileMapper {
- const map = createMap(clientManifest)
- // map server-side moduleIds to client-side files
- return function mapper (moduleIds: Array<string>): Array<string> {
- const res = new Set()
- for (let i = 0; i < moduleIds.length; i++) {
- const mapped = map.get(moduleIds[i])
- if (mapped) {
- for (let j = 0; j < mapped.length; j++) {
- res.add(mapped[j])
- }
- }
- }
- return Array.from(res)
- }
-}
-
-function createMap (clientManifest) {
- const map = new Map()
- Object.keys(clientManifest.modules).forEach(id => {
- map.set(id, mapIdToFile(id, clientManifest))
- })
- return map
-}
-
-function mapIdToFile (id, clientManifest) {
- const files = []
- const fileIndices = clientManifest.modules[id]
- if (fileIndices) {
- fileIndices.forEach(index => {
- const file = clientManifest.all[index]
- // only include async files or non-js assets
- if (clientManifest.async.indexOf(file) > -1 || !(/\.js($|\?)/.test(file))) {
- files.push(file)
- }
- })
- }
- return files
-}
+++ /dev/null
-/* @flow */
-
-const path = require('path')
-const serialize = require('serialize-javascript')
-
-import { isJS, isCSS } from '../util'
-import TemplateStream from './template-stream'
-import { parseTemplate } from './parse-template'
-import { createMapper } from './create-async-file-mapper'
-import type { ParsedTemplate } from './parse-template'
-import type { AsyncFileMapper } from './create-async-file-mapper'
-
-type TemplateRendererOptions = {
- template: ?string;
- inject?: boolean;
- clientManifest?: ClientManifest;
- shouldPreload?: (file: string, type: string) => boolean;
- shouldPrefetch?: (file: string, type: string) => boolean;
-};
-
-export type ClientManifest = {
- publicPath: string;
- all: Array<string>;
- initial: Array<string>;
- async: Array<string>;
- modules: {
- [id: string]: Array<number>;
- },
- hasNoCssVersion?: {
- [file: string]: boolean;
- }
-};
-
-type Resource = {
- file: string;
- extension: string;
- fileWithoutQuery: string;
- asType: string;
-};
-
-export default class TemplateRenderer {
- options: TemplateRendererOptions;
- inject: boolean;
- parsedTemplate: ParsedTemplate | null;
- publicPath: string;
- clientManifest: ClientManifest;
- preloadFiles: Array<Resource>;
- prefetchFiles: Array<Resource>;
- mapFiles: AsyncFileMapper;
-
- constructor (options: TemplateRendererOptions) {
- this.options = options
- this.inject = options.inject !== false
- // if no template option is provided, the renderer is created
- // as a utility object for rendering assets like preload links and scripts.
- this.parsedTemplate = options.template
- ? parseTemplate(options.template)
- : null
-
- // extra functionality with client manifest
- if (options.clientManifest) {
- const clientManifest = this.clientManifest = options.clientManifest
- this.publicPath = clientManifest.publicPath.replace(/\/$/, '')
- // preload/prefetch directives
- this.preloadFiles = (clientManifest.initial || []).map(normalizeFile)
- this.prefetchFiles = (clientManifest.async || []).map(normalizeFile)
- // initial async chunk mapping
- this.mapFiles = createMapper(clientManifest)
- }
- }
-
- bindRenderFns (context: Object) {
- const renderer: any = this
- ;['ResourceHints', 'State', 'Scripts', 'Styles'].forEach(type => {
- context[`render${type}`] = renderer[`render${type}`].bind(renderer, context)
- })
- // also expose getPreloadFiles, useful for HTTP/2 push
- context.getPreloadFiles = renderer.getPreloadFiles.bind(renderer, context)
- }
-
- // render synchronously given rendered app content and render context
- renderSync (content: string, context: ?Object) {
- const template = this.parsedTemplate
- if (!template) {
- throw new Error('renderSync cannot be called without a template.')
- }
- context = context || {}
- if (this.inject) {
- return (
- template.head(context) +
- (context.head || '') +
- this.renderResourceHints(context) +
- this.renderStyles(context) +
- template.neck(context) +
- content +
- this.renderState(context) +
- this.renderScripts(context) +
- template.tail(context)
- )
- } else {
- return (
- template.head(context) +
- template.neck(context) +
- content +
- template.tail(context)
- )
- }
- }
-
- renderStyles (context: Object): string {
- const cssFiles = this.clientManifest
- ? this.clientManifest.all.filter(isCSS)
- : []
- return (
- // render links for css files
- (cssFiles.length
- ? cssFiles.map(file => `<link rel="stylesheet" href="${this.publicPath}/${file}">`).join('')
- : '') +
- // context.styles is a getter exposed by vue-style-loader which contains
- // the inline component styles collected during SSR
- (context.styles || '')
- )
- }
-
- renderResourceHints (context: Object): string {
- return this.renderPreloadLinks(context) + this.renderPrefetchLinks(context)
- }
-
- getPreloadFiles (context: Object): Array<Resource> {
- const usedAsyncFiles = this.getUsedAsyncFiles(context)
- if (this.preloadFiles || usedAsyncFiles) {
- return (this.preloadFiles || []).concat(usedAsyncFiles || [])
- } else {
- return []
- }
- }
-
- renderPreloadLinks (context: Object): string {
- const files = this.getPreloadFiles(context)
- const shouldPreload = this.options.shouldPreload
- if (files.length) {
- return files.map(({ file, extension, fileWithoutQuery, asType }) => {
- let extra = ''
- // by default, we only preload scripts or css
- if (!shouldPreload && asType !== 'script' && asType !== 'style') {
- return ''
- }
- // user wants to explicitly control what to preload
- if (shouldPreload && !shouldPreload(fileWithoutQuery, asType)) {
- return ''
- }
- if (asType === 'font') {
- extra = ` type="font/${extension}" crossorigin`
- }
- return `<link rel="preload" href="${
- this.publicPath}/${file
- }"${
- asType !== '' ? ` as="${asType}"` : ''
- }${
- extra
- }>`
- }).join('')
- } else {
- return ''
- }
- }
-
- renderPrefetchLinks (context: Object): string {
- const shouldPrefetch = this.options.shouldPrefetch
- if (this.prefetchFiles) {
- const usedAsyncFiles = this.getUsedAsyncFiles(context)
- const alreadyRendered = file => {
- return usedAsyncFiles && usedAsyncFiles.some(f => f.file === file)
- }
- return this.prefetchFiles.map(({ file, fileWithoutQuery, asType }) => {
- if (shouldPrefetch && !shouldPrefetch(fileWithoutQuery, asType)) {
- return ''
- }
- if (alreadyRendered(file)) {
- return ''
- }
- return `<link rel="prefetch" href="${this.publicPath}/${file}">`
- }).join('')
- } else {
- return ''
- }
- }
-
- renderState (context: Object, options?: Object): string {
- const {
- contextKey = 'state',
- windowKey = '__INITIAL_STATE__'
- } = options || {}
- const state = serialize(context[contextKey], { isJSON: true })
- const autoRemove = process.env.NODE_ENV === 'production'
- ? ';(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());'
- : ''
- return context[contextKey]
- ? `<script>window.${windowKey}=${state}${autoRemove}</script>`
- : ''
- }
-
- renderScripts (context: Object): string {
- if (this.clientManifest) {
- const initial = this.preloadFiles
- const async = this.getUsedAsyncFiles(context)
- const needed = [initial[0]].concat(async || [], initial.slice(1))
- return needed.filter(({ file }) => isJS(file)).map(({ file }) => {
- return `<script src="${this.publicPath}/${file}" defer></script>`
- }).join('')
- } else {
- return ''
- }
- }
-
- getUsedAsyncFiles (context: Object): ?Array<Resource> {
- if (!context._mappedFiles && context._registeredComponents && this.mapFiles) {
- const registered = Array.from(context._registeredComponents)
- context._mappedFiles = this.mapFiles(registered).map(normalizeFile)
- }
- return context._mappedFiles
- }
-
- // create a transform stream
- createStream (context: ?Object): TemplateStream {
- if (!this.parsedTemplate) {
- throw new Error('createStream cannot be called without a template.')
- }
- return new TemplateStream(this, this.parsedTemplate, context || {})
- }
-}
-
-function normalizeFile (file: string): Resource {
- const withoutQuery = file.replace(/\?.*/, '')
- const extension = path.extname(withoutQuery).slice(1)
- return {
- file,
- extension,
- fileWithoutQuery: withoutQuery,
- asType: getPreloadType(extension)
- }
-}
-
-function getPreloadType (ext: string): string {
- if (ext === 'js') {
- return 'script'
- } else if (ext === 'css') {
- return 'style'
- } else if (/jpe?g|png|svg|gif|webp|ico/.test(ext)) {
- return 'image'
- } else if (/woff2?|ttf|otf|eot/.test(ext)) {
- return 'font'
- } else {
- // not exhausting all possibilities here, but above covers common cases
- return ''
- }
-}
+++ /dev/null
-/* @flow */
-
-const compile = require('lodash.template')
-const compileOptions = {
- escape: /{{([^{][\s\S]+?[^}])}}/g,
- interpolate: /{{{([\s\S]+?)}}}/g
-}
-
-export type ParsedTemplate = {
- head: (data: any) => string;
- neck: (data: any) => string;
- tail: (data: any) => string;
-};
-
-export function parseTemplate (
- template: string,
- contentPlaceholder?: string = '<!--vue-ssr-outlet-->'
-): ParsedTemplate {
- if (typeof template === 'object') {
- return template
- }
-
- let i = template.indexOf('</head>')
- const j = template.indexOf(contentPlaceholder)
-
- if (j < 0) {
- throw new Error(`Content placeholder not found in template.`)
- }
-
- if (i < 0) {
- i = template.indexOf('<body>')
- if (i < 0) {
- i = j
- }
- }
-
- return {
- head: compile(template.slice(0, i), compileOptions),
- neck: compile(template.slice(i, j), compileOptions),
- tail: compile(template.slice(j + contentPlaceholder.length), compileOptions)
- }
-}
+++ /dev/null
-/* @flow */
-
-const Transform = require('stream').Transform
-import type TemplateRenderer from './index'
-import type { ParsedTemplate } from './parse-template'
-
-export default class TemplateStream extends Transform {
- started: boolean;
- renderer: TemplateRenderer;
- template: ParsedTemplate;
- context: Object;
- inject: boolean;
-
- constructor (
- renderer: TemplateRenderer,
- template: ParsedTemplate,
- context: Object
- ) {
- super()
- this.started = false
- this.renderer = renderer
- this.template = template
- this.context = context || {}
- this.inject = renderer.inject
- }
-
- _transform (data: Buffer | string, encoding: string, done: Function) {
- if (!this.started) {
- this.emit('beforeStart')
- this.start()
- }
- this.push(data)
- done()
- }
-
- start () {
- this.started = true
- this.push(this.template.head(this.context))
-
- if (this.inject) {
- // inline server-rendered head meta information
- if (this.context.head) {
- this.push(this.context.head)
- }
-
- // inline preload/prefetch directives for initial/async chunks
- const links = this.renderer.renderResourceHints(this.context)
- if (links) {
- this.push(links)
- }
-
- // CSS files and inline server-rendered CSS collected by vue-style-loader
- const styles = this.renderer.renderStyles(this.context)
- if (styles) {
- this.push(styles)
- }
- }
-
- this.push(this.template.neck(this.context))
- }
-
- _flush (done: Function) {
- this.emit('beforeEnd')
-
- if (this.inject) {
- // inline initial store state
- const state = this.renderer.renderState(this.context)
- if (state) {
- this.push(state)
- }
-
- // embed scripts needed
- const scripts = this.renderer.renderScripts(this.context)
- if (scripts) {
- this.push(scripts)
- }
- }
-
- this.push(this.template.tail(this.context))
- done()
- }
-}
+++ /dev/null
-/* @flow */
-
-export const isJS = (file: string): boolean => /\.js(\?[^.]+)?$/.test(file)
-
-export const isCSS = (file: string): boolean => /\.css(\?[^.]+)?$/.test(file)
-
-export function createPromiseCallback () {
- let resolve, reject
- const promise: Promise<string> = new Promise((_resolve, _reject) => {
- resolve = _resolve
- reject = _reject
- })
- const cb = (err: Error, res?: string) => {
- if (err) return reject(err)
- resolve(res || '')
- }
- return { promise, cb }
-}
+++ /dev/null
-const hash = require('hash-sum')
-const uniq = require('lodash.uniq')
-import { isJS } from './util'
-
-export default class VueSSRClientPlugin {
- constructor (options = {}) {
- this.options = Object.assign({
- filename: 'vue-ssr-client-manifest.json'
- }, options)
- }
-
- apply (compiler) {
- compiler.plugin('emit', (compilation, cb) => {
- const stats = compilation.getStats().toJson()
-
- const allFiles = uniq(stats.assets
- .map(a => a.name))
-
- const initialFiles = uniq(Object.keys(stats.entrypoints)
- .map(name => stats.entrypoints[name].assets)
- .reduce((assets, all) => all.concat(assets), [])
- .filter(isJS))
-
- const asyncFiles = allFiles
- .filter(isJS)
- .filter(file => initialFiles.indexOf(file) < 0)
-
- const manifest = {
- publicPath: stats.publicPath,
- all: allFiles,
- initial: initialFiles,
- async: asyncFiles,
- modules: { /* [identifier: string]: Array<index: number> */ }
- }
-
- const assetModules = stats.modules.filter(m => m.assets.length)
- const fileToIndex = file => manifest.all.indexOf(file)
- stats.modules.forEach(m => {
- // ignore modules duplicated in multiple chunks
- if (m.chunks.length === 1) {
- const cid = m.chunks[0]
- const chunk = stats.chunks.find(c => c.id === cid)
- if (!chunk || !chunk.files) {
- return
- }
- const files = manifest.modules[hash(m.identifier)] = chunk.files.map(fileToIndex)
- // find all asset modules associated with the same chunk
- assetModules.forEach(m => {
- if (m.chunks.some(id => id === cid)) {
- files.push.apply(files, m.assets.map(fileToIndex))
- }
- })
- }
- })
-
- // const debug = (file, obj) => {
- // require('fs').writeFileSync(__dirname + '/' + file, JSON.stringify(obj, null, 2))
- // }
- // debug('stats.json', stats)
- // debug('client-manifest.json', manifest)
-
- const json = JSON.stringify(manifest, null, 2)
- compilation.assets[this.options.filename] = {
- source: () => json,
- size: () => json.length
- }
- cb()
- })
- }
-}
+++ /dev/null
-import { validate, isJS } from './util'
-
-export default class VueSSRServerPlugin {
- constructor (options = {}) {
- this.options = Object.assign({
- filename: 'vue-ssr-server-bundle.json'
- }, options)
- }
-
- apply (compiler) {
- validate(compiler)
-
- compiler.plugin('emit', (compilation, cb) => {
- const stats = compilation.getStats().toJson()
- const entryName = Object.keys(stats.entrypoints)[0]
- const entryInfo = stats.entrypoints[entryName]
-
- if (!entryInfo) {
- // #5553
- return cb()
- }
-
- const entryAssets = entryInfo.assets.filter(isJS)
-
- if (entryAssets.length > 1) {
- throw new Error(
- `Server-side bundle should have one single entry file. ` +
- `Avoid using CommonsChunkPlugin in the server config.`
- )
- }
-
- const entry = entryAssets[0]
- if (!entry || typeof entry !== 'string') {
- throw new Error(
- `Entry "${entryName}" not found. Did you specify the correct entry option?`
- )
- }
-
- const bundle = {
- entry,
- files: {},
- maps: {}
- }
-
- stats.assets.forEach(asset => {
- if (asset.name.match(/\.js$/)) {
- bundle.files[asset.name] = compilation.assets[asset.name].source()
- } else if (asset.name.match(/\.js\.map$/)) {
- bundle.maps[asset.name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[asset.name].source())
- }
- // do not emit anything else for server
- delete compilation.assets[asset.name]
- })
-
- const json = JSON.stringify(bundle, null, 2)
- const filename = this.options.filename
-
- compilation.assets[filename] = {
- source: () => json,
- size: () => json.length
- }
-
- cb()
- })
- }
-}
+++ /dev/null
-const { red, yellow } = require('chalk')
-
-const prefix = `[vue-server-renderer-webpack-plugin]`
-const warn = exports.warn = msg => console.error(red(`${prefix} ${msg}\n`))
-const tip = exports.tip = msg => console.log(yellow(`${prefix} ${msg}\n`))
-
-export const validate = compiler => {
- if (compiler.options.target !== 'node') {
- warn('webpack config `target` should be "node".')
- }
-
- if (compiler.options.output && compiler.options.output.libraryTarget !== 'commonjs2') {
- warn('webpack config `output.libraryTarget` should be "commonjs2".')
- }
-
- if (!compiler.options.externals) {
- tip(
- 'It is recommended to externalize dependencies in the server build for ' +
- 'better build performance.'
- )
- }
-}
-
-export { isJS, isCSS } from '../util'
+++ /dev/null
-/* @flow */
-
-const MAX_STACK_DEPTH = 1000
-const noop = _ => _
-
-const defer = typeof process !== 'undefined' && process.nextTick
- ? process.nextTick
- : typeof Promise !== 'undefined'
- ? fn => Promise.resolve().then(fn)
- : typeof setTimeout !== 'undefined'
- ? setTimeout
- : noop
-
-if (defer === noop) {
- throw new Error(
- 'Your JavaScript runtime does not support any asynchronous primitives ' +
- 'that are required by vue-server-renderer. Please use a polyfill for ' +
- 'either Promise or setTimeout.'
- )
-}
-
-export function createWriteFunction (
- write: (text: string, next: Function) => boolean,
- onError: Function
-): Function {
- let stackDepth = 0
- const cachedWrite = (text, next) => {
- if (text && cachedWrite.caching) {
- cachedWrite.cacheBuffer[cachedWrite.cacheBuffer.length - 1] += text
- }
- const waitForNext = write(text, next)
- if (waitForNext !== true) {
- if (stackDepth >= MAX_STACK_DEPTH) {
- defer(() => {
- try { next() } catch (e) {
- onError(e)
- }
- })
- } else {
- stackDepth++
- next()
- stackDepth--
- }
- }
- }
- cachedWrite.caching = false
- cachedWrite.cacheBuffer = []
- cachedWrite.componentBuffer = []
- return cachedWrite
-}
+++ /dev/null
-/* @flow */
-
-import deindent from 'de-indent'
-import { parseHTML } from 'compiler/parser/html-parser'
-import { makeMap } from 'shared/util'
-
-const splitRE = /\r?\n/g
-const replaceRE = /./g
-const isSpecialTag = makeMap('script,style,template', true)
-
-type Attribute = {
- name: string,
- value: string
-};
-
-/**
- * Parse a single-file component (*.vue) file into an SFC Descriptor Object.
- */
-export function parseComponent (
- content: string,
- options?: Object = {}
-): SFCDescriptor {
- const sfc: SFCDescriptor = {
- template: null,
- script: null,
- styles: [],
- customBlocks: []
- }
- let depth = 0
- let currentBlock: ?SFCBlock = null
-
- function start (
- tag: string,
- attrs: Array<Attribute>,
- unary: boolean,
- start: number,
- end: number
- ) {
- if (depth === 0) {
- currentBlock = {
- type: tag,
- content: '',
- start: end,
- attrs: attrs.reduce((cumulated, { name, value }) => {
- cumulated[name] = value || true
- return cumulated
- }, {})
- }
- if (isSpecialTag(tag)) {
- checkAttrs(currentBlock, attrs)
- if (tag === 'style') {
- sfc.styles.push(currentBlock)
- } else {
- sfc[tag] = currentBlock
- }
- } else { // custom blocks
- sfc.customBlocks.push(currentBlock)
- }
- }
- if (!unary) {
- depth++
- }
- }
-
- function checkAttrs (block: SFCBlock, attrs: Array<Attribute>) {
- for (let i = 0; i < attrs.length; i++) {
- const attr = attrs[i]
- if (attr.name === 'lang') {
- block.lang = attr.value
- }
- if (attr.name === 'scoped') {
- block.scoped = true
- }
- if (attr.name === 'module') {
- block.module = attr.value || true
- }
- if (attr.name === 'src') {
- block.src = attr.value
- }
- }
- }
-
- function end (tag: string, start: number, end: number) {
- if (depth === 1 && currentBlock) {
- currentBlock.end = start
- let text = deindent(content.slice(currentBlock.start, currentBlock.end))
- // pad content so that linters and pre-processors can output correct
- // line numbers in errors and warnings
- if (currentBlock.type !== 'template' && options.pad) {
- text = padContent(currentBlock, options.pad) + text
- }
- currentBlock.content = text
- currentBlock = null
- }
- depth--
- }
-
- function padContent (block: SFCBlock, pad: true | "line" | "space") {
- if (pad === 'space') {
- return content.slice(0, block.start).replace(replaceRE, ' ')
- } else {
- const offset = content.slice(0, block.start).split(splitRE).length
- const padChar = block.type === 'script' && !block.lang
- ? '//\n'
- : '\n'
- return Array(offset).join(padChar)
- }
- }
-
- parseHTML(content, {
- start,
- end
- })
-
- return sfc
-}
+++ /dev/null
-export const SSR_ATTR = 'data-server-rendered'
-
-export const ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
-]
-
-export const LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured'
-]
+++ /dev/null
-/* @flow */
-
-export const emptyObject = Object.freeze({})
-
-// these helpers produces better vm code in JS engines due to their
-// explicitness and function inlining
-export function isUndef (v: any): boolean %checks {
- return v === undefined || v === null
-}
-
-export function isDef (v: any): boolean %checks {
- return v !== undefined && v !== null
-}
-
-export function isTrue (v: any): boolean %checks {
- return v === true
-}
-
-export function isFalse (v: any): boolean %checks {
- return v === false
-}
-
-/**
- * Check if value is primitive
- */
-export function isPrimitive (value: any): boolean %checks {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
-}
-
-/**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
-export function isObject (obj: mixed): boolean %checks {
- return obj !== null && typeof obj === 'object'
-}
-
-/**
- * Get the raw type string of a value e.g. [object Object]
- */
-const _toString = Object.prototype.toString
-
-export function toRawType (value: any): string {
- return _toString.call(value).slice(8, -1)
-}
-
-/**
- * Strict object type check. Only returns true
- * for plain JavaScript objects.
- */
-export function isPlainObject (obj: any): boolean {
- return _toString.call(obj) === '[object Object]'
-}
-
-export function isRegExp (v: any): boolean {
- return _toString.call(v) === '[object RegExp]'
-}
-
-/**
- * Check if val is a valid array index.
- */
-export function isValidArrayIndex (val: any): boolean {
- const n = parseFloat(String(val))
- return n >= 0 && Math.floor(n) === n && isFinite(val)
-}
-
-/**
- * Convert a value to a string that is actually rendered.
- */
-export function toString (val: any): string {
- return val == null
- ? ''
- : typeof val === 'object'
- ? JSON.stringify(val, null, 2)
- : String(val)
-}
-
-/**
- * Convert a input value to a number for persistence.
- * If the conversion fails, return original string.
- */
-export function toNumber (val: string): number | string {
- const n = parseFloat(val)
- return isNaN(n) ? val : n
-}
-
-/**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
-export function makeMap (
- str: string,
- expectsLowerCase?: boolean
-): (key: string) => true | void {
- const map = Object.create(null)
- const list: Array<string> = str.split(',')
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true
- }
- return expectsLowerCase
- ? val => map[val.toLowerCase()]
- : val => map[val]
-}
-
-/**
- * Check if a tag is a built-in tag.
- */
-export const isBuiltInTag = makeMap('slot,component', true)
-
-/**
- * Check if a attribute is a reserved attribute.
- */
-export const isReservedAttribute = makeMap('key,ref,slot,slot-scope,is')
-
-/**
- * Remove an item from an array
- */
-export function remove (arr: Array<any>, item: any): Array<any> | void {
- if (arr.length) {
- const index = arr.indexOf(item)
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
-}
-
-/**
- * Check whether the object has the property.
- */
-const hasOwnProperty = Object.prototype.hasOwnProperty
-export function hasOwn (obj: Object | Array<*>, key: string): boolean {
- return hasOwnProperty.call(obj, key)
-}
-
-/**
- * Create a cached version of a pure function.
- */
-export function cached<F: Function> (fn: F): F {
- const cache = Object.create(null)
- return (function cachedFn (str: string) {
- const hit = cache[str]
- return hit || (cache[str] = fn(str))
- }: any)
-}
-
-/**
- * Camelize a hyphen-delimited string.
- */
-const camelizeRE = /-(\w)/g
-export const camelize = cached((str: string): string => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')
-})
-
-/**
- * Capitalize a string.
- */
-export const capitalize = cached((str: string): string => {
- return str.charAt(0).toUpperCase() + str.slice(1)
-})
-
-/**
- * Hyphenate a camelCase string.
- */
-const hyphenateRE = /\B([A-Z])/g
-export const hyphenate = cached((str: string): string => {
- return str.replace(hyphenateRE, '-$1').toLowerCase()
-})
-
-/**
- * Simple bind polyfill for environments that do not support it... e.g.
- * PhantomJS 1.x. Technically we don't need this anymore since native bind is
- * now more performant in most browsers, but removing it would be breaking for
- * code that was able to run in PhantomJS 1.x, so this must be kept for
- * backwards compatibility.
- */
-
-/* istanbul ignore next */
-function polyfillBind (fn: Function, ctx: Object): Function {
- function boundFn (a) {
- const l = arguments.length
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
-
- boundFn._length = fn.length
- return boundFn
-}
-
-function nativeBind (fn: Function, ctx: Object): Function {
- return fn.bind(ctx)
-}
-
-export const bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind
-
-/**
- * Convert an Array-like object to a real Array.
- */
-export function toArray (list: any, start?: number): Array<any> {
- start = start || 0
- let i = list.length - start
- const ret: Array<any> = new Array(i)
- while (i--) {
- ret[i] = list[i + start]
- }
- return ret
-}
-
-/**
- * Mix properties into target object.
- */
-export function extend (to: Object, _from: ?Object): Object {
- for (const key in _from) {
- to[key] = _from[key]
- }
- return to
-}
-
-/**
- * Merge an Array of Objects into a single Object.
- */
-export function toObject (arr: Array<any>): Object {
- const res = {}
- for (let i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i])
- }
- }
- return res
-}
-
-/**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
- */
-export function noop (a?: any, b?: any, c?: any) {}
-
-/**
- * Always return false.
- */
-export const no = (a?: any, b?: any, c?: any) => false
-
-/**
- * Return same value
- */
-export const identity = (_: any) => _
-
-/**
- * Generate a static keys string from compiler modules.
- */
-export function genStaticKeys (modules: Array<ModuleOptions>): string {
- return modules.reduce((keys, m) => {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
-}
-
-/**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
-export function looseEqual (a: any, b: any): boolean {
- if (a === b) return true
- const isObjectA = isObject(a)
- const isObjectB = isObject(b)
- if (isObjectA && isObjectB) {
- try {
- const isArrayA = Array.isArray(a)
- const isArrayB = Array.isArray(b)
- if (isArrayA && isArrayB) {
- return a.length === b.length && a.every((e, i) => {
- return looseEqual(e, b[i])
- })
- } else if (!isArrayA && !isArrayB) {
- const keysA = Object.keys(a)
- const keysB = Object.keys(b)
- return keysA.length === keysB.length && keysA.every(key => {
- return looseEqual(a[key], b[key])
- })
- } else {
- /* istanbul ignore next */
- return false
- }
- } catch (e) {
- /* istanbul ignore next */
- return false
- }
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b)
- } else {
- return false
- }
-}
-
-export function looseIndexOf (arr: Array<mixed>, val: mixed): number {
- for (let i = 0; i < arr.length; i++) {
- if (looseEqual(arr[i], val)) return i
- }
- return -1
-}
-
-/**
- * Ensure a function is called only once.
- */
-export function once (fn: Function): Function {
- let called = false
- return function () {
- if (!called) {
- called = true
- fn.apply(this, arguments)
- }
- }
-}
+++ /dev/null
-{
- "rules": {
- "indent": 0
- }
-}
+++ /dev/null
-// http://nightwatchjs.org/guide#settings-file
-module.exports = {
- 'src_folders': ['test/e2e/specs'],
- 'output_folder': 'test/e2e/reports',
- 'custom_commands_path': ['node_modules/nightwatch-helpers/commands'],
- 'custom_assertions_path': ['node_modules/nightwatch-helpers/assertions'],
-
- 'selenium': {
- 'start_process': true,
- 'server_path': require('selenium-server').path,
- 'host': '127.0.0.1',
- 'port': 4444,
- 'cli_args': {
- 'webdriver.chrome.driver': require('chromedriver').path
- // , 'webdriver.gecko.driver': require('geckodriver').path
- }
- },
-
- 'test_settings': {
- 'default': {
- 'selenium_port': 4444,
- 'selenium_host': 'localhost',
- 'silent': true,
- 'screenshots': {
- 'enabled': true,
- 'on_failure': true,
- 'on_error': false,
- 'path': 'test/e2e/screenshots'
- }
- },
-
- 'chrome': {
- 'desiredCapabilities': {
- 'browserName': 'chrome',
- 'javascriptEnabled': true,
- 'acceptSslCerts': true
- }
- },
-
- 'firefox': {
- 'desiredCapabilities': {
- 'browserName': 'firefox',
- 'javascriptEnabled': true,
- 'acceptSslCerts': true,
- 'marionette': true
- }
- },
-
- 'phantomjs': {
- 'desiredCapabilities': {
- 'browserName': 'phantomjs',
- 'javascriptEnabled': true,
- 'acceptSslCerts': true
- }
- }
- }
-}
+++ /dev/null
-var path = require('path')
-var spawn = require('cross-spawn')
-var httpServer = require('http-server')
-var server = httpServer.createServer({
- root: path.resolve(__dirname, '../../')
-})
-
-server.listen(8080)
-
-var args = process.argv.slice(2)
-if (args.indexOf('--config') === -1) {
- args = args.concat(['--config', 'test/e2e/nightwatch.config.js'])
-}
-if (args.indexOf('--env') === -1) {
- args = args.concat(['--env', 'chrome,phantomjs'])
-}
-var i = args.indexOf('--test')
-if (i > -1) {
- args[i + 1] = 'test/e2e/specs/' + args[i + 1] + '.js'
-}
-
-var runner = spawn('./node_modules/.bin/nightwatch', args, {
- stdio: 'inherit'
-})
-
-runner.on('exit', function (code) {
- server.close()
- process.exit(code)
-})
-
-runner.on('error', function (err) {
- server.close()
- throw err
-})
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title></title>
- <script src="../../../dist/vue.min.js"></script>
- </head>
- <body>
-
- <!-- #4510 click and change event on checkbox -->
- <div id="case-1">
- <div @click="num++">
- {{ num }}
- <input type="checkbox" v-model="checked">
- </div>
- </div>
- <script>
- var vm1 = new Vue({
- el: '#case-1',
- data: {
- num: 1,
- checked: false
- }
- })
- </script>
-
- <!-- #6566 click event bubbling -->
- <div id="case-2">
- <div class="panel" v-if="expand">
- <button @click="expand = false, countA++">Expand is True</button>
- </div>
- <div class="header" v-if="!expand" @click="expand = true, countB++">
- <button>Expand is False</button>
- </div>
- <div class="count-a">
- countA: {{countA}}
- </div>
- <div class="count-b">
- countB: {{countB}}
- </div>
- </div>
- <script>
- var vm2 = new Vue({
- el: '#case-2',
- data: {
- expand: true,
- countA: 0,
- countB: 0,
- }
- })
- </script>
-
- </body>
-</html>
+++ /dev/null
-module.exports = {
- 'async edge cases': function (browser) {
- browser
- .url('http://localhost:8080/test/e2e/specs/async-edge-cases.html')
- // #4510
- .assert.containsText('#case-1', '1')
- .assert.checked('#case-1 input', false)
-
- .click('#case-1 input')
- .assert.containsText('#case-1', '2')
- .assert.checked('#case-1 input', true)
-
- .click('#case-1 input')
- .assert.containsText('#case-1', '3')
- .assert.checked('#case-1 input', false)
-
- // #6566
- .assert.containsText('#case-2 button', 'Expand is True')
- .assert.containsText('.count-a', 'countA: 0')
- .assert.containsText('.count-b', 'countB: 0')
-
- .click('#case-2 button')
- .assert.containsText('#case-2 button', 'Expand is False')
- .assert.containsText('.count-a', 'countA: 1')
- .assert.containsText('.count-b', 'countB: 0')
-
- .click('#case-2 button')
- .assert.containsText('#case-2 button', 'Expand is True')
- .assert.containsText('.count-a', 'countA: 1')
- .assert.containsText('.count-b', 'countB: 1')
-
- .end()
- }
-}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title></title>
- </head>
- <body>
- <script src="../../../dist/vue.min.js"></script>
- <script src="../../../packages/vue-server-renderer/basic.js"></script>
-
- <div id="result">wtf</div>
-
- <script>
- var vm = new Vue({
- data: { msg: 'foo' },
- template: '<div>{{ msg }}</div>'
- })
-
- renderVueComponentToString(vm, function (err, result) {
- document.getElementById('result').textContent = err && err.toString() || result
- })
- </script>
- </body>
-</html>
+++ /dev/null
-module.exports = {
- 'basic SSR': function (browser) {
- browser
- .url('http://localhost:8080/test/e2e/specs/basic-ssr.html')
- .assert.containsText('#result', '<div data-server-rendered="true">foo</div>')
- .end()
- }
-}
+++ /dev/null
-module.exports = {
- 'commits': function (browser) {
- browser
- .url('http://localhost:8080/examples/commits/')
- .waitForElementVisible('li', 5000)
- .assert.count('input', 2)
- .assert.count('label', 2)
- .assert.containsText('label[for="master"]', 'master')
- .assert.containsText('label[for="dev"]', 'dev')
- .assert.checked('#master')
- .assert.checked('#dev', false)
- .assert.containsText('p', 'vuejs/vue@master')
- .assert.count('li', 3)
- .assert.count('li .commit', 3)
- .assert.count('li .message', 3)
- .click('#dev')
- .assert.containsText('p', 'vuejs/vue@dev')
- .assert.count('li', 3)
- .assert.count('li .commit', 3)
- .assert.count('li .message', 3)
- .end()
- }
-}
+++ /dev/null
-module.exports = {
- 'grid': function (browser) {
- var columns = ['name', 'power']
-
- browser
- .url('http://localhost:8080/examples/grid/')
- .waitForElementVisible('table', 1000)
- .assert.count('th', 2)
- .assert.count('th.active', 0)
- .assert.containsText('th:nth-child(1)', 'Name')
- .assert.containsText('th:nth-child(2)', 'Power')
- assertTable([
- { name: 'Chuck Norris', power: Infinity },
- { name: 'Bruce Lee', power: 9000 },
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
- ])
-
- browser
- .click('th:nth-child(1)')
- .assert.count('th.active:nth-child(1)', 1)
- .assert.count('th.active:nth-child(2)', 0)
- .assert.count('th:nth-child(1) .arrow.dsc', 1)
- .assert.count('th:nth-child(2) .arrow.dsc', 0)
- assertTable([
- { name: 'Jet Li', power: 8000 },
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Chuck Norris', power: Infinity },
- { name: 'Bruce Lee', power: 9000 }
- ])
-
- browser
- .click('th:nth-child(2)')
- .assert.count('th.active:nth-child(1)', 0)
- .assert.count('th.active:nth-child(2)', 1)
- .assert.count('th:nth-child(1) .arrow.dsc', 1)
- .assert.count('th:nth-child(2) .arrow.dsc', 1)
- assertTable([
- { name: 'Chuck Norris', power: Infinity },
- { name: 'Bruce Lee', power: 9000 },
- { name: 'Jet Li', power: 8000 },
- { name: 'Jackie Chan', power: 7000 }
- ])
-
- browser
- .click('th:nth-child(2)')
- .assert.count('th.active:nth-child(1)', 0)
- .assert.count('th.active:nth-child(2)', 1)
- .assert.count('th:nth-child(1) .arrow.dsc', 1)
- .assert.count('th:nth-child(2) .arrow.asc', 1)
- assertTable([
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 },
- { name: 'Bruce Lee', power: 9000 },
- { name: 'Chuck Norris', power: Infinity }
- ])
-
- browser
- .click('th:nth-child(1)')
- .assert.count('th.active:nth-child(1)', 1)
- .assert.count('th.active:nth-child(2)', 0)
- .assert.count('th:nth-child(1) .arrow.asc', 1)
- .assert.count('th:nth-child(2) .arrow.asc', 1)
- assertTable([
- { name: 'Bruce Lee', power: 9000 },
- { name: 'Chuck Norris', power: Infinity },
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
- ])
-
- browser
- .setValue('input[name="query"]', 'j')
- assertTable([
- { name: 'Jackie Chan', power: 7000 },
- { name: 'Jet Li', power: 8000 }
- ])
-
- browser
- .clearValue('input[name="query"]')
- .setValue('input[name="query"]', 'infinity')
- assertTable([
- { name: 'Chuck Norris', power: Infinity }
- ])
-
- browser
- .clearValue('input[name="query"]')
- .assert.count('p', 0)
- .setValue('input[name="query"]', 'stringthatdoesnotexistanywhere')
- .assert.count('p', 1)
-
- browser.end()
-
- function assertTable (data) {
- browser.assert.count('td', data.length * columns.length)
- for (var i = 0; i < data.length; i++) {
- for (var j = 0; j < columns.length; j++) {
- browser.assert.containsText(
- 'tr:nth-child(' + (i + 1) + ') td:nth-child(' + (j + 1) + ')',
- data[i][columns[j]]
- )
- }
- }
- }
- }
-}
+++ /dev/null
-module.exports = {
- 'markdown': function (browser) {
- browser
- .url('http://localhost:8080/examples/markdown/')
- .waitForElementVisible('#editor', 1000)
- .assert.value('textarea', '# hello')
- .assert.hasHTML('#editor div', '<h1 id="hello">hello</h1>')
- .setValue('textarea', '\n## foo\n\n- bar\n- baz')
- // assert the output is not updated yet because of debounce
- .assert.hasHTML('#editor div', '<h1 id="hello">hello</h1>')
- .waitFor(500)
- .assert.hasHTML('#editor div',
- '<h1 id="hello">hello</h1>\n' +
- '<h2 id="foo">foo</h2>\n' +
- '<ul>\n<li>bar</li>\n<li>baz</li>\n</ul>'
- )
- .end()
- }
-}
+++ /dev/null
-module.exports = {
- 'modal': function (browser) {
- browser
- .url('http://localhost:8080/examples/modal/')
- .waitForElementVisible('#app', 1000)
- .assert.elementNotPresent('.modal-mask')
- .click('#show-modal')
- .assert.elementPresent('.modal-mask')
- .assert.elementPresent('.modal-wrapper')
- .assert.elementPresent('.modal-container')
- .waitFor(50)
- .assert.cssClassPresent('.modal-mask', 'modal-enter-active')
- .waitFor(300)
- .assert.cssClassNotPresent('.modal-mask', 'modal-enter-active')
- .assert.containsText('.modal-header h3', 'custom header')
- .assert.containsText('.modal-body', 'default body')
- .assert.containsText('.modal-footer', 'default footer')
- .click('.modal-default-button')
- // should have transition
- .assert.elementPresent('.modal-mask')
- .waitFor(50)
- .assert.cssClassPresent('.modal-mask', 'modal-leave-active')
- .waitFor(300)
- .assert.elementNotPresent('.modal-mask')
- .end()
- }
-}
+++ /dev/null
-/* globals vm */
-module.exports = {
- 'select2': function (browser) {
- browser
- .url('http://localhost:8080/examples/select2/')
- .waitForElementVisible('.select2', 1000)
- .assert.elementPresent('select')
- .assert.containsText('p', 'Selected: 0')
- .assert.containsText('span.select2', 'Select one')
-
- .click('.select2-selection__rendered')
- .assert.count('.select2-results__option', 3)
- .assert.containsText('.select2-results__option:nth-child(1)', 'Select one')
- .assert.containsText('.select2-results__option:nth-child(2)', 'Hello')
- .assert.containsText('.select2-results__option:nth-child(3)', 'World')
- .assert.attributePresent('.select2-results__option:nth-child(1)', 'aria-disabled')
-
- .click('.select2-results__option:nth-child(2)')
- .assert.count('.select2-results__option', 0)
- .assert.containsText('p', 'Selected: 1')
- .assert.containsText('span.select2', 'Hello')
-
- // test dynamic options
- .execute(function () {
- vm.options.push({ id: 3, text: 'Vue' })
- })
- .click('.select2-selection__rendered')
- .assert.count('.select2-results__option', 4)
- .assert.containsText('.select2-results__option:nth-child(1)', 'Select one')
- .assert.containsText('.select2-results__option:nth-child(2)', 'Hello')
- .assert.containsText('.select2-results__option:nth-child(3)', 'World')
- .assert.containsText('.select2-results__option:nth-child(4)', 'Vue')
-
- .click('.select2-results__option:nth-child(4)')
- .assert.count('.select2-results__option', 0)
- .assert.containsText('p', 'Selected: 3')
- .assert.containsText('span.select2', 'Vue')
-
- .execute(function () {
- vm.selected = 2
- })
- .assert.containsText('p', 'Selected: 2')
- .assert.containsText('span.select2', 'World')
- .end()
- }
-}
+++ /dev/null
-/* globals stats, valueToPoint */
-module.exports = {
- 'svg': function (browser) {
- browser
- .url('http://localhost:8080/examples/svg/')
- .waitForElementVisible('svg', 1000)
- .assert.count('g', 1)
- .assert.count('polygon', 1)
- .assert.count('circle', 1)
- .assert.count('text', 6)
- .assert.count('label', 6)
- .assert.count('button', 7)
- .assert.count('input[type="range"]', 6)
- .assert.evaluate(function () {
- var points = stats.map(function (stat, i) {
- var point = valueToPoint(stat.value, i, 6)
- return point.x + ',' + point.y
- }).join(' ')
- return document.querySelector('polygon').attributes[0].value === points
- })
- .click('button.remove')
- .assert.count('text', 5)
- .assert.count('label', 5)
- .assert.count('button', 6)
- .assert.count('input[type="range"]', 5)
- .assert.evaluate(function () {
- var points = stats.map(function (stat, i) {
- var point = valueToPoint(stat.value, i, 5)
- return point.x + ',' + point.y
- }).join(' ')
- return document.querySelector('polygon').attributes[0].value === points
- })
- .setValue('input[name="newlabel"]', 'foo')
- .click('#add > button')
- .assert.count('text', 6)
- .assert.count('label', 6)
- .assert.count('button', 7)
- .assert.count('input[type="range"]', 6)
- .assert.evaluate(function () {
- var points = stats.map(function (stat, i) {
- var point = valueToPoint(stat.value, i, 6)
- return point.x + ',' + point.y
- }).join(' ')
- return document.querySelector('polygon').attributes[0].value === points
- })
- .end()
- }
-}
+++ /dev/null
-module.exports = {
- 'todomvc': function (browser) {
- browser
- .url('http://localhost:8080/examples/todomvc/#test')
- .waitForElementVisible('.todoapp', 1000)
- .assert.notVisible('.main')
- .assert.notVisible('.footer')
- .assert.count('.filters .selected', 1)
- .assert.evaluate(function () {
- return document.querySelector('.filters .selected').textContent === 'All'
- })
-
- createNewItem('test')
- .assert.count('.todo', 1)
- .assert.notVisible('.todo .edit')
- .assert.containsText('.todo label', 'test')
- .assert.containsText('.todo-count strong', '1')
- .assert.checked('.todo .toggle', false)
- .assert.visible('.main')
- .assert.visible('.footer')
- .assert.notVisible('.clear-completed')
- .assert.value('.new-todo', '')
-
- createNewItem('test2')
- .assert.count('.todo', 2)
- .assert.containsText('.todo:nth-child(2) label', 'test2')
- .assert.containsText('.todo-count strong', '2')
-
- // toggle
- browser
- .click('.todo .toggle')
- .assert.count('.todo.completed', 1)
- .assert.cssClassPresent('.todo:nth-child(1)', 'completed')
- .assert.containsText('.todo-count strong', '1')
- .assert.visible('.clear-completed')
-
- createNewItem('test3')
- .assert.count('.todo', 3)
- .assert.containsText('.todo:nth-child(3) label', 'test3')
- .assert.containsText('.todo-count strong', '2')
-
- createNewItem('test4')
- createNewItem('test5')
- .assert.count('.todo', 5)
- .assert.containsText('.todo-count strong', '4')
-
- // toggle more
- browser
- .click('.todo:nth-child(4) .toggle')
- .click('.todo:nth-child(5) .toggle')
- .assert.count('.todo.completed', 3)
- .assert.containsText('.todo-count strong', '2')
-
- // remove
- removeItemAt(1)
- .assert.count('.todo', 4)
- .assert.count('.todo.completed', 2)
- .assert.containsText('.todo-count strong', '2')
- removeItemAt(2)
- .assert.count('.todo', 3)
- .assert.count('.todo.completed', 2)
- .assert.containsText('.todo-count strong', '1')
-
- // remove all
- browser
- .click('.clear-completed')
- .assert.count('.todo', 1)
- .assert.containsText('.todo label', 'test2')
- .assert.count('.todo.completed', 0)
- .assert.containsText('.todo-count strong', '1')
- .assert.notVisible('.clear-completed')
-
- // prepare to test filters
- createNewItem('test')
- createNewItem('test')
- .click('.todo:nth-child(2) .toggle')
- .click('.todo:nth-child(3) .toggle')
-
- // active filter
- browser
- .click('.filters li:nth-child(2) a')
- .assert.count('.todo', 1)
- .assert.count('.todo.completed', 0)
- // add item with filter active
- createNewItem('test')
- .assert.count('.todo', 2)
-
- // completed filter
- browser.click('.filters li:nth-child(3) a')
- .assert.count('.todo', 2)
- .assert.count('.todo.completed', 2)
-
- // filter on page load
- browser.url('http://localhost:8080/examples/todomvc/#active')
- .assert.count('.todo', 2)
- .assert.count('.todo.completed', 0)
- .assert.containsText('.todo-count strong', '2')
-
- // completed on page load
- browser.url('http://localhost:8080/examples/todomvc/#completed')
- .assert.count('.todo', 2)
- .assert.count('.todo.completed', 2)
- .assert.containsText('.todo-count strong', '2')
-
- // toggling with filter active
- browser
- .click('.todo .toggle')
- .assert.count('.todo', 1)
- .click('.filters li:nth-child(2) a')
- .assert.count('.todo', 3)
- .click('.todo .toggle')
- .assert.count('.todo', 2)
-
- // editing triggered by blur
- browser
- .click('.filters li:nth-child(1) a')
- .dblClick('.todo:nth-child(1) label')
- .assert.count('.todo.editing', 1)
- .assert.focused('.todo:nth-child(1) .edit')
- .clearValue('.todo:nth-child(1) .edit')
- .setValue('.todo:nth-child(1) .edit', 'edited!')
- .click('footer') // blur
- .assert.count('.todo.editing', 0)
- .assert.containsText('.todo:nth-child(1) label', 'edited!')
-
- // editing triggered by enter
- browser
- .dblClick('.todo label')
- .enterValue('.todo:nth-child(1) .edit', 'edited again!')
- .assert.count('.todo.editing', 0)
- .assert.containsText('.todo:nth-child(1) label', 'edited again!')
-
- // cancel
- browser
- .dblClick('.todo label')
- .clearValue('.todo:nth-child(1) .edit')
- .setValue('.todo:nth-child(1) .edit', 'edited!')
- .trigger('.todo:nth-child(1) .edit', 'keyup', 27)
- .assert.count('.todo.editing', 0)
- .assert.containsText('.todo:nth-child(1) label', 'edited again!')
-
- // empty value should remove
- browser
- .dblClick('.todo label')
- .enterValue('.todo:nth-child(1) .edit', ' ')
- .assert.count('.todo', 3)
-
- // toggle all
- browser
- .click('.toggle-all')
- .assert.count('.todo.completed', 3)
- .click('.toggle-all')
- .assert.count('.todo:not(.completed)', 3)
- .end()
-
- function createNewItem (text) {
- return browser.enterValue('.new-todo', text)
- }
-
- function removeItemAt (n) {
- return browser
- .moveToElement('.todo:nth-child(' + n + ')', 10, 10)
- .click('.todo:nth-child(' + n + ') .destroy')
- }
- }
-}
+++ /dev/null
-module.exports = {
- 'tree': function (browser) {
- browser
- .url('http://localhost:8080/examples/tree/')
- .waitForElementVisible('li', 1000)
- .assert.count('.item', 12)
- .assert.count('.add', 4)
- .assert.count('.item > ul', 4)
- .assert.notVisible('#demo li ul')
- .assert.containsText('#demo li div span', '[+]')
-
- // expand root
- .click('.bold')
- .assert.visible('#demo ul')
- .assert.evaluate(function () {
- return document.querySelector('#demo li ul').children.length === 4
- })
- .assert.containsText('#demo li div span', '[-]')
- .assert.containsText('#demo > .item > ul > .item:nth-child(1)', 'hello')
- .assert.containsText('#demo > .item > ul > .item:nth-child(2)', 'wat')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', 'child folder')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', '[+]')
-
- // add items to root
- .click('#demo > .item > ul > .add')
- .assert.evaluate(function () {
- return document.querySelector('#demo li ul').children.length === 5
- })
- .assert.containsText('#demo > .item > ul > .item:nth-child(1)', 'hello')
- .assert.containsText('#demo > .item > ul > .item:nth-child(2)', 'wat')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', 'child folder')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', '[+]')
- .assert.containsText('#demo > .item > ul > .item:nth-child(4)', 'new stuff')
-
- // add another item
- .click('#demo > .item > ul > .add')
- .assert.evaluate(function () {
- return document.querySelector('#demo li ul').children.length === 6
- })
- .assert.containsText('#demo > .item > ul > .item:nth-child(1)', 'hello')
- .assert.containsText('#demo > .item > ul > .item:nth-child(2)', 'wat')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', 'child folder')
- .assert.containsText('#demo > .item > ul > .item:nth-child(3)', '[+]')
- .assert.containsText('#demo > .item > ul > .item:nth-child(4)', 'new stuff')
- .assert.containsText('#demo > .item > ul > .item:nth-child(5)', 'new stuff')
-
- .click('#demo ul .bold')
- .assert.visible('#demo ul ul')
- .assert.containsText('#demo ul > .item:nth-child(3)', '[-]')
- .assert.evaluate(function () {
- return document.querySelector('#demo ul ul').children.length === 5
- })
-
- .click('.bold')
- .assert.notVisible('#demo ul')
- .assert.containsText('#demo li div span', '[+]')
- .click('.bold')
- .assert.visible('#demo ul')
- .assert.containsText('#demo li div span', '[-]')
-
- .dblClick('#demo ul > .item div')
- .assert.count('.item', 15)
- .assert.count('.item > ul', 5)
- .assert.containsText('#demo ul > .item:nth-child(1)', '[-]')
- .assert.evaluate(function () {
- var firstItem = document.querySelector('#demo ul > .item:nth-child(1)')
- var ul = firstItem.querySelector('ul')
- return ul.children.length === 2
- })
- .end()
- }
-}
+++ /dev/null
-{
- "env": {
- "jasmine": true
- },
- "globals": {
- "waitForUpdate": true
- }
-}
+++ /dev/null
-beforeEach(() => {
- jasmine.addMatchers({
- // since classList may not be supported in all browsers
- toHaveClass: () => {
- return {
- compare: (el, cls) => {
- const pass = el.classList
- ? el.classList.contains(cls)
- : el.getAttribute('class').split(/\s+/g).indexOf(cls) > -1
- return {
- pass,
- message: `Expected element${pass ? ' ' : ' not '}to have class ${cls}`
- }
- }
- }
- }
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-export default function testObjectOption (name) {
- it(`Options ${name}: should warn non object value`, () => {
- const options = {}
- options[name] = () => {}
- new Vue(options)
- expect(`Invalid value for option "${name}"`).toHaveBeenWarned()
- })
-
- it(`Options ${name}: should not warn valid object value`, () => {
- const options = {}
- options[name] = {}
- new Vue(options)
- expect(`Invalid value for option "${name}"`).not.toHaveBeenWarned()
- })
-}
+++ /dev/null
-import { isEqual } from 'lodash'
-
-beforeEach(() => {
- jasmine.addMatchers({
- // override built-in toEqual because it behaves incorrectly
- // on Vue-observed arrays in Safari
- toEqual: () => {
- return {
- compare: (a, b) => {
- const pass = isEqual(a, b)
- return {
- pass,
- message: `Expected ${a} to equal ${b}`
- }
- }
- }
- }
- })
-})
+++ /dev/null
-function noop () {}
-
-if (typeof console === 'undefined') {
- window.console = {
- warn: noop,
- error: noop
- }
-}
-
-// avoid info messages during test
-console.info = noop
-
-let asserted
-
-function createCompareFn (spy) {
- const hasWarned = msg => {
- var count = spy.calls.count()
- var args
- while (count--) {
- args = spy.calls.argsFor(count)
- if (args.some(containsMsg)) {
- return true
- }
- }
-
- function containsMsg (arg) {
- return arg.toString().indexOf(msg) > -1
- }
- }
-
- return {
- compare: msg => {
- asserted = asserted.concat(msg)
- var warned = Array.isArray(msg)
- ? msg.some(hasWarned)
- : hasWarned(msg)
- return {
- pass: warned,
- message: warned
- ? 'Expected message "' + msg + '" not to have been warned'
- : 'Expected message "' + msg + '" to have been warned'
- }
- }
- }
-}
-
-// define custom matcher for warnings
-beforeEach(() => {
- asserted = []
- spyOn(console, 'warn')
- spyOn(console, 'error')
- jasmine.addMatchers({
- toHaveBeenWarned: () => createCompareFn(console.error),
- toHaveBeenTipped: () => createCompareFn(console.warn)
- })
-})
-
-afterEach(done => {
- const warned = msg => asserted.some(assertedMsg => msg.toString().indexOf(assertedMsg) > -1)
- let count = console.error.calls.count()
- let args
- while (count--) {
- args = console.error.calls.argsFor(count)
- if (!warned(args[0])) {
- done.fail(`Unexpected console.error message: ${args[0]}`)
- return
- }
- }
- done()
-})
+++ /dev/null
-window.triggerEvent = function triggerEvent (target, event, process) {
- var e = document.createEvent('HTMLEvents')
- e.initEvent(event, true, true)
- if (process) process(e)
- target.dispatchEvent(e)
-}
+++ /dev/null
-import VNode from 'core/vdom/vnode'
-
-window.createTextVNode = function (text) {
- return new VNode(undefined, undefined, undefined, text)
-}
+++ /dev/null
-import Vue from 'vue'
-
-// helper for async assertions.
-// Use like this:
-//
-// vm.a = 123
-// waitForUpdate(() => {
-// expect(vm.$el.textContent).toBe('123')
-// vm.a = 234
-// })
-// .then(() => {
-// // more assertions...
-// })
-// .then(done)
-window.waitForUpdate = initialCb => {
- let end
- const queue = initialCb ? [initialCb] : []
-
- function shift () {
- const job = queue.shift()
- if (queue.length) {
- let hasError = false
- try {
- job.wait ? job(shift) : job()
- } catch (e) {
- hasError = true
- const done = queue[queue.length - 1]
- if (done && done.fail) {
- done.fail(e)
- }
- }
- if (!hasError && !job.wait) {
- if (queue.length) {
- Vue.nextTick(shift)
- }
- }
- } else if (job && (job.fail || job === end)) {
- job() // done
- }
- }
-
- Vue.nextTick(() => {
- if (!queue.length || (!end && !queue[queue.length - 1].fail)) {
- throw new Error('waitForUpdate chain is missing .then(done)')
- }
- shift()
- })
-
- const chainer = {
- then: nextCb => {
- queue.push(nextCb)
- return chainer
- },
- thenWaitFor: (wait) => {
- if (typeof wait === 'number') {
- wait = timeout(wait)
- }
- wait.wait = true
- queue.push(wait)
- return chainer
- },
- end: endFn => {
- queue.push(endFn)
- end = endFn
- }
- }
-
- return chainer
-}
-
-function timeout (n) {
- return next => setTimeout(next, n)
-}
+++ /dev/null
-{
- "env": {
- "jasmine": true
- },
- "plugins": ["jasmine"],
- "rules": {
- "jasmine/no-focused-tests": 2
- }
-}
+++ /dev/null
-const hash = require('hash-sum')
-
-module.exports = function (code) {
- const id = hash(this.request) // simulating vue-loader module id injection
- return code.replace('__MODULE_ID__', id)
-}
+++ /dev/null
-import path from 'path'
-import webpack from 'webpack'
-import MemoryFS from 'memory-fs'
-
-export function compileWithWebpack (file, extraConfig, cb) {
- const config = Object.assign({
- entry: path.resolve(__dirname, 'fixtures', file),
- module: {
- rules: [
- {
- test: /\.js$/,
- loader: 'babel-loader'
- },
- {
- test: /async-.*\.js$/,
- loader: require.resolve('./async-loader')
- },
- {
- test: /\.(png|woff2|css)$/,
- loader: 'file-loader',
- options: {
- name: '[name].[ext]'
- }
- }
- ]
- }
- }, extraConfig)
-
- const compiler = webpack(config)
- const fs = new MemoryFS()
- compiler.outputFileSystem = fs
-
- compiler.run((err, stats) => {
- expect(err).toBeFalsy()
- expect(stats.errors).toBeFalsy()
- cb(fs)
- })
-}
+++ /dev/null
-import Vue from '../../../dist/vue.runtime.common.js'
-
-export default context => {
- return new Promise(resolve => {
- context.msg = 'hello'
- resolve(new Vue({
- render (h) {
- return h('div', context.url)
- }
- }))
- })
-}
+++ /dev/null
-module.exports = {
- beforeCreate () {
- this.$vnode.ssrContext._registeredComponents.add('__MODULE_ID__')
- },
- render (h) {
- return h('div', 'async bar')
- }
-}
+++ /dev/null
-// import image and font
-import './test.css'
-import font from './test.woff2'
-import image from './test.png'
-
-module.exports = {
- beforeCreate () {
- this.$vnode.ssrContext._registeredComponents.add('__MODULE_ID__')
- },
- render (h) {
- return h('div', `async ${font} ${image}`)
- }
-}
+++ /dev/null
-import Vue from '../../../dist/vue.runtime.common.js'
-
-const app = {
- name: 'app',
- props: ['id'],
- serverCacheKey: props => props.id,
- render (h) {
- return h('div', '/test')
- }
-}
-
-export default () => {
- return Promise.resolve(new Vue({
- render: h => h(app, { props: { id: 1 }})
- }))
-}
+++ /dev/null
-throw new Error('foo')
+++ /dev/null
-import Vue from '../../../dist/vue.runtime.common.js'
-
-function createRegisterFn (id) {
- return function (context) {
- context = context || this.$vnode.ssrContext
- context.registered.push(id)
- }
-}
-
-function addHooks (comp) {
- const hook = createRegisterFn(comp.name)
- return Object.assign(comp, {
- _ssrRegister: hook,
- beforeCreate: hook
- })
-}
-
-const grandchild = addHooks({
- name: 'grandchild',
- props: ['id'],
- serverCacheKey: props => props.id,
- render (h) {
- return h('div', '/test')
- }
-})
-
-const child = addHooks({
- name: 'child',
- props: ['id'],
- serverCacheKey: props => props.id,
- render (h) {
- return h(grandchild, { props: { id: this.id }})
- }
-})
-
-const app = addHooks({
- name: 'app',
- props: ['id'],
- serverCacheKey: props => props.id,
- render (h) {
- return h(child, { props: { id: this.id }})
- }
-})
-
-export default () => {
- return Promise.resolve(new Vue({
- render: h => h(app, { props: { id: 1 }})
- }))
-}
+++ /dev/null
-export default () => {
- return Promise.reject(new Error('foo'))
-}
+++ /dev/null
-import Vue from '../../../dist/vue.runtime.common.js'
-
-// async component!
-const Foo = () => import('./async-foo')
-const Bar = () => import('./async-bar') // eslint-disable-line
-
-export default context => {
- return new Promise(resolve => {
- context.msg = 'hello'
- const vm = new Vue({
- render (h) {
- return h('div', [
- context.url,
- h(Foo)
- ])
- }
- })
-
- // simulate router.onReady
- Foo().then(comp => {
- // resolve now to make the render sync
- Foo.resolved = Vue.extend(comp)
- resolve(vm)
- })
- })
-}
+++ /dev/null
-{
- "spec_dir": "test/ssr",
- "spec_files": [
- "*.spec.js"
- ],
- "helpers": [
- "../../node_modules/babel-register/lib/node.js"
- ]
-}
+++ /dev/null
-import Vue from '../../dist/vue.runtime.common.js'
-import renderToString from '../../packages/vue-server-renderer/basic'
-
-describe('SSR: basicRenderer', () => {
- it('should work', done => {
- renderToString(new Vue({
- template: `
- <div>
- <p class="hi">yoyo</p>
- <div id="ho" :class="{ red: isRed }"></div>
- <span>{{ test }}</span>
- <input :value="test">
- <img :src="imageUrl">
- <test></test>
- <test-async></test-async>
- </div>
- `,
- data: {
- test: 'hi',
- isRed: true,
- imageUrl: 'https://vuejs.org/images/logo.png'
- },
- components: {
- test: {
- render () {
- return this.$createElement('div', { class: ['a'] }, 'test')
- }
- },
- testAsync (resolve) {
- resolve({
- render () {
- return this.$createElement('span', { class: ['b'] }, 'testAsync')
- }
- })
- }
- }
- }), (err, result) => {
- expect(err).toBeNull()
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<p class="hi">yoyo</p> ' +
- '<div id="ho" class="red"></div> ' +
- '<span>hi</span> ' +
- '<input value="hi"> ' +
- '<img src="https://vuejs.org/images/logo.png"> ' +
- '<div class="a">test</div> ' +
- '<span class="b">testAsync</span>' +
- '</div>'
- )
- done()
- })
- })
-
- // #5941
- it('should work peoperly when accessing $ssrContext in root component', done => {
- let ssrContext
- renderToString(new Vue({
- template: `
- <div></div>
- `,
- created () {
- ssrContext = this.$ssrContext
- }
- }), (err, result) => {
- expect(err).toBeNull()
- expect(ssrContext).toBeUndefined()
- done()
- })
- })
-})
+++ /dev/null
-import LRU from 'lru-cache'
-import { compileWithWebpack } from './compile-with-webpack'
-import { createBundleRenderer } from '../../packages/vue-server-renderer'
-import VueSSRServerPlugin from '../../packages/vue-server-renderer/server-plugin'
-
-export function createRenderer (file, options, cb) {
- if (typeof options === 'function') {
- cb = options
- options = undefined
- }
- const asBundle = !!(options && options.asBundle)
- if (options) delete options.asBundle
-
- compileWithWebpack(file, {
- target: 'node',
- devtool: asBundle ? '#source-map' : false,
- output: {
- path: '/',
- filename: 'bundle.js',
- libraryTarget: 'commonjs2'
- },
- externals: [require.resolve('../../dist/vue.runtime.common.js')],
- plugins: asBundle
- ? [new VueSSRServerPlugin()]
- : []
- }, fs => {
- const bundle = asBundle
- ? JSON.parse(fs.readFileSync('/vue-ssr-server-bundle.json', 'utf-8'))
- : fs.readFileSync('/bundle.js', 'utf-8')
- const renderer = createBundleRenderer(bundle, options)
- cb(renderer)
- })
-}
-
-describe('SSR: bundle renderer', () => {
- createAssertions(true)
- createAssertions(false)
-})
-
-function createAssertions (runInNewContext) {
- it('renderToString', done => {
- createRenderer('app.js', { runInNewContext }, renderer => {
- const context = { url: '/test' }
- renderer.renderToString(context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toBe('<div data-server-rendered="true">/test</div>')
- expect(context.msg).toBe('hello')
- done()
- })
- })
- })
-
- it('renderToStream', done => {
- createRenderer('app.js', { runInNewContext }, renderer => {
- const context = { url: '/test' }
- const stream = renderer.renderToStream(context)
- let res = ''
- stream.on('data', chunk => {
- res += chunk.toString()
- })
- stream.on('end', () => {
- expect(res).toBe('<div data-server-rendered="true">/test</div>')
- expect(context.msg).toBe('hello')
- done()
- })
- })
- })
-
- it('renderToString catch error', done => {
- createRenderer('error.js', { runInNewContext }, renderer => {
- renderer.renderToString(err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToString catch Promise rejection', done => {
- createRenderer('promise-rejection.js', { runInNewContext }, renderer => {
- renderer.renderToString(err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToStream catch error', done => {
- createRenderer('error.js', { runInNewContext }, renderer => {
- const stream = renderer.renderToStream()
- stream.on('error', err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToStream catch Promise rejection', done => {
- createRenderer('promise-rejection.js', { runInNewContext }, renderer => {
- const stream = renderer.renderToStream()
- stream.on('error', err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('render with cache (get/set)', done => {
- const cache = {}
- const get = jasmine.createSpy('get')
- const set = jasmine.createSpy('set')
- const options = {
- runInNewContext,
- cache: {
- // async
- get: (key, cb) => {
- setTimeout(() => {
- get(key)
- cb(cache[key])
- }, 0)
- },
- set: (key, val) => {
- set(key, val)
- cache[key] = val
- }
- }
- }
- createRenderer('cache.js', options, renderer => {
- const expected = '<div data-server-rendered="true">/test</div>'
- const key = 'app::1'
- renderer.renderToString((err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(get).toHaveBeenCalledWith(key)
- const setArgs = set.calls.argsFor(0)
- expect(setArgs[0]).toBe(key)
- expect(setArgs[1].html).toBe(expected)
- expect(cache[key].html).toBe(expected)
- renderer.renderToString((err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(get.calls.count()).toBe(2)
- expect(set.calls.count()).toBe(1)
- done()
- })
- })
- })
- })
-
- it('render with cache (get/set/has)', done => {
- const cache = {}
- const has = jasmine.createSpy('has')
- const get = jasmine.createSpy('get')
- const set = jasmine.createSpy('set')
- const options = {
- runInNewContext,
- cache: {
- // async
- has: (key, cb) => {
- has(key)
- cb(!!cache[key])
- },
- // sync
- get: key => {
- get(key)
- return cache[key]
- },
- set: (key, val) => {
- set(key, val)
- cache[key] = val
- }
- }
- }
- createRenderer('cache.js', options, renderer => {
- const expected = '<div data-server-rendered="true">/test</div>'
- const key = 'app::1'
- renderer.renderToString((err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(has).toHaveBeenCalledWith(key)
- expect(get).not.toHaveBeenCalled()
- const setArgs = set.calls.argsFor(0)
- expect(setArgs[0]).toBe(key)
- expect(setArgs[1].html).toBe(expected)
- expect(cache[key].html).toBe(expected)
- renderer.renderToString((err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(has.calls.count()).toBe(2)
- expect(get.calls.count()).toBe(1)
- expect(set.calls.count()).toBe(1)
- done()
- })
- })
- })
- })
-
- it('render with cache (nested)', done => {
- const cache = LRU({ maxAge: Infinity })
- spyOn(cache, 'get').and.callThrough()
- spyOn(cache, 'set').and.callThrough()
- const options = {
- cache,
- runInNewContext
- }
- createRenderer('nested-cache.js', options, renderer => {
- const expected = '<div data-server-rendered="true">/test</div>'
- const key = 'app::1'
- const context1 = { registered: [] }
- const context2 = { registered: [] }
- renderer.renderToString(context1, (err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(cache.set.calls.count()).toBe(3) // 3 nested components cached
- const cached = cache.get(key)
- expect(cached.html).toBe(expected)
- expect(cache.get.calls.count()).toBe(1)
-
- // assert component usage registration for nested children
- expect(context1.registered).toEqual(['app', 'child', 'grandchild'])
-
- renderer.renderToString(context2, (err, res) => {
- expect(err).toBeNull()
- expect(res).toBe(expected)
- expect(cache.set.calls.count()).toBe(3) // no new cache sets
- expect(cache.get.calls.count()).toBe(2) // 1 get for root
-
- expect(context2.registered).toEqual(['app', 'child', 'grandchild'])
- done()
- })
- })
- })
- })
-
- it('renderToString (bundle format with code split)', done => {
- createRenderer('split.js', { runInNewContext, asBundle: true }, renderer => {
- const context = { url: '/test' }
- renderer.renderToString(context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toBe('<div data-server-rendered="true">/test<div>async test.woff2 test.png</div></div>')
- done()
- })
- })
- })
-
- it('renderToStream (bundle format with code split)', done => {
- createRenderer('split.js', { runInNewContext, asBundle: true }, renderer => {
- const context = { url: '/test' }
- const stream = renderer.renderToStream(context)
- let res = ''
- stream.on('data', chunk => {
- res += chunk.toString()
- })
- stream.on('end', () => {
- expect(res).toBe('<div data-server-rendered="true">/test<div>async test.woff2 test.png</div></div>')
- done()
- })
- })
- })
-
- it('renderToString catch error (bundle format with source map)', done => {
- createRenderer('error.js', { runInNewContext, asBundle: true }, renderer => {
- renderer.renderToString(err => {
- expect(err.stack).toContain('test/ssr/fixtures/error.js:1:6')
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToString catch error (bundle format with source map)', done => {
- createRenderer('error.js', { runInNewContext, asBundle: true }, renderer => {
- const stream = renderer.renderToStream()
- stream.on('error', err => {
- expect(err.stack).toContain('test/ssr/fixtures/error.js:1:6')
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToString return Promise', done => {
- createRenderer('app.js', { runInNewContext }, renderer => {
- const context = { url: '/test' }
- renderer.renderToString(context).then(res => {
- expect(res).toBe('<div data-server-rendered="true">/test</div>')
- expect(context.msg).toBe('hello')
- done()
- })
- })
- })
-
- it('renderToString return Promise (error)', done => {
- createRenderer('error.js', { runInNewContext }, renderer => {
- renderer.renderToString().catch(err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-
- it('renderToString return Promise (Promise rejection)', done => {
- createRenderer('promise-rejection.js', { runInNewContext }, renderer => {
- renderer.renderToString().catch(err => {
- expect(err.message).toBe('foo')
- done()
- })
- })
- })
-}
+++ /dev/null
-import Vue from '../../dist/vue.runtime.common.js'
-import { createRenderer } from '../../packages/vue-server-renderer'
-const { renderToStream } = createRenderer()
-
-describe('SSR: renderToStream', () => {
- it('should render to a stream', done => {
- const stream = renderToStream(new Vue({
- template: `
- <div>
- <p class="hi">yoyo</p>
- <div id="ho" :class="[testClass, { red: isRed }]"></div>
- <span>{{ test }}</span>
- <input :value="test">
- <b-comp></b-comp>
- <c-comp></c-comp>
- </div>
- `,
- data: {
- test: 'hi',
- isRed: true,
- testClass: 'a'
- },
- components: {
- bComp (resolve) {
- return resolve({
- render (h) {
- return h('test-async-2')
- },
- components: {
- testAsync2 (resolve) {
- return resolve({
- created () { this.$parent.$parent.testClass = 'b' },
- render (h) {
- return h('div', { class: [this.$parent.$parent.testClass] }, 'test')
- }
- })
- }
- }
- })
- },
- cComp: {
- render (h) {
- return h('div', { class: [this.$parent.testClass] }, 'test')
- }
- }
- }
- }))
- let res = ''
- stream.on('data', chunk => {
- res += chunk
- })
- stream.on('end', () => {
- expect(res).toContain(
- '<div data-server-rendered="true">' +
- '<p class="hi">yoyo</p> ' +
- '<div id="ho" class="a red"></div> ' +
- '<span>hi</span> ' +
- '<input value="hi"> ' +
- '<div class="b">test</div> ' +
- '<div class="b">test</div>' +
- '</div>'
- )
- done()
- })
- })
-
- it('should catch error', done => {
- Vue.config.silent = true
- const stream = renderToStream(new Vue({
- render () {
- throw new Error('oops')
- }
- }))
- stream.on('error', err => {
- expect(err.toString()).toMatch(/oops/)
- Vue.config.silent = false
- done()
- })
- stream.on('data', _ => _)
- })
-
- it('should not mingle two components', done => {
- const padding = (new Array(20000)).join('x')
- const component1 = new Vue({
- template: `<div>${padding}<div></div></div>`,
- _scopeId: '_component1'
- })
- const component2 = new Vue({
- template: `<div></div>`,
- _scopeId: '_component2'
- })
- var stream1 = renderToStream(component1)
- var stream2 = renderToStream(component2)
- var res = ''
- stream1.on('data', (text) => {
- res += text.toString('utf-8').replace(/x/g, '')
- })
- stream1.on('end', () => {
- expect(res).not.toContain('_component2')
- done()
- })
- stream1.read(1)
- stream2.read(1)
- })
-})
+++ /dev/null
-import Vue from '../../dist/vue.runtime.common.js'
-import VM from 'vm'
-import { createRenderer } from '../../packages/vue-server-renderer'
-const { renderToString } = createRenderer()
-
-describe('SSR: renderToString', () => {
- it('static attributes', done => {
- renderVmWithOptions({
- template: '<div id="foo" bar="123"></div>'
- }, result => {
- expect(result).toContain('<div id="foo" bar="123" data-server-rendered="true"></div>')
- done()
- })
- })
-
- it('unary tags', done => {
- renderVmWithOptions({
- template: '<input value="123">'
- }, result => {
- expect(result).toContain('<input value="123" data-server-rendered="true">')
- done()
- })
- })
-
- it('dynamic attributes', done => {
- renderVmWithOptions({
- template: '<div qux="quux" :id="foo" :bar="baz"></div>',
- data: {
- foo: 'hi',
- baz: 123
- }
- }, result => {
- expect(result).toContain('<div qux="quux" id="hi" bar="123" data-server-rendered="true"></div>')
- done()
- })
- })
-
- it('static class', done => {
- renderVmWithOptions({
- template: '<div class="foo bar"></div>'
- }, result => {
- expect(result).toContain('<div data-server-rendered="true" class="foo bar"></div>')
- done()
- })
- })
-
- it('dynamic class', done => {
- renderVmWithOptions({
- template: '<div class="foo bar" :class="[a, { qux: hasQux, quux: hasQuux }]"></div>',
- data: {
- a: 'baz',
- hasQux: true,
- hasQuux: false
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true" class="foo bar baz qux"></div>')
- done()
- })
- })
-
- it('custom component class', done => {
- renderVmWithOptions({
- template: '<div><cmp class="cmp"></cmp></div>',
- components: {
- cmp: {
- render: h => h('div', 'test')
- }
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><div class="cmp">test</div></div>')
- done()
- })
- })
-
- it('nested component class', done => {
- renderVmWithOptions({
- template: '<cmp class="outer" :class="cls"></cmp>',
- data: { cls: { 'success': 1 }},
- components: {
- cmp: {
- render: h => h('div', [h('nested', { staticClass: 'nested', 'class': { 'error': 1 }})]),
- components: {
- nested: {
- render: h => h('div', { staticClass: 'inner' }, 'test')
- }
- }
- }
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true" class="outer success">' +
- '<div class="inner nested error">test</div>' +
- '</div>')
- done()
- })
- })
-
- it('dynamic style', done => {
- renderVmWithOptions({
- template: '<div style="background-color:black" :style="{ fontSize: fontSize + \'px\', color: color }"></div>',
- data: {
- fontSize: 14,
- color: 'red'
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="background-color:black;font-size:14px;color:red;"></div>'
- )
- done()
- })
- })
-
- it('dynamic string style', done => {
- renderVmWithOptions({
- template: '<div :style="style"></div>',
- data: {
- style: 'color:red'
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="color:red;"></div>'
- )
- done()
- })
- })
-
- it('auto-prefixed style value as array', done => {
- renderVmWithOptions({
- template: '<div :style="style"></div>',
- data: {
- style: {
- display: ['-webkit-box', '-ms-flexbox', 'flex']
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="display:-webkit-box;display:-ms-flexbox;display:flex;"></div>'
- )
- done()
- })
- })
-
- it('custom component style', done => {
- renderVmWithOptions({
- template: '<section><comp :style="style"></comp></section>',
- data: {
- style: 'color:red'
- },
- components: {
- comp: {
- template: '<div></div>'
- }
- }
- }, result => {
- expect(result).toContain(
- '<section data-server-rendered="true"><div style="color:red;"></div></section>'
- )
- done()
- })
- })
-
- it('nested custom component style', done => {
- renderVmWithOptions({
- template: '<comp style="color: blue" :style="style"></comp>',
- data: {
- style: 'color:red'
- },
- components: {
- comp: {
- template: '<nested style="text-align: left;" :style="{fontSize:\'520rem\'}"></nested>',
- components: {
- nested: {
- template: '<div></div>'
- }
- }
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="text-align:left;font-size:520rem;color:red;"></div>'
- )
- done()
- })
- })
-
- it('component style not passed to child', done => {
- renderVmWithOptions({
- template: '<comp :style="style"></comp>',
- data: {
- style: 'color:red'
- },
- components: {
- comp: {
- template: '<div><div></div></div>'
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="color:red;"><div></div></div>'
- )
- done()
- })
- })
-
- it('component style not passed to slot', done => {
- renderVmWithOptions({
- template: '<comp :style="style"><span style="color:black"></span></comp>',
- data: {
- style: 'color:red'
- },
- components: {
- comp: {
- template: '<div><slot></slot></div>'
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" style="color:red;"><span style="color:black;"></span></div>'
- )
- done()
- })
- })
-
- it('attrs merging on components', done => {
- const Test = {
- render: h => h('div', {
- attrs: { id: 'a' }
- })
- }
- renderVmWithOptions({
- render: h => h(Test, {
- attrs: { id: 'b', name: 'c' }
- })
- }, res => {
- expect(res).toContain(
- '<div id="b" data-server-rendered="true" name="c"></div>'
- )
- done()
- })
- })
-
- it('domProps merging on components', done => {
- const Test = {
- render: h => h('div', {
- domProps: { innerHTML: 'a' }
- })
- }
- renderVmWithOptions({
- render: h => h(Test, {
- domProps: { innerHTML: 'b', value: 'c' }
- })
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" value="c">b</div>'
- )
- done()
- })
- })
-
- it('v-show directive render', done => {
- renderVmWithOptions({
- template: '<div v-show="false"><span>inner</span></div>'
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" style="display:none;"><span>inner</span></div>'
- )
- done()
- })
- })
-
- it('v-show directive merge with style', done => {
- renderVmWithOptions({
- template: '<div :style="[{lineHeight: 1}]" v-show="false"><span>inner</span></div>'
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" style="line-height:1;display:none;"><span>inner</span></div>'
- )
- done()
- })
- })
-
- it('v-show directive not passed to child', done => {
- renderVmWithOptions({
- template: '<foo v-show="false"></foo>',
- components: {
- foo: {
- template: '<div><span>inner</span></div>'
- }
- }
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" style="display:none;"><span>inner</span></div>'
- )
- done()
- })
- })
-
- it('v-show directive not passed to slot', done => {
- renderVmWithOptions({
- template: '<foo v-show="false"><span>inner</span></foo>',
- components: {
- foo: {
- template: '<div><slot></slot></div>'
- }
- }
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" style="display:none;"><span>inner</span></div>'
- )
- done()
- })
- })
-
- it('v-show directive merging on components', done => {
- renderVmWithOptions({
- template: '<foo v-show="false"></foo>',
- components: {
- foo: {
- render: h => h('bar', {
- directives: [{
- name: 'show',
- value: true
- }]
- }),
- components: {
- bar: {
- render: h => h('div', 'inner')
- }
- }
- }
- }
- }, res => {
- expect(res).toContain(
- '<div data-server-rendered="true" style="display:none;">inner</div>'
- )
- done()
- })
- })
-
- it('text interpolation', done => {
- renderVmWithOptions({
- template: '<div>{{ foo }} side {{ bar }}</div>',
- data: {
- foo: 'server',
- bar: '<span>rendering</span>'
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true">server side <span>rendering</span></div>')
- done()
- })
- })
-
- it('v-html on root', done => {
- renderVmWithOptions({
- template: '<div v-html="text"></div>',
- data: {
- text: '<span>foo</span>'
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><span>foo</span></div>')
- done()
- })
- })
-
- it('v-text on root', done => {
- renderVmWithOptions({
- template: '<div v-text="text"></div>',
- data: {
- text: '<span>foo</span>'
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><span>foo</span></div>')
- done()
- })
- })
-
- it('v-html', done => {
- renderVmWithOptions({
- template: '<div><div v-html="text"></div></div>',
- data: {
- text: '<span>foo</span>'
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><div><span>foo</span></div></div>')
- done()
- })
- })
-
- it('v-html with null value', done => {
- renderVmWithOptions({
- template: '<div><div v-html="text"></div></div>',
- data: {
- text: null
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><div></div></div>')
- done()
- })
- })
-
- it('v-text', done => {
- renderVmWithOptions({
- template: '<div><div v-text="text"></div></div>',
- data: {
- text: '<span>foo</span>'
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><div><span>foo</span></div></div>')
- done()
- })
- })
-
- it('v-text with null value', done => {
- renderVmWithOptions({
- template: '<div><div v-text="text"></div></div>',
- data: {
- text: null
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><div></div></div>')
- done()
- })
- })
-
- it('child component (hoc)', done => {
- renderVmWithOptions({
- template: '<child class="foo" :msg="msg"></child>',
- data: {
- msg: 'hello'
- },
- components: {
- child: {
- props: ['msg'],
- data () {
- return { name: 'bar' }
- },
- render () {
- const h = this.$createElement
- return h('div', { class: ['bar'] }, [`${this.msg} ${this.name}`])
- }
- }
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true" class="foo bar">hello bar</div>')
- done()
- })
- })
-
- it('has correct lifecycle during render', done => {
- let lifecycleCount = 1
- renderVmWithOptions({
- template: '<div><span>{{ val }}</span><test></test></div>',
- data: {
- val: 'hi'
- },
- beforeCreate () {
- expect(lifecycleCount++).toBe(1)
- },
- created () {
- this.val = 'hello'
- expect(this.val).toBe('hello')
- expect(lifecycleCount++).toBe(2)
- },
- components: {
- test: {
- beforeCreate () {
- expect(lifecycleCount++).toBe(3)
- },
- created () {
- expect(lifecycleCount++).toBe(4)
- },
- render () {
- expect(lifecycleCount++).toBeGreaterThan(4)
- return this.$createElement('span', { class: ['b'] }, 'testAsync')
- }
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<span>hello</span>' +
- '<span class="b">testAsync</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('computed properties', done => {
- renderVmWithOptions({
- template: '<div>{{ b }}</div>',
- data: {
- a: {
- b: 1
- }
- },
- computed: {
- b () {
- return this.a.b + 1
- }
- },
- created () {
- this.a.b = 2
- expect(this.b).toBe(3)
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true">3</div>')
- done()
- })
- })
-
- it('renders async component', done => {
- renderVmWithOptions({
- template: `
- <div>
- <test-async></test-async>
- </div>
- `,
- components: {
- testAsync (resolve) {
- setTimeout(() => resolve({
- render () {
- return this.$createElement('span', { class: ['b'] }, 'testAsync')
- }
- }), 1)
- }
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><span class="b">testAsync</span></div>')
- done()
- })
- })
-
- it('renders async component (Promise, nested)', done => {
- const Foo = () => Promise.resolve({
- render: h => h('div', [h('span', 'foo'), h(Bar)])
- })
- const Bar = () => ({
- component: Promise.resolve({
- render: h => h('span', 'bar')
- })
- })
- renderVmWithOptions({
- render: h => h(Foo)
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span><span>bar</span></div>`)
- done()
- })
- })
-
- it('renders async component (ES module)', done => {
- const Foo = () => Promise.resolve({
- __esModule: true,
- default: {
- render: h => h('div', [h('span', 'foo'), h(Bar)])
- }
- })
- const Bar = () => ({
- component: Promise.resolve({
- __esModule: true,
- default: {
- render: h => h('span', 'bar')
- }
- })
- })
- renderVmWithOptions({
- render: h => h(Foo)
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span><span>bar</span></div>`)
- done()
- })
- })
-
- it('renders async component (hoc)', done => {
- renderVmWithOptions({
- template: '<test-async></test-async>',
- components: {
- testAsync: () => Promise.resolve({
- render () {
- return this.$createElement('span', { class: ['b'] }, 'testAsync')
- }
- })
- }
- }, result => {
- expect(result).toContain('<span data-server-rendered="true" class="b">testAsync</span>')
- done()
- })
- })
-
- it('renders async component (functional, single node)', done => {
- renderVmWithOptions({
- template: `
- <div>
- <test-async></test-async>
- </div>
- `,
- components: {
- testAsync (resolve) {
- setTimeout(() => resolve({
- functional: true,
- render (h) {
- return h('span', { class: ['b'] }, 'testAsync')
- }
- }), 1)
- }
- }
- }, result => {
- expect(result).toContain('<div data-server-rendered="true"><span class="b">testAsync</span></div>')
- done()
- })
- })
-
- it('renders async component (functional, multiple nodes)', done => {
- renderVmWithOptions({
- template: `
- <div>
- <test-async></test-async>
- </div>
- `,
- components: {
- testAsync (resolve) {
- setTimeout(() => resolve({
- functional: true,
- render (h) {
- return [
- h('span', { class: ['a'] }, 'foo'),
- h('span', { class: ['b'] }, 'bar')
- ]
- }
- }), 1)
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<span class="a">foo</span>' +
- '<span class="b">bar</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('should catch async component error', done => {
- Vue.config.silent = true
- renderToString(new Vue({
- template: '<test-async></test-async>',
- components: {
- testAsync: () => Promise.resolve({
- render () {
- throw new Error('foo')
- }
- })
- }
- }), (err, result) => {
- Vue.config.silent = false
- expect(err).toBeTruthy()
- expect(result).toBeUndefined()
- done()
- })
- })
-
- it('everything together', done => {
- renderVmWithOptions({
- template: `
- <div>
- <p class="hi">yoyo</p>
- <div id="ho" :class="{ red: isRed }"></div>
- <span>{{ test }}</span>
- <input :value="test">
- <img :src="imageUrl">
- <test></test>
- <test-async></test-async>
- </div>
- `,
- data: {
- test: 'hi',
- isRed: true,
- imageUrl: 'https://vuejs.org/images/logo.png'
- },
- components: {
- test: {
- render () {
- return this.$createElement('div', { class: ['a'] }, 'test')
- }
- },
- testAsync (resolve) {
- resolve({
- render () {
- return this.$createElement('span', { class: ['b'] }, 'testAsync')
- }
- })
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<p class="hi">yoyo</p> ' +
- '<div id="ho" class="red"></div> ' +
- '<span>hi</span> ' +
- '<input value="hi"> ' +
- '<img src="https://vuejs.org/images/logo.png"> ' +
- '<div class="a">test</div> ' +
- '<span class="b">testAsync</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('normal attr', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span :test="'ok'">hello</span>
- <span :test="null">hello</span>
- <span :test="false">hello</span>
- <span :test="true">hello</span>
- <span :test="0">hello</span>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<span test="ok">hello</span> ' +
- '<span>hello</span> ' +
- '<span>hello</span> ' +
- '<span test="true">hello</span> ' +
- '<span test="0">hello</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('enumerated attr', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span :draggable="true">hello</span>
- <span :draggable="'ok'">hello</span>
- <span :draggable="null">hello</span>
- <span :draggable="false">hello</span>
- <span :draggable="''">hello</span>
- <span :draggable="'false'">hello</span>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<span draggable="true">hello</span> ' +
- '<span draggable="true">hello</span> ' +
- '<span draggable="false">hello</span> ' +
- '<span draggable="false">hello</span> ' +
- '<span draggable="true">hello</span> ' +
- '<span draggable="false">hello</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('boolean attr', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span :disabled="true">hello</span>
- <span :disabled="'ok'">hello</span>
- <span :disabled="null">hello</span>
- <span :disabled="''">hello</span>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true">' +
- '<span disabled="disabled">hello</span> ' +
- '<span disabled="disabled">hello</span> ' +
- '<span>hello</span> ' +
- '<span disabled="disabled">hello</span>' +
- '</div>'
- )
- done()
- })
- })
-
- it('v-bind object', done => {
- renderVmWithOptions({
- data: {
- test: { id: 'a', class: ['a', 'b'], value: 'c' }
- },
- template: '<input v-bind="test">'
- }, result => {
- expect(result).toContain('<input id="a" data-server-rendered="true" value="c" class="a b">')
- done()
- })
- })
-
- it('custom directives', done => {
- const renderer = createRenderer({
- directives: {
- 'class-prefixer': (node, dir) => {
- if (node.data.class) {
- node.data.class = `${dir.value}-${node.data.class}`
- }
- if (node.data.staticClass) {
- node.data.staticClass = `${dir.value}-${node.data.staticClass}`
- }
- }
- }
- })
- renderer.renderToString(new Vue({
- render () {
- const h = this.$createElement
- return h('p', {
- class: 'class1',
- staticClass: 'class2',
- directives: [{
- name: 'class-prefixer',
- value: 'my'
- }]
- }, ['hello world'])
- }
- }), (err, result) => {
- expect(err).toBeNull()
- expect(result).toContain('<p data-server-rendered="true" class="my-class2 my-class1">hello world</p>')
- done()
- })
- })
-
- it('_scopeId', done => {
- renderVmWithOptions({
- _scopeId: '_v-parent',
- template: '<div id="foo"><p><child></child></p></div>',
- components: {
- child: {
- _scopeId: '_v-child',
- render () {
- const h = this.$createElement
- return h('div', null, [h('span', null, ['foo'])])
- }
- }
- }
- }, result => {
- expect(result).toContain(
- '<div id="foo" data-server-rendered="true" _v-parent>' +
- '<p _v-parent>' +
- '<div _v-child _v-parent><span _v-child>foo</span></div>' +
- '</p>' +
- '</div>'
- )
- done()
- })
- })
-
- it('_scopeId on slot content', done => {
- renderVmWithOptions({
- _scopeId: '_v-parent',
- template: '<div><child><p>foo</p></child></div>',
- components: {
- child: {
- _scopeId: '_v-child',
- render () {
- const h = this.$createElement
- return h('div', null, this.$slots.default)
- }
- }
- }
- }, result => {
- expect(result).toContain(
- '<div data-server-rendered="true" _v-parent>' +
- '<div _v-child _v-parent><p _v-child _v-parent>foo</p></div>' +
- '</div>'
- )
- done()
- })
- })
-
- it('comment nodes', done => {
- renderVmWithOptions({
- template: '<div><transition><div v-if="false"></div></transition></div>'
- }, result => {
- expect(result).toContain(`<div data-server-rendered="true"><!----></div>`)
- done()
- })
- })
-
- it('should catch error', done => {
- Vue.config.silent = true
- renderToString(new Vue({
- render () {
- throw new Error('oops')
- }
- }), err => {
- expect(err instanceof Error).toBe(true)
- Vue.config.silent = false
- done()
- })
- })
-
- it('default value Foreign Function', () => {
- const FunctionConstructor = VM.runInNewContext('Function')
- const func = () => 123
- const vm = new Vue({
- props: {
- a: {
- type: FunctionConstructor,
- default: func
- }
- },
- propsData: {
- a: undefined
- }
- })
- expect(vm.a).toBe(func)
- })
-
- it('should prevent xss in attributes', done => {
- renderVmWithOptions({
- data: {
- xss: '"><script>alert(1)</script>'
- },
- template: `
- <div>
- <a :title="xss" :style="{ color: xss }" :class="[xss]">foo</a>
- </div>
- `
- }, res => {
- expect(res).not.toContain(`<script>alert(1)</script>`)
- done()
- })
- })
-
- it('should prevent script xss with v-bind object syntax + array value', done => {
- renderVmWithOptions({
- data: {
- test: ['"><script>alert(1)</script><!--"']
- },
- template: `<div v-bind="{ test }"></div>`
- }, res => {
- expect(res).not.toContain(`<script>alert(1)</script>`)
- done()
- })
- })
-
- it('v-if', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span v-if="true">foo</span>
- <span v-if="false">bar</span>
- </div>
- `
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span> <!----></div>`)
- done()
- })
- })
-
- it('v-for', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span>foo</span>
- <span v-for="i in 2">{{ i }}</span>
- </div>
- `
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span> <span>1</span><span>2</span></div>`)
- done()
- })
- })
-
- it('template v-if', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span>foo</span>
- <template v-if="true">
- <span>foo</span> bar <span>baz</span>
- </template>
- </div>
- `
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span> <span>foo</span> bar <span>baz</span></div>`)
- done()
- })
- })
-
- it('template v-for', done => {
- renderVmWithOptions({
- template: `
- <div>
- <span>foo</span>
- <template v-for="i in 2">
- <span>{{ i }}</span><span>bar</span>
- </template>
- </div>
- `
- }, res => {
- expect(res).toContain(`<div data-server-rendered="true"><span>foo</span> <span>1</span><span>bar</span><span>2</span><span>bar</span></div>`)
- done()
- })
- })
-
- it('with inheritAttrs: false + $attrs', done => {
- renderVmWithOptions({
- template: `<foo id="a"/>`,
- components: {
- foo: {
- inheritAttrs: false,
- template: `<div><div v-bind="$attrs"></div></div>`
- }
- }
- }, res => {
- expect(res).toBe(`<div data-server-rendered="true"><div id="a"></div></div>`)
- done()
- })
- })
-
- it('should escape static strings', done => {
- renderVmWithOptions({
- template: `<div><foo></div>`
- }, res => {
- expect(res).toBe(`<div data-server-rendered="true"><foo></div>`)
- done()
- })
- })
-
- it('should not cache computed properties', done => {
- renderVmWithOptions({
- template: `<div>{{ foo }}</div>`,
- data: () => ({ bar: 1 }),
- computed: {
- foo () { return this.bar + 1 }
- },
- created () {
- this.foo // access
- this.bar++ // trigger change
- }
- }, res => {
- expect(res).toBe(`<div data-server-rendered="true">3</div>`)
- done()
- })
- })
-
- it('return Promise', done => {
- renderToString(new Vue({
- template: `<div>{{ foo }}</div>`,
- data: { foo: 'bar' }
- })).then(res => {
- expect(res).toBe(`<div data-server-rendered="true">bar</div>`)
- done()
- })
- })
-
- it('return Promise (error)', done => {
- Vue.config.silent = true
- renderToString(new Vue({
- render () {
- throw new Error('foobar')
- }
- })).catch(err => {
- expect(err.toString()).toContain(`foobar`)
- Vue.config.silent = false
- done()
- })
- })
-
- it('should catch template compilation error', done => {
- renderToString(new Vue({
- template: `<div></div><div></div>`
- }), (err, res) => {
- expect(err.toString()).toContain('Component template should contain exactly one root element')
- done()
- })
- })
-
- // #6907
- it('should not optimize root if conditions', done => {
- renderVmWithOptions({
- data: { foo: 123 },
- template: `<input :type="'text'" v-model="foo">`
- }, res => {
- expect(res).toBe(`<input type="text" data-server-rendered="true" value="123">`)
- done()
- })
- })
-
- it('render muted properly', done => {
- renderVmWithOptions({
- template: '<video muted></video>'
- }, result => {
- expect(result).toContain('<video muted="muted" data-server-rendered="true"></video>')
- done()
- })
- })
-
- it('render v-model with textarea', done => {
- renderVmWithOptions({
- data: { foo: 'bar' },
- template: '<div><textarea v-model="foo"></textarea></div>'
- }, result => {
- expect(result).toContain('<textarea>bar</textarea>')
- done()
- })
- })
-
- it('render v-model with textarea (non-optimized)', done => {
- renderVmWithOptions({
- render (h) {
- return h('textarea', {
- domProps: {
- value: 'foo'
- }
- })
- }
- }, result => {
- expect(result).toContain('<textarea data-server-rendered="true">foo</textarea>')
- done()
- })
- })
-
- it('render v-model with <select> (value binding)', done => {
- renderVmWithOptions({
- data: {
- selected: 2,
- options: [
- { id: 1, label: 'one' },
- { id: 2, label: 'two' }
- ]
- },
- template: `
- <div>
- <select v-model="selected">
- <option v-for="o in options" :value="o.id">{{ o.label }}</option>
- </select>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<select>' +
- '<option value="1">one</option>' +
- '<option selected="selected" value="2">two</option>' +
- '</select>'
- )
- done()
- })
- })
-
- it('render v-model with <select> (static value)', done => {
- renderVmWithOptions({
- data: {
- selected: 2
- },
- template: `
- <div>
- <select v-model="selected">
- <option value="1">one</option>
- <option value="2">two</option>
- </select>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<select>' +
- '<option value="1">one</option> ' +
- '<option value="2" selected="selected">two</option>' +
- '</select>'
- )
- done()
- })
- })
-
- it('render v-model with <select> (text as value)', done => {
- renderVmWithOptions({
- data: {
- selected: 2,
- options: [
- { id: 1, label: 'one' },
- { id: 2, label: 'two' }
- ]
- },
- template: `
- <div>
- <select v-model="selected">
- <option v-for="o in options">{{ o.id }}</option>
- </select>
- </div>
- `
- }, result => {
- expect(result).toContain(
- '<select>' +
- '<option>1</option>' +
- '<option selected="selected">2</option>' +
- '</select>'
- )
- done()
- })
- })
-
- // #7223
- it('should not double escape attribute values', done => {
- renderVmWithOptions({
- template: `
- <div>
- <div id="a\nb"></div>
- </div>
- `
- }, result => {
- expect(result).toContain(`<div id="a\nb"></div>`)
- done()
- })
- })
-
- it('should expose ssr helpers on functional context', done => {
- let called = false
- renderVmWithOptions({
- template: `<div><foo/></div>`,
- components: {
- foo: {
- functional: true,
- render (h, ctx) {
- expect(ctx._ssrNode).toBeTruthy()
- called = true
- }
- }
- }
- }, () => {
- expect(called).toBe(true)
- done()
- })
- })
-})
-
-function renderVmWithOptions (options, cb) {
- renderToString(new Vue(options), (err, res) => {
- expect(err).toBeNull()
- cb(res)
- })
-}
+++ /dev/null
-import webpack from 'webpack'
-import Vue from '../../dist/vue.runtime.common.js'
-import { compileWithWebpack } from './compile-with-webpack'
-import { createRenderer } from '../../packages/vue-server-renderer'
-import VueSSRClientPlugin from '../../packages/vue-server-renderer/client-plugin'
-import { createRenderer as createBundleRenderer } from './ssr-bundle-render.spec.js'
-
-const defaultTemplate = `<html><head></head><body><!--vue-ssr-outlet--></body></html>`
-const interpolateTemplate = `<html><head><title>{{ title }}</title></head><body><!--vue-ssr-outlet-->{{{ snippet }}}</body></html>`
-
-function generateClientManifest (file, cb) {
- compileWithWebpack(file, {
- output: {
- path: '/',
- filename: '[name].js'
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin({
- name: 'manifest',
- minChunks: Infinity
- }),
- new VueSSRClientPlugin()
- ]
- }, fs => {
- cb(JSON.parse(fs.readFileSync('/vue-ssr-client-manifest.json', 'utf-8')))
- })
-}
-
-function createRendererWithManifest (file, options, cb) {
- if (typeof options === 'function') {
- cb = options
- options = null
- }
- generateClientManifest(file, clientManifest => {
- createBundleRenderer(file, Object.assign({
- asBundle: true,
- template: defaultTemplate,
- clientManifest
- }, options), cb)
- })
-}
-
-describe('SSR: template option', () => {
- it('renderToString', done => {
- const renderer = createRenderer({
- template: defaultTemplate
- })
-
- const context = {
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 }
- }
-
- renderer.renderToString(new Vue({
- template: '<div>hi</div>'
- }), context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(
- `<html><head>${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">hi</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- `</body></html>`
- )
- done()
- })
- })
-
- it('renderToString with interpolation', done => {
- const renderer = createRenderer({
- template: interpolateTemplate
- })
-
- const context = {
- title: '<script>hacks</script>',
- snippet: '<div>foo</div>',
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 }
- }
-
- renderer.renderToString(new Vue({
- template: '<div>hi</div>'
- }), context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(
- `<html><head>` +
- // double mustache should be escaped
- `<title><script>hacks</script></title>` +
- `${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">hi</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- // triple should be raw
- `<div>foo</div>` +
- `</body></html>`
- )
- done()
- })
- })
-
- it('renderToStream', done => {
- const renderer = createRenderer({
- template: defaultTemplate
- })
-
- const context = {
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 }
- }
-
- const stream = renderer.renderToStream(new Vue({
- template: '<div>hi</div>'
- }), context)
-
- let res = ''
- stream.on('data', chunk => {
- res += chunk
- })
- stream.on('end', () => {
- expect(res).toContain(
- `<html><head>${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">hi</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- `</body></html>`
- )
- done()
- })
- })
-
- it('renderToStream with interpolation', done => {
- const renderer = createRenderer({
- template: interpolateTemplate
- })
-
- const context = {
- title: '<script>hacks</script>',
- snippet: '<div>foo</div>',
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 }
- }
-
- const stream = renderer.renderToStream(new Vue({
- template: '<div>hi</div>'
- }), context)
-
- let res = ''
- stream.on('data', chunk => {
- res += chunk
- })
- stream.on('end', () => {
- expect(res).toContain(
- `<html><head>` +
- // double mustache should be escaped
- `<title><script>hacks</script></title>` +
- `${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">hi</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- // triple should be raw
- `<div>foo</div>` +
- `</body></html>`
- )
- done()
- })
- })
-
- it('bundleRenderer + renderToString', done => {
- createBundleRenderer('app.js', {
- asBundle: true,
- template: defaultTemplate
- }, renderer => {
- const context = {
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 },
- url: '/test'
- }
- renderer.renderToString(context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(
- `<html><head>${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">/test</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- `</body></html>`
- )
- expect(context.msg).toBe('hello')
- done()
- })
- })
- })
-
- it('bundleRenderer + renderToStream', done => {
- createBundleRenderer('app.js', {
- asBundle: true,
- template: defaultTemplate
- }, renderer => {
- const context = {
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 },
- url: '/test'
- }
- const stream = renderer.renderToStream(context)
- let res = ''
- stream.on('data', chunk => {
- res += chunk.toString()
- })
- stream.on('end', () => {
- expect(res).toContain(
- `<html><head>${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">/test</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- `</body></html>`
- )
- expect(context.msg).toBe('hello')
- done()
- })
- })
- })
-
- const expectedHTMLWithManifest = (options = {}) =>
- `<html><head>` +
- // used chunks should have preload
- `<link rel="preload" href="/manifest.js" as="script">` +
- `<link rel="preload" href="/main.js" as="script">` +
- `<link rel="preload" href="/0.js" as="script">` +
- `<link rel="preload" href="/test.css" as="style">` +
- // images and fonts are only preloaded when explicitly asked for
- (options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
- (options.preloadOtherAssets ? `<link rel="preload" href="/test.png" as="image">` : ``) +
- // unused chunks should have prefetch
- (options.noPrefetch ? `` : `<link rel="prefetch" href="/1.js">`) +
- // css assets should be loaded
- `<link rel="stylesheet" href="/test.css">` +
- `</head><body>` +
- `<div data-server-rendered="true"><div>async test.woff2 test.png</div></div>` +
- // state should be inlined before scripts
- `<script>window.${options.stateKey || '__INITIAL_STATE__'}={"a":1}</script>` +
- // manifest chunk should be first
- `<script src="/manifest.js" defer></script>` +
- // async chunks should be before main chunk
- `<script src="/0.js" defer></script>` +
- `<script src="/main.js" defer></script>` +
- `</body></html>`
-
- createClientManifestAssertions(true)
- createClientManifestAssertions(false)
-
- function createClientManifestAssertions (runInNewContext) {
- it('bundleRenderer + renderToString + clientManifest ()', done => {
- createRendererWithManifest('split.js', { runInNewContext }, renderer => {
- renderer.renderToString({ state: { a: 1 }}, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(expectedHTMLWithManifest())
- done()
- })
- })
- })
-
- it('bundleRenderer + renderToStream + clientManifest + shouldPreload', done => {
- createRendererWithManifest('split.js', {
- runInNewContext,
- shouldPreload: (file, type) => {
- if (type === 'image' || type === 'script' || type === 'font' || type === 'style') {
- return true
- }
- }
- }, renderer => {
- const stream = renderer.renderToStream({ state: { a: 1 }})
- let res = ''
- stream.on('data', chunk => {
- res += chunk.toString()
- })
- stream.on('end', () => {
- expect(res).toContain(expectedHTMLWithManifest({
- preloadOtherAssets: true
- }))
- done()
- })
- })
- })
-
- it('bundleRenderer + renderToStream + clientManifest + shouldPrefetch', done => {
- createRendererWithManifest('split.js', {
- runInNewContext,
- shouldPrefetch: (file, type) => {
- if (type === 'script') {
- return false
- }
- }
- }, renderer => {
- const stream = renderer.renderToStream({ state: { a: 1 }})
- let res = ''
- stream.on('data', chunk => {
- res += chunk.toString()
- })
- stream.on('end', () => {
- expect(res).toContain(expectedHTMLWithManifest({
- noPrefetch: true
- }))
- done()
- })
- })
- })
-
- it('bundleRenderer + renderToString + clientManifest + inject: false', done => {
- createRendererWithManifest('split.js', {
- runInNewContext,
- template: `<html>` +
- `<head>{{{ renderResourceHints() }}}{{{ renderStyles() }}}</head>` +
- `<body><!--vue-ssr-outlet-->{{{ renderState({ windowKey: '__FOO__', contextKey: 'foo' }) }}}{{{ renderScripts() }}}</body>` +
- `</html>`,
- inject: false
- }, renderer => {
- const context = { foo: { a: 1 }}
- renderer.renderToString(context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(expectedHTMLWithManifest({
- stateKey: '__FOO__'
- }))
- done()
- })
- })
- })
-
- it('bundleRenderer + renderToString + clientManifest + no template', done => {
- createRendererWithManifest('split.js', {
- runInNewContext,
- template: null
- }, renderer => {
- const context = { foo: { a: 1 }}
- renderer.renderToString(context, (err, res) => {
- expect(err).toBeNull()
-
- const customOutput =
- `<html><head>${
- context.renderResourceHints() +
- context.renderStyles()
- }</head><body>${
- res +
- context.renderState({
- windowKey: '__FOO__',
- contextKey: 'foo'
- }) +
- context.renderScripts()
- }</body></html>`
-
- expect(customOutput).toContain(expectedHTMLWithManifest({
- stateKey: '__FOO__'
- }))
- done()
- })
- })
- })
-
- it('whitespace insensitive interpolation', done => {
- const interpolateTemplate = `<html><head><title>{{title}}</title></head><body><!--vue-ssr-outlet-->{{{snippet}}}</body></html>`
- const renderer = createRenderer({
- template: interpolateTemplate
- })
-
- const context = {
- title: '<script>hacks</script>',
- snippet: '<div>foo</div>',
- head: '<meta name="viewport" content="width=device-width">',
- styles: '<style>h1 { color: red }</style>',
- state: { a: 1 }
- }
-
- renderer.renderToString(new Vue({
- template: '<div>hi</div>'
- }), context, (err, res) => {
- expect(err).toBeNull()
- expect(res).toContain(
- `<html><head>` +
- // double mustache should be escaped
- `<title><script>hacks</script></title>` +
- `${context.head}${context.styles}</head><body>` +
- `<div data-server-rendered="true">hi</div>` +
- `<script>window.__INITIAL_STATE__={"a":1}</script>` +
- // triple should be raw
- `<div>foo</div>` +
- `</body></html>`
- )
- done()
- })
- })
- }
-})
+++ /dev/null
-{
- "env": {
- "jasmine": true
- },
- "globals": {
- "waitForUpdate": true,
- "triggerEvent": true,
- "createTextVNode": true
- },
- "plugins": ["jasmine"],
- "rules": {
- "jasmine/no-focused-tests": 2
- }
-}
+++ /dev/null
-import Vue from 'vue'
-import { Promise } from 'es6-promise'
-
-describe('Component async', () => {
- it('normal', done => {
- const vm = new Vue({
- template: '<div><test></test></div>',
- components: {
- test: (resolve) => {
- setTimeout(() => {
- resolve({
- template: '<div>hi</div>'
- })
- // wait for parent update
- Vue.nextTick(next)
- }, 0)
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<!---->')
- expect(vm.$children.length).toBe(0)
- function next () {
- expect(vm.$el.innerHTML).toBe('<div>hi</div>')
- expect(vm.$children.length).toBe(1)
- done()
- }
- })
-
- it('resolve ES module default', done => {
- const vm = new Vue({
- template: '<div><test></test></div>',
- components: {
- test: (resolve) => {
- setTimeout(() => {
- resolve({
- __esModule: true,
- default: {
- template: '<div>hi</div>'
- }
- })
- // wait for parent update
- Vue.nextTick(next)
- }, 0)
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<!---->')
- expect(vm.$children.length).toBe(0)
- function next () {
- expect(vm.$el.innerHTML).toBe('<div>hi</div>')
- expect(vm.$children.length).toBe(1)
- done()
- }
- })
-
- it('as root', done => {
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: resolve => {
- setTimeout(() => {
- resolve({
- template: '<div>hi</div>'
- })
- // wait for parent update
- Vue.nextTick(next)
- }, 0)
- }
- }
- }).$mount()
- expect(vm.$el.nodeType).toBe(8)
- expect(vm.$children.length).toBe(0)
- function next () {
- expect(vm.$el.nodeType).toBe(1)
- expect(vm.$el.outerHTML).toBe('<div>hi</div>')
- expect(vm.$children.length).toBe(1)
- done()
- }
- })
-
- it('dynamic', done => {
- var vm = new Vue({
- template: '<component :is="view"></component>',
- data: {
- view: 'view-a'
- },
- components: {
- 'view-a': resolve => {
- setTimeout(() => {
- resolve({
- template: '<div>A</div>'
- })
- Vue.nextTick(step1)
- }, 0)
- },
- 'view-b': resolve => {
- setTimeout(() => {
- resolve({
- template: '<p>B</p>'
- })
- Vue.nextTick(step2)
- }, 0)
- }
- }
- }).$mount()
- var aCalled = false
- function step1 () {
- // ensure A is resolved only once
- expect(aCalled).toBe(false)
- aCalled = true
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('A')
- vm.view = 'view-b'
- }
- function step2 () {
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.textContent).toBe('B')
- vm.view = 'view-a'
- waitForUpdate(function () {
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('A')
- }).then(done)
- }
- })
-
- it('warn reject', () => {
- new Vue({
- template: '<test></test>',
- components: {
- test: (resolve, reject) => {
- reject('nooooo')
- }
- }
- }).$mount()
- expect('Reason: nooooo').toHaveBeenWarned()
- })
-
- it('with v-for', done => {
- const vm = new Vue({
- template: '<div><test v-for="n in list" :key="n" :n="n"></test></div>',
- data: {
- list: [1, 2, 3]
- },
- components: {
- test: resolve => {
- setTimeout(() => {
- resolve({
- props: ['n'],
- template: '<div>{{n}}</div>'
- })
- Vue.nextTick(next)
- }, 0)
- }
- }
- }).$mount()
- function next () {
- expect(vm.$el.innerHTML).toBe('<div>1</div><div>2</div><div>3</div>')
- done()
- }
- })
-
- it('returning Promise', done => {
- const vm = new Vue({
- template: '<div><test></test></div>',
- components: {
- test: () => {
- return new Promise(resolve => {
- setTimeout(() => {
- resolve({
- template: '<div>hi</div>'
- })
- // wait for promise resolve and then parent update
- Promise.resolve().then(() => {
- Vue.nextTick(next)
- })
- }, 0)
- })
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<!---->')
- expect(vm.$children.length).toBe(0)
- function next () {
- expect(vm.$el.innerHTML).toBe('<div>hi</div>')
- expect(vm.$children.length).toBe(1)
- done()
- }
- })
-
- describe('loading/error/timeout', () => {
- it('with loading component', done => {
- const vm = new Vue({
- template: `<div><test/></div>`,
- components: {
- test: () => ({
- component: new Promise(resolve => {
- setTimeout(() => {
- resolve({ template: '<div>hi</div>' })
- // wait for promise resolve and then parent update
- Promise.resolve().then(() => {
- Vue.nextTick(next)
- })
- }, 50)
- }),
- loading: { template: `<div>loading</div>` },
- delay: 1
- })
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<!---->')
-
- let loadingAsserted = false
- setTimeout(() => {
- Vue.nextTick(() => {
- loadingAsserted = true
- expect(vm.$el.textContent).toBe('loading')
- })
- }, 1)
-
- function next () {
- expect(loadingAsserted).toBe(true)
- expect(vm.$el.textContent).toBe('hi')
- done()
- }
- })
-
- it('with loading component (0 delay)', done => {
- const vm = new Vue({
- template: `<div><test/></div>`,
- components: {
- test: () => ({
- component: new Promise(resolve => {
- setTimeout(() => {
- resolve({ template: '<div>hi</div>' })
- // wait for promise resolve and then parent update
- Promise.resolve().then(() => {
- Vue.nextTick(next)
- })
- }, 50)
- }),
- loading: { template: `<div>loading</div>` },
- delay: 0
- })
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('loading')
-
- function next () {
- expect(vm.$el.textContent).toBe('hi')
- done()
- }
- })
-
- it('with error component', done => {
- const vm = new Vue({
- template: `<div><test/></div>`,
- components: {
- test: () => ({
- component: new Promise((resolve, reject) => {
- setTimeout(() => {
- reject()
- // wait for promise resolve and then parent update
- Promise.resolve().then(() => {
- Vue.nextTick(next)
- })
- }, 50)
- }),
- loading: { template: `<div>loading</div>` },
- error: { template: `<div>error</div>` },
- delay: 0
- })
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('loading')
-
- function next () {
- expect(`Failed to resolve async component`).toHaveBeenWarned()
- expect(vm.$el.textContent).toBe('error')
- done()
- }
- })
-
- it('with error component + timeout', done => {
- const vm = new Vue({
- template: `<div><test/></div>`,
- components: {
- test: () => ({
- component: new Promise((resolve, reject) => {
- setTimeout(() => {
- resolve({ template: '<div>hi</div>' })
- // wait for promise resolve and then parent update
- Promise.resolve().then(() => {
- Vue.nextTick(next)
- })
- }, 50)
- }),
- loading: { template: `<div>loading</div>` },
- error: { template: `<div>error</div>` },
- delay: 0,
- timeout: 1
- })
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('loading')
-
- setTimeout(() => {
- Vue.nextTick(() => {
- expect(`Failed to resolve async component`).toHaveBeenWarned()
- expect(vm.$el.textContent).toBe('error')
- })
- }, 1)
-
- function next () {
- expect(vm.$el.textContent).toBe('error') // late resolve ignored
- done()
- }
- })
-
- it('should not trigger timeout if resolved', done => {
- const vm = new Vue({
- template: `<div><test/></div>`,
- components: {
- test: () => ({
- component: new Promise((resolve, reject) => {
- setTimeout(() => {
- resolve({ template: '<div>hi</div>' })
- }, 10)
- }),
- error: { template: `<div>error</div>` },
- timeout: 20
- })
- }
- }).$mount()
-
- setTimeout(() => {
- expect(vm.$el.textContent).toBe('hi')
- expect(`Failed to resolve async component`).not.toHaveBeenWarned()
- done()
- }, 50)
- })
-
- // #7107
- it(`should work when resolving sync in sibling component's mounted hook`, done => {
- let resolveTwo
-
- const vm = new Vue({
- template: `<div><one/> <two/></div>`,
- components: {
- one: {
- template: `<div>one</div>`,
- mounted () {
- resolveTwo()
- }
- },
- two: resolve => {
- resolveTwo = () => {
- resolve({
- template: `<div>two</div>`
- })
- }
- }
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('one ')
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('one two')
- }).then(done)
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import injectStyles from '../transition/inject-styles'
-import { isIE9 } from 'core/util/env'
-import { nextFrame } from 'web/runtime/transition-util'
-
-describe('Component keep-alive', () => {
- const { duration, buffer } = injectStyles()
- let components, one, two, el
- beforeEach(() => {
- one = {
- template: '<div>one</div>',
- created: jasmine.createSpy('one created'),
- mounted: jasmine.createSpy('one mounted'),
- activated: jasmine.createSpy('one activated'),
- deactivated: jasmine.createSpy('one deactivated'),
- destroyed: jasmine.createSpy('one destroyed')
- }
- two = {
- template: '<div>two</div>',
- created: jasmine.createSpy('two created'),
- mounted: jasmine.createSpy('two mounted'),
- activated: jasmine.createSpy('two activated'),
- deactivated: jasmine.createSpy('two deactivated'),
- destroyed: jasmine.createSpy('two destroyed')
- }
- components = {
- one,
- two
- }
- el = document.createElement('div')
- document.body.appendChild(el)
- })
-
- function assertHookCalls (component, callCounts) {
- expect([
- component.created.calls.count(),
- component.mounted.calls.count(),
- component.activated.calls.count(),
- component.deactivated.calls.count(),
- component.destroyed.calls.count()
- ]).toEqual(callCounts)
- }
-
- it('should work', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive>
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.view = 'one'
- }).then(() => {
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- vm.view = 'two'
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [1, 1, 2, 1, 0])
- vm.ok = false // teardown
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 1])
- assertHookCalls(two, [1, 1, 2, 2, 1])
- }).then(done)
- })
-
- it('should invoke hooks on the entire sub tree', done => {
- one.template = '<two/>'
- one.components = { two }
-
- const vm = new Vue({
- template: `
- <div>
- <keep-alive>
- <one v-if="ok"/>
- </keep-alive>
- </div>
- `,
- data: {
- ok: true
- },
- components
- }).$mount()
-
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- vm.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 2, 1, 0])
- vm.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [1, 1, 2, 2, 0])
- }).then(done)
- })
-
- it('should handle nested keep-alive hooks properly', done => {
- one.template = '<keep-alive><two v-if="ok" /></keep-alive>'
- one.data = () => ({ ok: true })
- one.components = { two }
-
- const vm = new Vue({
- template: `
- <div>
- <keep-alive>
- <one v-if="ok" ref="one" />
- </keep-alive>
- </div>
- `,
- data: {
- ok: true
- },
- components
- }).$mount()
-
- var oneInstance = vm.$refs.one
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).then(() => {
- vm.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 2, 1, 0])
- }).then(() => {
- // toggle sub component when activated
- oneInstance.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 2, 2, 0])
- }).then(() => {
- oneInstance.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 3, 2, 0])
- }).then(() => {
- vm.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [1, 1, 3, 3, 0])
- }).then(() => {
- // toggle sub component when parent is deactivated
- oneInstance.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [1, 1, 3, 3, 0]) // should not be affected
- }).then(() => {
- oneInstance.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [1, 1, 3, 3, 0]) // should not be affected
- }).then(() => {
- vm.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 3, 2, 0])
- assertHookCalls(two, [1, 1, 4, 3, 0])
- }).then(() => {
- oneInstance.ok = false
- vm.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 3, 3, 0])
- assertHookCalls(two, [1, 1, 4, 4, 0])
- }).then(() => {
- vm.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 4, 3, 0])
- assertHookCalls(two, [1, 1, 4, 4, 0]) // should remain inactive
- }).then(done)
- })
-
- function sharedAssertions (vm, done) {
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 0])
- vm.view = 'one'
- }).then(() => {
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 1])
- vm.view = 'two'
- }).then(() => {
- expect(vm.$el.textContent).toBe('two')
- assertHookCalls(one, [1, 1, 2, 2, 0])
- assertHookCalls(two, [2, 2, 0, 0, 1])
- vm.ok = false // teardown
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- assertHookCalls(one, [1, 1, 2, 2, 1])
- assertHookCalls(two, [2, 2, 0, 0, 2])
- }).then(done)
- }
-
- it('include (string)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive include="one">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('include (regex)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive :include="/^one$/">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('include (array)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive :include="['one']">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('exclude (string)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive exclude="two">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('exclude (regex)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive :exclude="/^two$/">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('exclude (array)', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive :exclude="['two']">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('include + exclude', done => {
- const vm = new Vue({
- template: `
- <div v-if="ok">
- <keep-alive include="one,two" exclude="two">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- ok: true
- },
- components
- }).$mount()
- sharedAssertions(vm, done)
- })
-
- it('prune cache on include/exclude change', done => {
- const vm = new Vue({
- template: `
- <div>
- <keep-alive :include="include">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- include: 'one,two'
- },
- components
- }).$mount()
-
- vm.view = 'two'
- waitForUpdate(() => {
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.include = 'two'
- }).then(() => {
- assertHookCalls(one, [1, 1, 1, 1, 1])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.view = 'one'
- }).then(() => {
- assertHookCalls(one, [2, 2, 1, 1, 1])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).then(done)
- })
-
- it('prune cache on include/exclude change + view switch', done => {
- const vm = new Vue({
- template: `
- <div>
- <keep-alive :include="include">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- include: 'one,two'
- },
- components
- }).$mount()
-
- vm.view = 'two'
- waitForUpdate(() => {
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- vm.include = 'one'
- vm.view = 'one'
- }).then(() => {
- assertHookCalls(one, [1, 1, 2, 1, 0])
- // two should be pruned
- assertHookCalls(two, [1, 1, 1, 1, 1])
- }).then(done)
- })
-
- it('should not prune currently active instance', done => {
- const vm = new Vue({
- template: `
- <div>
- <keep-alive :include="include">
- <component :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: {
- view: 'one',
- include: 'one,two'
- },
- components
- }).$mount()
-
- vm.include = 'two'
- waitForUpdate(() => {
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- }).then(() => {
- assertHookCalls(one, [1, 1, 1, 0, 1])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).then(done)
- })
-
- // #3882
- it('deeply nested keep-alive should be destroyed properly', done => {
- one.template = `<div><keep-alive><two></two></keep-alive></div>`
- one.components = { two }
- const vm = new Vue({
- template: `<div><parent v-if="ok"></parent></div>`,
- data: { ok: true },
- components: {
- parent: {
- template: `<div><keep-alive><one></one></keep-alive></div>`,
- components: { one }
- }
- }
- }).$mount()
-
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
-
- vm.ok = false
- waitForUpdate(() => {
- assertHookCalls(one, [1, 1, 1, 1, 1])
- assertHookCalls(two, [1, 1, 1, 1, 1])
- }).then(done)
- })
-
- // #4237
- it('should update latest props/listeners for a re-activated component', done => {
- const one = {
- props: ['prop'],
- template: `<div>one {{ prop }}</div>`
- }
- const two = {
- props: ['prop'],
- template: `<div>two {{ prop }}</div>`
- }
- const vm = new Vue({
- data: { view: 'one', n: 1 },
- template: `
- <div>
- <keep-alive>
- <component :is="view" :prop="n"></component>
- </keep-alive>
- </div>
- `,
- components: { one, two }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('one 1')
- vm.n++
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('one 2')
- vm.view = 'two'
- }).then(() => {
- expect(vm.$el.textContent).toBe('two 2')
- }).then(done)
- })
-
- it('max', done => {
- const spyA = jasmine.createSpy()
- const spyB = jasmine.createSpy()
- const spyC = jasmine.createSpy()
- const spyAD = jasmine.createSpy()
- const spyBD = jasmine.createSpy()
- const spyCD = jasmine.createSpy()
-
- function assertCount (calls) {
- expect([
- spyA.calls.count(),
- spyAD.calls.count(),
- spyB.calls.count(),
- spyBD.calls.count(),
- spyC.calls.count(),
- spyCD.calls.count()
- ]).toEqual(calls)
- }
-
- const vm = new Vue({
- template: `
- <keep-alive max="2">
- <component :is="n"></component>
- </keep-alive>
- `,
- data: {
- n: 'aa'
- },
- components: {
- aa: {
- template: '<div>a</div>',
- created: spyA,
- destroyed: spyAD
- },
- bb: {
- template: '<div>bbb</div>',
- created: spyB,
- destroyed: spyBD
- },
- cc: {
- template: '<div>ccc</div>',
- created: spyC,
- destroyed: spyCD
- }
- }
- }).$mount()
-
- assertCount([1, 0, 0, 0, 0, 0])
- vm.n = 'bb'
- waitForUpdate(() => {
- assertCount([1, 0, 1, 0, 0, 0])
- vm.n = 'cc'
- }).then(() => {
- // should prune A because max cache reached
- assertCount([1, 1, 1, 0, 1, 0])
- vm.n = 'bb'
- }).then(() => {
- // B should be reused, and made latest
- assertCount([1, 1, 1, 0, 1, 0])
- vm.n = 'aa'
- }).then(() => {
- // C should be pruned because B was used last so C is the oldest cached
- assertCount([2, 1, 1, 0, 1, 1])
- }).then(done)
- })
-
- it('should warn unknown component inside', () => {
- new Vue({
- template: `<keep-alive><foo/></keep-alive>`
- }).$mount()
- expect(`Unknown custom element: <foo>`).toHaveBeenWarned()
- })
-
- // #6938
- it('should not cache anonymous component when include is specified', done => {
- const Foo = {
- name: 'foo',
- template: `<div>foo</div>`,
- created: jasmine.createSpy('foo')
- }
-
- const Bar = {
- template: `<div>bar</div>`,
- created: jasmine.createSpy('bar')
- }
-
- const Child = {
- functional: true,
- render (h, ctx) {
- return h(ctx.props.view ? Foo : Bar)
- }
- }
-
- const vm = new Vue({
- template: `
- <keep-alive include="foo">
- <child :view="view"></child>
- </keep-alive>
- `,
- data: {
- view: true
- },
- components: { Child }
- }).$mount()
-
- function assert (foo, bar) {
- expect(Foo.created.calls.count()).toBe(foo)
- expect(Bar.created.calls.count()).toBe(bar)
- }
-
- expect(vm.$el.textContent).toBe('foo')
- assert(1, 0)
- vm.view = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('bar')
- assert(1, 1)
- vm.view = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('foo')
- assert(1, 1)
- vm.view = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('bar')
- assert(1, 2)
- }).then(done)
- })
-
- it('should cache anonymous components if include is not specified', done => {
- const Foo = {
- template: `<div>foo</div>`,
- created: jasmine.createSpy('foo')
- }
-
- const Bar = {
- template: `<div>bar</div>`,
- created: jasmine.createSpy('bar')
- }
-
- const Child = {
- functional: true,
- render (h, ctx) {
- return h(ctx.props.view ? Foo : Bar)
- }
- }
-
- const vm = new Vue({
- template: `
- <keep-alive>
- <child :view="view"></child>
- </keep-alive>
- `,
- data: {
- view: true
- },
- components: { Child }
- }).$mount()
-
- function assert (foo, bar) {
- expect(Foo.created.calls.count()).toBe(foo)
- expect(Bar.created.calls.count()).toBe(bar)
- }
-
- expect(vm.$el.textContent).toBe('foo')
- assert(1, 0)
- vm.view = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('bar')
- assert(1, 1)
- vm.view = true
- }).then(() => {
- expect(vm.$el.textContent).toBe('foo')
- assert(1, 1)
- vm.view = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('bar')
- assert(1, 1)
- }).then(done)
- })
-
- // #7105
- it('should not destroy active instance when pruning cache', done => {
- const Foo = {
- template: `<div>foo</div>`,
- destroyed: jasmine.createSpy('destroyed')
- }
- const vm = new Vue({
- template: `
- <div>
- <keep-alive :include="include">
- <foo/>
- </keep-alive>
- </div>
- `,
- data: {
- include: ['foo']
- },
- components: { Foo }
- }).$mount()
- // condition: a render where a previous component is reused
- vm.include = ['foo']
- waitForUpdate(() => {
- vm.include = ['']
- }).then(() => {
- expect(Foo.destroyed).not.toHaveBeenCalled()
- }).then(done)
- })
-
- if (!isIE9) {
- it('with transition-mode out-in', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-leave="afterLeave">
- <keep-alive>
- <component :is="view" class="test"></component>
- </keep-alive>
- </transition>
- </div>`,
- data: {
- view: 'one'
- },
- components,
- methods: {
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div><!---->'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).then(() => {
- vm.view = 'one'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">two</div><!---->'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">two</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).then(done)
- })
-
- it('with transition-mode out-in + include', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-leave="afterLeave">
- <keep-alive include="one">
- <component :is="view" class="test"></component>
- </keep-alive>
- </transition>
- </div>`,
- data: {
- view: 'one'
- },
- components,
- methods: {
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div><!---->'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 0])
- }).then(() => {
- vm.view = 'one'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">two</div><!---->'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 1])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">two</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 1])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 0, 0, 1])
- }).then(done)
- })
-
- it('with transition-mode in-out', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="in-out" @after-enter="afterEnter">
- <keep-alive>
- <component :is="view" class="test"></component>
- </keep-alive>
- </transition>
- </div>`,
- data: {
- view: 'one'
- },
- components,
- methods: {
- afterEnter () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter test-enter-active">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test">two</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).then(() => {
- vm.view = 'one'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter test-enter-active">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test">one</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>'
- )
- assertHookCalls(one, [1, 1, 2, 1, 0])
- assertHookCalls(two, [1, 1, 1, 1, 0])
- }).then(done)
- })
-
- it('dynamic components, in-out with early cancel', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="in-out" @after-enter="afterEnter">
- <keep-alive>
- <component :is="view" class="test"></component>
- </keep-alive>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterEnter () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- // switch again before enter finishes,
- // this cancels both enter and leave.
- vm.view = 'one'
- }).then(() => {
- // 1. the pending leaving "one" should be removed instantly.
- // 2. the entering "two" should be placed into its final state instantly.
- // 3. a new "one" is created and entering
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter test-enter-active">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test">one</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>'
- )
- }).then(done).then(done)
- })
-
- // #4339
- it('component with inner transition', done => {
- const vm = new Vue({
- template: `
- <div>
- <keep-alive>
- <component ref="test" :is="view"></component>
- </keep-alive>
- </div>
- `,
- data: { view: 'foo' },
- components: {
- foo: { template: '<transition><div class="test">foo</div></transition>' },
- bar: { template: '<transition name="test"><div class="test">bar</div></transition>' }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.view = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave v-leave-active">foo</div>' +
- '<div class="test test-enter test-enter-active">bar</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave-active v-leave-to">foo</div>' +
- '<div class="test test-enter-active test-enter-to">bar</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">bar</div>'
- )
- vm.view = 'foo'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">bar</div>' +
- '<div class="test v-enter v-enter-active">foo</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">bar</div>' +
- '<div class="test v-enter-active v-enter-to">foo</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">foo</div>'
- )
- }).then(done)
- })
-
- it('async components with transition-mode out-in', done => {
- const barResolve = jasmine.createSpy('bar resolved')
- let next
- const foo = (resolve) => {
- setTimeout(() => {
- resolve(one)
- Vue.nextTick(next)
- }, duration / 2)
- }
- const bar = (resolve) => {
- setTimeout(() => {
- resolve(two)
- barResolve()
- }, duration / 2)
- }
- components = {
- foo,
- bar
- }
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-enter="afterEnter" @after-leave="afterLeave">
- <keep-alive>
- <component :is="view" class="test"></component>
- </keep-alive>
- </transition>
- </div>`,
- data: {
- view: 'foo'
- },
- components,
- methods: {
- afterEnter () {
- next()
- },
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('')
- next = () => {
- assertHookCalls(one, [1, 1, 1, 0, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- // foo afterEnter get called
- expect(vm.$el.innerHTML).toBe('<div class="test">one</div>')
- vm.view = 'bar'
- }).thenWaitFor(nextFrame).then(() => {
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [0, 0, 0, 0, 0])
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- // foo afterLeave get called
- // and bar has already been resolved before afterLeave get called
- expect(barResolve.calls.count()).toBe(1)
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- assertHookCalls(one, [1, 1, 1, 1, 0])
- assertHookCalls(two, [1, 1, 1, 0, 0])
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- // bar afterEnter get called
- expect(vm.$el.innerHTML).toBe('<div class="test">two</div>')
- }).then(done)
- }
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Component scoped slot', () => {
- it('default slot', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot-scope="props">
- <span>{{ props.msg }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot :msg="msg"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.$refs.test.msg = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>world</span>')
- }).then(done)
- })
-
- it('default slot (plain element)', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <span slot-scope="props">{{ props.msg }}</span>
- </test>
- `,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot :msg="msg"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.$refs.test.msg = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>world</span>')
- }).then(done)
- })
-
- it('with v-bind', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot-scope="props">
- <span>{{ props.msg }} {{ props.msg2 }} {{ props.msg3 }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- msg: 'hello',
- obj: { msg2: 'world', msg3: '.' }
- }
- },
- template: `
- <div>
- <slot :msg="msg" v-bind="obj" msg3="!"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello world !</span>')
- vm.$refs.test.msg = 'bye'
- vm.$refs.test.obj.msg2 = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>bye bye !</span>')
- }).then(done)
- })
-
- it('should warn when using v-bind with no object', () => {
- new Vue({
- template: `
- <test ref="test">
- <template scope="props">
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- text: 'some text'
- }
- },
- template: `
- <div>
- <slot v-bind="text"></slot>
- </div>
- `
- }
- }
- }).$mount()
- expect('slot v-bind without argument expects an Object').toHaveBeenWarned()
- })
-
- it('should not warn when using v-bind with object', () => {
- new Vue({
- template: `
- <test ref="test">
- <template scope="props">
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- foo: {
- text: 'some text'
- }
- }
- },
- template: `
- <div>
- <slot v-bind="foo"></slot>
- </div>
- `
- }
- }
- }).$mount()
- expect('slot v-bind without argument expects an Object').not.toHaveBeenWarned()
- })
-
- it('named scoped slot', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot="item" slot-scope="props">
- <span>{{ props.foo }}</span><span>{{ props.bar }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return { foo: 'FOO', bar: 'BAR' }
- },
- template: `
- <div>
- <slot name="item" :foo="foo" :bar="bar"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>FOO</span><span>BAR</span>')
- vm.$refs.test.foo = 'BAZ'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>BAZ</span><span>BAR</span>')
- }).then(done)
- })
-
- it('named scoped slot (plain element)', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <span slot="item" slot-scope="props">{{ props.foo }} {{ props.bar }}</span>
- </test>
- `,
- components: {
- test: {
- data () {
- return { foo: 'FOO', bar: 'BAR' }
- },
- template: `
- <div>
- <slot name="item" :foo="foo" :bar="bar"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>FOO BAR</span>')
- vm.$refs.test.foo = 'BAZ'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>BAZ BAR</span>')
- }).then(done)
- })
-
- it('fallback content', () => {
- const vm = new Vue({
- template: `<test></test>`,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot name="item" :text="msg">
- <span>{{ msg }} fallback</span>
- </slot>
- </div>
- `
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello fallback</span>')
- })
-
- it('slot with v-for', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot="item" slot-scope="props">
- <span>{{ props.text }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- items: ['foo', 'bar', 'baz']
- }
- },
- template: `
- <div>
- <slot v-for="item in items" name="item" :text="item"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- function assertOutput () {
- expect(vm.$el.innerHTML).toBe(vm.$refs.test.items.map(item => {
- return `<span>${item}</span>`
- }).join(''))
- }
-
- assertOutput()
- vm.$refs.test.items.reverse()
- waitForUpdate(assertOutput).then(() => {
- vm.$refs.test.items.push('qux')
- }).then(assertOutput).then(done)
- })
-
- it('slot inside v-for', done => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot="item" slot-scope="props">
- <span>{{ props.text }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- items: ['foo', 'bar', 'baz']
- }
- },
- template: `
- <ul>
- <li v-for="item in items">
- <slot name="item" :text="item"></slot>
- </li>
- </ul>
- `
- }
- }
- }).$mount()
-
- function assertOutput () {
- expect(vm.$el.innerHTML).toBe(vm.$refs.test.items.map(item => {
- return `<li><span>${item}</span></li>`
- }).join(''))
- }
-
- assertOutput()
- vm.$refs.test.items.reverse()
- waitForUpdate(assertOutput).then(() => {
- vm.$refs.test.items.push('qux')
- }).then(assertOutput).then(done)
- })
-
- it('scoped slot without scope alias', () => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <span slot="item">I am static</span>
- </test>
- `,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot name="item" :text="msg"></slot>
- </div>
- `
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>I am static</span>')
- })
-
- it('non-scoped slot with scope alias', () => {
- const vm = new Vue({
- template: `
- <test ref="test">
- <template slot="item" slot-scope="props">
- <span>{{ props.text || 'meh' }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot name="item"></slot>
- </div>
- `
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>meh</span>')
- })
-
- it('warn key on slot', () => {
- new Vue({
- template: `
- <test ref="test">
- <template slot="item" slot-scope="props">
- <span>{{ props.text }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return {
- items: ['foo', 'bar', 'baz']
- }
- },
- template: `
- <div>
- <slot v-for="item in items" name="item" :text="item" :key="item"></slot>
- </div>
- `
- }
- }
- }).$mount()
- expect(`\`key\` does not work on <slot>`).toHaveBeenWarned()
- })
-
- it('render function usage (named, via data)', done => {
- const vm = new Vue({
- render (h) {
- return h('test', {
- ref: 'test',
- scopedSlots: {
- item: props => h('span', props.text)
- }
- })
- },
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- render (h) {
- return h('div', [
- this.$scopedSlots.item({
- text: this.msg
- })
- ])
- }
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.$refs.test.msg = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>world</span>')
- }).then(done)
- })
-
- it('render function usage (default, as children)', () => {
- const vm = new Vue({
- render (h) {
- return h('test', [
- props => h('span', [props.msg])
- ])
- },
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- render (h) {
- return h('div', [
- this.$scopedSlots.default({ msg: this.msg })
- ])
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- })
-
- // #4779
- it('should support dynamic slot target', done => {
- const Child = {
- template: `
- <div>
- <slot name="a" msg="a" />
- <slot name="b" msg="b" />
- </div>
- `
- }
-
- const vm = new Vue({
- data: {
- a: 'a',
- b: 'b'
- },
- template: `
- <child>
- <template :slot="a" slot-scope="props">A {{ props.msg }}</template>
- <template :slot="b" slot-scope="props">B {{ props.msg }}</template>
- </child>
- `,
- components: { Child }
- }).$mount()
-
- expect(vm.$el.textContent.trim()).toBe('A a B b')
-
- // switch slots
- vm.a = 'b'
- vm.b = 'a'
- waitForUpdate(() => {
- expect(vm.$el.textContent.trim()).toBe('B a A b')
- }).then(done)
- })
-
- it('render function usage (JSX)', () => {
- const vm = new Vue({
- render (h) {
- return <test>{
- props => <span>{props.msg}</span>
- }</test>
- },
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- render (h) {
- return <div>
- {this.$scopedSlots.default({ msg: this.msg })}
- </div>
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- })
-
- // #5615
- it('scoped slot with v-for', done => {
- const vm = new Vue({
- data: { names: ['foo', 'bar'] },
- template: `
- <test ref="test">
- <template v-for="n in names" :slot="n" slot-scope="props">
- <span>{{ props.msg }}</span>
- </template>
- <template slot="abc" slot-scope="props">
- <span>{{ props.msg }}</span>
- </template>
- </test>
- `,
- components: {
- test: {
- data: () => ({ msg: 'hello' }),
- template: `
- <div>
- <slot name="foo" :msg="msg + ' foo'"></slot>
- <slot name="bar" :msg="msg + ' bar'"></slot>
- <slot name="abc" :msg="msg + ' abc'"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span> <span>hello abc</span>')
- vm.$refs.test.msg = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span> <span>world abc</span>')
- }).then(done)
- })
-
- it('scoped slot with v-for (plain elements)', done => {
- const vm = new Vue({
- data: { names: ['foo', 'bar'] },
- template: `
- <test ref="test">
- <span v-for="n in names" :slot="n" slot-scope="props">{{ props.msg }}</span>
- <span slot="abc" slot-scope="props">{{ props.msg }}</span>
- </test>
- `,
- components: {
- test: {
- data: () => ({ msg: 'hello' }),
- template: `
- <div>
- <slot name="foo" :msg="msg + ' foo'"></slot>
- <slot name="bar" :msg="msg + ' bar'"></slot>
- <slot name="abc" :msg="msg + ' abc'"></slot>
- </div>
- `
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span> <span>hello abc</span>')
- vm.$refs.test.msg = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span> <span>world abc</span>')
- }).then(done)
- })
-
- // #6725
- it('scoped slot with v-if', done => {
- const vm = new Vue({
- data: {
- ok: false
- },
- template: `
- <test>
- <template v-if="ok" slot-scope="foo">
- <p>{{ foo.text }}</p>
- </template>
- </test>
- `,
- components: {
- test: {
- data () {
- return { msg: 'hello' }
- },
- template: `
- <div>
- <slot :text="msg">
- <span>{{ msg }} fallback</span>
- </slot>
- </div>
- `
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello fallback</span>')
-
- vm.ok = true
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<p>hello</p>')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Component slot', () => {
- let vm, child
- function mount (options) {
- vm = new Vue({
- data: {
- msg: 'parent message'
- },
- template: `<div><test>${options.parentContent || ''}</test></div>`,
- components: {
- test: {
- template: options.childTemplate,
- data () {
- return {
- msg: 'child message'
- }
- }
- }
- }
- }).$mount()
- child = vm.$children[0]
- }
-
- it('no content', () => {
- mount({
- childTemplate: '<div><slot></slot></div>'
- })
- expect(child.$el.childNodes.length).toBe(0)
- })
-
- it('default slot', done => {
- mount({
- childTemplate: '<div><slot></slot></div>',
- parentContent: '<p>{{ msg }}</p>'
- })
- expect(child.$el.tagName).toBe('DIV')
- expect(child.$el.children[0].tagName).toBe('P')
- expect(child.$el.children[0].textContent).toBe('parent message')
- vm.msg = 'changed'
- waitForUpdate(() => {
- expect(child.$el.children[0].textContent).toBe('changed')
- }).then(done)
- })
-
- it('named slot', done => {
- mount({
- childTemplate: '<div><slot name="test"></slot></div>',
- parentContent: '<p slot="test">{{ msg }}</p>'
- })
- expect(child.$el.tagName).toBe('DIV')
- expect(child.$el.children[0].tagName).toBe('P')
- expect(child.$el.children[0].textContent).toBe('parent message')
- vm.msg = 'changed'
- waitForUpdate(() => {
- expect(child.$el.children[0].textContent).toBe('changed')
- }).then(done)
- })
-
- it('named slot with 0 as a number', done => {
- mount({
- childTemplate: '<div><slot :name="0"></slot></div>',
- parentContent: '<p :slot="0">{{ msg }}</p>'
- })
- expect(child.$el.tagName).toBe('DIV')
- expect(child.$el.children[0].tagName).toBe('P')
- expect(child.$el.children[0].textContent).toBe('parent message')
- vm.msg = 'changed'
- waitForUpdate(() => {
- expect(child.$el.children[0].textContent).toBe('changed')
- }).then(done)
- })
-
- it('fallback content', () => {
- mount({
- childTemplate: '<div><slot><p>{{msg}}</p></slot></div>'
- })
- expect(child.$el.children[0].tagName).toBe('P')
- expect(child.$el.textContent).toBe('child message')
- })
-
- it('fallback content with multiple named slots', () => {
- mount({
- childTemplate: `
- <div>
- <slot name="a"><p>fallback a</p></slot>
- <slot name="b">fallback b</slot>
- </div>
- `,
- parentContent: '<p slot="b">slot b</p>'
- })
- expect(child.$el.children.length).toBe(2)
- expect(child.$el.children[0].textContent).toBe('fallback a')
- expect(child.$el.children[1].textContent).toBe('slot b')
- })
-
- it('fallback content with mixed named/unnamed slots', () => {
- mount({
- childTemplate: `
- <div>
- <slot><p>fallback a</p></slot>
- <slot name="b">fallback b</slot>
- </div>
- `,
- parentContent: '<p slot="b">slot b</p>'
- })
- expect(child.$el.children.length).toBe(2)
- expect(child.$el.children[0].textContent).toBe('fallback a')
- expect(child.$el.children[1].textContent).toBe('slot b')
- })
-
- it('selector matching multiple elements', () => {
- mount({
- childTemplate: '<div><slot name="t"></slot></div>',
- parentContent: '<p slot="t">1</p><div></div><p slot="t">2</p>'
- })
- expect(child.$el.innerHTML).toBe('<p>1</p><p>2</p>')
- })
-
- it('default content should only render parts not selected', () => {
- mount({
- childTemplate: `
- <div>
- <slot name="a"></slot>
- <slot></slot>
- <slot name="b"></slot>
- </div>
- `,
- parentContent: '<div>foo</div><p slot="a">1</p><p slot="b">2</p>'
- })
- expect(child.$el.innerHTML).toBe('<p>1</p> <div>foo</div> <p>2</p>')
- })
-
- it('name should only match children', function () {
- mount({
- childTemplate: `
- <div>
- <slot name="a"><p>fallback a</p></slot>
- <slot name="b"><p>fallback b</p></slot>
- <slot name="c"><p>fallback c</p></slot>
- </div>
- `,
- parentContent: `
- '<p slot="b">select b</p>
- '<span><p slot="b">nested b</p></span>
- '<span><p slot="c">nested c</p></span>
- `
- })
- expect(child.$el.children.length).toBe(3)
- expect(child.$el.children[0].textContent).toBe('fallback a')
- expect(child.$el.children[1].textContent).toBe('select b')
- expect(child.$el.children[2].textContent).toBe('fallback c')
- })
-
- it('should accept expressions in slot attribute and slot names', () => {
- mount({
- childTemplate: `<div><slot :name="'a'"></slot></div>`,
- parentContent: `<p>one</p><p :slot="'a'">two</p>`
- })
- expect(child.$el.innerHTML).toBe('<p>two</p>')
- })
-
- it('slot inside v-if', done => {
- const vm = new Vue({
- data: {
- a: 1,
- b: 2,
- show: true
- },
- template: '<test :show="show"><p slot="b">{{b}}</p><p>{{a}}</p></test>',
- components: {
- test: {
- props: ['show'],
- template: '<div v-if="show"><slot></slot><slot name="b"></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('12')
- vm.a = 2
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('22')
- vm.show = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('')
- vm.show = true
- vm.a = 3
- }).then(() => {
- expect(vm.$el.textContent).toBe('32')
- }).then(done)
- })
-
- it('slot inside v-for', () => {
- mount({
- childTemplate: '<div><slot v-for="i in 3" :name="i"></slot></div>',
- parentContent: '<p v-for="i in 3" :slot="i">{{ i - 1 }}</p>'
- })
- expect(child.$el.innerHTML).toBe('<p>0</p><p>1</p><p>2</p>')
- })
-
- it('nested slots', done => {
- const vm = new Vue({
- template: '<test><test2><p>{{ msg }}</p></test2></test>',
- data: {
- msg: 'foo'
- },
- components: {
- test: {
- template: '<div><slot></slot></div>'
- },
- test2: {
- template: '<div><slot></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div><p>foo</p></div>')
- vm.msg = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div><p>bar</p></div>')
- }).then(done)
- })
-
- it('v-if on inserted content', done => {
- const vm = new Vue({
- template: '<test><p v-if="ok">{{ msg }}</p></test>',
- data: {
- ok: true,
- msg: 'hi'
- },
- components: {
- test: {
- template: '<div><slot>fallback</slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<p>hi</p>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('fallback')
- vm.ok = true
- vm.msg = 'bye'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>bye</p>')
- }).then(done)
- })
-
- it('template slot', function () {
- const vm = new Vue({
- template: '<test><template slot="test">hello</template></test>',
- components: {
- test: {
- template: '<div><slot name="test"></slot> world</div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('hello world')
- })
-
- it('combined with v-for', () => {
- const vm = new Vue({
- template: '<div><test v-for="i in 3" :key="i">{{ i }}</test></div>',
- components: {
- test: {
- template: '<div><slot></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div>1</div><div>2</div><div>3</div>')
- })
-
- it('inside template v-if', () => {
- mount({
- childTemplate: `
- <div>
- <template v-if="true"><slot></slot></template>
- </div>
- `,
- parentContent: 'foo'
- })
- expect(child.$el.innerHTML).toBe('foo')
- })
-
- it('default slot should use fallback content if has only whitespace', () => {
- mount({
- childTemplate: `
- <div>
- <slot name="first"><p>first slot</p></slot>
- <slot><p>this is the default slot</p></slot>
- <slot name="second"><p>second named slot</p></slot>
- </div>
- `,
- parentContent: `<div slot="first">1</div> <div slot="second">2</div> <div slot="second">2+</div>`
- })
- expect(child.$el.innerHTML).toBe(
- '<div>1</div> <p>this is the default slot</p> <div>2</div><div>2+</div>'
- )
- })
-
- it('programmatic access to $slots', () => {
- const vm = new Vue({
- template: '<test><p slot="a">A</p><div>C</div><p slot="b">B</p></test>',
- components: {
- test: {
- render () {
- expect(this.$slots.a.length).toBe(1)
- expect(this.$slots.a[0].tag).toBe('p')
- expect(this.$slots.a[0].children.length).toBe(1)
- expect(this.$slots.a[0].children[0].text).toBe('A')
-
- expect(this.$slots.b.length).toBe(1)
- expect(this.$slots.b[0].tag).toBe('p')
- expect(this.$slots.b[0].children.length).toBe(1)
- expect(this.$slots.b[0].children[0].text).toBe('B')
-
- expect(this.$slots.default.length).toBe(1)
- expect(this.$slots.default[0].tag).toBe('div')
- expect(this.$slots.default[0].children.length).toBe(1)
- expect(this.$slots.default[0].children[0].text).toBe('C')
-
- return this.$slots.default[0]
- }
- }
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('C')
- })
-
- it('warn if user directly returns array', () => {
- new Vue({
- template: '<test><div></div></test>',
- components: {
- test: {
- render () {
- return this.$slots.default
- }
- }
- }
- }).$mount()
- expect('Render function should return a single root node').toHaveBeenWarned()
- })
-
- // #3254
- it('should not keep slot name when passed further down', () => {
- const vm = new Vue({
- template: '<test><span slot="foo">foo</span></test>',
- components: {
- test: {
- template: '<child><slot name="foo"></slot></child>',
- components: {
- child: {
- template: `
- <div>
- <div class="default"><slot></slot></div>
- <div class="named"><slot name="foo"></slot></div>
- </div>
- `
- }
- }
- }
- }
- }).$mount()
- expect(vm.$el.querySelector('.default').textContent).toBe('foo')
- expect(vm.$el.querySelector('.named').textContent).toBe('')
- })
-
- it('should not keep slot name when passed further down (nested)', () => {
- const vm = new Vue({
- template: '<wrap><test><span slot="foo">foo</span></test></wrap>',
- components: {
- wrap: {
- template: '<div><slot></slot></div>'
- },
- test: {
- template: '<child><slot name="foo"></slot></child>',
- components: {
- child: {
- template: `
- <div>
- <div class="default"><slot></slot></div>
- <div class="named"><slot name="foo"></slot></div>
- </div>
- `
- }
- }
- }
- }
- }).$mount()
- expect(vm.$el.querySelector('.default').textContent).toBe('foo')
- expect(vm.$el.querySelector('.named').textContent).toBe('')
- })
-
- it('should not keep slot name when passed further down (functional)', () => {
- const child = {
- template: `
- <div>
- <div class="default"><slot></slot></div>
- <div class="named"><slot name="foo"></slot></div>
- </div>
- `
- }
-
- const vm = new Vue({
- template: '<test><span slot="foo">foo</span></test>',
- components: {
- test: {
- functional: true,
- render (h, ctx) {
- const slots = ctx.slots()
- return h(child, slots.foo)
- }
- }
- }
- }).$mount()
- expect(vm.$el.querySelector('.default').textContent).toBe('foo')
- expect(vm.$el.querySelector('.named').textContent).toBe('')
- })
-
- // #3400
- it('named slots should be consistent across re-renders', done => {
- const vm = new Vue({
- template: `
- <comp>
- <div slot="foo">foo</div>
- </comp>
- `,
- components: {
- comp: {
- data () {
- return { a: 1 }
- },
- template: `<div><slot name="foo"></slot>{{ a }}</div>`
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('foo1')
- vm.$children[0].a = 2
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('foo2')
- }).then(done)
- })
-
- // #3437
- it('should correctly re-create components in slot', done => {
- const calls = []
- const vm = new Vue({
- template: `
- <comp ref="child">
- <div slot="foo">
- <child></child>
- </div>
- </comp>
- `,
- components: {
- comp: {
- data () {
- return { ok: true }
- },
- template: `<div><slot name="foo" v-if="ok"></slot></div>`
- },
- child: {
- template: '<div>child</div>',
- created () {
- calls.push(1)
- },
- destroyed () {
- calls.push(2)
- }
- }
- }
- }).$mount()
-
- expect(calls).toEqual([1])
- vm.$refs.child.ok = false
- waitForUpdate(() => {
- expect(calls).toEqual([1, 2])
- vm.$refs.child.ok = true
- }).then(() => {
- expect(calls).toEqual([1, 2, 1])
- vm.$refs.child.ok = false
- }).then(() => {
- expect(calls).toEqual([1, 2, 1, 2])
- }).then(done)
- })
-
- it('warn duplicate slots', () => {
- new Vue({
- template: `<div>
- <test>
- <div>foo</div>
- <div slot="a">bar</div>
- </test>
- </div>`,
- components: {
- test: {
- template: `<div>
- <slot></slot><slot></slot>
- <div v-for="i in 3"><slot name="a"></slot></div>
- </div>`
- }
- }
- }).$mount()
- expect('Duplicate presence of slot "default"').toHaveBeenWarned()
- expect('Duplicate presence of slot "a"').toHaveBeenWarned()
- })
-
- it('should not warn valid conditional slots', () => {
- new Vue({
- template: `<div>
- <test>
- <div>foo</div>
- </test>
- </div>`,
- components: {
- test: {
- template: `<div>
- <slot v-if="true"></slot>
- <slot v-else></slot>
- </div>`
- }
- }
- }).$mount()
- expect('Duplicate presence of slot "default"').not.toHaveBeenWarned()
- })
-
- // #3518
- it('events should not break when slot is toggled by v-if', done => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- template: `<test><div class="click" @click="test">hi</div></test>`,
- methods: {
- test: spy
- },
- components: {
- test: {
- data: () => ({
- toggle: true
- }),
- template: `<div v-if="toggle"><slot></slot></div>`
- }
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('hi')
- vm.$children[0].toggle = false
- waitForUpdate(() => {
- vm.$children[0].toggle = true
- }).then(() => {
- triggerEvent(vm.$el.querySelector('.click'), 'click')
- expect(spy).toHaveBeenCalled()
- }).then(done)
- })
-
- it('renders static tree with text', () => {
- const vm = new Vue({
- template: `<div><test><template><div></div>Hello<div></div></template></test></div>`,
- components: {
- test: {
- template: '<div><slot></slot></div>'
- }
- }
- })
- vm.$mount()
- expect('Error when rendering root').not.toHaveBeenWarned()
- })
-
- // #3872
- it('functional component as slot', () => {
- const vm = new Vue({
- template: `
- <parent>
- <child>one</child>
- <child slot="a">two</child>
- </parent>
- `,
- components: {
- parent: {
- template: `<div><slot name="a"></slot><slot></slot></div>`
- },
- child: {
- functional: true,
- render (h, { slots }) {
- return h('div', slots().default)
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML.trim()).toBe('<div>two</div><div>one</div>')
- })
-
- // #4209
- it('slot of multiple text nodes should not be infinitely merged', done => {
- const wrap = {
- template: `<inner ref="inner">foo<slot></slot></inner>`,
- components: {
- inner: {
- data: () => ({ a: 1 }),
- template: `<div>{{a}}<slot></slot></div>`
- }
- }
- }
- const vm = new Vue({
- template: `<wrap ref="wrap">bar</wrap>`,
- components: { wrap }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('1foobar')
- vm.$refs.wrap.$refs.inner.a++
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('2foobar')
- }).then(done)
- })
-
- // #4315
- it('functional component passing slot content to stateful child component', done => {
- const ComponentWithSlots = {
- render (h) {
- return h('div', this.$slots.slot1)
- }
- }
-
- const FunctionalComp = {
- functional: true,
- render (h) {
- return h(ComponentWithSlots, [h('span', { slot: 'slot1' }, 'foo')])
- }
- }
-
- const vm = new Vue({
- data: { n: 1 },
- render (h) {
- return h('div', [this.n, h(FunctionalComp)])
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('1foo')
- vm.n++
- waitForUpdate(() => {
- // should not lose named slot
- expect(vm.$el.textContent).toBe('2foo')
- }).then(done)
- })
-
- it('the elements of slot should be updated correctly', done => {
- const vm = new Vue({
- data: { n: 1 },
- template: '<div><test><span v-for="i in n" :key="i">{{ i }}</span><input value="a"/></test></div>',
- components: {
- test: {
- template: '<div><slot></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div><span>1</span><input value="a"></div>')
- const input = vm.$el.querySelector('input')
- input.value = 'b'
- vm.n++
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div><span>1</span><span>2</span><input value="a"></div>')
- expect(vm.$el.querySelector('input')).toBe(input)
- expect(vm.$el.querySelector('input').value).toBe('b')
- }).then(done)
- })
-
- // GitHub issue #5888
- it('should resolve correctly slot with keep-alive', () => {
- const vm = new Vue({
- template: `
- <div>
- <container>
- <keep-alive slot="foo">
- <child></child>
- </keep-alive>
- </container>
- </div>
- `,
- components: {
- container: {
- template:
- '<div><slot>default</slot><slot name="foo">named</slot></div>'
- },
- child: {
- template: '<span>foo</span>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div>default<span>foo</span></div>')
- })
-
- // #6372, #6915
- it('should handle nested components in slots properly', done => {
- const TestComponent = {
- template: `
- <component :is="toggleEl ? 'b' : 'i'">
- <slot />
- </component>
- `,
- data () {
- return {
- toggleEl: true
- }
- }
- }
-
- const vm = new Vue({
- template: `
- <div>
- <test-component ref="test">
- <div>
- <foo/>
- </div>
- <bar>
- <foo/>
- </bar>
- </test-component>
- </div>
- `,
- components: {
- TestComponent,
- foo: {
- template: `<div>foo</div>`
- },
- bar: {
- template: `<div>bar<slot/></div>`
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe(`<b><div><div>foo</div></div> <div>bar<div>foo</div></div></b>`)
-
- vm.$refs.test.toggleEl = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(`<i><div><div>foo</div></div> <div>bar<div>foo</div></div></i>`)
- }).then(done)
- })
-
- it('should preserve slot attribute if not absorbed by a Vue component', () => {
- const vm = new Vue({
- template: `
- <div>
- <div slot="foo"></div>
- </div>
- `
- }).$mount()
- expect(vm.$el.children[0].getAttribute('slot')).toBe('foo')
- })
-
- it('passing a slot down as named slot', () => {
- const Bar = {
- template: `<div class="bar"><slot name="foo"/></div>`
- }
-
- const Foo = {
- components: { Bar },
- template: `<div class="foo"><bar><slot slot="foo"/></bar></div>`
- }
-
- const vm = new Vue({
- components: { Foo },
- template: `<div><foo>hello</foo></div>`
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<div class="foo"><div class="bar">hello</div></div>')
- })
-
- it('fallback content for named template slot', () => {
- const Bar = {
- template: `<div class="bar"><slot name="foo">fallback</slot></div>`
- }
-
- const Foo = {
- components: { Bar },
- template: `<div class="foo"><bar><template slot="foo"/><slot/></template></bar></div>`
- }
-
- const vm = new Vue({
- components: { Foo },
- template: `<div><foo></foo></div>`
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<div class="foo"><div class="bar">fallback</div></div>')
- })
-
- // #7106
- it('should not lose functional slot across renders', done => {
- const One = {
- data: () => ({
- foo: true
- }),
- render (h) {
- this.foo
- return h('div', this.$slots.slot)
- }
- }
-
- const Two = {
- render (h) {
- return h('span', this.$slots.slot)
- }
- }
-
- const Three = {
- functional: true,
- render: (h, { children }) => h('span', children)
- }
-
- const vm = new Vue({
- template: `
- <div>
- <one ref="one">
- <two slot="slot">
- <three slot="slot">hello</three>
- </two>
- </one>
- </div>
- `,
- components: { One, Two, Three }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('hello')
- // trigger re-render of <one>
- vm.$refs.one.foo = false
- waitForUpdate(() => {
- // should still be there
- expect(vm.$el.textContent).toBe('hello')
- }).then(done)
- })
-
- it('should allow passing named slots as raw children down multiple layers of functional component', () => {
- const CompB = {
- functional: true,
- render (h, { slots }) {
- return slots().foo
- }
- }
-
- const CompA = {
- functional: true,
- render (h, { children }) {
- return h(CompB, children)
- }
- }
-
- const vm = new Vue({
- components: {
- CompA
- },
- template: `
- <div>
- <comp-a>
- <span slot="foo">foo</span>
- </comp-a>
- </div>
- `
- }).$mount()
-
- expect(vm.$el.textContent).toBe('foo')
- })
-
- // #7817
- it('should not match wrong named slot in functional component on re-render', done => {
- const Functional = {
- functional: true,
- render: (h, ctx) => ctx.slots().default
- }
-
- const Stateful = {
- data () {
- return { ok: true }
- },
- render (h) {
- this.ok // register dep
- return h('div', [
- h(Functional, this.$slots.named)
- ])
- }
- }
-
- const vm = new Vue({
- template: `<stateful ref="stateful"><div slot="named">foo</div></stateful>`,
- components: { Stateful }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('foo')
- vm.$refs.stateful.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('foo')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Component', () => {
- it('static', () => {
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: {
- data () {
- return { a: 123 }
- },
- template: '<span>{{a}}</span>'
- }
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('SPAN')
- expect(vm.$el.innerHTML).toBe('123')
- })
-
- it('using component in restricted elements', () => {
- const vm = new Vue({
- template: '<div><table><tbody><test></test></tbody></table></div>',
- components: {
- test: {
- data () {
- return { a: 123 }
- },
- template: '<tr><td>{{a}}</td></tr>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<table><tbody><tr><td>123</td></tr></tbody></table>')
- })
-
- it('"is" attribute', () => {
- const vm = new Vue({
- template: '<div><table><tbody><tr is="test"></tr></tbody></table></div>',
- components: {
- test: {
- data () {
- return { a: 123 }
- },
- template: '<tr><td>{{a}}</td></tr>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<table><tbody><tr><td>123</td></tr></tbody></table>')
- })
-
- it('inline-template', () => {
- const vm = new Vue({
- template: '<div><test inline-template><span>{{a}}</span></test></div>',
- data: {
- a: 'parent'
- },
- components: {
- test: {
- data () {
- return { a: 'child' }
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>child</span>')
- })
-
- it('fragment instance warning', () => {
- new Vue({
- template: '<test></test>',
- components: {
- test: {
- data () {
- return { a: 123, b: 234 }
- },
- template: '<p>{{a}}</p><p>{{b}}</p>'
- }
- }
- }).$mount()
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('dynamic', done => {
- const vm = new Vue({
- template: '<component :is="view" :view="view"></component>',
- data: {
- view: 'view-a'
- },
- components: {
- 'view-a': {
- template: '<div>foo {{view}}</div>',
- data () {
- return { view: 'a' }
- }
- },
- 'view-b': {
- template: '<div>bar {{view}}</div>',
- data () {
- return { view: 'b' }
- }
- }
- }
- }).$mount()
- expect(vm.$el.outerHTML).toBe('<div view="view-a">foo a</div>')
- vm.view = 'view-b'
- waitForUpdate(() => {
- expect(vm.$el.outerHTML).toBe('<div view="view-b">bar b</div>')
- vm.view = ''
- })
- .then(() => {
- expect(vm.$el.nodeType).toBe(8)
- expect(vm.$el.data).toBe('')
- }).then(done)
- })
-
- it('dynamic with props', done => {
- const vm = new Vue({
- template: '<component :is="view" :view="view"></component>',
- data: {
- view: 'view-a'
- },
- components: {
- 'view-a': {
- template: '<div>foo {{view}}</div>',
- props: ['view']
- },
- 'view-b': {
- template: '<div>bar {{view}}</div>',
- props: ['view']
- }
- }
- }).$mount()
- expect(vm.$el.outerHTML).toBe('<div>foo view-a</div>')
- vm.view = 'view-b'
- waitForUpdate(() => {
- expect(vm.$el.outerHTML).toBe('<div>bar view-b</div>')
- vm.view = ''
- }).then(() => {
- expect(vm.$el.nodeType).toBe(8)
- expect(vm.$el.data).toBe('')
- }).then(done)
- })
-
- it(':is using raw component constructor', () => {
- const vm = new Vue({
- template:
- '<div>' +
- '<component :is="$options.components.test"></component>' +
- '<component :is="$options.components.async"></component>' +
- '</div>',
- components: {
- test: {
- template: '<span>foo</span>'
- },
- async: function (resolve) {
- resolve({
- template: '<span>bar</span>'
- })
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo</span><span>bar</span>')
- })
-
- it('dynamic combined with v-for', done => {
- const vm = new Vue({
- template:
- '<div>' +
- '<component v-for="(c, i) in comps" :key="i" :is="c.type"></component>' +
- '</div>',
- data: {
- comps: [{ type: 'one' }, { type: 'two' }]
- },
- components: {
- one: {
- template: '<span>one</span>'
- },
- two: {
- template: '<span>two</span>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>one</span><span>two</span>')
- vm.comps[1].type = 'one'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>one</span><span>one</span>')
- }).then(done)
- })
-
- it('dynamic elements with domProps', done => {
- const vm = new Vue({
- template: '<component :is="view" :value.prop="val"></component>',
- data: {
- view: 'input',
- val: 'hello'
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('INPUT')
- expect(vm.$el.value).toBe('hello')
- vm.view = 'textarea'
- vm.val += ' world'
- waitForUpdate(() => {
- expect(vm.$el.tagName).toBe('TEXTAREA')
- expect(vm.$el.value).toBe('hello world')
- vm.view = ''
- }).then(done)
- })
-
- it('should compile parent template directives & content in parent scope', done => {
- const vm = new Vue({
- data: {
- ok: false,
- message: 'hello'
- },
- template: '<test v-show="ok">{{message}}</test>',
- components: {
- test: {
- template: '<div><slot></slot> {{message}}</div>',
- data () {
- return {
- message: 'world'
- }
- }
- }
- }
- }).$mount()
- expect(vm.$el.style.display).toBe('none')
- expect(vm.$el.textContent).toBe('hello world')
- vm.ok = true
- vm.message = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.style.display).toBe('')
- expect(vm.$el.textContent).toBe('bye world')
- }).then(done)
- })
-
- it('parent content + v-if', done => {
- const vm = new Vue({
- data: {
- ok: false,
- message: 'hello'
- },
- template: '<test v-if="ok">{{message}}</test>',
- components: {
- test: {
- template: '<div><slot></slot> {{message}}</div>',
- data () {
- return {
- message: 'world'
- }
- }
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('')
- expect(vm.$children.length).toBe(0)
- vm.ok = true
- waitForUpdate(() => {
- expect(vm.$children.length).toBe(1)
- expect(vm.$el.textContent).toBe('hello world')
- }).then(done)
- })
-
- it('props', () => {
- const vm = new Vue({
- data: {
- list: [{ a: 1 }, { a: 2 }]
- },
- template: '<test :collection="list"></test>',
- components: {
- test: {
- template: '<ul><li v-for="item in collection">{{item.a}}</li></ul>',
- props: ['collection']
- }
- }
- }).$mount()
- expect(vm.$el.outerHTML).toBe('<ul><li>1</li><li>2</li></ul>')
- })
-
- it('should warn when using camelCased props in in-DOM template', () => {
- new Vue({
- data: {
- list: [{ a: 1 }, { a: 2 }]
- },
- template: '<test :somecollection="list"></test>', // <-- simulate lowercased template
- components: {
- test: {
- template: '<ul><li v-for="item in someCollection">{{item.a}}</li></ul>',
- props: ['someCollection']
- }
- }
- }).$mount()
- expect(
- 'You should probably use "some-collection" instead of "someCollection".'
- ).toHaveBeenTipped()
- })
-
- it('should warn when using camelCased events in in-DOM template', () => {
- new Vue({
- template: '<test @foobar="a++"></test>', // <-- simulate lowercased template
- components: {
- test: {
- template: '<div></div>',
- created () {
- this.$emit('fooBar')
- }
- }
- }
- }).$mount()
- expect(
- 'You should probably use "foo-bar" instead of "fooBar".'
- ).toHaveBeenTipped()
- })
-
- it('not found component should not throw', () => {
- expect(function () {
- new Vue({
- template: '<div is="non-existent"></div>'
- })
- }).not.toThrow()
- })
-
- it('properly update replaced higher-order component root node', done => {
- const vm = new Vue({
- data: {
- color: 'red'
- },
- template: '<test id="foo" :class="color"></test>',
- components: {
- test: {
- data () {
- return { tag: 'div' }
- },
- render (h) {
- return h(this.tag, { class: 'test' }, 'hi')
- }
- }
- }
- }).$mount()
-
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.id).toBe('foo')
- expect(vm.$el.className).toBe('test red')
-
- vm.color = 'green'
- waitForUpdate(() => {
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.id).toBe('foo')
- expect(vm.$el.className).toBe('test green')
- vm.$children[0].tag = 'p'
- }).then(() => {
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.id).toBe('foo')
- expect(vm.$el.className).toBe('test green')
- vm.color = 'red'
- }).then(() => {
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.id).toBe('foo')
- expect(vm.$el.className).toBe('test red')
- }).then(done)
- })
-
- it('catch component render error and preserve previous vnode', done => {
- const spy = jasmine.createSpy()
- Vue.config.errorHandler = spy
- const vm = new Vue({
- data: {
- a: {
- b: 123
- }
- },
- render (h) {
- return h('div', [this.a.b])
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('123')
- expect(spy).not.toHaveBeenCalled()
- vm.a = null
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.$el.textContent).toBe('123') // should preserve rendered DOM
- vm.a = { b: 234 }
- }).then(() => {
- expect(vm.$el.textContent).toBe('234') // should be able to recover
- Vue.config.errorHandler = null
- }).then(done)
- })
-
- it('relocates node without error', done => {
- const el = document.createElement('div')
- document.body.appendChild(el)
- const target = document.createElement('div')
- document.body.appendChild(target)
-
- const Test = {
- render (h) {
- return h('div', { class: 'test' }, this.$slots.default)
- },
- mounted () {
- target.appendChild(this.$el)
- },
- beforeDestroy () {
- const parent = this.$el.parentNode
- if (parent) {
- parent.removeChild(this.$el)
- }
- }
- }
- const vm = new Vue({
- data () {
- return {
- view: true
- }
- },
- template: `<div><test v-if="view">Test</test></div>`,
- components: {
- test: Test
- }
- }).$mount(el)
-
- expect(el.outerHTML).toBe('<div></div>')
- expect(target.outerHTML).toBe('<div><div class="test">Test</div></div>')
- vm.view = false
- waitForUpdate(() => {
- expect(el.outerHTML).toBe('<div></div>')
- expect(target.outerHTML).toBe('<div></div>')
- vm.$destroy()
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { formatComponentName, warn } from 'core/util/debug'
-
-describe('Debug utilities', () => {
- it('properly format component names', () => {
- const vm = new Vue()
- expect(formatComponentName(vm)).toBe('<Root>')
-
- vm.$root = null
- vm.$options.name = 'hello-there'
- expect(formatComponentName(vm)).toBe('<HelloThere>')
-
- vm.$options.name = null
- vm.$options._componentTag = 'foo-bar-1'
- expect(formatComponentName(vm)).toBe('<FooBar1>')
-
- vm.$options._componentTag = null
- vm.$options.__file = '/foo/bar/baz/SomeThing.vue'
- expect(formatComponentName(vm)).toBe(`<SomeThing> at ${vm.$options.__file}`)
- expect(formatComponentName(vm, false)).toBe('<SomeThing>')
-
- vm.$options.__file = 'C:\\foo\\bar\\baz\\windows_file.vue'
- expect(formatComponentName(vm)).toBe(`<WindowsFile> at ${vm.$options.__file}`)
- expect(formatComponentName(vm, false)).toBe('<WindowsFile>')
- })
-
- it('generate correct component hierarchy trace', () => {
- const one = {
- name: 'one',
- render: h => h(two)
- }
- const two = {
- name: 'two',
- render: h => h(three)
- }
- const three = {
- name: 'three'
- }
- new Vue({
- render: h => h(one)
- }).$mount()
-
- expect(
- `Failed to mount component: template or render function not defined.
-
-found in
-
----> <Three>
- <Two>
- <One>
- <Root>`
- ).toHaveBeenWarned()
- })
-
- it('generate correct component hierarchy trace (recursive)', () => {
- let i = 0
- const one = {
- name: 'one',
- render: h => i++ < 5 ? h(one) : h(two)
- }
- const two = {
- name: 'two',
- render: h => h(three)
- }
- const three = {
- name: 'three'
- }
- new Vue({
- render: h => h(one)
- }).$mount()
-
- expect(
- `Failed to mount component: template or render function not defined.
-
-found in
-
----> <Three>
- <Two>
- <One>... (5 recursive calls)
- <Root>`
- ).toHaveBeenWarned()
- })
-
- describe('warn', () => {
- const msg = 'message'
- const vm = new Vue()
-
- it('calls warnHandler if warnHandler is set', () => {
- Vue.config.warnHandler = jasmine.createSpy()
-
- warn(msg, vm)
-
- expect(Vue.config.warnHandler).toHaveBeenCalledWith(msg, vm, jasmine.any(String))
-
- Vue.config.warnHandler = null
- })
-
- it('calls console.error if silent is false', () => {
- Vue.config.silent = false
-
- warn(msg, vm)
-
- expect(msg).toHaveBeenWarned()
- expect(console.error).toHaveBeenCalled()
- })
-
- it('does not call console.error if silent is true', () => {
- Vue.config.silent = true
-
- warn(msg, vm)
-
- expect(console.error).not.toHaveBeenCalled()
-
- Vue.config.silent = false
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-bind', () => {
- it('normal attr', done => {
- const vm = new Vue({
- template: '<div><span :test="foo">hello</span></div>',
- data: { foo: 'ok' }
- }).$mount()
- expect(vm.$el.firstChild.getAttribute('test')).toBe('ok')
- vm.foo = 'again'
- waitForUpdate(() => {
- expect(vm.$el.firstChild.getAttribute('test')).toBe('again')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.firstChild.hasAttribute('test')).toBe(false)
- vm.foo = false
- }).then(() => {
- expect(vm.$el.firstChild.hasAttribute('test')).toBe(false)
- vm.foo = true
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('test')).toBe('true')
- vm.foo = 0
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('test')).toBe('0')
- }).then(done)
- })
-
- it('should set property for input value', done => {
- const vm = new Vue({
- template: `
- <div>
- <input type="text" :value="foo">
- <input type="checkbox" :checked="bar">
- </div>
- `,
- data: {
- foo: 'ok',
- bar: false
- }
- }).$mount()
- expect(vm.$el.firstChild.value).toBe('ok')
- expect(vm.$el.lastChild.checked).toBe(false)
- vm.bar = true
- waitForUpdate(() => {
- expect(vm.$el.lastChild.checked).toBe(true)
- }).then(done)
- })
-
- it('xlink', done => {
- const vm = new Vue({
- template: '<svg><a :xlink:special="foo"></a></svg>',
- data: {
- foo: 'ok'
- }
- }).$mount()
- const xlinkNS = 'http://www.w3.org/1999/xlink'
- expect(vm.$el.firstChild.getAttributeNS(xlinkNS, 'special')).toBe('ok')
- vm.foo = 'again'
- waitForUpdate(() => {
- expect(vm.$el.firstChild.getAttributeNS(xlinkNS, 'special')).toBe('again')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.firstChild.hasAttributeNS(xlinkNS, 'special')).toBe(false)
- vm.foo = true
- }).then(() => {
- expect(vm.$el.firstChild.getAttributeNS(xlinkNS, 'special')).toBe('true')
- }).then(done)
- })
-
- it('enumerated attr', done => {
- const vm = new Vue({
- template: '<div><span :draggable="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('true')
- vm.foo = 'again'
- waitForUpdate(() => {
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('true')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('false')
- vm.foo = ''
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('true')
- vm.foo = false
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('false')
- vm.foo = 'false'
- }).then(() => {
- expect(vm.$el.firstChild.getAttribute('draggable')).toBe('false')
- }).then(done)
- })
-
- it('boolean attr', done => {
- const vm = new Vue({
- template: '<div><span :disabled="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.firstChild.getAttribute('disabled')).toBe('disabled')
- vm.foo = 'again'
- waitForUpdate(() => {
- expect(vm.$el.firstChild.getAttribute('disabled')).toBe('disabled')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.firstChild.hasAttribute('disabled')).toBe(false)
- vm.foo = ''
- }).then(() => {
- expect(vm.$el.firstChild.hasAttribute('disabled')).toBe(true)
- }).then(done)
- })
-
- it('.prop modifier', () => {
- const vm = new Vue({
- template: '<div><span v-bind:text-content.prop="foo"></span><span :inner-html.prop="bar"></span></div>',
- data: {
- foo: 'hello',
- bar: '<span>qux</span>'
- }
- }).$mount()
- expect(vm.$el.children[0].textContent).toBe('hello')
- expect(vm.$el.children[1].innerHTML).toBe('<span>qux</span>')
- })
-
- it('.prop modifier with normal attribute binding', () => {
- const vm = new Vue({
- template: '<input :some.prop="some" :id="id">',
- data: {
- some: 'hello',
- id: false
- }
- }).$mount()
- expect(vm.$el.some).toBe('hello')
- expect(vm.$el.getAttribute('id')).toBe(null)
- })
-
- it('.camel modifier', () => {
- const vm = new Vue({
- template: '<svg :view-box.camel="viewBox"></svg>',
- data: {
- viewBox: '0 0 1 1'
- }
- }).$mount()
- expect(vm.$el.getAttribute('viewBox')).toBe('0 0 1 1')
- })
-
- it('.sync modifier', done => {
- const vm = new Vue({
- template: `<test :foo-bar.sync="bar"/>`,
- data: {
- bar: 1
- },
- components: {
- test: {
- props: ['fooBar'],
- template: `<div @click="$emit('update:fooBar', 2)">{{ fooBar }}</div>`
- }
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('1')
- triggerEvent(vm.$el, 'click')
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('2')
- }).then(done)
- })
-
- it('bind object', done => {
- const vm = new Vue({
- template: '<input v-bind="test">',
- data: {
- test: {
- id: 'test',
- class: 'ok',
- value: 'hello'
- }
- }
- }).$mount()
- expect(vm.$el.getAttribute('id')).toBe('test')
- expect(vm.$el.getAttribute('class')).toBe('ok')
- expect(vm.$el.value).toBe('hello')
- vm.test.id = 'hi'
- vm.test.value = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.getAttribute('id')).toBe('hi')
- expect(vm.$el.getAttribute('class')).toBe('ok')
- expect(vm.$el.value).toBe('bye')
- }).then(done)
- })
-
- it('.sync modifier with bind object', done => {
- const vm = new Vue({
- template: `<test v-bind.sync="test"/>`,
- data: {
- test: {
- fooBar: 1
- }
- },
- components: {
- test: {
- props: ['fooBar'],
- template: `<div @click="handleUpdate">{{ fooBar }}</div>`,
- methods: {
- handleUpdate () {
- this.$emit('update:fooBar', 2)
- }
- }
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('1')
- triggerEvent(vm.$el, 'click')
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('2')
- vm.test.fooBar = 3
- }).then(() => {
- expect(vm.$el.textContent).toBe('3')
- }).then(done)
- })
-
- it('bind object with overwrite', done => {
- const vm = new Vue({
- template: '<input v-bind="test" id="foo" :class="test.value">',
- data: {
- test: {
- id: 'test',
- class: 'ok',
- value: 'hello'
- }
- }
- }).$mount()
- expect(vm.$el.getAttribute('id')).toBe('foo')
- expect(vm.$el.getAttribute('class')).toBe('hello')
- expect(vm.$el.value).toBe('hello')
- vm.test.id = 'hi'
- vm.test.value = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.getAttribute('id')).toBe('foo')
- expect(vm.$el.getAttribute('class')).toBe('bye')
- expect(vm.$el.value).toBe('bye')
- }).then(done)
- })
-
- it('bind object with class/style', done => {
- const vm = new Vue({
- template: '<input class="a" style="color:red" v-bind="test">',
- data: {
- test: {
- id: 'test',
- class: ['b', 'c'],
- style: { fontSize: '12px' }
- }
- }
- }).$mount()
- expect(vm.$el.id).toBe('test')
- expect(vm.$el.className).toBe('a b c')
- expect(vm.$el.style.color).toBe('red')
- expect(vm.$el.style.fontSize).toBe('12px')
- vm.test.id = 'hi'
- vm.test.class = ['d']
- vm.test.style = { fontSize: '14px' }
- waitForUpdate(() => {
- expect(vm.$el.id).toBe('hi')
- expect(vm.$el.className).toBe('a d')
- expect(vm.$el.style.color).toBe('red')
- expect(vm.$el.style.fontSize).toBe('14px')
- }).then(done)
- })
-
- it('bind object as prop', done => {
- const vm = new Vue({
- template: '<input v-bind.prop="test">',
- data: {
- test: {
- id: 'test',
- className: 'ok',
- value: 'hello'
- }
- }
- }).$mount()
- expect(vm.$el.id).toBe('test')
- expect(vm.$el.className).toBe('ok')
- expect(vm.$el.value).toBe('hello')
- vm.test.id = 'hi'
- vm.test.className = 'okay'
- vm.test.value = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.id).toBe('hi')
- expect(vm.$el.className).toBe('okay')
- expect(vm.$el.value).toBe('bye')
- }).then(done)
- })
-
- it('bind array', done => {
- const vm = new Vue({
- template: '<input v-bind="test">',
- data: {
- test: [
- { id: 'test', class: 'ok' },
- { value: 'hello' }
- ]
- }
- }).$mount()
- expect(vm.$el.getAttribute('id')).toBe('test')
- expect(vm.$el.getAttribute('class')).toBe('ok')
- expect(vm.$el.value).toBe('hello')
- vm.test[0].id = 'hi'
- vm.test[1].value = 'bye'
- waitForUpdate(() => {
- expect(vm.$el.getAttribute('id')).toBe('hi')
- expect(vm.$el.getAttribute('class')).toBe('ok')
- expect(vm.$el.value).toBe('bye')
- }).then(done)
- })
-
- it('warn expect object', () => {
- new Vue({
- template: '<input v-bind="test">',
- data: {
- test: 1
- }
- }).$mount()
- expect('v-bind without argument expects an Object or Array value').toHaveBeenWarned()
- })
-
- it('set value for option element', () => {
- const vm = new Vue({
- template: '<select><option :value="val">val</option></select>',
- data: {
- val: 'val'
- }
- }).$mount()
- // check value attribute
- expect(vm.$el.options[0].getAttribute('value')).toBe('val')
- })
-
- // a vdom patch edge case where the user has several un-keyed elements of the
- // same tag next to each other, and toggling them.
- it('properly update for toggling un-keyed children', done => {
- const vm = new Vue({
- template: `
- <div>
- <div v-if="ok" id="a" data-test="1"></div>
- <div v-if="!ok" id="b"></div>
- </div>
- `,
- data: {
- ok: true
- }
- }).$mount()
- expect(vm.$el.children[0].id).toBe('a')
- expect(vm.$el.children[0].getAttribute('data-test')).toBe('1')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].id).toBe('b')
- expect(vm.$el.children[0].getAttribute('data-test')).toBe(null)
- }).then(done)
- })
-
- describe('bind object with special attribute', () => {
- function makeInstance (options) {
- return new Vue({
- template: `<div>${options.parentTemp}</div>`,
- data: {
- attrs: {
- [options.attr]: options.value
- }
- },
- components: {
- comp: {
- template: options.childTemp
- }
- }
- }).$mount()
- }
-
- it('key', () => {
- const vm = makeInstance({
- attr: 'key',
- value: 'test',
- parentTemp: '<div v-bind="attrs"></div>'
- })
- expect(vm._vnode.children[0].key).toBe('test')
- })
-
- it('ref', () => {
- const vm = makeInstance({
- attr: 'ref',
- value: 'test',
- parentTemp: '<div v-bind="attrs"></div>'
- })
- expect(vm.$refs.test).toBe(vm.$el.firstChild)
- })
-
- it('slot', () => {
- const vm = makeInstance({
- attr: 'slot',
- value: 'test',
- parentTemp: '<comp><span v-bind="attrs">123</span></comp>',
- childTemp: '<div>slot:<slot name="test"></slot></div>'
- })
- expect(vm.$el.innerHTML).toBe('<div>slot:<span>123</span></div>')
- })
-
- it('is', () => {
- const vm = makeInstance({
- attr: 'is',
- value: 'comp',
- parentTemp: '<component v-bind="attrs"></component>',
- childTemp: '<div>comp</div>'
- })
- expect(vm.$el.innerHTML).toBe('<div>comp</div>')
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-function assertClass (assertions, done) {
- const vm = new Vue({
- template: '<div class="foo" :class="value"></div>',
- data: { value: '' }
- }).$mount()
- var chain = waitForUpdate()
- assertions.forEach(([value, expected], i) => {
- chain.then(() => {
- if (typeof value === 'function') {
- value(vm.value)
- } else {
- vm.value = value
- }
- }).then(() => {
- expect(vm.$el.className).toBe(expected)
- if (i >= assertions.length - 1) {
- done()
- }
- })
- })
- chain.then(done)
-}
-
-describe('Directive v-bind:class', () => {
- it('plain string', done => {
- assertClass([
- ['bar', 'foo bar'],
- ['baz qux', 'foo baz qux'],
- ['qux', 'foo qux'],
- [undefined, 'foo']
- ], done)
- })
-
- it('object value', done => {
- assertClass([
- [{ bar: true, baz: false }, 'foo bar'],
- [{ baz: true }, 'foo baz'],
- [null, 'foo'],
- [{ 'bar baz': true, qux: false }, 'foo bar baz'],
- [{ qux: true }, 'foo qux']
- ], done)
- })
-
- it('array value', done => {
- assertClass([
- [['bar', 'baz'], 'foo bar baz'],
- [['qux', 'baz'], 'foo qux baz'],
- [['w', 'x y z'], 'foo w x y z'],
- [undefined, 'foo'],
- [['bar'], 'foo bar'],
- [val => val.push('baz'), 'foo bar baz']
- ], done)
- })
-
- it('array of mixed values', done => {
- assertClass([
- [['x', { y: true, z: true }], 'foo x y z'],
- [['x', { y: true, z: false }], 'foo x y'],
- [['f', { z: true }], 'foo f z'],
- [['l', 'f', { n: true, z: true }], 'foo l f n z'],
- [['x', {}], 'foo x'],
- [undefined, 'foo']
- ], done)
- })
-
- it('class merge between parent and child', done => {
- const vm = new Vue({
- template: '<child class="a" :class="value"></child>',
- data: { value: 'b' },
- components: {
- child: {
- template: '<div class="c" :class="value"></div>',
- data: () => ({ value: 'd' })
- }
- }
- }).$mount()
- const child = vm.$children[0]
- expect(vm.$el.className).toBe('c a d b')
- vm.value = 'e'
- waitForUpdate(() => {
- expect(vm.$el.className).toBe('c a d e')
- }).then(() => {
- child.value = 'f'
- }).then(() => {
- expect(vm.$el.className).toBe('c a f e')
- }).then(() => {
- vm.value = { foo: true }
- child.value = ['bar', 'baz']
- }).then(() => {
- expect(vm.$el.className).toBe('c a bar baz foo')
- }).then(done)
- })
-
- it('class merge between multiple nested components sharing same element', done => {
- const vm = new Vue({
- template: `
- <component1 :class="componentClass1">
- <component2 :class="componentClass2">
- <component3 :class="componentClass3">
- some text
- </component3>
- </component2>
- </component1>
- `,
- data: {
- componentClass1: 'componentClass1',
- componentClass2: 'componentClass2',
- componentClass3: 'componentClass3'
- },
- components: {
- component1: {
- render () {
- return this.$slots.default[0]
- }
- },
- component2: {
- render () {
- return this.$slots.default[0]
- }
- },
- component3: {
- template: '<div class="staticClass"><slot></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.className).toBe('staticClass componentClass3 componentClass2 componentClass1')
- vm.componentClass1 = 'c1'
- waitForUpdate(() => {
- expect(vm.$el.className).toBe('staticClass componentClass3 componentClass2 c1')
- vm.componentClass2 = 'c2'
- }).then(() => {
- expect(vm.$el.className).toBe('staticClass componentClass3 c2 c1')
- vm.componentClass3 = 'c3'
- }).then(() => {
- expect(vm.$el.className).toBe('staticClass c3 c2 c1')
- }).then(done)
- })
-
- it('deep update', done => {
- const vm = new Vue({
- template: '<div :class="test"></div>',
- data: {
- test: { a: true, b: false }
- }
- }).$mount()
- expect(vm.$el.className).toBe('a')
- vm.test.b = true
- waitForUpdate(() => {
- expect(vm.$el.className).toBe('a b')
- }).then(done)
- })
-
- // a vdom patch edge case where the user has several un-keyed elements of the
- // same tag next to each other, and toggling them.
- it('properly remove staticClass for toggling un-keyed children', done => {
- const vm = new Vue({
- template: `
- <div>
- <div v-if="ok" class="a"></div>
- <div v-if="!ok"></div>
- </div>
- `,
- data: {
- ok: true
- }
- }).$mount()
- expect(vm.$el.children[0].className).toBe('a')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-cloak', () => {
- it('should be removed after compile', () => {
- const el = document.createElement('div')
- el.setAttribute('v-cloak', '')
- const vm = new Vue({ el })
- expect(vm.$el.hasAttribute('v-cloak')).toBe(false)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-for', () => {
- it('should render array of primitive values', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="item in list">{{item}}</span>
- </div>
- `,
- data: {
- list: ['a', 'b', 'c']
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>a</span><span>b</span><span>c</span>')
- Vue.set(vm.list, 0, 'd')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>d</span><span>b</span><span>c</span>')
- vm.list.push('d')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>d</span><span>b</span><span>c</span><span>d</span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>d</span><span>d</span>')
- vm.list = ['x', 'y']
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>x</span><span>y</span>')
- }).then(done)
- })
-
- it('should render array of primitive values with index', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(item, i) in list">{{i}}-{{item}}</span>
- </div>
- `,
- data: {
- list: ['a', 'b', 'c']
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0-a</span><span>1-b</span><span>2-c</span>')
- Vue.set(vm.list, 0, 'd')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-d</span><span>1-b</span><span>2-c</span>')
- vm.list.push('d')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-d</span><span>1-b</span><span>2-c</span><span>3-d</span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-d</span><span>1-d</span>')
- vm.list = ['x', 'y']
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-x</span><span>1-y</span>')
- }).then(done)
- })
-
- it('should render array of object values', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="item in list">{{item.value}}</span>
- </div>
- `,
- data: {
- list: [
- { value: 'a' },
- { value: 'b' },
- { value: 'c' }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>a</span><span>b</span><span>c</span>')
- Vue.set(vm.list, 0, { value: 'd' })
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>d</span><span>b</span><span>c</span>')
- vm.list[0].value = 'e'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>e</span><span>b</span><span>c</span>')
- vm.list.push({})
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>e</span><span>b</span><span>c</span><span></span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>e</span><span></span>')
- vm.list = [{ value: 'x' }, { value: 'y' }]
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>x</span><span>y</span>')
- }).then(done)
- })
-
- it('should render array of object values with index', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(item, i) in list">{{i}}-{{item.value}}</span>
- </div>
- `,
- data: {
- list: [
- { value: 'a' },
- { value: 'b' },
- { value: 'c' }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0-a</span><span>1-b</span><span>2-c</span>')
- Vue.set(vm.list, 0, { value: 'd' })
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-d</span><span>1-b</span><span>2-c</span>')
- vm.list[0].value = 'e'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-e</span><span>1-b</span><span>2-c</span>')
- vm.list.push({})
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-e</span><span>1-b</span><span>2-c</span><span>3-</span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-e</span><span>1-</span>')
- vm.list = [{ value: 'x' }, { value: 'y' }]
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>0-x</span><span>1-y</span>')
- }).then(done)
- })
-
- it('should render an Object', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="val in obj">{{val}}</span>
- </div>
- `,
- data: {
- obj: { a: 0, b: 1, c: 2 }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0</span><span>1</span><span>2</span>')
- vm.obj.a = 3
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>3</span><span>1</span><span>2</span>')
- Vue.set(vm.obj, 'd', 4)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>3</span><span>1</span><span>2</span><span>4</span>')
- Vue.delete(vm.obj, 'a')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>1</span><span>2</span><span>4</span>')
- }).then(done)
- })
-
- it('should render an Object with key', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(val, key) in obj">{{val}}-{{key}}</span>
- </div>
- `,
- data: {
- obj: { a: 0, b: 1, c: 2 }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0-a</span><span>1-b</span><span>2-c</span>')
- vm.obj.a = 3
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>3-a</span><span>1-b</span><span>2-c</span>')
- Vue.set(vm.obj, 'd', 4)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>3-a</span><span>1-b</span><span>2-c</span><span>4-d</span>')
- Vue.delete(vm.obj, 'a')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>1-b</span><span>2-c</span><span>4-d</span>')
- }).then(done)
- })
-
- it('should render an Object with key and index', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(val, key, i) in obj">{{val}}-{{key}}-{{i}}</span>
- </div>
- `,
- data: {
- obj: { a: 0, b: 1, c: 2 }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0-a-0</span><span>1-b-1</span><span>2-c-2</span>')
- vm.obj.a = 3
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>3-a-0</span><span>1-b-1</span><span>2-c-2</span>')
- Vue.set(vm.obj, 'd', 4)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>3-a-0</span><span>1-b-1</span><span>2-c-2</span><span>4-d-3</span>')
- Vue.delete(vm.obj, 'a')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>1-b-0</span><span>2-c-1</span><span>4-d-2</span>')
- }).then(done)
- })
-
- it('should render each key of data', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(val, key) in $data">{{val}}-{{key}}</span>
- </div>
- `,
- data: { a: 0, b: 1, c: 2 }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0-a</span><span>1-b</span><span>2-c</span>')
- vm.a = 3
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>3-a</span><span>1-b</span><span>2-c</span>')
- }).then(done)
- })
-
- it('check priorities: v-if before v-for', function () {
- const vm = new Vue({
- data: {
- items: [1, 2, 3]
- },
- template: '<div><div v-if="item < 3" v-for="item in items">{{item}}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('12')
- })
-
- it('check priorities: v-if after v-for', function () {
- const vm = new Vue({
- data: {
- items: [1, 2, 3]
- },
- template: '<div><div v-for="item in items" v-if="item < 3">{{item}}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('12')
- })
-
- it('range v-for', () => {
- const vm = new Vue({
- template: '<div><div v-for="n in 3">{{n}}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('123')
- })
-
- it('without key', done => {
- const vm = new Vue({
- data: {
- items: [
- { id: 1, msg: 'a' },
- { id: 2, msg: 'b' },
- { id: 3, msg: 'c' }
- ]
- },
- template: '<div><div v-for="item in items">{{ item.msg }}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('abc')
- const first = vm.$el.children[0]
- vm.items.reverse()
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('cba')
- // assert reusing DOM element in place
- expect(vm.$el.children[0]).toBe(first)
- }).then(done)
- })
-
- it('with key', done => {
- const vm = new Vue({
- data: {
- items: [
- { id: 1, msg: 'a' },
- { id: 2, msg: 'b' },
- { id: 3, msg: 'c' }
- ]
- },
- template: '<div><div v-for="item in items" :key="item.id">{{ item.msg }}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('abc')
- const first = vm.$el.children[0]
- vm.items.reverse()
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('cba')
- // assert moving DOM element
- expect(vm.$el.children[0]).not.toBe(first)
- expect(vm.$el.children[2]).toBe(first)
- }).then(done)
- })
-
- it('nested loops', () => {
- const vm = new Vue({
- data: {
- items: [
- { items: [{ a: 1 }, { a: 2 }], a: 1 },
- { items: [{ a: 3 }, { a: 4 }], a: 2 }
- ]
- },
- template:
- '<div>' +
- '<div v-for="(item, i) in items">' +
- '<p v-for="(subItem, j) in item.items">{{j}} {{subItem.a}} {{i}} {{item.a}}</p>' +
- '</div>' +
- '</div>'
- }).$mount()
- expect(vm.$el.innerHTML).toBe(
- '<div><p>0 1 0 1</p><p>1 2 0 1</p></div>' +
- '<div><p>0 3 1 2</p><p>1 4 1 2</p></div>'
- )
- })
-
- it('template v-for', done => {
- const vm = new Vue({
- data: {
- list: [
- { a: 1 },
- { a: 2 },
- { a: 3 }
- ]
- },
- template:
- '<div>' +
- '<template v-for="item in list">' +
- '<p>{{item.a}}</p>' +
- '<p>{{item.a + 1}}</p>' +
- '</template>' +
- '</div>'
- }).$mount()
- assertMarkup()
- vm.list.reverse()
- waitForUpdate(() => {
- assertMarkup()
- vm.list.splice(1, 1)
- }).then(() => {
- assertMarkup()
- vm.list.splice(1, 0, { a: 2 })
- }).then(done)
-
- function assertMarkup () {
- var markup = vm.list.map(function (item) {
- return '<p>' + item.a + '</p><p>' + (item.a + 1) + '</p>'
- }).join('')
- expect(vm.$el.innerHTML).toBe(markup)
- }
- })
-
- it('component v-for', done => {
- const vm = new Vue({
- data: {
- list: [
- { a: 1 },
- { a: 2 },
- { a: 3 }
- ]
- },
- template:
- '<div>' +
- '<test v-for="item in list" :msg="item.a" :key="item.a">' +
- '<span>{{item.a}}</span>' +
- '</test>' +
- '</div>',
- components: {
- test: {
- props: ['msg'],
- template: '<p>{{msg}}<slot></slot></p>'
- }
- }
- }).$mount()
- assertMarkup()
- vm.list.reverse()
- waitForUpdate(() => {
- assertMarkup()
- vm.list.splice(1, 1)
- }).then(() => {
- assertMarkup()
- vm.list.splice(1, 0, { a: 2 })
- }).then(done)
-
- function assertMarkup () {
- var markup = vm.list.map(function (item) {
- return `<p>${item.a}<span>${item.a}</span></p>`
- }).join('')
- expect(vm.$el.innerHTML).toBe(markup)
- }
- })
-
- it('dynamic component v-for', done => {
- const vm = new Vue({
- data: {
- list: [
- { type: 'one' },
- { type: 'two' }
- ]
- },
- template:
- '<div>' +
- '<component v-for="item in list" :key="item.type" :is="item.type"></component>' +
- '</div>',
- components: {
- one: {
- template: '<p>One!</p>'
- },
- two: {
- template: '<div>Two!</div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toContain('<p>One!</p><div>Two!</div>')
- vm.list.reverse()
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toContain('<div>Two!</div><p>One!</p>')
- }).then(done)
- })
-
- it('should warn component v-for without keys', () => {
- const warn = console.warn
- console.warn = jasmine.createSpy()
- new Vue({
- template: `<div><test v-for="i in 3"></test></div>`,
- components: {
- test: {
- render () {}
- }
- }
- }).$mount()
- expect(console.warn.calls.argsFor(0)[0]).toContain(
- `<test v-for="i in 3">: component lists rendered with v-for should have explicit keys`
- )
- console.warn = warn
- })
-
- it('multi nested array reactivity', done => {
- const vm = new Vue({
- data: {
- list: [[['foo']]]
- },
- template: `
- <div>
- <div v-for="i in list">
- <div v-for="j in i">
- <div v-for="k in j">
- {{ k }}
- </div>
- </div>
- </div>
- </div>
- `
- }).$mount()
- expect(vm.$el.textContent).toMatch(/\s+foo\s+/)
- vm.list[0][0].push('bar')
- waitForUpdate(() => {
- expect(vm.$el.textContent).toMatch(/\s+foo\s+bar\s+/)
- }).then(done)
- })
-
- it('should work with strings', done => {
- const vm = new Vue({
- data: {
- text: 'foo'
- },
- template: `
- <div>
- <span v-for="letter in text">{{ letter }}.</span>
- </div>
- `
- }).$mount()
- expect(vm.$el.textContent).toMatch('f.o.o.')
- vm.text += 'bar'
- waitForUpdate(() => {
- expect(vm.$el.textContent).toMatch('f.o.o.b.a.r.')
- }).then(done)
- })
-
- // #7792
- it('should work with multiline expressions', () => {
- const vm = new Vue({
- data: {
- a: [1],
- b: [2]
- },
- template: `
- <div>
- <span v-for="n in (
- a.concat(
- b
- )
- )">{{ n }}</span>
- </div>
- `
- }).$mount()
- expect(vm.$el.textContent).toBe('12')
- })
-
- const supportsDestructuring = (() => {
- try {
- new Function('var { foo } = bar')
- return true
- } catch (e) {}
- })()
-
- if (supportsDestructuring) {
- it('should support destructuring syntax in alias position (object)', () => {
- const vm = new Vue({
- data: { list: [{ foo: 'hi', bar: 'ho' }] },
- template: '<div><div v-for="({ foo, bar }, i) in list">{{ foo }} {{ bar }} {{ i }}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('hi ho 0')
- })
-
- it('should support destructuring syntax in alias position (array)', () => {
- const vm = new Vue({
- data: { list: [[1, 2], [3, 4]] },
- template: '<div><div v-for="([ foo, bar ], i) in list">{{ foo }} {{ bar }} {{ i }}</div></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('1 2 03 4 1')
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-html', () => {
- it('should render html', () => {
- const vm = new Vue({
- template: '<div v-html="a"></div>',
- data: { a: 'hello' }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('hello')
- })
-
- it('should encode html entities', () => {
- const vm = new Vue({
- template: '<div v-html="a"></div>',
- data: { a: '<span><</span>' }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span><</span>')
- })
-
- it('should work inline', () => {
- const vm = new Vue({
- template: `<div v-html="'<span><</span>'"></div>`
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span><</span>')
- })
-
- it('should work inline in DOM', () => {
- const el = document.createElement('div')
- el.innerHTML = `<div v-html="'<span><</span>'"></div>`
- const vm = new Vue({ el })
- expect(vm.$el.children[0].innerHTML).toBe('<span><</span>')
- })
-
- it('should support all value types', done => {
- const vm = new Vue({
- template: '<div v-html="a"></div>',
- data: { a: false }
- }).$mount()
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('false')
- vm.a = []
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('[]')
- vm.a = {}
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('{}')
- vm.a = 123
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('123')
- vm.a = 0
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('0')
- vm.a = ' '
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(' ')
- vm.a = ' '
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(' ')
- vm.a = null
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- vm.a = undefined
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-if', () => {
- it('should check if value is truthy', () => {
- const vm = new Vue({
- template: '<div><span v-if="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- })
-
- it('should check if value is falsy', () => {
- const vm = new Vue({
- template: '<div><span v-if="foo">hello</span></div>',
- data: { foo: false }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<!---->')
- })
-
- it('should update if value changed', done => {
- const vm = new Vue({
- template: '<div><span v-if="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.foo = {}
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.foo = 0
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.foo = []
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.foo = '0'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- vm.foo = undefined
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.foo = 1
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>hello</span>')
- }).then(done)
- })
-
- it('should work well with v-else', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-if="foo">hello</span>
- <span v-else>bye</span>
- </div>
- `,
- data: { foo: true }
- }).$mount()
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.foo = {}
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = 0
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.foo = []
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.foo = '0'
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = undefined
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.foo = 1
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- }).then(done)
- })
-
- it('should work well with v-else-if', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-if="foo">hello</span>
- <span v-else-if="bar">elseif</span>
- <span v-else>bye</span>
- </div>
- `,
- data: { foo: true, bar: false }
- }).$mount()
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.bar = true
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>elseif</span>')
- vm.bar = false
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.foo = true
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span>')
- vm.foo = false
- vm.bar = {}
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>elseif</span>')
- vm.bar = 0
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.bar = []
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>elseif</span>')
- vm.bar = null
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.bar = '0'
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>elseif</span>')
- vm.bar = undefined
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span>')
- vm.bar = 1
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>elseif</span>')
- }).then(done)
- })
-
- it('should work well with v-for', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(item, i) in list" v-if="item.value">{{i}}</span>
- </div>
- `,
- data: {
- list: [
- { value: true },
- { value: false },
- { value: true }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>0</span><!----><span>2</span>')
- vm.list[0].value = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<!----><!----><span>2</span>')
- vm.list.push({ value: true })
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!----><!----><span>2</span><span>3</span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!----><span>1</span>')
- }).then(done)
- })
-
- it('should work well with v-for and v-else', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-for="(item, i) in list" v-if="item.value">hello</span>
- <span v-else>bye</span>
- </div>
- `,
- data: {
- list: [
- { value: true },
- { value: false },
- { value: true }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML.trim()).toBe('<span>hello</span><span>bye</span><span>hello</span>')
- vm.list[0].value = false
- waitForUpdate(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span><span>bye</span><span>hello</span>')
- vm.list.push({ value: true })
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span><span>bye</span><span>hello</span><span>hello</span>')
- vm.list.splice(1, 2)
- }).then(() => {
- expect(vm.$el.innerHTML.trim()).toBe('<span>bye</span><span>hello</span>')
- }).then(done)
- })
-
- it('should work with v-for on v-else branch', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-if="false">hello</span>
- <span v-else v-for="item in list">{{ item }}</span>
- </div>
- `,
- data: {
- list: [1, 2, 3]
- }
- }).$mount()
- expect(vm.$el.textContent.trim()).toBe('123')
- vm.list.reverse()
- waitForUpdate(() => {
- expect(vm.$el.textContent.trim()).toBe('321')
- }).then(done)
- })
-
- it('should work properly on component root', done => {
- const vm = new Vue({
- template: `
- <div>
- <test class="test"></test>
- </div>
- `,
- components: {
- test: {
- data () {
- return { ok: true }
- },
- template: '<div v-if="ok" id="ok" class="inner">test</div>'
- }
- }
- }).$mount()
- expect(vm.$el.children[0].id).toBe('ok')
- expect(vm.$el.children[0].className).toBe('inner test')
- vm.$children[0].ok = false
- waitForUpdate(() => {
- // attrs / class modules should not attempt to patch the comment node
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.$children[0].ok = true
- }).then(() => {
- expect(vm.$el.children[0].id).toBe('ok')
- expect(vm.$el.children[0].className).toBe('inner test')
- }).then(done)
- })
-
- it('should maintain stable list to avoid unnecessary patches', done => {
- const created = jasmine.createSpy()
- const destroyed = jasmine.createSpy()
- const vm = new Vue({
- data: {
- ok: true
- },
- // when the first div is toggled, the second div should be reused
- // instead of re-created/destroyed
- template: `
- <div>
- <div v-if="ok"></div>
- <div><test></test></div>
- </div>
- `,
- components: {
- test: {
- template: '<div></div>',
- created,
- destroyed
- }
- }
- }).$mount()
-
- expect(created.calls.count()).toBe(1)
- vm.ok = false
- waitForUpdate(() => {
- expect(created.calls.count()).toBe(1)
- expect(destroyed).not.toHaveBeenCalled()
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-model checkbox', () => {
- it('should work', done => {
- const vm = new Vue({
- data: {
- test: true
- },
- template: '<input type="checkbox" v-model="test">'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.checked).toBe(true)
- vm.test = false
- waitForUpdate(function () {
- expect(vm.$el.checked).toBe(false)
- expect(vm.test).toBe(false)
- vm.$el.click()
- expect(vm.$el.checked).toBe(true)
- expect(vm.test).toBe(true)
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('should respect value bindings', done => {
- const vm = new Vue({
- data: {
- test: 1,
- a: 1,
- b: 2
- },
- template: '<input type="checkbox" v-model="test" :true-value="a" :false-value="b">'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.checked).toBe(true)
- vm.$el.click()
- expect(vm.$el.checked).toBe(false)
- expect(vm.test).toBe(2)
- vm.$el.click()
- expect(vm.$el.checked).toBe(true)
- expect(vm.test).toBe(1)
- vm.test = 2
- waitForUpdate(() => {
- expect(vm.$el.checked).toBe(false)
- vm.test = 1
- }).then(() => {
- expect(vm.$el.checked).toBe(true)
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('bind to Array value', done => {
- const vm = new Vue({
- data: {
- test: ['1']
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" value="1">
- <input type="checkbox" v-model="test" value="2">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[0].click()
- expect(vm.test.length).toBe(0)
- vm.$el.children[1].click()
- expect(vm.test).toEqual(['2'])
- vm.$el.children[0].click()
- expect(vm.test).toEqual(['2', '1'])
- vm.test = ['1']
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- }).then(done)
- })
-
- it('bind to Array value ignores false-value', done => {
- const vm = new Vue({
- data: {
- test: ['1']
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" value="1" :false-value="true">
- <input type="checkbox" v-model="test" value="2" :false-value="true">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[0].click()
- expect(vm.test.length).toBe(0)
- vm.$el.children[1].click()
- expect(vm.test).toEqual(['2'])
- vm.$el.children[0].click()
- expect(vm.test).toEqual(['2', '1'])
- vm.test = ['1']
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- }).then(done)
- })
-
- it('bind to Array value with value bindings', done => {
- const vm = new Vue({
- data: {
- test: [1]
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" :value="1">
- <input type="checkbox" v-model="test" :value="2">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[0].click()
- expect(vm.test.length).toBe(0)
- vm.$el.children[1].click()
- expect(vm.test).toEqual([2])
- vm.$el.children[0].click()
- expect(vm.test).toEqual([2, 1])
- vm.test = [1]
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- }).then(done)
- })
-
- it('bind to Array value with value bindings (object loose equal)', done => {
- const vm = new Vue({
- data: {
- test: [{ a: 1 }]
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" :value="{ a: 1 }">
- <input type="checkbox" v-model="test" :value="{ a: 2 }">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[0].click()
- expect(vm.test.length).toBe(0)
- vm.$el.children[1].click()
- expect(vm.test).toEqual([{ a: 2 }])
- vm.$el.children[0].click()
- expect(vm.test).toEqual([{ a: 2 }, { a: 1 }])
- vm.test = [{ a: 1 }]
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- }).then(done)
- })
-
- it('bind to Array value with array value bindings (object loose equal)', done => {
- const vm = new Vue({
- data: {
- test: [{ a: 1 }]
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" :value="{ a: 1 }">
- <input type="checkbox" v-model="test" :value="[2]">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[0].click()
- expect(vm.test.length).toBe(0)
- vm.$el.children[1].click()
- expect(vm.test).toEqual([[2]])
- vm.$el.children[0].click()
- expect(vm.test).toEqual([[2], { a: 1 }])
- vm.test = [{ a: 1 }]
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- }).then(done)
- })
-
- it('.number modifier', () => {
- const vm = new Vue({
- data: {
- test: [],
- check: true
- },
- template: `
- <div>
- <input type="checkbox" v-model.number="test" value="1">
- <input type="checkbox" v-model="test" value="2">
- <input type="checkbox" v-model.number="check">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- const checkboxInputs = vm.$el.getElementsByTagName('input')
- expect(checkboxInputs[0].checked).toBe(false)
- expect(checkboxInputs[1].checked).toBe(false)
- expect(checkboxInputs[2].checked).toBe(true)
- checkboxInputs[0].click()
- checkboxInputs[1].click()
- checkboxInputs[2].click()
- expect(vm.test).toEqual([1, '2'])
- expect(vm.check).toEqual(false)
- })
-
- it('should respect different primitive type value', (done) => {
- const vm = new Vue({
- data: {
- test: [0]
- },
- template:
- '<div>' +
- '<input type="checkbox" value="" v-model="test">' +
- '<input type="checkbox" value="0" v-model="test">' +
- '<input type="checkbox" value="1" v-model="test">' +
- '<input type="checkbox" value="false" v-model="test">' +
- '<input type="checkbox" value="true" v-model="test">' +
- '</div>'
- }).$mount()
- const checkboxInput = vm.$el.children
- expect(checkboxInput[0].checked).toBe(false)
- expect(checkboxInput[1].checked).toBe(true)
- expect(checkboxInput[2].checked).toBe(false)
- expect(checkboxInput[3].checked).toBe(false)
- expect(checkboxInput[4].checked).toBe(false)
- vm.test = [1]
- waitForUpdate(() => {
- expect(checkboxInput[0].checked).toBe(false)
- expect(checkboxInput[1].checked).toBe(false)
- expect(checkboxInput[2].checked).toBe(true)
- expect(checkboxInput[3].checked).toBe(false)
- expect(checkboxInput[4].checked).toBe(false)
- vm.test = ['']
- }).then(() => {
- expect(checkboxInput[0].checked).toBe(true)
- expect(checkboxInput[1].checked).toBe(false)
- expect(checkboxInput[2].checked).toBe(false)
- expect(checkboxInput[3].checked).toBe(false)
- expect(checkboxInput[4].checked).toBe(false)
- vm.test = [false]
- }).then(() => {
- expect(checkboxInput[0].checked).toBe(false)
- expect(checkboxInput[1].checked).toBe(false)
- expect(checkboxInput[2].checked).toBe(false)
- expect(checkboxInput[3].checked).toBe(true)
- expect(checkboxInput[4].checked).toBe(false)
- vm.test = [true]
- }).then(() => {
- expect(checkboxInput[0].checked).toBe(false)
- expect(checkboxInput[1].checked).toBe(false)
- expect(checkboxInput[2].checked).toBe(false)
- expect(checkboxInput[3].checked).toBe(false)
- expect(checkboxInput[4].checked).toBe(true)
- vm.test = ['', 0, 1, false, true]
- }).then(() => {
- expect(checkboxInput[0].checked).toBe(true)
- expect(checkboxInput[1].checked).toBe(true)
- expect(checkboxInput[2].checked).toBe(true)
- expect(checkboxInput[3].checked).toBe(true)
- expect(checkboxInput[4].checked).toBe(true)
- }).then(done)
- })
-
- // #4521
- it('should work with click event', (done) => {
- const vm = new Vue({
- data: {
- num: 1,
- checked: false
- },
- template: '<div @click="add">click {{ num }}<input ref="checkbox" type="checkbox" v-model="checked"/></div>',
- methods: {
- add: function () {
- this.num++
- }
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- const checkbox = vm.$refs.checkbox
- checkbox.click()
- waitForUpdate(() => {
- expect(checkbox.checked).toBe(true)
- expect(vm.num).toBe(2)
- }).then(done)
- })
-
- it('should get updated with model when in focus', (done) => {
- const vm = new Vue({
- data: {
- a: 2
- },
- template: '<input type="checkbox" v-model="a"/>'
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.$el.click()
- waitForUpdate(() => {
- expect(vm.$el.checked).toBe(false)
- vm.a = 2
- }).then(() => {
- expect(vm.$el.checked).toBe(true)
- }).then(done)
- })
-
- it('triggers a watcher when binding to an array value in a checkbox', done => {
- const vm = new Vue({
- data: {
- test: {
- thing: false,
- arr: [true]
- }
- },
- template: `
- <div>
- <input type="checkbox" v-model="test.arr[0]">
- <span>{{ test.arr[0] }}</span>
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].textContent).toBe('true')
- vm.$el.children[0].click()
- expect(vm.$el.children[0].checked).toBe(false)
- waitForUpdate(() => {
- expect(vm.$el.children[1].textContent).toBe('false')
- }).then(done)
- })
-
- // #7811
- it('type should not be overwritten by v-bind', () => {
- const vm = new Vue({
- data: {
- test: true
- },
- template: '<input type="checkbox" v-model="test" v-bind="$attrs">'
- }).$mount()
- expect(vm.$el.type).toBe('checkbox')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-model component', () => {
- it('should work', done => {
- const vm = new Vue({
- data: {
- msg: 'hello'
- },
- template: `
- <div>
- <p>{{ msg }}</p>
- <test v-model="msg"></test>
- </div>
- `,
- components: {
- test: {
- props: ['value'],
- template: `<input :value="value" @input="$emit('input', $event.target.value)">`
- }
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- waitForUpdate(() => {
- const input = vm.$el.querySelector('input')
- input.value = 'world'
- triggerEvent(input, 'input')
- }).then(() => {
- expect(vm.msg).toEqual('world')
- expect(vm.$el.querySelector('p').textContent).toEqual('world')
- vm.msg = 'changed'
- }).then(() => {
- expect(vm.$el.querySelector('p').textContent).toEqual('changed')
- expect(vm.$el.querySelector('input').value).toEqual('changed')
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('should work with native tags with "is"', done => {
- const vm = new Vue({
- data: {
- msg: 'hello'
- },
- template: `
- <div>
- <p>{{ msg }}</p>
- <input is="test" v-model="msg">
- </div>
- `,
- components: {
- test: {
- props: ['value'],
- template: `<input :value="value" @input="$emit('input', $event.target.value)">`
- }
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- waitForUpdate(() => {
- const input = vm.$el.querySelector('input')
- input.value = 'world'
- triggerEvent(input, 'input')
- }).then(() => {
- expect(vm.msg).toEqual('world')
- expect(vm.$el.querySelector('p').textContent).toEqual('world')
- vm.msg = 'changed'
- }).then(() => {
- expect(vm.$el.querySelector('p').textContent).toEqual('changed')
- expect(vm.$el.querySelector('input').value).toEqual('changed')
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('should support customization via model option', done => {
- const spy = jasmine.createSpy('update')
- const vm = new Vue({
- data: {
- msg: 'hello'
- },
- methods: {
- spy
- },
- template: `
- <div>
- <p>{{ msg }}</p>
- <test v-model="msg" @update="spy"></test>
- </div>
- `,
- components: {
- test: {
- model: {
- prop: 'currentValue',
- event: 'update'
- },
- props: ['currentValue'],
- template: `<input :value="currentValue" @input="$emit('update', $event.target.value)">`
- }
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- waitForUpdate(() => {
- const input = vm.$el.querySelector('input')
- input.value = 'world'
- triggerEvent(input, 'input')
- }).then(() => {
- expect(vm.msg).toEqual('world')
- expect(vm.$el.querySelector('p').textContent).toEqual('world')
- expect(spy).toHaveBeenCalledWith('world')
- vm.msg = 'changed'
- }).then(() => {
- expect(vm.$el.querySelector('p').textContent).toEqual('changed')
- expect(vm.$el.querySelector('input').value).toEqual('changed')
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('modifier: .number', () => {
- const vm = new Vue({
- template: `<div><my-input ref="input" v-model.number="text"></my-input></div>`,
- data: { text: 'foo' },
- components: {
- 'my-input': {
- template: '<input>'
- }
- }
- }).$mount()
- expect(vm.text).toBe('foo')
- vm.$refs.input.$emit('input', 'bar')
- expect(vm.text).toBe('bar')
- vm.$refs.input.$emit('input', '123')
- expect(vm.text).toBe(123)
- })
-
- it('modifier: .trim', () => {
- const vm = new Vue({
- template: `<div><my-input ref="input" v-model.trim="text"></my-input></div>`,
- data: { text: 'foo' },
- components: {
- 'my-input': {
- template: '<input>'
- }
- }
- }).$mount()
- expect(vm.text).toBe('foo')
- vm.$refs.input.$emit('input', ' bar ')
- expect(vm.text).toBe('bar')
- vm.$refs.input.$emit('input', ' foo o ')
- expect(vm.text).toBe('foo o')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-model dynamic input type', () => {
- it('should work', done => {
- const vm = new Vue({
- data: {
- inputType: null,
- test: 'b'
- },
- template: `<input :type="inputType" v-model="test">`
- }).$mount()
- document.body.appendChild(vm.$el)
-
- // test text
- assertInputWorks(vm, 'inputType').then(done)
- })
-
- it('with v-if', done => {
- const vm = new Vue({
- data: {
- ok: true,
- type: null,
- test: 'b'
- },
- template: `<input v-if="ok" :type="type" v-model="test"><div v-else>haha</div>`
- }).$mount()
- document.body.appendChild(vm.$el)
-
- const chain = assertInputWorks(vm).then(() => {
- vm.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toBe('haha')
- }).then(() => {
- // reset
- vm.ok = true
- vm.type = null
- vm.test = 'b'
- })
-
- assertInputWorks(vm, chain).then(done)
- })
-
- it('with v-else', done => {
- const data = {
- ok: true,
- type: null,
- test: 'b'
- }
- const vm = new Vue({
- data,
- template: `<div v-if="ok">haha</div><input v-else :type="type" v-model="test">`
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.textContent).toBe('haha')
-
- vm.ok = false
- assertInputWorks(vm).then(done)
- })
-
- it('with v-else-if', done => {
- const vm = new Vue({
- data: {
- foo: true,
- bar: false,
- type: null,
- test: 'b'
- },
- template: `<div v-if="foo">text</div><input v-else-if="bar" :type="type" v-model="test">`
- }).$mount()
- document.body.appendChild(vm.$el)
-
- const chain = waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('text')
- }).then(() => {
- vm.foo = false
- }).then(() => {
- expect(vm._vnode.isComment).toBe(true)
- }).then(() => {
- vm.bar = true
- })
-
- assertInputWorks(vm, chain).then(done)
- })
-
- it('with v-for', done => {
- const vm = new Vue({
- data: {
- data: {
- text: 'foo',
- checkbox: true
- },
- types: ['text', 'checkbox']
- },
- template: `<div>
- <input v-for="type in types" :type="type" v-model="data[type]">
- </div>`
- }).$mount()
- document.body.appendChild(vm.$el)
-
- let el1 = vm.$el.children[0]
- expect(el1.type).toBe('text')
- expect(el1.value).toBe('foo')
- el1.value = 'bar'
- triggerEvent(el1, 'input')
- expect(vm.data.text).toBe('bar')
-
- let el2 = vm.$el.children[1]
- expect(el2.type).toBe('checkbox')
- expect(el2.checked).toBe(true)
- el2.click()
- expect(vm.data.checkbox).toBe(false)
-
- // now in reverse!
- vm.types.reverse()
- waitForUpdate(() => {
- el1 = vm.$el.children[0]
- expect(el1.type).toBe('checkbox')
- expect(el1.checked).toBe(false)
- el1.click()
- expect(vm.data.checkbox).toBe(true)
-
- el2 = vm.$el.children[1]
- expect(el2.type).toBe('text')
- expect(el2.value).toBe('bar')
- el2.value = 'foo'
- triggerEvent(el2, 'input')
- expect(vm.data.text).toBe('foo')
- }).then(done)
- })
-
- it('with v-bind', done => {
- const vm = new Vue({
- data: {
- data: {
- text: 'foo',
- checkbox: true
- },
- inputs: [{ id: 'one', type: 'text' }, { id: 'two', type: 'checkbox' }]
- },
- template: `<div>
- <input v-for="i in inputs" v-bind="i" v-model="data[i.type]">
- </div>`
- }).$mount()
- document.body.appendChild(vm.$el)
-
- let el1 = vm.$el.children[0]
- expect(el1.id).toBe('one')
- expect(el1.type).toBe('text')
- expect(el1.value).toBe('foo')
- el1.value = 'bar'
- triggerEvent(el1, 'input')
- expect(vm.data.text).toBe('bar')
-
- let el2 = vm.$el.children[1]
- expect(el2.id).toBe('two')
- expect(el2.type).toBe('checkbox')
- expect(el2.checked).toBe(true)
- el2.click()
- expect(vm.data.checkbox).toBe(false)
-
- // now in reverse!
- vm.inputs.reverse()
- waitForUpdate(() => {
- el1 = vm.$el.children[0]
- expect(el1.id).toBe('two')
- expect(el1.type).toBe('checkbox')
- expect(el1.checked).toBe(false)
- el1.click()
- expect(vm.data.checkbox).toBe(true)
-
- el2 = vm.$el.children[1]
- expect(el2.id).toBe('one')
- expect(el2.type).toBe('text')
- expect(el2.value).toBe('bar')
- el2.value = 'foo'
- triggerEvent(el2, 'input')
- expect(vm.data.text).toBe('foo')
- }).then(done)
- })
-})
-
-function assertInputWorks (vm, type, chain) {
- if (typeof type !== 'string') {
- if (!chain) chain = type
- type = 'type'
- }
- if (!chain) chain = waitForUpdate()
- chain.then(() => {
- expect(vm.$el.value).toBe('b')
- vm.test = 'a'
- }).then(() => {
- expect(vm.$el.value).toBe('a')
- vm.$el.value = 'c'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('c')
- }).then(() => {
- // change it to password
- vm[type] = 'password'
- vm.test = 'b'
- }).then(() => {
- expect(vm.$el.type).toBe('password')
- expect(vm.$el.value).toBe('b')
- vm.$el.value = 'c'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('c')
- }).then(() => {
- // change it to checkbox...
- vm[type] = 'checkbox'
- }).then(() => {
- expect(vm.$el.type).toBe('checkbox')
- expect(vm.$el.checked).toBe(true)
- }).then(() => {
- vm.$el.click()
- expect(vm.$el.checked).toBe(false)
- expect(vm.test).toBe(false)
- })
- return chain
-}
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-model file', () => {
- it('warn to use @change instead', () => {
- new Vue({
- data: {
- file: ''
- },
- template: '<input v-model="file" type="file">'
- }).$mount()
- expect('Use a v-on:change listener instead').toHaveBeenWarned()
- })
-})
+++ /dev/null
-import { parseModel } from 'compiler/directives/model'
-
-describe('model expression parser', () => {
- it('parse single path', () => {
- const res = parseModel('foo')
- expect(res.exp).toBe('foo')
- expect(res.key).toBe(null)
- })
-
- it('parse object dot notation', () => {
- const res = parseModel('a.b.c')
- expect(res.exp).toBe('a.b')
- expect(res.key).toBe('"c"')
- })
-
- it('parse string in brackets', () => {
- const res = parseModel('a["b"][c]')
- expect(res.exp).toBe('a["b"]')
- expect(res.key).toBe('c')
- })
-
- it('parse brackets with object dot notation', () => {
- const res = parseModel('a["b"][c].xxx')
- expect(res.exp).toBe('a["b"][c]')
- expect(res.key).toBe('"xxx"')
- })
-
- it('parse nested brackets', () => {
- const res = parseModel('a[i[c]]')
- expect(res.exp).toBe('a')
- expect(res.key).toBe('i[c]')
- })
-
- it('combined', () => {
- const res = parseModel('test.xxx.a["asa"][test1[key]]')
- expect(res.exp).toBe('test.xxx.a["asa"]')
- expect(res.key).toBe('test1[key]')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-model radio', () => {
- it('should work', done => {
- const vm = new Vue({
- data: {
- test: '1'
- },
- template: `
- <div>
- <input type="radio" value="1" v-model="test" name="test">
- <input type="radio" value="2" v-model="test" name="test">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.test = '2'
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(false)
- expect(vm.$el.children[1].checked).toBe(true)
- vm.$el.children[0].click()
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- expect(vm.test).toBe('1')
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('should respect value bindings', done => {
- const vm = new Vue({
- data: {
- test: 1
- },
- template: `
- <div>
- <input type="radio" :value="1" v-model="test" name="test">
- <input type="radio" :value="2" v-model="test" name="test">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.test = 2
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(false)
- expect(vm.$el.children[1].checked).toBe(true)
- vm.$el.children[0].click()
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- expect(vm.test).toBe(1)
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('should respect value bindings (object loose equal)', done => {
- const vm = new Vue({
- data: {
- test: { a: 1 }
- },
- template: `
- <div>
- <input type="radio" :value="{ a: 1 }" v-model="test" name="test">
- <input type="radio" :value="{ a: 2 }" v-model="test" name="test">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.test = { a: 2 }
- waitForUpdate(() => {
- expect(vm.$el.children[0].checked).toBe(false)
- expect(vm.$el.children[1].checked).toBe(true)
- vm.$el.children[0].click()
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- expect(vm.test).toEqual({ a: 1 })
- }).then(() => {
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('multiple radios ', (done) => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- selections: ['a', '1'],
- radioList: [
- {
- name: 'questionA',
- data: ['a', 'b', 'c']
- },
- {
- name: 'questionB',
- data: ['1', '2']
- }
- ]
- },
- watch: {
- selections: spy
- },
- template:
- '<div>' +
- '<div v-for="(radioGroup, idx) in radioList">' +
- '<div>' +
- '<span v-for="(item, index) in radioGroup.data">' +
- '<input :name="radioGroup.name" type="radio" :value="item" v-model="selections[idx]" :id="idx"/>' +
- '<label>{{item}}</label>' +
- '</span>' +
- '</div>' +
- '</div>' +
- '</div>'
- }).$mount()
- document.body.appendChild(vm.$el)
- var inputs = vm.$el.getElementsByTagName('input')
- inputs[1].click()
- waitForUpdate(() => {
- expect(vm.selections).toEqual(['b', '1'])
- expect(spy).toHaveBeenCalled()
- }).then(done)
- })
-
- it('.number modifier', () => {
- const vm = new Vue({
- data: {
- test: 1
- },
- template: `
- <div>
- <input type="radio" value="1" v-model="test" name="test">
- <input type="radio" value="2" v-model.number="test" name="test">
- </div>
- `
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.children[0].checked).toBe(true)
- expect(vm.$el.children[1].checked).toBe(false)
- vm.$el.children[1].click()
- expect(vm.$el.children[0].checked).toBe(false)
- expect(vm.$el.children[1].checked).toBe(true)
- expect(vm.test).toBe(2)
- })
-
- it('should respect different primitive type value', (done) => {
- const vm = new Vue({
- data: {
- test: 1
- },
- template:
- '<div>' +
- '<input type="radio" value="" v-model="test" name="test">' +
- '<input type="radio" value="0" v-model="test" name="test">' +
- '<input type="radio" value="1" v-model="test" name="test">' +
- '<input type="radio" value="false" v-model="test" name="test">' +
- '<input type="radio" value="true" v-model="test" name="test">' +
- '</div>'
- }).$mount()
- var radioboxInput = vm.$el.children
- expect(radioboxInput[0].checked).toBe(false)
- expect(radioboxInput[1].checked).toBe(false)
- expect(radioboxInput[2].checked).toBe(true)
- expect(radioboxInput[3].checked).toBe(false)
- expect(radioboxInput[4].checked).toBe(false)
- vm.test = 0
- waitForUpdate(() => {
- expect(radioboxInput[0].checked).toBe(false)
- expect(radioboxInput[1].checked).toBe(true)
- expect(radioboxInput[2].checked).toBe(false)
- expect(radioboxInput[3].checked).toBe(false)
- expect(radioboxInput[4].checked).toBe(false)
- vm.test = ''
- }).then(() => {
- expect(radioboxInput[0].checked).toBe(true)
- expect(radioboxInput[1].checked).toBe(false)
- expect(radioboxInput[2].checked).toBe(false)
- expect(radioboxInput[3].checked).toBe(false)
- expect(radioboxInput[4].checked).toBe(false)
- vm.test = false
- }).then(() => {
- expect(radioboxInput[0].checked).toBe(false)
- expect(radioboxInput[1].checked).toBe(false)
- expect(radioboxInput[2].checked).toBe(false)
- expect(radioboxInput[3].checked).toBe(true)
- expect(radioboxInput[4].checked).toBe(false)
- vm.test = true
- }).then(() => {
- expect(radioboxInput[0].checked).toBe(false)
- expect(radioboxInput[1].checked).toBe(false)
- expect(radioboxInput[2].checked).toBe(false)
- expect(radioboxInput[3].checked).toBe(false)
- expect(radioboxInput[4].checked).toBe(true)
- }).then(done)
- })
-
- // #4521
- it('should work with click event', (done) => {
- const vm = new Vue({
- data: {
- num: 1,
- checked: 1
- },
- template:
- '<div @click="add">' +
- 'click {{ num }}<input name="test" type="radio" value="1" v-model="checked"/>' +
- '<input name="test" type="radio" value="2" v-model="checked"/>' +
- '</div>',
- methods: {
- add: function () {
- this.num++
- }
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- const radios = vm.$el.getElementsByTagName('input')
- radios[0].click()
- waitForUpdate(() => {
- expect(radios[0].checked).toBe(true)
- expect(radios[1].checked).toBe(false)
- expect(vm.num).toBe(2)
- radios[0].click()
- }).then(() => {
- expect(radios[0].checked).toBe(true)
- expect(radios[1].checked).toBe(false)
- expect(vm.num).toBe(3)
- radios[1].click()
- }).then(() => {
- expect(radios[0].checked).toBe(false)
- expect(radios[1].checked).toBe(true)
- expect(vm.num).toBe(4)
- }).then(done)
- })
-
- it('should get updated with model when in focus', (done) => {
- const vm = new Vue({
- data: {
- a: '2'
- },
- template: '<input type="radio" value="1" v-model="a"/>'
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.$el.click()
- waitForUpdate(() => {
- expect(vm.$el.checked).toBe(true)
- vm.a = 2
- }).then(() => {
- expect(vm.$el.checked).toBe(false)
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { looseEqual } from 'shared/util'
-
-// Android 4.4 Chrome 30 has the bug that a multi-select option cannot be
-// deselected by setting its "selected" prop via JavaScript.
-function hasMultiSelectBug () {
- var s = document.createElement('select')
- s.setAttribute('multiple', '')
- var o = document.createElement('option')
- s.appendChild(o)
- o.selected = true
- o.selected = false
- return o.selected !== false
-}
-
-/**
- * setting <select>'s value in IE9 doesn't work
- * we have to manually loop through the options
- */
-function updateSelect (el, value) {
- var options = el.options
- var i = options.length
- while (i--) {
- if (looseEqual(getValue(options[i]), value)) {
- options[i].selected = true
- break
- }
- }
-}
-
-function getValue (option) {
- return '_value' in option
- ? option._value
- : option.value || option.text
-}
-
-describe('Directive v-model select', () => {
- it('should work', done => {
- const vm = new Vue({
- data: {
- test: 'b'
- },
- template:
- '<select v-model="test">' +
- '<option>a</option>' +
- '<option>b</option>' +
- '<option>c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.test).toBe('b')
- expect(vm.$el.value).toBe('b')
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = 'c'
- waitForUpdate(function () {
- expect(vm.$el.value).toBe('c')
- expect(vm.$el.childNodes[2].selected).toBe(true)
- updateSelect(vm.$el, 'a')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('a')
- }).then(done)
- })
-
- it('should work with value bindings', done => {
- const vm = new Vue({
- data: {
- test: 2
- },
- template:
- '<select v-model="test">' +
- '<option value="1">a</option>' +
- '<option :value="2">b</option>' +
- '<option :value="3">c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.value).toBe('2')
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = 3
- waitForUpdate(function () {
- expect(vm.$el.value).toBe('3')
- expect(vm.$el.childNodes[2].selected).toBe(true)
-
- updateSelect(vm.$el, '1')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('1')
-
- updateSelect(vm.$el, '2')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe(2)
- }).then(done)
- })
-
- it('should work with value bindings (object loose equal)', done => {
- const vm = new Vue({
- data: {
- test: { a: 2 }
- },
- template:
- '<select v-model="test">' +
- '<option value="1">a</option>' +
- '<option :value="{ a: 2 }">b</option>' +
- '<option :value="{ a: 3 }">c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = { a: 3 }
- waitForUpdate(function () {
- expect(vm.$el.childNodes[2].selected).toBe(true)
-
- updateSelect(vm.$el, '1')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('1')
-
- updateSelect(vm.$el, { a: 2 })
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toEqual({ a: 2 })
- }).then(done)
- })
-
- it('should work with value bindings (Array loose equal)', done => {
- const vm = new Vue({
- data: {
- test: [{ a: 2 }]
- },
- template:
- '<select v-model="test">' +
- '<option value="1">a</option>' +
- '<option :value="[{ a: 2 }]">b</option>' +
- '<option :value="[{ a: 3 }]">c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = [{ a: 3 }]
- waitForUpdate(function () {
- expect(vm.$el.childNodes[2].selected).toBe(true)
-
- updateSelect(vm.$el, '1')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('1')
-
- updateSelect(vm.$el, [{ a: 2 }])
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toEqual([{ a: 2 }])
- }).then(done)
- })
-
- it('should work with v-for', done => {
- const vm = new Vue({
- data: {
- test: 'b',
- opts: ['a', 'b', 'c']
- },
- template:
- '<select v-model="test">' +
- '<option v-for="o in opts">{{ o }}</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.test).toBe('b')
- expect(vm.$el.value).toBe('b')
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = 'c'
- waitForUpdate(function () {
- expect(vm.$el.value).toBe('c')
- expect(vm.$el.childNodes[2].selected).toBe(true)
- updateSelect(vm.$el, 'a')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('a')
- // update v-for opts
- vm.opts = ['d', 'a']
- }).then(() => {
- expect(vm.$el.childNodes[0].selected).toBe(false)
- expect(vm.$el.childNodes[1].selected).toBe(true)
- }).then(done)
- })
-
- it('should work with v-for & value bindings', done => {
- const vm = new Vue({
- data: {
- test: 2,
- opts: [1, 2, 3]
- },
- template:
- '<select v-model="test">' +
- '<option v-for="o in opts" :value="o">option {{ o }}</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.$el.value).toBe('2')
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = 3
- waitForUpdate(function () {
- expect(vm.$el.value).toBe('3')
- expect(vm.$el.childNodes[2].selected).toBe(true)
- updateSelect(vm.$el, 1)
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe(1)
- // update v-for opts
- vm.opts = [0, 1]
- }).then(() => {
- expect(vm.$el.childNodes[0].selected).toBe(false)
- expect(vm.$el.childNodes[1].selected).toBe(true)
- }).then(done)
- })
-
- it('should work with select which has no default selected options', (done) => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- id: 4,
- list: [1, 2, 3],
- testChange: 5
- },
- template:
- '<div>' +
- '<select @change="test" v-model="id">' +
- '<option v-for="item in list" :value="item">{{item}}</option>' +
- '</select>' +
- '{{testChange}}' +
- '</div>',
- methods: {
- test: spy
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.testChange = 10
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(0)
- }).then(done)
- })
-
- if (!hasMultiSelectBug()) {
- it('multiple', done => {
- const vm = new Vue({
- data: {
- test: ['b']
- },
- template:
- '<select v-model="test" multiple>' +
- '<option>a</option>' +
- '<option>b</option>' +
- '<option>c</option>' +
- '</select>'
- }).$mount()
- var opts = vm.$el.options
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(true)
- expect(opts[2].selected).toBe(false)
- vm.test = ['a', 'c']
- waitForUpdate(() => {
- expect(opts[0].selected).toBe(true)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(true)
- opts[0].selected = false
- opts[1].selected = true
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toEqual(['b', 'c'])
- }).then(done)
- })
-
- it('multiple + v-for', done => {
- const vm = new Vue({
- data: {
- test: ['b'],
- opts: ['a', 'b', 'c']
- },
- template:
- '<select v-model="test" multiple>' +
- '<option v-for="o in opts">{{ o }}</option>' +
- '</select>'
- }).$mount()
- var opts = vm.$el.options
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(true)
- expect(opts[2].selected).toBe(false)
- vm.test = ['a', 'c']
- waitForUpdate(() => {
- expect(opts[0].selected).toBe(true)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(true)
- opts[0].selected = false
- opts[1].selected = true
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toEqual(['b', 'c'])
- // update v-for opts
- vm.opts = ['c', 'd']
- }).then(() => {
- expect(opts[0].selected).toBe(true)
- expect(opts[1].selected).toBe(false)
- expect(vm.test).toEqual(['c']) // should remove 'd' which no longer has a matching option
- }).then(done)
- })
- }
-
- it('should work with multiple binding', (done) => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- isMultiple: true,
- selections: ['1']
- },
- template:
- '<select v-model="selections" :multiple="isMultiple">' +
- '<option value="1">item 1</option>' +
- '<option value="2">item 2</option>' +
- '</select>',
- watch: {
- selections: spy
- }
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.$el.options[1].selected = true
- triggerEvent(vm.$el, 'change')
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.selections).toEqual(['1', '2'])
- }).then(done)
- })
-
- it('should not have multiple attr with falsy values except \'\'', () => {
- const vm = new Vue({
- template:
- '<div>' +
- '<select id="undefined" :multiple="undefined"></select>' +
- '<select id="null" :multiple="null"></select>' +
- '<select id="false" :multiple="false"></select>' +
- '<select id="string" :multiple="\'\'"></select>' +
- '</div>'
- }).$mount()
- expect(vm.$el.querySelector('#undefined').multiple).toEqual(false)
- expect(vm.$el.querySelector('#null').multiple).toEqual(false)
- expect(vm.$el.querySelector('#false').multiple).toEqual(false)
- expect(vm.$el.querySelector('#string').multiple).toEqual(true)
- })
-
- it('multiple with static template', () => {
- const vm = new Vue({
- template:
- '<select multiple>' +
- '<option selected>a</option>' +
- '<option selected>b</option>' +
- '<option selected>c</option>' +
- '</select>'
- }).$mount()
- var opts = vm.$el.options
- expect(opts[0].selected).toBe(true)
- expect(opts[1].selected).toBe(true)
- expect(opts[2].selected).toBe(true)
- })
-
- it('multiple selects', (done) => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- selections: ['', ''],
- selectBoxes: [
- [
- { value: 'foo', text: 'foo' },
- { value: 'bar', text: 'bar' }
- ],
- [
- { value: 'day', text: 'day' },
- { value: 'night', text: 'night' }
- ]
- ]
- },
- watch: {
- selections: spy
- },
- template:
- '<div>' +
- '<select v-for="(item, index) in selectBoxes" v-model="selections[index]">' +
- '<option v-for="element in item" v-bind:value="element.value" v-text="element.text"></option>' +
- '</select>' +
- '<span ref="rs">{{selections}}</span>' +
- '</div>'
- }).$mount()
- document.body.appendChild(vm.$el)
- var selects = vm.$el.getElementsByTagName('select')
- var select0 = selects[0]
- select0.options[0].selected = true
- triggerEvent(select0, 'change')
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.selections).toEqual(['foo', ''])
- }).then(done)
- })
-
- it('.number modifier', () => {
- const vm = new Vue({
- data: {
- test: 2
- },
- template:
- '<select v-model.number="test">' +
- '<option value="1">a</option>' +
- '<option :value="2">b</option>' +
- '<option :value="3">c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- updateSelect(vm.$el, '1')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe(1)
- })
-
- it('should respect different primitive type value', (done) => {
- const vm = new Vue({
- data: {
- test: 0
- },
- template:
- '<select v-model.number="test">' +
- '<option value="">a</option>' +
- '<option value="0">b</option>' +
- '<option value="1">c</option>' +
- '<option value="false">c</option>' +
- '<option value="true">c</option>' +
- '</select>'
- }).$mount()
- var opts = vm.$el.options
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(true)
- expect(opts[2].selected).toBe(false)
- expect(opts[3].selected).toBe(false)
- expect(opts[4].selected).toBe(false)
- vm.test = 1
- waitForUpdate(() => {
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(true)
- expect(opts[3].selected).toBe(false)
- expect(opts[4].selected).toBe(false)
- vm.test = ''
- }).then(() => {
- expect(opts[0].selected).toBe(true)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(false)
- expect(opts[3].selected).toBe(false)
- expect(opts[4].selected).toBe(false)
- vm.test = false
- }).then(() => {
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(false)
- expect(opts[3].selected).toBe(true)
- expect(opts[4].selected).toBe(false)
- vm.test = true
- }).then(() => {
- expect(opts[0].selected).toBe(false)
- expect(opts[1].selected).toBe(false)
- expect(opts[2].selected).toBe(false)
- expect(opts[3].selected).toBe(false)
- expect(opts[4].selected).toBe(true)
- }).then(done)
- })
-
- it('should warn multiple with non-Array value', done => {
- new Vue({
- data: {
- test: 'meh'
- },
- template:
- '<select v-model="test" multiple></select>'
- }).$mount()
- // IE warns on a setTimeout as well
- setTimeout(() => {
- expect('<select multiple v-model="test"> expects an Array value for its binding, but got String')
- .toHaveBeenWarned()
- done()
- }, 0)
- })
-
- it('should work with option value that has circular reference', done => {
- const circular = {}
- circular.self = circular
-
- const vm = new Vue({
- data: {
- test: 'b',
- circular
- },
- template:
- '<select v-model="test">' +
- '<option :value="circular">a</option>' +
- '<option>b</option>' +
- '<option>c</option>' +
- '</select>'
- }).$mount()
- document.body.appendChild(vm.$el)
- expect(vm.test).toBe('b')
- expect(vm.$el.value).toBe('b')
- expect(vm.$el.childNodes[1].selected).toBe(true)
- vm.test = circular
- waitForUpdate(function () {
- expect(vm.$el.childNodes[0].selected).toBe(true)
- }).then(done)
- })
-
- // #6112
- it('should not set non-matching value to undefined if options did not change', done => {
- const vm = new Vue({
- data: {
- test: '1'
- },
- template:
- '<select v-model="test">' +
- '<option>a</option>' +
- '</select>'
- }).$mount()
-
- vm.test = '2'
- waitForUpdate(() => {
- expect(vm.test).toBe('2')
- }).then(done)
- })
-
- // #6193
- it('should not trigger change event when matching option can be found for each value', done => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- options: ['1']
- },
- computed: {
- test: {
- get () {
- return '1'
- },
- set () {
- spy()
- }
- }
- },
- template:
- '<select v-model="test">' +
- '<option :key="opt" v-for="opt in options" :value="opt">{{ opt }}</option>' +
- '</select>'
- }).$mount()
-
- vm.options = ['1', '2']
- waitForUpdate(() => {
- expect(spy).not.toHaveBeenCalled()
- }).then(done)
- })
-
- // #6903
- describe('should correctly handle v-model when the vnodes are the same', () => {
- function makeInstance (foo) {
- return new Vue({
- data: {
- foo: foo,
- options: ['b', 'c', 'd'],
- value: 'c'
- },
- template:
- '<div>' +
- '<select v-if="foo" data-attr>' +
- '<option selected>a</option>' +
- '</select>' +
- '<select v-else v-model="value">' +
- '<option v-for="option in options" :value="option">{{ option }}</option>' +
- '</select>' +
- '</div>'
- }).$mount()
- }
-
- it('register v-model', done => {
- const vm = makeInstance(true)
-
- expect(vm.$el.firstChild.selectedIndex).toBe(0)
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.firstChild.selectedIndex).toBe(1)
- }).then(done)
- })
-
- it('remove v-model', done => {
- const vm = makeInstance(false)
-
- expect(vm.$el.firstChild.selectedIndex).toBe(1)
- vm.foo = true
- waitForUpdate(() => {
- expect(vm.$el.firstChild.selectedIndex).toBe(0)
- }).then(done)
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { isIE9, isIE, isAndroid } from 'core/util/env'
-
-describe('Directive v-model text', () => {
- it('should update value both ways', done => {
- const vm = new Vue({
- data: {
- test: 'b'
- },
- template: '<input v-model="test">'
- }).$mount()
- expect(vm.$el.value).toBe('b')
- vm.test = 'a'
- waitForUpdate(() => {
- expect(vm.$el.value).toBe('a')
- vm.$el.value = 'c'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('c')
- }).then(done)
- })
-
- it('should work with space ended expression in v-model', () => {
- const vm = new Vue({
- data: {
- obj: {
- test: 'b'
- }
- },
- template: '<input v-model="obj.test ">'
- }).$mount()
-
- triggerEvent(vm.$el, 'input')
- expect(vm.obj['test ']).toBe(undefined)
- expect(vm.obj.test).toBe('b')
- })
-
- it('.lazy modifier', () => {
- const vm = new Vue({
- data: {
- test: 'b'
- },
- template: '<input v-model.lazy="test">'
- }).$mount()
- expect(vm.$el.value).toBe('b')
- expect(vm.test).toBe('b')
- vm.$el.value = 'c'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('b')
- triggerEvent(vm.$el, 'change')
- expect(vm.test).toBe('c')
- })
-
- it('.number modifier', () => {
- const vm = new Vue({
- data: {
- test: 1
- },
- template: '<input v-model.number="test">'
- }).$mount()
- expect(vm.test).toBe(1)
- vm.$el.value = '2'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe(2)
- // should let strings pass through
- vm.$el.value = 'f'
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('f')
- })
-
- it('.trim modifier', () => {
- const vm = new Vue({
- data: {
- test: 'hi'
- },
- template: '<input v-model.trim="test">'
- }).$mount()
- expect(vm.test).toBe('hi')
- vm.$el.value = ' what '
- triggerEvent(vm.$el, 'input')
- expect(vm.test).toBe('what')
- })
-
- it('.number focus and typing', (done) => {
- const vm = new Vue({
- data: {
- test: 0,
- update: 0
- },
- template:
- '<div>' +
- '<input ref="input" v-model.number="test">{{ update }}' +
- '<input ref="blur">' +
- '</div>'
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.$refs.input.focus()
- expect(vm.test).toBe(0)
- vm.$refs.input.value = '1.0'
- triggerEvent(vm.$refs.input, 'input')
- expect(vm.test).toBe(1)
- vm.update++
- waitForUpdate(() => {
- expect(vm.$refs.input.value).toBe('1.0')
- vm.$refs.blur.focus()
- vm.update++
- }).then(() => {
- expect(vm.$refs.input.value).toBe('1')
- }).then(done)
- })
-
- it('.trim focus and typing', (done) => {
- const vm = new Vue({
- data: {
- test: 'abc',
- update: 0
- },
- template:
- '<div>' +
- '<input ref="input" v-model.trim="test" type="text">{{ update }}' +
- '<input ref="blur"/>' +
- '</div>'
- }).$mount()
- document.body.appendChild(vm.$el)
- vm.$refs.input.focus()
- vm.$refs.input.value = ' abc '
- triggerEvent(vm.$refs.input, 'input')
- expect(vm.test).toBe('abc')
- vm.update++
- waitForUpdate(() => {
- expect(vm.$refs.input.value).toBe(' abc ')
- vm.$refs.blur.focus()
- vm.update++
- }).then(() => {
- expect(vm.$refs.input.value).toBe('abc')
- }).then(done)
- })
-
- it('multiple inputs', (done) => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- selections: [[1, 2, 3], [4, 5]],
- inputList: [
- {
- name: 'questionA',
- data: ['a', 'b', 'c']
- },
- {
- name: 'questionB',
- data: ['1', '2']
- }
- ]
- },
- watch: {
- selections: spy
- },
- template:
- '<div>' +
- '<div v-for="(inputGroup, idx) in inputList">' +
- '<div>' +
- '<span v-for="(item, index) in inputGroup.data">' +
- '<input v-bind:name="item" type="text" v-model.number="selections[idx][index]" v-bind:id="idx+\'-\'+index"/>' +
- '<label>{{item}}</label>' +
- '</span>' +
- '</div>' +
- '</div>' +
- '<span ref="rs">{{selections}}</span>' +
- '</div>'
- }).$mount()
- var inputs = vm.$el.getElementsByTagName('input')
- inputs[1].value = 'test'
- triggerEvent(inputs[1], 'input')
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.selections).toEqual([[1, 'test', 3], [4, 5]])
- }).then(done)
- })
-
- if (isIE9) {
- it('IE9 selectionchange', done => {
- const vm = new Vue({
- data: {
- test: 'foo'
- },
- template: '<input v-model="test">'
- }).$mount()
- const input = vm.$el
- input.value = 'bar'
- document.body.appendChild(input)
- input.focus()
- triggerEvent(input, 'selectionchange')
- waitForUpdate(() => {
- expect(vm.test).toBe('bar')
- input.value = 'a'
- triggerEvent(input, 'selectionchange')
- expect(vm.test).toBe('a')
- }).then(done)
- })
- }
-
- it('compositionevents', function (done) {
- const vm = new Vue({
- data: {
- test: 'foo'
- },
- template: '<input v-model="test">'
- }).$mount()
- const input = vm.$el
- triggerEvent(input, 'compositionstart')
- input.value = 'baz'
- // input before composition unlock should not call set
- triggerEvent(input, 'input')
- expect(vm.test).toBe('foo')
- // after composition unlock it should work
- triggerEvent(input, 'compositionend')
- triggerEvent(input, 'input')
- expect(vm.test).toBe('baz')
- done()
- })
-
- it('warn invalid tag', () => {
- new Vue({
- data: {
- test: 'foo'
- },
- template: '<div v-model="test"></div>'
- }).$mount()
- expect('<div v-model="test">: v-model is not supported on this element type').toHaveBeenWarned()
- })
-
- // #3468
- it('should have higher priority than user v-on events', () => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- a: 'a'
- },
- template: '<input v-model="a" @input="onInput">',
- methods: {
- onInput (e) {
- spy(e.target.value)
- }
- }
- }).$mount()
- vm.$el.value = 'b'
- triggerEvent(vm.$el, 'input')
- expect(spy).toHaveBeenCalledWith('b')
- })
-
- it('warn binding to v-for alias', () => {
- new Vue({
- data: {
- strings: ['hi']
- },
- template: `
- <div>
- <div v-for="str in strings">
- <input v-model="str">
- </div>
- </div>
- `
- }).$mount()
- expect('You are binding v-model directly to a v-for iteration alias').toHaveBeenWarned()
- })
-
- it('warn if v-model and v-bind:value conflict', () => {
- new Vue({
- data: {
- test: 'foo'
- },
- template: '<input type="text" v-model="test" v-bind:value="test">'
- }).$mount()
- expect('v-bind:value="test" conflicts with v-model').toHaveBeenWarned()
- })
-
- it('warn if v-model and :value conflict', () => {
- new Vue({
- data: {
- test: 'foo'
- },
- template: '<input type="text" v-model="test" :value="test">'
- }).$mount()
- expect(':value="test" conflicts with v-model').toHaveBeenWarned()
- })
-
- it('should not warn on radio, checkbox, or custom component', () => {
- new Vue({
- data: { test: '' },
- components: {
- foo: {
- props: ['model', 'value'],
- model: { prop: 'model', event: 'change' },
- template: `<div/>`
- }
- },
- template: `
- <div>
- <input type="checkbox" v-model="test" :value="test">
- <input type="radio" v-model="test" :value="test">
- <foo v-model="test" :value="test"/>
- </div>
- `
- }).$mount()
- expect('conflicts with v-model').not.toHaveBeenWarned()
- })
-
- it('should not warn on input with dynamic type binding', () => {
- new Vue({
- data: {
- type: 'checkbox',
- test: 'foo'
- },
- template: '<input :type="type" v-model="test" :value="test">'
- }).$mount()
- expect('conflicts with v-model').not.toHaveBeenWarned()
- })
-
- if (!isAndroid) {
- it('does not trigger extra input events with single compositionend', () => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- a: 'a'
- },
- template: '<input v-model="a" @input="onInput">',
- methods: {
- onInput (e) {
- spy(e.target.value)
- }
- }
- }).$mount()
- expect(spy.calls.count()).toBe(0)
- vm.$el.value = 'b'
- triggerEvent(vm.$el, 'input')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$el, 'compositionend')
- expect(spy.calls.count()).toBe(1)
- })
-
- it('triggers extra input on compositionstart + end', () => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- a: 'a'
- },
- template: '<input v-model="a" @input="onInput">',
- methods: {
- onInput (e) {
- spy(e.target.value)
- }
- }
- }).$mount()
- expect(spy.calls.count()).toBe(0)
- vm.$el.value = 'b'
- triggerEvent(vm.$el, 'input')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$el, 'compositionstart')
- triggerEvent(vm.$el, 'compositionend')
- expect(spy.calls.count()).toBe(2)
- })
-
- // #4392
- it('should not update value with modifiers when in focus if post-conversion values are the same', done => {
- const vm = new Vue({
- data: {
- a: 1,
- foo: false
- },
- template: '<div>{{ foo }}<input ref="input" v-model.number="a"></div>'
- }).$mount()
-
- document.body.appendChild(vm.$el)
- vm.$refs.input.focus()
- vm.$refs.input.value = '1.000'
- vm.foo = true
-
- waitForUpdate(() => {
- expect(vm.$refs.input.value).toBe('1.000')
- }).then(done)
- })
-
- // #6552
- // This was original introduced due to the microtask between DOM events issue
- // but fixed after switching to MessageChannel.
- it('should not block input when another input listener with modifier is used', done => {
- const vm = new Vue({
- data: {
- a: 'a',
- foo: false
- },
- template: `
- <div>
- <input ref="input" v-model="a" @input.capture="onInput">{{ a }}
- <div v-if="foo">foo</div>
- </div>
- `,
- methods: {
- onInput (e) {
- this.foo = true
- }
- }
- }).$mount()
-
- document.body.appendChild(vm.$el)
- vm.$refs.input.focus()
- vm.$refs.input.value = 'b'
- triggerEvent(vm.$refs.input, 'input')
-
- // not using wait for update here because there will be two update cycles
- // one caused by onInput in the first listener
- setTimeout(() => {
- expect(vm.a).toBe('b')
- expect(vm.$refs.input.value).toBe('b')
- done()
- }, 16)
- })
-
- it('should create and make reactive non-existent properties', done => {
- const vm = new Vue({
- data: {
- foo: {}
- },
- template: '<input v-model="foo.bar">'
- }).$mount()
- expect(vm.$el.value).toBe('')
-
- vm.$el.value = 'a'
- triggerEvent(vm.$el, 'input')
- expect(vm.foo.bar).toBe('a')
- vm.foo.bar = 'b'
- waitForUpdate(() => {
- expect(vm.$el.value).toBe('b')
- vm.foo = {}
- }).then(() => {
- expect(vm.$el.value).toBe('')
- }).then(done)
- })
- }
-
- // #7138
- if (isIE && !isIE9) {
- it('should not fire input on initial render of textarea with placeholder in IE10/11', done => {
- const el = document.createElement('div')
- document.body.appendChild(el)
- const vm = new Vue({
- el,
- data: { foo: null },
- template: `<textarea v-model="foo" placeholder="bar"></textarea>`
- })
- setTimeout(() => {
- expect(vm.foo).toBe(null)
- done()
- }, 17)
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-import { supportsPassive } from 'core/util/env'
-
-describe('Directive v-on', () => {
- let vm, spy, el
-
- beforeEach(() => {
- vm = null
- spy = jasmine.createSpy()
- el = document.createElement('div')
- document.body.appendChild(el)
- })
-
- afterEach(() => {
- if (vm) {
- document.body.removeChild(vm.$el)
- }
- })
-
- it('should bind event to a method', () => {
- vm = new Vue({
- el,
- template: '<div v-on:click="foo"></div>',
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
-
- const args = spy.calls.allArgs()
- const event = args[0] && args[0][0] || {}
- expect(event.type).toBe('click')
- })
-
- it('should bind event to a inline statement', () => {
- vm = new Vue({
- el,
- template: '<div v-on:click="foo(1,2,3,$event)"></div>',
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
-
- const args = spy.calls.allArgs()
- const firstArgs = args[0]
- expect(firstArgs.length).toBe(4)
- expect(firstArgs[0]).toBe(1)
- expect(firstArgs[1]).toBe(2)
- expect(firstArgs[2]).toBe(3)
- expect(firstArgs[3].type).toBe('click')
- })
-
- it('should support inline function expression', () => {
- const spy = jasmine.createSpy()
- vm = new Vue({
- el,
- template: `<div class="test" @click="function (e) { log(e.target.className) }"></div>`,
- methods: {
- log: spy
- }
- }).$mount()
- triggerEvent(vm.$el, 'click')
- expect(spy).toHaveBeenCalledWith('test')
- })
-
- it('should support shorthand', () => {
- vm = new Vue({
- el,
- template: '<a href="#test" @click.prevent="foo"></a>',
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
- })
-
- it('should support stop propagation', () => {
- vm = new Vue({
- el,
- template: `
- <div @click.stop="foo"></div>
- `,
- methods: { foo: spy }
- })
- const hash = window.location.hash
- triggerEvent(vm.$el, 'click')
- expect(window.location.hash).toBe(hash)
- })
-
- it('should support prevent default', () => {
- vm = new Vue({
- el,
- template: `
- <input type="checkbox" ref="input" @click.prevent="foo">
- `,
- methods: {
- foo ($event) {
- spy($event.defaultPrevented)
- }
- }
- })
- vm.$refs.input.checked = false
- triggerEvent(vm.$refs.input, 'click')
- expect(spy).toHaveBeenCalledWith(true)
- })
-
- it('should support capture', () => {
- const callOrder = []
- vm = new Vue({
- el,
- template: `
- <div @click.capture="foo">
- <div @click="bar"></div>
- </div>
- `,
- methods: {
- foo () { callOrder.push(1) },
- bar () { callOrder.push(2) }
- }
- })
- triggerEvent(vm.$el.firstChild, 'click')
- expect(callOrder.toString()).toBe('1,2')
- })
-
- it('should support once', () => {
- vm = new Vue({
- el,
- template: `
- <div @click.once="foo">
- </div>
- `,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- })
-
- // #4655
- it('should handle .once on multiple elements properly', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <button ref="one" @click.once="foo">one</button>
- <button ref="two" @click.once="foo">two</button>
- </div>
- `,
- methods: { foo: spy }
- })
- triggerEvent(vm.$refs.one, 'click')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$refs.one, 'click')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$refs.two, 'click')
- expect(spy.calls.count()).toBe(2)
- triggerEvent(vm.$refs.one, 'click')
- triggerEvent(vm.$refs.two, 'click')
- expect(spy.calls.count()).toBe(2)
- })
-
- it('should support capture and once', () => {
- const callOrder = []
- vm = new Vue({
- el,
- template: `
- <div @click.capture.once="foo">
- <div @click="bar"></div>
- </div>
- `,
- methods: {
- foo () { callOrder.push(1) },
- bar () { callOrder.push(2) }
- }
- })
- triggerEvent(vm.$el.firstChild, 'click')
- expect(callOrder.toString()).toBe('1,2')
- triggerEvent(vm.$el.firstChild, 'click')
- expect(callOrder.toString()).toBe('1,2,2')
- })
-
- // #4846
- it('should support once and other modifiers', () => {
- vm = new Vue({
- el,
- template: `<div @click.once.self="foo"><span/></div>`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy).not.toHaveBeenCalled()
- triggerEvent(vm.$el, 'click')
- expect(spy).toHaveBeenCalled()
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
- })
-
- it('should support keyCode', () => {
- vm = new Vue({
- el,
- template: `<input @keyup.enter="foo">`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 13
- })
- expect(spy).toHaveBeenCalled()
- })
-
- it('should support automatic key name inference', () => {
- vm = new Vue({
- el,
- template: `<input @keyup.arrow-right="foo">`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'keyup', e => {
- e.key = 'ArrowRight'
- })
- expect(spy).toHaveBeenCalled()
- })
-
- // ctrl, shift, alt, meta
- it('should support system modifers', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <input ref="ctrl" @keyup.ctrl="foo">
- <input ref="shift" @keyup.shift="foo">
- <input ref="alt" @keyup.alt="foo">
- <input ref="meta" @keyup.meta="foo">
- </div>
- `,
- methods: { foo: spy }
- })
-
- triggerEvent(vm.$refs.ctrl, 'keyup')
- expect(spy.calls.count()).toBe(0)
- triggerEvent(vm.$refs.ctrl, 'keyup', e => { e.ctrlKey = true })
- expect(spy.calls.count()).toBe(1)
-
- triggerEvent(vm.$refs.shift, 'keyup')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$refs.shift, 'keyup', e => { e.shiftKey = true })
- expect(spy.calls.count()).toBe(2)
-
- triggerEvent(vm.$refs.alt, 'keyup')
- expect(spy.calls.count()).toBe(2)
- triggerEvent(vm.$refs.alt, 'keyup', e => { e.altKey = true })
- expect(spy.calls.count()).toBe(3)
-
- triggerEvent(vm.$refs.meta, 'keyup')
- expect(spy.calls.count()).toBe(3)
- triggerEvent(vm.$refs.meta, 'keyup', e => { e.metaKey = true })
- expect(spy.calls.count()).toBe(4)
- })
-
- it('should support exact modifier', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <input ref="ctrl" @keyup.exact="foo">
- </div>
- `,
- methods: { foo: spy }
- })
-
- triggerEvent(vm.$refs.ctrl, 'keyup')
- expect(spy.calls.count()).toBe(1)
-
- triggerEvent(vm.$refs.ctrl, 'keyup', e => {
- e.ctrlKey = true
- })
- expect(spy.calls.count()).toBe(1)
-
- // should not trigger if has other system modifiers
- triggerEvent(vm.$refs.ctrl, 'keyup', e => {
- e.ctrlKey = true
- e.altKey = true
- })
- expect(spy.calls.count()).toBe(1)
- })
-
- it('should support system modifers with exact', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <input ref="ctrl" @keyup.ctrl.exact="foo">
- </div>
- `,
- methods: { foo: spy }
- })
-
- triggerEvent(vm.$refs.ctrl, 'keyup')
- expect(spy.calls.count()).toBe(0)
-
- triggerEvent(vm.$refs.ctrl, 'keyup', e => {
- e.ctrlKey = true
- })
- expect(spy.calls.count()).toBe(1)
-
- // should not trigger if has other system modifiers
- triggerEvent(vm.$refs.ctrl, 'keyup', e => {
- e.ctrlKey = true
- e.altKey = true
- })
- expect(spy.calls.count()).toBe(1)
- })
-
- it('should support number keyCode', () => {
- vm = new Vue({
- el,
- template: `<input @keyup.13="foo">`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 13
- })
- expect(spy).toHaveBeenCalled()
- })
-
- it('should support mouse modifier', () => {
- const left = 0
- const middle = 1
- const right = 2
- const spyLeft = jasmine.createSpy()
- const spyMiddle = jasmine.createSpy()
- const spyRight = jasmine.createSpy()
-
- vm = new Vue({
- el,
- template: `
- <div>
- <div ref="left" @mousedown.left="foo">left</div>
- <div ref="right" @mousedown.right="foo1">right</div>
- <div ref="middle" @mousedown.middle="foo2">right</div>
- </div>
- `,
- methods: {
- foo: spyLeft,
- foo1: spyRight,
- foo2: spyMiddle
- }
- })
-
- triggerEvent(vm.$refs.left, 'mousedown', e => { e.button = right })
- triggerEvent(vm.$refs.left, 'mousedown', e => { e.button = middle })
- expect(spyLeft).not.toHaveBeenCalled()
- triggerEvent(vm.$refs.left, 'mousedown', e => { e.button = left })
- expect(spyLeft).toHaveBeenCalled()
-
- triggerEvent(vm.$refs.right, 'mousedown', e => { e.button = left })
- triggerEvent(vm.$refs.right, 'mousedown', e => { e.button = middle })
- expect(spyRight).not.toHaveBeenCalled()
- triggerEvent(vm.$refs.right, 'mousedown', e => { e.button = right })
- expect(spyRight).toHaveBeenCalled()
-
- triggerEvent(vm.$refs.middle, 'mousedown', e => { e.button = left })
- triggerEvent(vm.$refs.middle, 'mousedown', e => { e.button = right })
- expect(spyMiddle).not.toHaveBeenCalled()
- triggerEvent(vm.$refs.middle, 'mousedown', e => { e.button = middle })
- expect(spyMiddle).toHaveBeenCalled()
- })
-
- it('should support KeyboardEvent.key for built in aliases', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <input ref="enter" @keyup.enter="foo">
- <input ref="space" @keyup.space="foo">
- <input ref="esc" @keyup.esc="foo">
- <input ref="left" @keyup.left="foo">
- <input ref="delete" @keyup.delete="foo">
- </div>
- `,
- methods: { foo: spy }
- })
-
- triggerEvent(vm.$refs.enter, 'keyup', e => { e.key = 'Enter' })
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$refs.space, 'keyup', e => { e.key = ' ' })
- expect(spy.calls.count()).toBe(2)
- triggerEvent(vm.$refs.esc, 'keyup', e => { e.key = 'Escape' })
- expect(spy.calls.count()).toBe(3)
- triggerEvent(vm.$refs.left, 'keyup', e => { e.key = 'ArrowLeft' })
- expect(spy.calls.count()).toBe(4)
- triggerEvent(vm.$refs.delete, 'keyup', e => { e.key = 'Backspace' })
- expect(spy.calls.count()).toBe(5)
- triggerEvent(vm.$refs.delete, 'keyup', e => { e.key = 'Delete' })
- expect(spy.calls.count()).toBe(6)
- })
-
- it('should support custom keyCode', () => {
- Vue.config.keyCodes.test = 1
- vm = new Vue({
- el,
- template: `<input @keyup.test="foo">`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 1
- })
- expect(spy).toHaveBeenCalled()
- Vue.config.keyCodes = Object.create(null)
- })
-
- it('should override build-in keyCode', () => {
- Vue.config.keyCodes.up = [1, 87]
- vm = new Vue({
- el,
- template: `<input @keyup.up="foo" @keyup.down="foo">`,
- methods: { foo: spy }
- })
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 87
- })
- expect(spy).toHaveBeenCalled()
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 1
- })
- expect(spy).toHaveBeenCalledTimes(2)
- // should not affect build-in down keycode
- triggerEvent(vm.$el, 'keyup', e => {
- e.keyCode = 40
- })
- expect(spy).toHaveBeenCalledTimes(3)
- Vue.config.keyCodes = Object.create(null)
- })
-
- it('should bind to a child component', () => {
- vm = new Vue({
- el,
- template: '<bar @custom="foo"></bar>',
- methods: { foo: spy },
- components: {
- bar: {
- template: '<span>Hello</span>'
- }
- }
- })
- vm.$children[0].$emit('custom', 'foo', 'bar')
- expect(spy).toHaveBeenCalledWith('foo', 'bar')
- })
-
- it('should be able to bind native events for a child component', () => {
- vm = new Vue({
- el,
- template: '<bar @click.native="foo"></bar>',
- methods: { foo: spy },
- components: {
- bar: {
- template: '<span>Hello</span>'
- }
- }
- })
- vm.$children[0].$emit('click')
- expect(spy).not.toHaveBeenCalled()
- triggerEvent(vm.$children[0].$el, 'click')
- expect(spy).toHaveBeenCalled()
- })
-
- it('.once modifier should work with child components', () => {
- vm = new Vue({
- el,
- template: '<bar @custom.once="foo"></bar>',
- methods: { foo: spy },
- components: {
- bar: {
- template: '<span>Hello</span>'
- }
- }
- })
- vm.$children[0].$emit('custom')
- expect(spy.calls.count()).toBe(1)
- vm.$children[0].$emit('custom')
- expect(spy.calls.count()).toBe(1) // should not be called again
- })
-
- it('remove listener', done => {
- const spy2 = jasmine.createSpy('remove listener')
- vm = new Vue({
- el,
- methods: { foo: spy, bar: spy2 },
- data: {
- ok: true
- },
- render (h) {
- return this.ok
- ? h('input', { on: { click: this.foo }})
- : h('input', { on: { input: this.bar }})
- }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
- expect(spy2.calls.count()).toBe(0)
- vm.ok = false
- waitForUpdate(() => {
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- triggerEvent(vm.$el, 'input')
- expect(spy2.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('remove capturing listener', done => {
- const spy2 = jasmine.createSpy('remove listener')
- vm = new Vue({
- el,
- methods: { foo: spy, bar: spy2, stopped (ev) { ev.stopPropagation() } },
- data: {
- ok: true
- },
- render (h) {
- return this.ok
- ? h('div', { on: { '!click': this.foo }}, [h('div', { on: { click: this.stopped }})])
- : h('div', { on: { mouseOver: this.bar }}, [h('div')])
- }
- })
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy.calls.count()).toBe(1)
- expect(spy2.calls.count()).toBe(0)
- vm.ok = false
- waitForUpdate(() => {
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- triggerEvent(vm.$el, 'mouseOver')
- expect(spy2.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('remove once listener', done => {
- const spy2 = jasmine.createSpy('remove listener')
- vm = new Vue({
- el,
- methods: { foo: spy, bar: spy2 },
- data: {
- ok: true
- },
- render (h) {
- return this.ok
- ? h('input', { on: { '~click': this.foo }})
- : h('input', { on: { input: this.bar }})
- }
- })
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- expect(spy2.calls.count()).toBe(0)
- vm.ok = false
- waitForUpdate(() => {
- triggerEvent(vm.$el, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- triggerEvent(vm.$el, 'input')
- expect(spy2.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('remove capturing and once listener', done => {
- const spy2 = jasmine.createSpy('remove listener')
- vm = new Vue({
- el,
- methods: { foo: spy, bar: spy2, stopped (ev) { ev.stopPropagation() } },
- data: {
- ok: true
- },
- render (h) {
- return this.ok
- ? h('div', { on: { '~!click': this.foo }}, [h('div', { on: { click: this.stopped }})])
- : h('div', { on: { mouseOver: this.bar }}, [h('div')])
- }
- })
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy.calls.count()).toBe(1)
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- expect(spy2.calls.count()).toBe(0)
- vm.ok = false
- waitForUpdate(() => {
- triggerEvent(vm.$el.firstChild, 'click')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- triggerEvent(vm.$el, 'mouseOver')
- expect(spy2.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('remove listener on child component', done => {
- const spy2 = jasmine.createSpy('remove listener')
- vm = new Vue({
- el,
- methods: { foo: spy, bar: spy2 },
- data: {
- ok: true
- },
- components: {
- test: {
- template: '<div></div>'
- }
- },
- render (h) {
- return this.ok
- ? h('test', { on: { foo: this.foo }})
- : h('test', { on: { bar: this.bar }})
- }
- })
- vm.$children[0].$emit('foo')
- expect(spy.calls.count()).toBe(1)
- expect(spy2.calls.count()).toBe(0)
- vm.ok = false
- waitForUpdate(() => {
- vm.$children[0].$emit('foo')
- expect(spy.calls.count()).toBe(1) // should no longer trigger
- vm.$children[0].$emit('bar')
- expect(spy2.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('warn missing handlers', () => {
- vm = new Vue({
- el,
- data: { none: null },
- template: `<div @click="none"></div>`
- })
- expect(`Invalid handler for event "click": got null`).toHaveBeenWarned()
- expect(() => {
- triggerEvent(vm.$el, 'click')
- }).not.toThrow()
- })
-
- // Github Issue #5046
- it('should support keyboard modifier for direction keys', () => {
- const spyLeft = jasmine.createSpy()
- const spyRight = jasmine.createSpy()
- const spyUp = jasmine.createSpy()
- const spyDown = jasmine.createSpy()
- vm = new Vue({
- el,
- template: `
- <div>
- <input ref="left" @keydown.left="foo"></input>
- <input ref="right" @keydown.right="foo1"></input>
- <input ref="up" @keydown.up="foo2"></input>
- <input ref="down" @keydown.down="foo3"></input>
- </div>
- `,
- methods: {
- foo: spyLeft,
- foo1: spyRight,
- foo2: spyUp,
- foo3: spyDown
- }
- })
- triggerEvent(vm.$refs.left, 'keydown', e => { e.keyCode = 37 })
- triggerEvent(vm.$refs.left, 'keydown', e => { e.keyCode = 39 })
-
- triggerEvent(vm.$refs.right, 'keydown', e => { e.keyCode = 39 })
- triggerEvent(vm.$refs.right, 'keydown', e => { e.keyCode = 38 })
-
- triggerEvent(vm.$refs.up, 'keydown', e => { e.keyCode = 38 })
- triggerEvent(vm.$refs.up, 'keydown', e => { e.keyCode = 37 })
-
- triggerEvent(vm.$refs.down, 'keydown', e => { e.keyCode = 40 })
- triggerEvent(vm.$refs.down, 'keydown', e => { e.keyCode = 39 })
-
- expect(spyLeft.calls.count()).toBe(1)
- expect(spyRight.calls.count()).toBe(1)
- expect(spyUp.calls.count()).toBe(1)
- expect(spyDown.calls.count()).toBe(1)
- })
-
- // This test case should only run when the test browser supports passive.
- if (supportsPassive) {
- it('should support passive', () => {
- vm = new Vue({
- el,
- template: `
- <div>
- <input type="checkbox" ref="normal" @click="foo"/>
- <input type="checkbox" ref="passive" @click.passive="foo"/>
- <input type="checkbox" ref="exclusive" @click.prevent.passive/>
- </div>
- `,
- methods: {
- foo (e) {
- e.preventDefault()
- }
- }
- })
-
- vm.$refs.normal.checked = false
- vm.$refs.passive.checked = false
- vm.$refs.exclusive.checked = false
- vm.$refs.normal.click()
- vm.$refs.passive.click()
- vm.$refs.exclusive.click()
- expect(vm.$refs.normal.checked).toBe(false)
- expect(vm.$refs.passive.checked).toBe(true)
- expect(vm.$refs.exclusive.checked).toBe(true)
- expect('passive and prevent can\'t be used together. Passive handler can\'t prevent default event.').toHaveBeenWarned()
- })
- }
-
- // GitHub Issues #5146
- it('should only prevent when match keycode', () => {
- let prevented = false
- vm = new Vue({
- el,
- template: `
- <input ref="input" @keydown.enter.prevent="foo">
- `,
- methods: {
- foo ($event) {
- prevented = $event.defaultPrevented
- }
- }
- })
-
- triggerEvent(vm.$refs.input, 'keydown', e => { e.keyCode = 32 })
- expect(prevented).toBe(false)
- triggerEvent(vm.$refs.input, 'keydown', e => { e.keyCode = 13 })
- expect(prevented).toBe(true)
- })
-
- it('should transform click.right to contextmenu', () => {
- const spy = jasmine.createSpy('click.right')
- const vm = new Vue({
- template: `<div @click.right="foo"></div>`,
- methods: { foo: spy }
- }).$mount()
-
- triggerEvent(vm.$el, 'contextmenu')
- expect(spy).toHaveBeenCalled()
- })
-
- it('should transform click.middle to mouseup', () => {
- const spy = jasmine.createSpy('click.middle')
- const vm = new Vue({
- template: `<div @click.middle="foo"></div>`,
- methods: { foo: spy }
- }).$mount()
- triggerEvent(vm.$el, 'mouseup', e => { e.button = 0 })
- expect(spy).not.toHaveBeenCalled()
- triggerEvent(vm.$el, 'mouseup', e => { e.button = 1 })
- expect(spy).toHaveBeenCalled()
- })
-
- it('object syntax (no argument)', () => {
- const click = jasmine.createSpy('click')
- const mouseup = jasmine.createSpy('mouseup')
- vm = new Vue({
- el,
- template: `<button v-on="listeners">foo</button>`,
- created () {
- this.listeners = {
- click,
- mouseup
- }
- }
- })
-
- triggerEvent(vm.$el, 'click')
- expect(click.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(0)
-
- triggerEvent(vm.$el, 'mouseup')
- expect(click.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(1)
- })
-
- it('object syntax (no argument, mixed with normal listeners)', () => {
- const click1 = jasmine.createSpy('click1')
- const click2 = jasmine.createSpy('click2')
- const mouseup = jasmine.createSpy('mouseup')
- vm = new Vue({
- el,
- template: `<button v-on="listeners" @click="click2">foo</button>`,
- created () {
- this.listeners = {
- click: click1,
- mouseup
- }
- },
- methods: {
- click2
- }
- })
-
- triggerEvent(vm.$el, 'click')
- expect(click1.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(0)
-
- triggerEvent(vm.$el, 'mouseup')
- expect(click1.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(1)
- })
-
- it('object syntax (usage in HOC, mixed with native listeners)', () => {
- const click = jasmine.createSpy('click')
- const mouseup = jasmine.createSpy('mouseup')
- const mousedown = jasmine.createSpy('mousedown')
-
- vm = new Vue({
- el,
- template: `
- <foo-button
- @click="click"
- @mousedown="mousedown"
- @mouseup.native="mouseup">
- </foo-button>
- `,
- methods: {
- click,
- mouseup,
- mousedown
- },
- components: {
- fooButton: {
- template: `
- <button v-on="$listeners"></button>
- `
- }
- }
- })
-
- triggerEvent(vm.$el, 'click')
- expect(click.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(0)
- expect(mousedown.calls.count()).toBe(0)
-
- triggerEvent(vm.$el, 'mouseup')
- expect(click.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(1)
- expect(mousedown.calls.count()).toBe(0)
-
- triggerEvent(vm.$el, 'mousedown')
- expect(click.calls.count()).toBe(1)
- expect(mouseup.calls.count()).toBe(1)
- expect(mousedown.calls.count()).toBe(1)
- })
-
- // #6805 (v-on="object" bind order problem)
- it('object syntax (no argument): should fire after high-priority listeners', done => {
- const MyCheckbox = {
- template: '<input type="checkbox" v-model="model" v-on="$listeners">',
- props: {
- value: false
- },
- computed: {
- model: {
- get () {
- return this.value
- },
- set (val) {
- this.$emit('input', val)
- }
- }
- }
- }
-
- vm = new Vue({
- el,
- template: `
- <div>
- <my-checkbox v-model="check" @change="change"></my-checkbox>
- </div>
- `,
- components: { MyCheckbox },
- data: {
- check: false
- },
- methods: {
- change () {
- expect(this.check).toBe(true)
- done()
- }
- }
- })
-
- vm.$el.querySelector('input').click()
- })
-
- it('warn object syntax with modifier', () => {
- new Vue({
- template: `<button v-on.self="{}"></button>`
- }).$mount()
- expect(`v-on without argument does not support modifiers`).toHaveBeenWarned()
- })
-
- it('warn object syntax with non-object value', () => {
- new Vue({
- template: `<button v-on="123"></button>`
- }).$mount()
- expect(`v-on without argument expects an Object value`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-once', () => {
- it('should not rerender component', done => {
- const vm = new Vue({
- template: '<div v-once>{{ a }}</div>',
- data: { a: 'hello' }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('hello')
- vm.a = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('hello')
- }).then(done)
- })
-
- it('should not rerender self and child component', done => {
- const vm = new Vue({
- template: `
- <div v-once>
- <span>{{ a }}</span>
- <item :b="a"></item>
- </div>`,
- data: { a: 'hello' },
- components: {
- item: {
- template: '<div>{{ b }}</div>',
- props: ['b']
- }
- }
- }).$mount()
- expect(vm.$children.length).toBe(1)
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>hello</div>')
- vm.a = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>hello</div>')
- }).then(done)
- })
-
- it('should rerender parent but not self', done => {
- const vm = new Vue({
- template: `
- <div>
- <span>{{ a }}</span>
- <item v-once :b="a"></item>
- </div>`,
- data: { a: 'hello' },
- components: {
- item: {
- template: '<div>{{ b }}</div>',
- props: ['b']
- }
- }
- }).$mount()
- expect(vm.$children.length).toBe(1)
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>hello</div>')
- vm.a = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML)
- .toBe('<span>world</span> <div>hello</div>')
- }).then(done)
- })
-
- it('should not rerender static sub nodes', done => {
- const vm = new Vue({
- template: `
- <div>
- <span v-once>{{ a }}</span>
- <item :b="a"></item>
- <span>{{ suffix }}</span>
- </div>`,
- data: {
- a: 'hello',
- suffix: '?'
- },
- components: {
- item: {
- template: '<div>{{ b }}</div>',
- props: ['b']
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>hello</div> <span>?</span>')
- vm.a = 'world'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>world</div> <span>?</span>')
- vm.suffix = '!'
- }).then(() => {
- expect(vm.$el.innerHTML)
- .toBe('<span>hello</span> <div>world</div> <span>!</span>')
- }).then(done)
- })
-
- it('should work with v-if', done => {
- const vm = new Vue({
- data: {
- tester: true,
- yes: 'y',
- no: 'n'
- },
- template: `
- <div>
- <div v-if="tester">{{ yes }}</div>
- <div v-else>{{ no }}</div>
- <div v-if="tester" v-once>{{ yes }}</div>
- <div v-else>{{ no }}</div>
- <div v-if="tester">{{ yes }}</div>
- <div v-else v-once>{{ no }}</div>
- <div v-if="tester" v-once>{{ yes }}</div>
- <div v-else v-once>{{ no }}</div>
- </div>
- `
- }).$mount()
- expectTextContent(vm, 'yyyy')
- vm.yes = 'yes'
- waitForUpdate(() => {
- expectTextContent(vm, 'yesyyesy')
- vm.tester = false
- }).then(() => {
- expectTextContent(vm, 'nnnn')
- vm.no = 'no'
- }).then(() => {
- expectTextContent(vm, 'nononn')
- }).then(done)
- })
-
- it('should work with v-for', done => {
- const vm = new Vue({
- data: {
- list: [1, 2, 3]
- },
- template: `<div><div v-for="i in list" v-once>{{i}}</div></div>`
- }).$mount()
- expect(vm.$el.textContent).toBe('123')
- vm.list.reverse()
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('123')
- }).then(done)
- })
-
- it('should work inside v-for', done => {
- const vm = new Vue({
- data: {
- list: [
- { id: 0, text: 'a' },
- { id: 1, text: 'b' },
- { id: 2, text: 'c' }
- ]
- },
- template: `
- <div>
- <div v-for="i in list" :key="i.id">
- <div>
- <span v-once>{{ i.text }}</span><span>{{ i.text }}</span>
- </div>
- </div>
- </div>
- `
- }).$mount()
-
- expect(vm.$el.textContent).toBe('aabbcc')
-
- vm.list[0].text = 'd'
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('adbbcc')
- vm.list[1].text = 'e'
- }).then(() => {
- expect(vm.$el.textContent).toBe('adbecc')
- vm.list.reverse()
- }).then(() => {
- expect(vm.$el.textContent).toBe('ccbead')
- }).then(done)
- })
-
- it('should work inside v-for with v-if', done => {
- const vm = new Vue({
- data: {
- list: [
- { id: 0, text: 'a', tester: true, truthy: 'y' }
- ]
- },
- template: `
- <div>
- <div v-for="i in list" :key="i.id">
- <span v-if="i.tester" v-once>{{ i.truthy }}</span>
- <span v-else v-once>{{ i.text }}</span>
- <span v-if="i.tester" v-once>{{ i.truthy }}</span>
- <span v-else>{{ i.text }}</span>
- <span v-if="i.tester">{{ i.truthy }}</span>
- <span v-else v-once>{{ i.text }}</span>
- <span v-if="i.tester">{{ i.truthy }}</span>
- <span v-else>{{ i.text }}</span>
- </div>
- </div>
- `
- }).$mount()
-
- expectTextContent(vm, 'yyyy')
-
- vm.list[0].truthy = 'yy'
- waitForUpdate(() => {
- expectTextContent(vm, 'yyyyyy')
- vm.list[0].tester = false
- }).then(() => {
- expectTextContent(vm, 'aaaa')
- vm.list[0].text = 'nn'
- }).then(() => {
- expectTextContent(vm, 'annann')
- }).then(done)
- })
-
- it('should work inside v-for with nested v-else', done => {
- const vm = new Vue({
- data: {
- list: [{ id: 0, text: 'a', tester: true, truthy: 'y' }]
- },
- template: `
- <div v-if="0"></div>
- <div v-else>
- <div v-for="i in list" :key="i.id">
- <span v-if="i.tester" v-once>{{ i.truthy }}</span>
- <span v-else v-once>{{ i.text }}</span>
- </div>
- </div>
- `
- }).$mount()
-
- expectTextContent(vm, 'y')
- vm.list[0].truthy = 'yy'
- waitForUpdate(() => {
- expectTextContent(vm, 'y')
- vm.list[0].tester = false
- }).then(() => {
- expectTextContent(vm, 'a')
- vm.list[0].text = 'nn'
- }).then(() => {
- expectTextContent(vm, 'a')
- }).then(done)
- })
-
- it('should work inside v-for with nested v-else-if and v-else', done => {
- const vm = new Vue({
- data: {
- tester: false,
- list: [{ id: 0, text: 'a', tester: true, truthy: 'y' }]
- },
- template: `
- <div v-if="0"></div>
- <div v-else-if="tester">
- <div v-for="i in list" :key="i.id">
- <span v-if="i.tester" v-once>{{ i.truthy }}</span>
- <span v-else-if="tester" v-once>{{ i.text }}elseif</span>
- <span v-else v-once>{{ i.text }}</span>
- </div>
- </div>
- <div v-else>
- <div v-for="i in list" :key="i.id">
- <span v-if="i.tester" v-once>{{ i.truthy }}</span>
- <span v-else-if="tester">{{ i.text }}elseif</span>
- <span v-else v-once>{{ i.text }}</span>
- </div>
- </div>
- `
- }).$mount()
-
- expectTextContent(vm, 'y')
- vm.list[0].truthy = 'yy'
- waitForUpdate(() => {
- expectTextContent(vm, 'y')
- vm.list[0].tester = false
- }).then(() => {
- expectTextContent(vm, 'a')
- vm.list[0].text = 'nn'
- }).then(() => {
- expectTextContent(vm, 'a')
- vm.tester = true
- }).then(() => {
- expectTextContent(vm, 'nnelseif')
- vm.list[0].text = 'xx'
- }).then(() => {
- expectTextContent(vm, 'nnelseif')
- vm.list[0].tester = true
- }).then(() => {
- expectTextContent(vm, 'yy')
- vm.list[0].truthy = 'nn'
- }).then(() => {
- expectTextContent(vm, 'yy')
- }).then(done)
- })
-
- it('should warn inside non-keyed v-for', () => {
- const vm = new Vue({
- data: {
- list: [
- { id: 0, text: 'a' },
- { id: 1, text: 'b' },
- { id: 2, text: 'c' }
- ]
- },
- template: `
- <div>
- <div v-for="i in list">
- <span v-once>{{ i.text }}</span><span>{{ i.text }}</span>
- </div>
- </div>
- `
- }).$mount()
-
- expect(vm.$el.textContent).toBe('aabbcc')
- expect(`v-once can only be used inside v-for that is keyed.`).toHaveBeenWarned()
- })
-
- // #4288
- it('should inherit child reference for v-once', done => {
- const vm = new Vue({
- template: `<div>{{a}}<test v-if="ok" v-once></test></div>`,
- data: {
- a: 0,
- ok: true
- },
- components: {
- test: {
- template: '<div>foo</div>'
- }
- }
- }).$mount()
- vm.a++ // first update to force a patch
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('1foo')
- }).then(() => {
- vm.ok = false // teardown component with v-once
- }).then(done) // should not throw
- })
-
- // #6826
- it('should render different component instances properly', done => {
- const vm = new Vue({
- components: {
- foo: {
- props: ['name'],
- template: '<div v-once>{{ name }}</div>'
- }
- },
- template: `
- <div>
- <foo name="a" v-once></foo>
- <foo name="b" v-once></foo>
- </div>
- `
- }).$mount()
- waitForUpdate(() => {
- expect(vm.$el.children[0].innerHTML).toBe('a')
- expect(vm.$el.children[1].innerHTML).toBe('b')
- }).then(done)
- })
-})
-
-function expectTextContent (vm, text) {
- expect(vm.$el.textContent.replace(/\s+/g, '')).toBe(text)
-}
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-pre', function () {
- it('should not compile inner content', function () {
- const vm = new Vue({
- template: `<div>
- <div v-pre>{{ a }}</div>
- <div>{{ a }}</div>
- <div v-pre>
- <component></component>
- </div>
- </div>`,
- data: {
- a: 123
- }
- })
- vm.$mount()
- expect(vm.$el.firstChild.textContent).toBe('{{ a }}')
- expect(vm.$el.children[1].textContent).toBe('123')
- expect(vm.$el.lastChild.innerHTML).toBe('<component></component>')
- })
-
- it('should not compile on root node', function () {
- const vm = new Vue({
- template: '<div v-pre>{{ a }}</div>',
- replace: true,
- data: {
- a: 123
- }
- })
- vm.$mount()
- expect(vm.$el.firstChild.textContent).toBe('{{ a }}')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-show', () => {
- it('should check show value is truthy', () => {
- const vm = new Vue({
- template: '<div><span v-show="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.firstChild.style.display).toBe('')
- })
-
- it('should check show value is falsy', () => {
- const vm = new Vue({
- template: '<div><span v-show="foo">hello</span></div>',
- data: { foo: false }
- }).$mount()
- expect(vm.$el.firstChild.style.display).toBe('none')
- })
-
- it('should update show value changed', done => {
- const vm = new Vue({
- template: '<div><span v-show="foo">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.firstChild.style.display).toBe('')
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.foo = {}
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('')
- vm.foo = 0
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.foo = []
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('')
- vm.foo = null
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.foo = '0'
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('')
- vm.foo = undefined
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.foo = 1
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('')
- }).then(done)
- })
-
- it('should respect display value in style attribute', done => {
- const vm = new Vue({
- template: '<div><span v-show="foo" style="display:block">hello</span></div>',
- data: { foo: true }
- }).$mount()
- expect(vm.$el.firstChild.style.display).toBe('block')
- vm.foo = false
- waitForUpdate(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.foo = true
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('block')
- }).then(done)
- })
-
- it('should support unbind when reused', done => {
- const vm = new Vue({
- template:
- '<div v-if="tester"><span v-show="false"></span></div>' +
- '<div v-else><span @click="tester=!tester">show</span></div>',
- data: { tester: true }
- }).$mount()
- expect(vm.$el.firstChild.style.display).toBe('none')
- vm.tester = false
- waitForUpdate(() => {
- expect(vm.$el.firstChild.style.display).toBe('')
- vm.tester = true
- }).then(() => {
- expect(vm.$el.firstChild.style.display).toBe('none')
- }).then(done)
- })
-})
+++ /dev/null
-import { parseStyleText } from 'web/util/style'
-const base64ImgUrl = 'url("data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==")'
-const logoUrl = 'url(https://vuejs.org/images/logo.png)'
-
-it('should parse normal static style', () => {
- const staticStyle = `font-size: 12px;background: ${logoUrl};color:red`
- const res = parseStyleText(staticStyle)
- expect(res.background).toBe(logoUrl)
- expect(res.color).toBe('red')
- expect(res['font-size']).toBe('12px')
-})
-
-it('should parse base64 background', () => {
- const staticStyle = `background: ${base64ImgUrl}`
- const res = parseStyleText(staticStyle)
- expect(res.background).toBe(base64ImgUrl)
-})
-
-it('should parse multiple background images ', () => {
- let staticStyle = `background: ${logoUrl}, ${logoUrl};`
- let res = parseStyleText(staticStyle)
- expect(res.background).toBe(`${logoUrl}, ${logoUrl}`)
-
- staticStyle = `background: ${base64ImgUrl}, ${base64ImgUrl}`
- res = parseStyleText(staticStyle)
- expect(res.background).toBe(`${base64ImgUrl}, ${base64ImgUrl}`)
-})
-
-it('should parse other images ', () => {
- let staticStyle = `shape-outside: ${logoUrl}`
- let res = parseStyleText(staticStyle)
- expect(res['shape-outside']).toBe(logoUrl)
-
- staticStyle = `list-style-image: ${logoUrl}`
- res = parseStyleText(staticStyle)
- expect(res['list-style-image']).toBe(logoUrl)
-
- staticStyle = `border-image: ${logoUrl} 30 30 repeat`
- res = parseStyleText(staticStyle)
- expect(res['border-image']).toBe(`${logoUrl} 30 30 repeat`)
-})
+++ /dev/null
-import Vue from 'vue'
-
-function checkPrefixedProp (prop) {
- var el = document.createElement('div')
- var upper = prop.charAt(0).toUpperCase() + prop.slice(1)
- if (!(prop in el.style)) {
- var prefixes = ['Webkit', 'Moz', 'ms']
- var i = prefixes.length
- while (i--) {
- if ((prefixes[i] + upper) in el.style) {
- prop = prefixes[i] + upper
- }
- }
- }
- return prop
-}
-
-describe('Directive v-bind:style', () => {
- let vm
-
- beforeEach(() => {
- vm = new Vue({
- template: '<div :style="styles"></div>',
- data () {
- return {
- styles: {},
- fontSize: 16
- }
- }
- }).$mount()
- })
-
- it('string', done => {
- vm.styles = 'color:red;'
- waitForUpdate(() => {
- expect(vm.$el.style.cssText.replace(/\s/g, '')).toBe('color:red;')
- }).then(done)
- })
-
- it('falsy number', done => {
- vm.styles = { opacity: 0 }
- waitForUpdate(() => {
- expect(vm.$el.style.opacity).toBe('0')
- }).then(done)
- })
-
- it('plain object', done => {
- vm.styles = { color: 'red' }
- waitForUpdate(() => {
- expect(vm.$el.style.cssText.replace(/\s/g, '')).toBe('color:red;')
- }).then(done)
- })
-
- it('camelCase', done => {
- vm.styles = { marginRight: '10px' }
- waitForUpdate(() => {
- expect(vm.$el.style.marginRight).toBe('10px')
- }).then(done)
- })
-
- it('remove if falsy value', done => {
- vm.$el.style.color = 'red'
- waitForUpdate(() => {
- vm.styles = { color: null }
- }).then(() => {
- expect(vm.$el.style.color).toBe('')
- }).then(done)
- })
-
- it('ignore unsupported property', done => {
- vm.styles = { foo: 'bar' }
- waitForUpdate(() => {
- expect(vm.$el.style.foo).not.toBe('bar')
- }).then(done)
- })
-
- it('auto prefix', done => {
- const prop = checkPrefixedProp('transform')
- const val = 'scale(0.5)'
- vm.styles = { transform: val }
- waitForUpdate(() => {
- expect(vm.$el.style[prop]).toBe(val)
- }).then(done)
- })
-
- it('auto-prefixed style value as array', done => {
- vm.styles = { display: ['-webkit-box', '-ms-flexbox', 'flex'] }
- const testEl = document.createElement('div')
- vm.styles.display.forEach(value => {
- testEl.style.display = value
- })
- waitForUpdate(() => {
- expect(vm.$el.style.display).toBe(testEl.style.display)
- }).then(done)
- })
-
- it('!important', done => {
- vm.styles = { display: 'block !important' }
- waitForUpdate(() => {
- expect(vm.$el.style.getPropertyPriority('display')).toBe('important')
- }).then(done)
- })
-
- it('object with multiple entries', done => {
- vm.$el.style.color = 'red'
- vm.styles = {
- marginLeft: '10px',
- marginRight: '15px'
- }
- waitForUpdate(() => {
- expect(vm.$el.style.getPropertyValue('color')).toBe('red')
- expect(vm.$el.style.getPropertyValue('margin-left')).toBe('10px')
- expect(vm.$el.style.getPropertyValue('margin-right')).toBe('15px')
- vm.styles = {
- color: 'blue',
- padding: null
- }
- }).then(() => {
- expect(vm.$el.style.getPropertyValue('color')).toBe('blue')
- expect(vm.$el.style.getPropertyValue('padding')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('margin-left')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('margin-right')).toBeFalsy()
- // handle falsy value
- vm.styles = null
- }).then(() => {
- expect(vm.$el.style.getPropertyValue('color')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('padding')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('margin-left')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('margin-right')).toBeFalsy()
- }).then(done)
- })
-
- it('array of objects', done => {
- vm.$el.style.padding = '10px'
- vm.styles = [{ color: 'red' }, { marginRight: '20px' }]
-
- waitForUpdate(() => {
- expect(vm.$el.style.getPropertyValue('color')).toBe('red')
- expect(vm.$el.style.getPropertyValue('margin-right')).toBe('20px')
- expect(vm.$el.style.getPropertyValue('padding')).toBe('10px')
- vm.styles = [{ color: 'blue' }, { padding: null }]
- }).then(() => {
- expect(vm.$el.style.getPropertyValue('color')).toBe('blue')
- expect(vm.$el.style.getPropertyValue('margin-right')).toBeFalsy()
- expect(vm.$el.style.getPropertyValue('padding')).toBeFalsy()
- }).then(done)
- })
-
- it('updates objects deeply', done => {
- vm.styles = { display: 'none' }
- waitForUpdate(() => {
- expect(vm.$el.style.display).toBe('none')
- vm.styles.display = 'block'
- }).then(() => {
- expect(vm.$el.style.display).toBe('block')
- }).then(done)
- })
-
- it('background size with only one value', done => {
- vm.styles = { backgroundSize: '100%' }
- waitForUpdate(() => {
- expect(vm.$el.style.cssText.replace(/\s/g, '')).toMatch(/background-size:100%(auto)?;/)
- }).then(done)
- })
-
- it('should work with interpolation', done => {
- vm.styles = { fontSize: `${vm.fontSize}px` }
- waitForUpdate(() => {
- expect(vm.$el.style.fontSize).toBe('16px')
- }).then(done)
- })
-
- const supportCssVariable = () => {
- const el = document.createElement('div')
- el.style.setProperty('--color', 'red')
- return el.style.getPropertyValue('--color') === 'red'
- }
-
- if (supportCssVariable()) {
- it('CSS variables', done => {
- vm.styles = { '--color': 'red' }
- waitForUpdate(() => {
- expect(vm.$el.style.getPropertyValue('--color')).toBe('red')
- }).then(done)
- })
- }
-
- it('should merge static style with binding style', () => {
- const vm = new Vue({
- template: '<div style="background: url(https://vuejs.org/images/logo.png);color: blue" :style="test"></div>',
- data: {
- test: { color: 'red', fontSize: '12px' }
- }
- }).$mount()
- const style = vm.$el.style
- expect(style.getPropertyValue('background-image')).toMatch('https://vuejs.org/images/logo.png')
- expect(style.getPropertyValue('color')).toBe('red')
- expect(style.getPropertyValue('font-size')).toBe('12px')
- })
-
- it('should merge between parent and child', done => {
- const vm = new Vue({
- template: '<child style="text-align: left;margin-right:20px" :style="test"></child>',
- data: {
- test: { color: 'red', fontSize: '12px' }
- },
- components: {
- child: {
- template: '<div style="margin-right:10px;" :style="{marginLeft: marginLeft}"></div>',
- data: () => ({ marginLeft: '16px' })
- }
- }
- }).$mount()
- const style = vm.$el.style
- const child = vm.$children[0]
- const css = style.cssText.replace(/\s/g, '')
- expect(css).toContain('margin-right:20px;')
- expect(css).toContain('margin-left:16px;')
- expect(css).toContain('text-align:left;')
- expect(css).toContain('color:red;')
- expect(css).toContain('font-size:12px;')
- expect(style.color).toBe('red')
- expect(style.marginRight).toBe('20px')
- vm.test.color = 'blue'
- waitForUpdate(() => {
- expect(style.color).toBe('blue')
- child.marginLeft = '30px'
- }).then(() => {
- expect(style.marginLeft).toBe('30px')
- child.fontSize = '30px'
- }).then(() => {
- expect(style.fontSize).toBe('12px')
- }).then(done)
- })
-
- it('should not pass to child root element', () => {
- const vm = new Vue({
- template: '<child :style="test"></child>',
- data: {
- test: { color: 'red', fontSize: '12px' }
- },
- components: {
- child: {
- template: '<div><nested ref="nested" style="color: blue;text-align:left"></nested></div>',
- components: {
- nested: {
- template: '<div></div>'
- }
- }
- }
- }
- }).$mount()
- const style = vm.$el.style
- expect(style.color).toBe('red')
- expect(style.textAlign).toBe('')
- expect(style.fontSize).toBe('12px')
- expect(vm.$children[0].$refs.nested.$el.style.color).toBe('blue')
- })
-
- it('should merge between nested components', (done) => {
- const vm = new Vue({
- template: '<child :style="test"></child>',
- data: {
- test: { color: 'red', fontSize: '12px' }
- },
- components: {
- child: {
- template: '<nested style="color: blue;text-align:left"></nested>',
- components: {
- nested: {
- template: '<div style="margin-left: 12px;" :style="nestedStyle"></div>',
- data: () => ({ nestedStyle: { marginLeft: '30px' }})
- }
- }
- }
- }
- }).$mount()
- const style = vm.$el.style
- const child = vm.$children[0].$children[0]
- expect(style.color).toBe('red')
- expect(style.marginLeft).toBe('30px')
- expect(style.textAlign).toBe('left')
- expect(style.fontSize).toBe('12px')
- vm.test.color = 'yellow'
- waitForUpdate(() => {
- child.nestedStyle.marginLeft = '60px'
- }).then(() => {
- expect(style.marginLeft).toBe('60px')
- child.nestedStyle = {
- fontSize: '14px',
- marginLeft: '40px'
- }
- }).then(() => {
- expect(style.fontSize).toBe('12px')
- expect(style.marginLeft).toBe('40px')
- }).then(done)
- })
-
- it('should not merge for different adjacent elements', (done) => {
- const vm = new Vue({
- template:
- '<div>' +
- '<section style="color: blue" :style="style" v-if="!bool"></section>' +
- '<div></div>' +
- '<section style="margin-top: 12px" v-if="bool"></section>' +
- '</div>',
- data: {
- bool: false,
- style: {
- fontSize: '12px'
- }
- }
- }).$mount()
- const style = vm.$el.children[0].style
- expect(style.fontSize).toBe('12px')
- expect(style.color).toBe('blue')
- waitForUpdate(() => {
- vm.bool = true
- }).then(() => {
- expect(style.color).toBe('')
- expect(style.fontSize).toBe('')
- expect(style.marginTop).toBe('12px')
- }).then(done)
- })
-
- it('should not merge for v-if, v-else-if and v-else elements', (done) => {
- const vm = new Vue({
- template:
- '<div>' +
- '<section style="color: blue" :style="style" v-if="foo"></section>' +
- '<section style="margin-top: 12px" v-else-if="bar"></section>' +
- '<section style="margin-bottom: 24px" v-else></section>' +
- '<div></div>' +
- '</div>',
- data: {
- foo: true,
- bar: false,
- style: {
- fontSize: '12px'
- }
- }
- }).$mount()
- const style = vm.$el.children[0].style
- expect(style.fontSize).toBe('12px')
- expect(style.color).toBe('blue')
- waitForUpdate(() => {
- vm.foo = false
- }).then(() => {
- expect(style.color).toBe('')
- expect(style.fontSize).toBe('')
- expect(style.marginBottom).toBe('24px')
- vm.bar = true
- }).then(() => {
- expect(style.color).toBe('')
- expect(style.fontSize).toBe('')
- expect(style.marginBottom).toBe('')
- expect(style.marginTop).toBe('12px')
- }).then(done)
- })
-
- // #5318
- it('should work for elements passed down as a slot', done => {
- const vm = new Vue({
- template: `<test><div :style="style"/></test>`,
- data: {
- style: { color: 'red' }
- },
- components: {
- test: {
- template: `<div><slot/></div>`
- }
- }
- }).$mount()
-
- expect(vm.$el.children[0].style.color).toBe('red')
- vm.style.color = 'green'
- waitForUpdate(() => {
- expect(vm.$el.children[0].style.color).toBe('green')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Directive v-text', () => {
- it('should render text', () => {
- const vm = new Vue({
- template: '<div v-text="a"></div>',
- data: { a: 'hello' }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('hello')
- })
-
- it('should encode html entities', () => {
- const vm = new Vue({
- template: '<div v-text="a"></div>',
- data: { a: '<foo>' }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<foo>')
- })
-
- it('should support all value types', done => {
- const vm = new Vue({
- template: '<div v-text="a"></div>',
- data: { a: false }
- }).$mount()
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('false')
- vm.a = []
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('[]')
- vm.a = {}
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('{}')
- vm.a = 123
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('123')
- vm.a = 0
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('0')
- vm.a = ' '
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(' ')
- vm.a = ' '
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(' ')
- vm.a = null
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- vm.a = undefined
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-const components = createErrorTestComponents()
-
-describe('Error handling', () => {
- // hooks that prevents the component from rendering, but should not
- // break parent component
- ;[
- ['data', 'data()'],
- ['render', 'render'],
- ['beforeCreate', 'beforeCreate hook'],
- ['created', 'created hook'],
- ['beforeMount', 'beforeMount hook'],
- ['directive bind', 'directive foo bind hook'],
- ['event', 'event handler for "e"']
- ].forEach(([type, description]) => {
- it(`should recover from errors in ${type}`, done => {
- const vm = createTestInstance(components[type])
- expect(`Error in ${description}`).toHaveBeenWarned()
- expect(`Error: ${type}`).toHaveBeenWarned()
- assertRootInstanceActive(vm).then(done)
- })
- })
-
- // error in mounted hook should affect neither child nor parent
- it('should recover from errors in mounted hook', done => {
- const vm = createTestInstance(components.mounted)
- expect(`Error in mounted hook`).toHaveBeenWarned()
- expect(`Error: mounted`).toHaveBeenWarned()
- assertBothInstancesActive(vm).then(done)
- })
-
- // error in beforeUpdate/updated should affect neither child nor parent
- ;[
- ['beforeUpdate', 'beforeUpdate hook'],
- ['updated', 'updated hook'],
- ['directive update', 'directive foo update hook']
- ].forEach(([type, description]) => {
- it(`should recover from errors in ${type} hook`, done => {
- const vm = createTestInstance(components[type])
- assertBothInstancesActive(vm).then(() => {
- expect(`Error in ${description}`).toHaveBeenWarned()
- expect(`Error: ${type}`).toHaveBeenWarned()
- }).then(done)
- })
- })
-
- ;[
- ['beforeDestroy', 'beforeDestroy hook'],
- ['destroyed', 'destroyed hook'],
- ['directive unbind', 'directive foo unbind hook']
- ].forEach(([type, description]) => {
- it(`should recover from errors in ${type} hook`, done => {
- const vm = createTestInstance(components[type])
- vm.ok = false
- waitForUpdate(() => {
- expect(`Error in ${description}`).toHaveBeenWarned()
- expect(`Error: ${type}`).toHaveBeenWarned()
- }).thenWaitFor(next => {
- assertRootInstanceActive(vm).end(next)
- }).then(done)
- })
- })
-
- it('should recover from errors in user watcher getter', done => {
- const vm = createTestInstance(components.userWatcherGetter)
- vm.n++
- waitForUpdate(() => {
- expect(`Error in getter for watcher`).toHaveBeenWarned()
- function getErrorMsg () {
- try {
- this.a.b.c
- } catch (e) {
- return e.toString()
- }
- }
- const msg = getErrorMsg.call(vm)
- expect(msg).toHaveBeenWarned()
- }).thenWaitFor(next => {
- assertBothInstancesActive(vm).end(next)
- }).then(done)
- })
-
- it('should recover from errors in user watcher callback', done => {
- const vm = createTestInstance(components.userWatcherCallback)
- vm.n++
- waitForUpdate(() => {
- expect(`Error in callback for watcher "n"`).toHaveBeenWarned()
- expect(`Error: userWatcherCallback`).toHaveBeenWarned()
- }).thenWaitFor(next => {
- assertBothInstancesActive(vm).end(next)
- }).then(done)
- })
-
- it('config.errorHandler should capture render errors', done => {
- const spy = Vue.config.errorHandler = jasmine.createSpy('errorHandler')
- const vm = createTestInstance(components.render)
-
- const args = spy.calls.argsFor(0)
- expect(args[0].toString()).toContain('Error: render') // error
- expect(args[1]).toBe(vm.$refs.child) // vm
- expect(args[2]).toContain('render') // description
-
- assertRootInstanceActive(vm).then(() => {
- Vue.config.errorHandler = null
- }).then(done)
- })
-
- it('should capture and recover from nextTick errors', done => {
- const err1 = new Error('nextTick')
- const err2 = new Error('nextTick2')
- const spy = Vue.config.errorHandler = jasmine.createSpy('errorHandler')
- Vue.nextTick(() => { throw err1 })
- Vue.nextTick(() => {
- expect(spy).toHaveBeenCalledWith(err1, undefined, 'nextTick')
-
- const vm = new Vue()
- vm.$nextTick(() => { throw err2 })
- Vue.nextTick(() => {
- // should be called with correct instance info
- expect(spy).toHaveBeenCalledWith(err2, vm, 'nextTick')
- Vue.config.errorHandler = null
- done()
- })
- })
- })
-
- it('should recover from errors thrown in errorHandler itself', () => {
- Vue.config.errorHandler = () => {
- throw new Error('error in errorHandler ¯\\_(ツ)_/¯')
- }
- const vm = new Vue({
- render (h) {
- throw new Error('error in render')
- },
- renderError (h, err) {
- return h('div', err.toString())
- }
- }).$mount()
- expect('error in errorHandler').toHaveBeenWarned()
- expect('error in render').toHaveBeenWarned()
- expect(vm.$el.textContent).toContain('error in render')
- Vue.config.errorHandler = null
- })
-})
-
-function createErrorTestComponents () {
- const components = {}
-
- // data
- components.data = {
- data () {
- throw new Error('data')
- },
- render (h) {
- return h('div')
- }
- }
-
- // render error
- components.render = {
- render (h) {
- throw new Error('render')
- }
- }
-
- // lifecycle errors
- ;['create', 'mount', 'update', 'destroy'].forEach(hook => {
- // before
- const before = 'before' + hook.charAt(0).toUpperCase() + hook.slice(1)
- const beforeComp = components[before] = {
- props: ['n'],
- render (h) {
- return h('div', this.n)
- }
- }
- beforeComp[before] = function () {
- throw new Error(before)
- }
-
- // after
- const after = hook.replace(/e?$/, 'ed')
- const afterComp = components[after] = {
- props: ['n'],
- render (h) {
- return h('div', this.n)
- }
- }
- afterComp[after] = function () {
- throw new Error(after)
- }
- })
-
- // directive hooks errors
- ;['bind', 'update', 'unbind'].forEach(hook => {
- const key = 'directive ' + hook
- const dirComp = components[key] = {
- props: ['n'],
- template: `<div v-foo="n">{{ n }}</div>`
- }
- const dirFoo = {}
- dirFoo[hook] = function () {
- throw new Error(key)
- }
- dirComp.directives = {
- foo: dirFoo
- }
- })
-
- // user watcher
- components.userWatcherGetter = {
- props: ['n'],
- created () {
- this.$watch(function () {
- return this.n + this.a.b.c
- }, val => {
- console.log('user watcher fired: ' + val)
- })
- },
- render (h) {
- return h('div', this.n)
- }
- }
-
- components.userWatcherCallback = {
- props: ['n'],
- watch: {
- n () {
- throw new Error('userWatcherCallback error')
- }
- },
- render (h) {
- return h('div', this.n)
- }
- }
-
- // event errors
- components.event = {
- beforeCreate () {
- this.$on('e', () => { throw new Error('event') })
- },
- mounted () {
- this.$emit('e')
- },
- render (h) {
- return h('div')
- }
- }
-
- return components
-}
-
-function createTestInstance (Comp) {
- return new Vue({
- data: {
- n: 0,
- ok: true
- },
- render (h) {
- return h('div', [
- 'n:' + this.n + '\n',
- this.ok
- ? h(Comp, { ref: 'child', props: { n: this.n }})
- : null
- ])
- }
- }).$mount()
-}
-
-function assertRootInstanceActive (vm, chain) {
- expect(vm.$el.innerHTML).toContain('n:0\n')
- vm.n++
- return waitForUpdate(() => {
- expect(vm.$el.innerHTML).toContain('n:1\n')
- })
-}
-
-function assertBothInstancesActive (vm) {
- vm.n = 0
- return waitForUpdate(() => {
- expect(vm.$refs.child.$el.innerHTML).toContain('0')
- }).thenWaitFor(next => {
- assertRootInstanceActive(vm).then(() => {
- expect(vm.$refs.child.$el.innerHTML).toContain('1')
- }).end(next)
- })
-}
+++ /dev/null
-import Vue from 'vue'
-import { parseFilters } from 'compiler/parser/filter-parser'
-
-describe('Filters', () => {
- it('basic usage', () => {
- const vm = new Vue({
- template: '<div>{{ msg | upper }}</div>',
- data: {
- msg: 'hi'
- },
- filters: {
- upper: v => v.toUpperCase()
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('HI')
- })
-
- it('chained usage', () => {
- const vm = new Vue({
- template: '<div>{{ msg | upper | reverse }}</div>',
- data: {
- msg: 'hi'
- },
- filters: {
- upper: v => v.toUpperCase(),
- reverse: v => v.split('').reverse().join('')
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('IH')
- })
-
- it('in v-bind', () => {
- const vm = new Vue({
- template: `
- <div
- v-bind:id="id | upper | reverse"
- :class="cls | reverse"
- :ref="ref | lower">
- </div>
- `,
- filters: {
- upper: v => v.toUpperCase(),
- reverse: v => v.split('').reverse().join(''),
- lower: v => v.toLowerCase()
- },
- data: {
- id: 'abc',
- cls: 'foo',
- ref: 'BAR'
- }
- }).$mount()
- expect(vm.$el.id).toBe('CBA')
- expect(vm.$el.className).toBe('oof')
- expect(vm.$refs.bar).toBe(vm.$el)
- })
-
- it('handle regex with pipe', () => {
- const vm = new Vue({
- template: `<test ref="test" :pattern="/a|b\\// | identity"></test>`,
- filters: { identity: v => v },
- components: {
- test: {
- props: ['pattern'],
- template: '<div></div>'
- }
- }
- }).$mount()
- expect(vm.$refs.test.pattern instanceof RegExp).toBe(true)
- expect(vm.$refs.test.pattern.toString()).toBe('/a|b\\//')
- })
-
- it('handle division', () => {
- const vm = new Vue({
- data: { a: 2 },
- template: `<div>{{ 1/a / 4 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(1 / 4))
- })
-
- it('handle division with parenthesis', () => {
- const vm = new Vue({
- data: { a: 20 },
- template: `<div>{{ (a*2) / 5 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(16))
- })
-
- it('handle division with dot', () => {
- const vm = new Vue({
- template: `<div>{{ 20. / 5 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(8))
- })
-
- it('handle division with array values', () => {
- const vm = new Vue({
- data: { a: [20] },
- template: `<div>{{ a[0] / 5 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(8))
- })
-
- it('handle division with hash values', () => {
- const vm = new Vue({
- data: { a: { n: 20 }},
- template: `<div>{{ a['n'] / 5 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(8))
- })
-
- it('handle division with variable_', () => {
- const vm = new Vue({
- data: { a_: 8 },
- template: `<div>{{ a_ / 2 | double }}</div>`,
- filters: { double: v => v * 2 }
- }).$mount()
- expect(vm.$el.textContent).toBe(String(8))
- })
-
- it('arguments', () => {
- const vm = new Vue({
- template: `<div>{{ msg | add(a, 3) }}</div>`,
- data: {
- msg: 1,
- a: 2
- },
- filters: {
- add: (v, arg1, arg2) => v + arg1 + arg2
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('6')
- })
-
- it('quotes', () => {
- const vm = new Vue({
- template: `<div>{{ msg + "b | c" + 'd' | upper }}</div>`,
- data: {
- msg: 'a'
- },
- filters: {
- upper: v => v.toUpperCase()
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('AB | CD')
- })
-
- it('double pipe', () => {
- const vm = new Vue({
- template: `<div>{{ b || msg | upper }}</div>`,
- data: {
- b: false,
- msg: 'a'
- },
- filters: {
- upper: v => v.toUpperCase()
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('A')
- })
-
- it('object literal', () => {
- const vm = new Vue({
- template: `<div>{{ { a: 123 } | pick('a') }}</div>`,
- filters: {
- pick: (v, key) => v[key]
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('123')
- })
-
- it('array literal', () => {
- const vm = new Vue({
- template: `<div>{{ [1, 2, 3] | reverse }}</div>`,
- filters: {
- reverse: arr => arr.reverse().join(',')
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('3,2,1')
- })
-
- it('warn non-existent', () => {
- new Vue({
- template: '<div>{{ msg | upper }}</div>',
- data: { msg: 'foo' }
- }).$mount()
- expect('Failed to resolve filter: upper').toHaveBeenWarned()
- })
-
- it('support template string', () => {
- expect(parseFilters('`a | ${b}c` | d')).toBe('_f("d")(`a | ${b}c`)')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: assets', () => {
- const Test = Vue.extend()
-
- it('directive / filters', () => {
- const assets = ['directive', 'filter']
- assets.forEach(function (type) {
- const def = {}
- Test[type]('test', def)
- expect(Test.options[type + 's'].test).toBe(def)
- expect(Test[type]('test')).toBe(def)
- // extended registration should not pollute global
- expect(Vue.options[type + 's'].test).toBeUndefined()
- })
- })
-
- describe('Vue.component', () => {
- it('should register a component', () => {
- Vue.component('foo', {
- template: '<span>foo</span>'
- })
- Vue.component('bar', {
- template: '<span>bar</span>'
- })
- const vm = new Vue({
- template: '<div><foo></foo><bar></bar></div>'
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo</span><span>bar</span>')
- // unregister them
- delete Vue.options.components.foo
- delete Vue.options.components.bar
- })
- })
-
- it('component on extended constructor', () => {
- const def = { a: 1 }
- Test.component('test', def)
- const component = Test.options.components.test
- expect(typeof component).toBe('function')
- expect(component.super).toBe(Vue)
- expect(component.options.a).toBe(1)
- expect(component.options.name).toBe('test')
- expect(Test.component('test')).toBe(component)
- // already extended
- Test.component('test2', component)
- expect(Test.component('test2')).toBe(component)
- // extended registration should not pollute global
- expect(Vue.options.components.test).toBeUndefined()
- })
-
- // #4434
- it('local registration should take priority regardless of naming convention', () => {
- Vue.component('x-foo', {
- template: '<span>global</span>'
- })
- const vm = new Vue({
- components: {
- xFoo: {
- template: '<span>local</span>'
- }
- },
- template: '<div><x-foo></x-foo></div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('local')
- delete Vue.options.components['x-foo']
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: compile', () => {
- it('should compile render functions', () => {
- const res = Vue.compile('<div><span>{{ msg }}</span></div>')
- const vm = new Vue({
- data: {
- msg: 'hello'
- },
- render: res.render,
- staticRenderFns: res.staticRenderFns
- }).$mount()
- expect(vm.$el.innerHTML).toContain('<span>hello</span>')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { warn } from 'core/util/debug'
-
-describe('Global config', () => {
- it('should warn replacing config object', () => {
- const originalConfig = Vue.config
- Vue.config = {}
- expect(Vue.config).toBe(originalConfig)
- expect('Do not replace the Vue.config object').toHaveBeenWarned()
- })
-
- describe('silent', () => {
- it('should be false by default', () => {
- warn('foo')
- expect('foo').toHaveBeenWarned()
- })
-
- it('should work when set to true', () => {
- Vue.config.silent = true
- warn('foo')
- expect('foo').not.toHaveBeenWarned()
- Vue.config.silent = false
- })
- })
-
- describe('optionMergeStrategies', () => {
- it('should allow defining custom option merging strategies', () => {
- const spy = jasmine.createSpy('option merging')
- Vue.config.optionMergeStrategies.__test__ = (parent, child, vm) => {
- spy(parent, child, vm)
- return child + 1
- }
- const Test = Vue.extend({
- __test__: 1
- })
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(undefined, 1, undefined)
- expect(Test.options.__test__).toBe(2)
- const test = new Test({
- __test__: 2
- })
- expect(spy.calls.count()).toBe(2)
- expect(spy).toHaveBeenCalledWith(2, 2, test)
- expect(test.$options.__test__).toBe(3)
- })
- })
-
- describe('ignoredElements', () => {
- it('should work', () => {
- Vue.config.ignoredElements = ['foo', /^ion-/]
- new Vue({
- template: `<div><foo/><ion-foo/><ion-bar/></div>`
- }).$mount()
- expect('Unknown custom element').not.toHaveBeenWarned()
- Vue.config.ignoredElements = []
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: extend', () => {
- it('should correctly merge options', () => {
- const Test = Vue.extend({
- name: 'test',
- a: 1,
- b: 2
- })
- expect(Test.options.a).toBe(1)
- expect(Test.options.b).toBe(2)
- expect(Test.super).toBe(Vue)
- const t = new Test({
- a: 2
- })
- expect(t.$options.a).toBe(2)
- expect(t.$options.b).toBe(2)
- // inheritance
- const Test2 = Test.extend({
- a: 2
- })
- expect(Test2.options.a).toBe(2)
- expect(Test2.options.b).toBe(2)
- const t2 = new Test2({
- a: 3
- })
- expect(t2.$options.a).toBe(3)
- expect(t2.$options.b).toBe(2)
- })
-
- it('should warn invalid names', () => {
- Vue.extend({ name: '123' })
- expect('Invalid component name: "123"').toHaveBeenWarned()
- Vue.extend({ name: '_fesf' })
- expect('Invalid component name: "_fesf"').toHaveBeenWarned()
- Vue.extend({ name: 'Some App' })
- expect('Invalid component name: "Some App"').toHaveBeenWarned()
- })
-
- it('should work when used as components', () => {
- const foo = Vue.extend({
- template: '<span>foo</span>'
- })
- const bar = Vue.extend({
- template: '<span>bar</span>'
- })
- const vm = new Vue({
- template: '<div><foo></foo><bar></bar></div>',
- components: { foo, bar }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo</span><span>bar</span>')
- })
-
- it('should merge lifecycle hooks', () => {
- const calls = []
- const A = Vue.extend({
- created () {
- calls.push(1)
- }
- })
- const B = A.extend({
- created () {
- calls.push(2)
- }
- })
- new B({
- created () {
- calls.push(3)
- }
- })
- expect(calls).toEqual([1, 2, 3])
- })
-
- it('should merge methods', () => {
- const A = Vue.extend({
- methods: {
- a () { return this.n }
- }
- })
- const B = A.extend({
- methods: {
- b () { return this.n + 1 }
- }
- })
- const b = new B({
- data: { n: 0 },
- methods: {
- c () { return this.n + 2 }
- }
- })
- expect(b.a()).toBe(0)
- expect(b.b()).toBe(1)
- expect(b.c()).toBe(2)
- })
-
- it('should merge assets', () => {
- const A = Vue.extend({
- components: {
- aa: {
- template: '<div>A</div>'
- }
- }
- })
- const B = A.extend({
- components: {
- bb: {
- template: '<div>B</div>'
- }
- }
- })
- const b = new B({
- template: '<div><aa></aa><bb></bb></div>'
- }).$mount()
- expect(b.$el.innerHTML).toBe('<div>A</div><div>B</div>')
- })
-
- it('caching', () => {
- const options = {
- template: '<div></div>'
- }
- const A = Vue.extend(options)
- const B = Vue.extend(options)
- expect(A).toBe(B)
- })
-
- // #4767
- it('extended options should use different identify from parent', () => {
- const A = Vue.extend({ computed: {}})
- const B = A.extend()
- B.options.computed.b = () => 'foo'
- expect(B.options.computed).not.toBe(A.options.computed)
- expect(A.options.computed.b).toBeUndefined()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: mixin', () => {
- let options
- beforeEach(() => { options = Vue.options })
- afterEach(() => { Vue.options = options })
-
- it('should work', () => {
- const spy = jasmine.createSpy('global mixin')
- Vue.mixin({
- created () {
- spy(this.$options.myOption)
- }
- })
- new Vue({
- myOption: 'hello'
- })
- expect(spy).toHaveBeenCalledWith('hello')
- })
-
- it('should work for constructors created before mixin is applied', () => {
- const calls = []
- const Test = Vue.extend({
- name: 'test',
- beforeCreate () {
- calls.push(this.$options.myOption + ' local')
- }
- })
- Vue.mixin({
- beforeCreate () {
- calls.push(this.$options.myOption + ' global')
- }
- })
- expect(Test.options.name).toBe('test')
- new Test({
- myOption: 'hello'
- })
- expect(calls).toEqual(['hello global', 'hello local'])
- })
-
- // #3957
- it('should work for global props', () => {
- const Test = Vue.extend({
- template: `<div>{{ prop }}</div>`
- })
-
- Vue.mixin({
- props: ['prop']
- })
-
- // test child component
- const vm = new Vue({
- template: '<test prop="hi"></test>',
- components: { Test }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('hi')
- })
-
- // vue-loader#433
- it('should not drop late-set render functions', () => {
- const Test = Vue.extend({})
- Test.options.render = h => h('div', 'hello')
-
- Vue.mixin({})
-
- const vm = new Vue({
- render: h => h(Test)
- }).$mount()
-
- expect(vm.$el.textContent).toBe('hello')
- })
-
- // #4266
- it('should not drop scopedId', () => {
- const Test = Vue.extend({})
- Test.options._scopeId = 'foo'
-
- Vue.mixin({})
-
- const vm = new Test({
- template: '<div><p>hi</p></div>'
- }).$mount()
-
- expect(vm.$el.children[0].hasAttribute('foo')).toBe(true)
- })
-
- // #4976
- it('should not drop late-attached custom options on existing constructors', () => {
- const baseSpy = jasmine.createSpy('base')
- const Base = Vue.extend({
- beforeCreate: baseSpy
- })
-
- const Test = Base.extend({})
-
- // Inject options later
- // vue-loader and vue-hot-reload-api are doing like this
- Test.options.computed = {
- $style: () => 123
- }
-
- const spy = jasmine.createSpy('late attached')
- Test.options.beforeCreate = Test.options.beforeCreate.concat(spy)
-
- // Update super constructor's options
- const mixinSpy = jasmine.createSpy('mixin')
- Vue.mixin({
- beforeCreate: mixinSpy
- })
-
- // mount the component
- const vm = new Test({
- template: '<div>{{ $style }}</div>'
- }).$mount()
-
- expect(spy.calls.count()).toBe(1)
- expect(baseSpy.calls.count()).toBe(1)
- expect(mixinSpy.calls.count()).toBe(1)
- expect(vm.$el.textContent).toBe('123')
- expect(vm.$style).toBe(123)
-
- // Should not be dropped
- expect(Test.options.computed.$style()).toBe(123)
- expect(Test.options.beforeCreate).toEqual([mixinSpy, baseSpy, spy])
- })
-
- // vue-class-component#83
- it('should work for a constructor mixin', () => {
- const spy = jasmine.createSpy('global mixin')
- const Mixin = Vue.extend({
- created () {
- spy(this.$options.myOption)
- }
- })
-
- Vue.mixin(Mixin)
-
- new Vue({
- myOption: 'hello'
- })
- expect(spy).toHaveBeenCalledWith('hello')
- })
-
- // vue-class-component#87
- it('should not drop original lifecycle hooks', () => {
- const base = jasmine.createSpy('base')
-
- const Base = Vue.extend({
- beforeCreate: base
- })
-
- const injected = jasmine.createSpy('injected')
-
- // inject a function
- Base.options.beforeCreate = Base.options.beforeCreate.concat(injected)
-
- Vue.mixin({})
-
- new Base({})
-
- expect(base).toHaveBeenCalled()
- expect(injected).toHaveBeenCalled()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: set/delete', () => {
- describe('Vue.set', () => {
- it('should update a vue object', done => {
- const vm = new Vue({
- template: '<div>{{x}}</div>',
- data: { x: 1 }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('1')
- Vue.set(vm, 'x', 2)
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('2')
- }).then(done)
- })
-
- it('should update a observing object', done => {
- const vm = new Vue({
- template: '<div>{{foo.x}}</div>',
- data: { foo: { x: 1 }}
- }).$mount()
- expect(vm.$el.innerHTML).toBe('1')
- Vue.set(vm.foo, 'x', 2)
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('2')
- }).then(done)
- })
-
- it('should update a observing array', done => {
- const vm = new Vue({
- template: '<div><div v-for="v,k in list">{{k}}-{{v}}</div></div>',
- data: { list: ['a', 'b', 'c'] }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div>0-a</div><div>1-b</div><div>2-c</div>')
- Vue.set(vm.list, 1, 'd')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div>0-a</div><div>1-d</div><div>2-c</div>')
- Vue.set(vm.list, '2', 'e')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<div>0-a</div><div>1-d</div><div>2-e</div>')
- /* eslint-disable no-new-wrappers */
- Vue.set(vm.list, new Number(1), 'f')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<div>0-a</div><div>1-f</div><div>2-e</div>')
- Vue.set(vm.list, '3g', 'g')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<div>0-a</div><div>1-f</div><div>2-e</div>')
- }).then(done)
- })
-
- it('should update a vue object with nothing', done => {
- const vm = new Vue({
- template: '<div>{{x}}</div>',
- data: { x: 1 }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('1')
- Vue.set(vm, 'x', null)
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('')
- Vue.set(vm, 'x')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
-
- it('be able to use string type index in array', done => {
- const vm = new Vue({
- template: '<div><p v-for="obj in lists">{{obj.name}}</p></div>',
- data: {
- lists: [
- { name: 'A' },
- { name: 'B' },
- { name: 'C' }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>B</p><p>C</p>')
- Vue.set(vm.lists, '0', { name: 'D' })
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<p>D</p><p>B</p><p>C</p>')
- }).then(done)
- })
-
- // #6845
- it('should not overwrite properties on prototype chain', () => {
- class Model {
- constructor () {
- this._bar = null
- }
- get bar () {
- return this._bar
- }
- set bar (newvalue) {
- this._bar = newvalue
- }
- }
-
- const vm = new Vue({
- data: {
- data: new Model()
- }
- })
-
- Vue.set(vm.data, 'bar', 123)
- expect(vm.data.bar).toBe(123)
- expect(vm.data.hasOwnProperty('bar')).toBe(false)
- expect(vm.data._bar).toBe(123)
- })
- })
-
- describe('Vue.delete', () => {
- it('should delete a key', done => {
- const vm = new Vue({
- template: '<div>{{obj.x}}</div>',
- data: { obj: { x: 1 }}
- }).$mount()
- expect(vm.$el.innerHTML).toBe('1')
- vm.obj.x = 2
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('2')
- Vue.delete(vm.obj, 'x')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- vm.obj.x = 3
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
-
- it('be able to delete an item in array', done => {
- const vm = new Vue({
- template: '<div><p v-for="obj in lists">{{obj.name}}</p></div>',
- data: {
- lists: [
- { name: 'A' },
- { name: 'B' },
- { name: 'C' }
- ]
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>B</p><p>C</p>')
- Vue.delete(vm.lists, 1)
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, NaN)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, -1)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, '1.3')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, true)
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, {})
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p><p>C</p>')
- Vue.delete(vm.lists, '1')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<p>A</p>')
- /* eslint-disable no-new-wrappers */
- Vue.delete(vm.lists, new Number(0))
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Global API: use', () => {
- const def = {}
- const options = {}
- const pluginStub = {
- install: (Vue, opts) => {
- Vue.directive('plugin-test', def)
- expect(opts).toBe(options)
- }
- }
-
- it('should apply Object plugin', () => {
- Vue.use(pluginStub, options)
- expect(Vue.options.directives['plugin-test']).toBe(def)
- delete Vue.options.directives['plugin-test']
- expect(Vue.options.directives['plugin-test']).toBeUndefined()
-
- // should not double apply
- Vue.use(pluginStub, options)
- expect(Vue.options.directives['plugin-test']).toBeUndefined()
- })
-
- it('should apply Function plugin', () => {
- Vue.use(pluginStub.install, options)
- expect(Vue.options.directives['plugin-test']).toBe(def)
- delete Vue.options.directives['plugin-test']
- })
-
- it('should work on extended constructors without polluting the base', () => {
- const Ctor = Vue.extend({})
- Ctor.use(pluginStub, options)
- expect(Vue.options.directives['plugin-test']).toBeUndefined()
- expect(Ctor.options.directives['plugin-test']).toBe(def)
- })
-
- // GitHub issue #5970
- it('should work on multi version', () => {
- const Ctor1 = Vue.extend({})
- const Ctor2 = Vue.extend({})
-
- Ctor1.use(pluginStub, options)
- expect(Vue.options.directives['plugin-test']).toBeUndefined()
- expect(Ctor1.options.directives['plugin-test']).toBe(def)
-
- // multi version Vue Ctor with the same cid
- Ctor2.cid = Ctor1.cid
- Ctor2.use(pluginStub, options)
- expect(Vue.options.directives['plugin-test']).toBeUndefined()
- expect(Ctor2.options.directives['plugin-test']).toBe(def)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Initialization', () => {
- it('without new', () => {
- try { Vue() } catch (e) {}
- expect('Vue is a constructor and should be called with the `new` keyword').toHaveBeenWarned()
- })
-
- it('with new', () => {
- expect(new Vue() instanceof Vue).toBe(true)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Instance methods data', () => {
- it('$set/$delete', done => {
- const vm = new Vue({
- template: '<div>{{ a.msg }}</div>',
- data: {
- a: {}
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('')
- vm.$set(vm.a, 'msg', 'hello')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('hello')
- vm.$delete(vm.a, 'msg')
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('')
- }).then(done)
- })
-
- describe('$watch', () => {
- let vm, spy
- beforeEach(() => {
- spy = jasmine.createSpy('watch')
- vm = new Vue({
- data: {
- a: {
- b: 1
- }
- },
- methods: {
- foo: spy
- }
- })
- })
-
- it('basic usage', done => {
- vm.$watch('a.b', spy)
- vm.a.b = 2
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(2, 1)
- vm.a = { b: 3 }
- }).then(() => {
- expect(spy.calls.count()).toBe(2)
- expect(spy).toHaveBeenCalledWith(3, 2)
- }).then(done)
- })
-
- it('immediate', () => {
- vm.$watch('a.b', spy, { immediate: true })
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(1)
- })
-
- it('unwatch', done => {
- const unwatch = vm.$watch('a.b', spy)
- unwatch()
- vm.a.b = 2
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(0)
- }).then(done)
- })
-
- it('function watch', done => {
- vm.$watch(function () {
- return this.a.b
- }, spy)
- vm.a.b = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
-
- it('deep watch', done => {
- var oldA = vm.a
- vm.$watch('a', spy, { deep: true })
- vm.a.b = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(oldA, oldA)
- vm.a = { b: 3 }
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.a, oldA)
- }).then(done)
- })
-
- it('handler option', done => {
- var oldA = vm.a
- vm.$watch('a', {
- handler: spy,
- deep: true
- })
- vm.a.b = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(oldA, oldA)
- vm.a = { b: 3 }
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.a, oldA)
- }).then(done)
- })
-
- it('handler option in string', () => {
- vm.$watch('a.b', {
- handler: 'foo',
- immediate: true
- })
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(1)
- })
-
- it('warn expression', () => {
- vm.$watch('a + b', spy)
- expect('Watcher only accepts simple dot-delimited paths').toHaveBeenWarned()
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Instance methods events', () => {
- let vm, spy
- beforeEach(() => {
- vm = new Vue()
- spy = jasmine.createSpy('emitter')
- })
-
- it('$on', () => {
- vm.$on('test', function () {
- // expect correct context
- expect(this).toBe(vm)
- spy.apply(this, arguments)
- })
- vm.$emit('test', 1, 2, 3, 4)
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(1, 2, 3, 4)
- })
-
- it('$on multi event', () => {
- vm.$on(['test1', 'test2'], function () {
- expect(this).toBe(vm)
- spy.apply(this, arguments)
- })
- vm.$emit('test1', 1, 2, 3, 4)
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(1, 2, 3, 4)
- vm.$emit('test2', 5, 6, 7, 8)
- expect(spy.calls.count()).toBe(2)
- expect(spy).toHaveBeenCalledWith(5, 6, 7, 8)
- })
-
- it('$off multi event', () => {
- vm.$on(['test1', 'test2', 'test3'], spy)
- vm.$off(['test1', 'test2'], spy)
- vm.$emit('test1')
- vm.$emit('test2')
- expect(spy).not.toHaveBeenCalled()
- vm.$emit('test3', 1, 2, 3, 4)
- expect(spy.calls.count()).toBe(1)
- })
-
- it('$off multi event without callback', () => {
- vm.$on(['test1', 'test2'], spy)
- vm.$off(['test1', 'test2'])
- vm.$emit('test1')
- expect(spy).not.toHaveBeenCalled()
- })
-
- it('$once', () => {
- vm.$once('test', spy)
- vm.$emit('test', 1, 2, 3)
- vm.$emit('test', 2, 3, 4)
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(1, 2, 3)
- })
-
- it('$off', () => {
- vm.$on('test1', spy)
- vm.$on('test2', spy)
- vm.$off()
- vm.$emit('test1')
- vm.$emit('test2')
- expect(spy).not.toHaveBeenCalled()
- })
-
- it('$off event', () => {
- vm.$on('test1', spy)
- vm.$on('test2', spy)
- vm.$off('test1')
- vm.$off('test1') // test off something that's already off
- vm.$emit('test1', 1)
- vm.$emit('test2', 2)
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(2)
- })
-
- it('$off event + fn', () => {
- var spy2 = jasmine.createSpy('emitter')
- vm.$on('test', spy)
- vm.$on('test', spy2)
- vm.$off('test', spy)
- vm.$emit('test', 1, 2, 3)
- expect(spy).not.toHaveBeenCalled()
- expect(spy2.calls.count()).toBe(1)
- expect(spy2).toHaveBeenCalledWith(1, 2, 3)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Instance methods lifecycle', () => {
- describe('$mount', () => {
- it('empty mount', () => {
- const vm = new Vue({
- data: { msg: 'hi' },
- template: '<div>{{ msg }}</div>'
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('mount to existing element', () => {
- const el = document.createElement('div')
- el.innerHTML = '{{ msg }}'
- const vm = new Vue({
- data: { msg: 'hi' }
- }).$mount(el)
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('mount to id', () => {
- const el = document.createElement('div')
- el.id = 'mount-test'
- el.innerHTML = '{{ msg }}'
- document.body.appendChild(el)
- const vm = new Vue({
- data: { msg: 'hi' }
- }).$mount('#mount-test')
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
- })
-
- describe('$destroy', () => {
- it('remove self from parent', () => {
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: { template: '<div></div>' }
- }
- }).$mount()
- vm.$children[0].$destroy()
- expect(vm.$children.length).toBe(0)
- })
-
- it('teardown watchers', () => {
- const vm = new Vue({
- data: { a: 123 },
- template: '<div></div>'
- }).$mount()
- vm.$watch('a', () => {})
- vm.$destroy()
- expect(vm._watcher.active).toBe(false)
- expect(vm._watchers.every(w => !w.active)).toBe(true)
- })
-
- it('remove self from data observer', () => {
- const vm = new Vue({ data: { a: 1 }})
- vm.$destroy()
- expect(vm.$data.__ob__.vmCount).toBe(0)
- })
-
- it('avoid duplicate calls', () => {
- const spy = jasmine.createSpy('destroy')
- const vm = new Vue({
- beforeDestroy: spy
- })
- vm.$destroy()
- vm.$destroy()
- expect(spy.calls.count()).toBe(1)
- })
- })
-
- describe('$forceUpdate', () => {
- it('should force update', done => {
- const vm = new Vue({
- data: {
- a: {}
- },
- template: '<div>{{ a.b }}</div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('')
- vm.a.b = 'foo'
- waitForUpdate(() => {
- // should not work because adding new property
- expect(vm.$el.textContent).toBe('')
- vm.$forceUpdate()
- }).then(() => {
- expect(vm.$el.textContent).toBe('foo')
- }).then(done)
- })
- })
-
- describe('$nextTick', () => {
- it('should be called after DOM update in correct context', done => {
- const vm = new Vue({
- template: '<div>{{ msg }}</div>',
- data: {
- msg: 'foo'
- }
- }).$mount()
- vm.msg = 'bar'
- vm.$nextTick(function () {
- expect(this).toBe(vm)
- expect(vm.$el.textContent).toBe('bar')
- done()
- })
- })
-
- if (typeof Promise !== 'undefined') {
- it('should be called after DOM update in correct context, when using Promise syntax', done => {
- const vm = new Vue({
- template: '<div>{{ msg }}</div>',
- data: {
- msg: 'foo'
- }
- }).$mount()
- vm.msg = 'bar'
- vm.$nextTick().then(ctx => {
- expect(ctx).toBe(vm)
- expect(vm.$el.textContent).toBe('bar')
- done()
- })
- })
- }
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Instance properties', () => {
- it('$data', () => {
- const data = { a: 1 }
- const vm = new Vue({
- data
- })
- expect(vm.a).toBe(1)
- expect(vm.$data).toBe(data)
- // vm -> data
- vm.a = 2
- expect(data.a).toBe(2)
- // data -> vm
- data.a = 3
- expect(vm.a).toBe(3)
- })
-
- it('$options', () => {
- const A = Vue.extend({
- methods: {
- a () {}
- }
- })
- const vm = new A({
- methods: {
- b () {}
- }
- })
- expect(typeof vm.$options.methods.a).toBe('function')
- expect(typeof vm.$options.methods.b).toBe('function')
- })
-
- it('$root/$children', done => {
- const vm = new Vue({
- template: '<div><test v-if="ok"></test></div>',
- data: { ok: true },
- components: {
- test: {
- template: '<div></div>'
- }
- }
- }).$mount()
- expect(vm.$root).toBe(vm)
- expect(vm.$children.length).toBe(1)
- expect(vm.$children[0].$root).toBe(vm)
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$children.length).toBe(1)
- expect(vm.$children[0].$root).toBe(vm)
- }).then(done)
- })
-
- it('$parent', () => {
- const calls = []
- const makeOption = name => ({
- name,
- template: `<div><slot></slot></div>`,
- created () {
- calls.push(`${name}:${this.$parent.$options.name}`)
- }
- })
- new Vue({
- template: `
- <div>
- <outer><middle><inner></inner></middle></outer>
- <next></next>
- </div>
- `,
- components: {
- outer: makeOption('outer'),
- middle: makeOption('middle'),
- inner: makeOption('inner'),
- next: makeOption('next')
- }
- }).$mount()
- expect(calls).toEqual(['outer:undefined', 'middle:outer', 'inner:middle', 'next:undefined'])
- })
-
- it('$props', done => {
- const Comp = Vue.extend({
- props: ['msg'],
- template: '<div>{{ msg }} {{ $props.msg }}</div>'
- })
- const vm = new Comp({
- propsData: {
- msg: 'foo'
- }
- }).$mount()
- // check render
- expect(vm.$el.textContent).toContain('foo foo')
- // warn set
- vm.$props = {}
- expect('$props is readonly').toHaveBeenWarned()
- // check existence
- expect(vm.$props.msg).toBe('foo')
- // check change
- vm.msg = 'bar'
- expect(vm.$props.msg).toBe('bar')
- waitForUpdate(() => {
- expect(vm.$el.textContent).toContain('bar bar')
- }).then(() => {
- vm.$props.msg = 'baz'
- expect(vm.msg).toBe('baz')
- }).then(() => {
- expect(vm.$el.textContent).toContain('baz baz')
- }).then(done)
- })
-
- it('warn mutating $props', () => {
- const Comp = {
- props: ['msg'],
- render () {},
- mounted () {
- expect(this.$props.msg).toBe('foo')
- this.$props.msg = 'bar'
- }
- }
- new Vue({
- template: `<comp ref="comp" msg="foo" />`,
- components: { Comp }
- }).$mount()
- expect(`Avoid mutating a prop`).toHaveBeenWarned()
- })
-
- it('$attrs', done => {
- const vm = new Vue({
- template: `<foo :id="foo" bar="1"/>`,
- data: { foo: 'foo' },
- components: {
- foo: {
- props: ['bar'],
- template: `<div><div v-bind="$attrs"></div></div>`
- }
- }
- }).$mount()
- expect(vm.$el.children[0].id).toBe('foo')
- expect(vm.$el.children[0].hasAttribute('bar')).toBe(false)
- vm.foo = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.children[0].id).toBe('bar')
- expect(vm.$el.children[0].hasAttribute('bar')).toBe(false)
- }).then(done)
- })
-
- // #6263
- it('$attrs should not be undefined when no props passed in', () => {
- const vm = new Vue({
- template: `<foo/>`,
- data: { foo: 'foo' },
- components: {
- foo: {
- template: `<div>{{ this.foo }}</div>`
- }
- }
- }).$mount()
- expect(vm.$attrs).toBeDefined()
- })
-
- it('warn mutating $attrs', () => {
- const vm = new Vue()
- vm.$attrs = {}
- expect(`$attrs is readonly`).toHaveBeenWarned()
- })
-
- it('$listeners', done => {
- const spyA = jasmine.createSpy('A')
- const spyB = jasmine.createSpy('B')
- const vm = new Vue({
- template: `<foo @click="foo"/>`,
- data: { foo: spyA },
- components: {
- foo: {
- template: `<div v-on="$listeners"></div>`
- }
- }
- }).$mount()
-
- // has to be in dom for test to pass in IE
- document.body.appendChild(vm.$el)
-
- triggerEvent(vm.$el, 'click')
- expect(spyA.calls.count()).toBe(1)
- expect(spyB.calls.count()).toBe(0)
-
- vm.foo = spyB
- waitForUpdate(() => {
- triggerEvent(vm.$el, 'click')
- expect(spyA.calls.count()).toBe(1)
- expect(spyB.calls.count()).toBe(1)
- document.body.removeChild(vm.$el)
- }).then(done)
- })
-
- it('warn mutating $listeners', () => {
- const vm = new Vue()
- vm.$listeners = {}
- expect(`$listeners is readonly`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-if (typeof Proxy !== 'undefined') {
- describe('render proxy', () => {
- it('should warn missing property in render fns with `with`', () => {
- new Vue({
- template: `<div>{{ a }}</div>`
- }).$mount()
- expect(`Property or method "a" is not defined`).toHaveBeenWarned()
- })
-
- it('should warn missing property in render fns without `with`', () => {
- const render = function (h) {
- return h('div', [this.a])
- }
- render._withStripped = true
- new Vue({
- render
- }).$mount()
- expect(`Property or method "a" is not defined`).toHaveBeenWarned()
- })
-
- it('should not warn for hand-written render functions', () => {
- new Vue({
- render (h) {
- return h('div', [this.a])
- }
- }).$mount()
- expect(`Property or method "a" is not defined`).not.toHaveBeenWarned()
- })
- })
-}
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options _scopeId', () => {
- it('should add scopeId attributes', () => {
- const vm = new Vue({
- _scopeId: 'foo',
- template: '<div><p><span></span></p></div>'
- }).$mount()
- expect(vm.$el.hasAttribute('foo')).toBe(true)
- expect(vm.$el.children[0].hasAttribute('foo')).toBe(true)
- expect(vm.$el.children[0].children[0].hasAttribute('foo')).toBe(true)
- })
-
- it('should add scopedId attributes from both parent and child on child root', () => {
- const vm = new Vue({
- _scopeId: 'foo',
- template: '<div><child></child></div>',
- components: {
- child: {
- _scopeId: 'bar',
- template: '<div></div>'
- }
- }
- }).$mount()
- expect(vm.$el.children[0].hasAttribute('foo')).toBe(true)
- expect(vm.$el.children[0].hasAttribute('bar')).toBe(true)
- })
-
- it('should add scopedId attributes from both parent and child on slot contents', () => {
- const vm = new Vue({
- _scopeId: 'foo',
- template: '<div><child><p>hi</p></child></div>',
- components: {
- child: {
- _scopeId: 'bar',
- template: '<div><slot></slot></div>'
- }
- }
- }).$mount()
- expect(vm.$el.children[0].children[0].hasAttribute('foo')).toBe(true)
- expect(vm.$el.children[0].children[0].hasAttribute('bar')).toBe(true)
- })
-
- // #4774
- it('should not discard parent scopeId when component root element is replaced', done => {
- const vm = new Vue({
- _scopeId: 'data-1',
- template: `<div><child ref="child" /></div>`,
- components: {
- child: {
- _scopeId: 'data-2',
- data: () => ({ show: true }),
- template: '<div v-if="show"></div>'
- }
- }
- }).$mount()
-
- const child = vm.$refs.child
-
- expect(child.$el.hasAttribute('data-1')).toBe(true)
- expect(child.$el.hasAttribute('data-2')).toBe(true)
-
- child.show = false
- waitForUpdate(() => {
- child.show = true
- }).then(() => {
- expect(child.$el.hasAttribute('data-1')).toBe(true)
- expect(child.$el.hasAttribute('data-2')).toBe(true)
- }).then(done)
- })
-
- it('should work on functional components', () => {
- const child = {
- functional: true,
- _scopeId: 'child',
- render (h) {
- return h('div', { class: 'child' }, [
- h('span', { class: 'child' }, 'child')
- ])
- }
- }
- const vm = new Vue({
- _scopeId: 'parent',
- components: { child },
- template: '<div><child></child></div>'
- }).$mount()
-
- expect(vm.$el.hasAttribute('parent')).toBe(true)
- const childEls = vm.$el.querySelectorAll('.child')
- ;[].forEach.call(childEls, el => {
- expect(el.hasAttribute('child')).toBe(true)
- // functional component with scopeId will not inherit parent scopeId
- expect(el.hasAttribute('parent')).toBe(false)
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Comments', () => {
- it('comments should be kept', () => {
- const vm = new Vue({
- comments: true,
- data () {
- return {
- foo: 1
- }
- },
- template: '<div><span>node1</span><!--comment1-->{{foo}}<!--comment2--></div>'
- }).$mount()
- expect(vm.$el.innerHTML).toEqual('<span>node1</span><!--comment1-->1<!--comment2-->')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { UA } from 'core/util/env'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options components', () => {
- testObjectOption('components')
-
- it('should accept plain object', () => {
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: {
- template: '<div>hi</div>'
- }
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('should accept extended constructor', () => {
- const Test = Vue.extend({
- template: '<div>hi</div>'
- })
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: Test
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('should accept camelCase', () => {
- const myComp = {
- template: '<div>hi</div>'
- }
- const vm = new Vue({
- template: '<my-comp></my-comp>',
- components: {
- myComp
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('should accept PascalCase', () => {
- const MyComp = {
- template: '<div>hi</div>'
- }
- const vm = new Vue({
- template: '<my-comp></my-comp>',
- components: {
- MyComp
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hi')
- })
-
- it('should warn native HTML elements', () => {
- new Vue({
- components: {
- div: { template: '<div></div>' }
- }
- })
- expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
- })
-
- it('should warn built-in elements', () => {
- new Vue({
- components: {
- component: { template: '<div></div>' }
- }
- })
- expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
- })
-
- // the HTMLUnknownElement check doesn't work in Android 4.2
- // but since it doesn't support custom elements nor will any dev use it
- // as their primary debugging browser, it doesn't really matter.
- if (!(UA && /android 4\.2/.test(UA))) {
- it('warn non-existent', () => {
- new Vue({
- template: '<test></test>'
- }).$mount()
- expect('Unknown custom element: <test>').toHaveBeenWarned()
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options computed', () => {
- testObjectOption('computed')
-
- it('basic usage', done => {
- const vm = new Vue({
- template: '<div>{{ b }}</div>',
- data: {
- a: 1
- },
- computed: {
- b () {
- return this.a + 1
- }
- }
- }).$mount()
- expect(vm.b).toBe(2)
- expect(vm.$el.textContent).toBe('2')
- vm.a = 2
- expect(vm.b).toBe(3)
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('3')
- }).then(done)
- })
-
- it('with setter', done => {
- const vm = new Vue({
- template: '<div>{{ b }}</div>',
- data: {
- a: 1
- },
- computed: {
- b: {
- get () { return this.a + 1 },
- set (v) { this.a = v - 1 }
- }
- }
- }).$mount()
- expect(vm.b).toBe(2)
- expect(vm.$el.textContent).toBe('2')
- vm.a = 2
- expect(vm.b).toBe(3)
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('3')
- vm.b = 1
- expect(vm.a).toBe(0)
- }).then(() => {
- expect(vm.$el.textContent).toBe('1')
- }).then(done)
- })
-
- it('warn with setter and no getter', () => {
- const vm = new Vue({
- template: `
- <div>
- <test></test>
- </div>
- `,
- components: {
- test: {
- data () {
- return {
- a: 1
- }
- },
- computed: {
- b: {
- set (v) { this.a = v }
- }
- },
- template: `<div>{{a}}</div>`
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div>1</div>')
- expect('Getter is missing for computed property "b".').toHaveBeenWarned()
- })
-
- it('warn assigning to computed with no setter', () => {
- const vm = new Vue({
- computed: {
- b () {
- return 1
- }
- }
- })
- vm.b = 2
- expect(`Computed property "b" was assigned to but it has no setter.`).toHaveBeenWarned()
- })
-
- it('watching computed', done => {
- const spy = jasmine.createSpy('watch computed')
- const vm = new Vue({
- data: {
- a: 1
- },
- computed: {
- b () { return this.a + 1 }
- }
- })
- vm.$watch('b', spy)
- vm.a = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(3, 2)
- }).then(done)
- })
-
- it('caching', () => {
- const spy = jasmine.createSpy('cached computed')
- const vm = new Vue({
- data: {
- a: 1
- },
- computed: {
- b () {
- spy()
- return this.a + 1
- }
- }
- })
- expect(spy.calls.count()).toBe(0)
- vm.b
- expect(spy.calls.count()).toBe(1)
- vm.b
- expect(spy.calls.count()).toBe(1)
- })
-
- it('cache: false', () => {
- const spy = jasmine.createSpy('cached computed')
- const vm = new Vue({
- data: {
- a: 1
- },
- computed: {
- b: {
- cache: false,
- get () {
- spy()
- return this.a + 1
- }
- }
- }
- })
- expect(spy.calls.count()).toBe(0)
- vm.b
- expect(spy.calls.count()).toBe(1)
- vm.b
- expect(spy.calls.count()).toBe(2)
- })
-
- it('as component', done => {
- const Comp = Vue.extend({
- template: `<div>{{ b }} {{ c }}</div>`,
- data () {
- return { a: 1 }
- },
- computed: {
- // defined on prototype
- b () {
- return this.a + 1
- }
- }
- })
-
- const vm = new Comp({
- computed: {
- // defined at instantiation
- c () {
- return this.b + 1
- }
- }
- }).$mount()
- expect(vm.b).toBe(2)
- expect(vm.c).toBe(3)
- expect(vm.$el.textContent).toBe('2 3')
- vm.a = 2
- expect(vm.b).toBe(3)
- expect(vm.c).toBe(4)
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('3 4')
- }).then(done)
- })
-
- it('warn conflict with data', () => {
- new Vue({
- data: {
- a: 1
- },
- computed: {
- a: () => 2
- }
- })
- expect(`computed property "a" is already defined in data`).toHaveBeenWarned()
- })
-
- it('warn conflict with props', () => {
- new Vue({
- props: ['a'],
- propsData: { a: 1 },
- computed: {
- a: () => 2
- }
- })
- expect(`computed property "a" is already defined as a prop`).toHaveBeenWarned()
- })
-
- it('rethrow computed error', () => {
- const vm = new Vue({
- computed: {
- a: () => {
- throw new Error('rethrow')
- }
- }
- })
- expect(() => vm.a).toThrowError('rethrow')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options data', () => {
- it('should proxy and be reactive', done => {
- const data = { msg: 'foo' }
- const vm = new Vue({
- data,
- template: '<div>{{ msg }}</div>'
- }).$mount()
- expect(vm.$data).toEqual({ msg: 'foo' })
- expect(vm.$data).toBe(data)
- data.msg = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('bar')
- }).then(done)
- })
-
- it('should merge data properly', () => {
- const Test = Vue.extend({
- data () {
- return { a: 1 }
- }
- })
- let vm = new Test({
- data: { b: 2 }
- })
- expect(vm.a).toBe(1)
- expect(vm.b).toBe(2)
- // no instance data
- vm = new Test()
- expect(vm.a).toBe(1)
- // no child-val
- const Extended = Test.extend({})
- vm = new Extended()
- expect(vm.a).toBe(1)
- // recursively merge objects
- const WithObject = Vue.extend({
- data () {
- return {
- obj: {
- a: 1
- }
- }
- }
- })
- vm = new WithObject({
- data: {
- obj: {
- b: 2
- }
- }
- })
- expect(vm.obj.a).toBe(1)
- expect(vm.obj.b).toBe(2)
- })
-
- it('should warn non-function during extend', () => {
- Vue.extend({
- data: { msg: 'foo' }
- })
- expect('The "data" option should be a function').toHaveBeenWarned()
- })
-
- it('should warn non object return', () => {
- new Vue({
- data () {}
- })
- expect('data functions should return an object').toHaveBeenWarned()
- })
-
- it('should warn replacing root $data', () => {
- const vm = new Vue({
- data: {}
- })
- vm.$data = {}
- expect('Avoid replacing instance root $data').toHaveBeenWarned()
- })
-
- it('should have access to props', () => {
- const Test = {
- props: ['a'],
- render () {},
- data () {
- return {
- b: this.a
- }
- }
- }
- const vm = new Vue({
- template: `<test ref="test" :a="1"></test>`,
- components: { Test }
- }).$mount()
- expect(vm.$refs.test.b).toBe(1)
- })
-
- it('props should not be reactive', done => {
- let calls = 0
- const vm = new Vue({
- template: `<child :msg="msg"></child>`,
- data: {
- msg: 'hello'
- },
- beforeUpdate () { calls++ },
- components: {
- child: {
- template: `<span>{{ localMsg }}</span>`,
- props: ['msg'],
- data () {
- return { localMsg: this.msg }
- },
- computed: {
- computedMsg () {
- return this.msg + ' world'
- }
- }
- }
- }
- }).$mount()
- const child = vm.$children[0]
- vm.msg = 'hi'
- waitForUpdate(() => {
- expect(child.localMsg).toBe('hello')
- expect(child.computedMsg).toBe('hi world')
- expect(calls).toBe(1)
- }).then(done)
- })
-
- it('should have access to methods', () => {
- const vm = new Vue({
- methods: {
- get () {
- return { a: 1 }
- }
- },
- data () {
- return this.get()
- }
- })
- expect(vm.a).toBe(1)
- })
-
- it('should be called with this', () => {
- const vm = new Vue({
- template: '<div><child></child></div>',
- provide: { foo: 1 },
- components: {
- child: {
- template: '<span>{{bar}}</span>',
- inject: ['foo'],
- data ({ foo }) {
- return { bar: 'foo:' + foo }
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo:1</span>')
- })
-
- it('should be called with vm as first argument when merged', () => {
- const superComponent = {
- data: ({ foo }) => ({ ext: 'ext:' + foo })
- }
- const mixins = [
- {
- data: ({ foo }) => ({ mixin1: 'm1:' + foo })
- },
- {
- data: ({ foo }) => ({ mixin2: 'm2:' + foo })
- }
- ]
- const vm = new Vue({
- template: '<div><child></child></div>',
- provide: { foo: 1 },
- components: {
- child: {
- extends: superComponent,
- mixins,
- template: '<span>{{bar}}-{{ext}}-{{mixin1}}-{{mixin2}}</span>',
- inject: ['foo'],
- data: ({ foo }) => ({ bar: 'foo:' + foo })
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo:1-ext:1-m1:1-m2:1</span>')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Delimiters', () => {
- it('default delimiters should work', () => {
- const vm = new Vue({
- data: {
- a: 1
- },
- template: '<div>{{ a }}</div>'
- }).$mount()
- expect(vm.$el.textContent).toEqual('1')
- })
-
- it('custom delimiters should work', () => {
- const vm = new Vue({
- delimiters: ['[[', ']]'],
- template: '<div>[[ a ]]</div>',
- data: {
- a: 1
- }
- }).$mount()
-
- expect(vm.$el.textContent).toEqual('1')
- })
-
- it('default delimiters should be ignored when custom delimiters defined', () => {
- const vm = new Vue({
- delimiters: ['[[', ']]'],
- template: '<div>{{ a }}</div>',
- data: {
- a: 1
- }
- }).$mount()
-
- expect(vm.$el.textContent).toEqual('{{ a }}')
- })
-
- it('delimiters should only affect vm', () => {
- const Component = Vue.extend({
- data: function () {
- return {
- b: 2
- }
- },
- template: '<span>[[ b ]]</span>'
- })
-
- const vm = new Vue({
- delimiters: ['[[', ']]'],
- template: '<div>[[ a ]] - <test-component></test-component></div>',
- data: {
- a: 2
- },
- components: {
- 'test-component': Component
- }
- }).$mount()
-
- expect(vm.$el.textContent).toEqual('2 - [[ b ]]')
- })
-
- it('delimiters defined globally should work on all vms', () => {
- Vue.options.delimiters = ['[[', ']]']
-
- const Component = Vue.extend({
- template: '<span>[[ a ]]</span>',
- data: function () {
- return {
- a: 2
- }
- }
- })
-
- const vm = new Vue({
- data: {
- b: 1
- },
- template: '<div>[[ b ]] - <test-component></test-component></div>',
- components: {
- 'test-component': Component
- }
- }).$mount()
-
- expect(vm.$el.textContent).toEqual('1 - 2')
- // restore default options
- delete Vue.options.delimiters
- })
-
- it('component specific delimiters should override global delimiters', () => {
- Vue.options.delimiters = ['[[', ']]']
-
- const Component = Vue.extend({
- delimiters: ['@{{', '}}'],
- template: '<span>@{{ a }}</span>',
- data: function () {
- return {
- a: 2
- }
- }
- })
-
- const vm = new Vue({
- data: {
- b: 1
- },
- template: '<div>[[ b ]] - <test-component></test-component></div>',
- components: {
- 'test-component': Component
- }
- }).$mount()
-
- expect(vm.$el.textContent).toEqual('1 - 2')
- // restore default options
- delete Vue.options.delimiters
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options directives', () => {
- it('basic usage', done => {
- const bindSpy = jasmine.createSpy('bind')
- const insertedSpy = jasmine.createSpy('inserted')
- const updateSpy = jasmine.createSpy('update')
- const componentUpdatedSpy = jasmine.createSpy('componentUpdated')
- const unbindSpy = jasmine.createSpy('unbind')
-
- const assertContext = (el, binding, vnode) => {
- expect(vnode.context).toBe(vm)
- expect(binding.arg).toBe('arg')
- expect(binding.modifiers).toEqual({ hello: true })
- }
-
- const vm = new Vue({
- template: '<div class="hi"><div v-if="ok" v-test:arg.hello="a">{{ msg }}</div></div>',
- data: {
- msg: 'hi',
- a: 'foo',
- ok: true
- },
- directives: {
- test: {
- bind (el, binding, vnode) {
- bindSpy()
- assertContext(el, binding, vnode)
- expect(binding.value).toBe('foo')
- expect(binding.expression).toBe('a')
- expect(binding.oldValue).toBeUndefined()
- expect(el.parentNode).toBeNull()
- },
- inserted (el, binding, vnode) {
- insertedSpy()
- assertContext(el, binding, vnode)
- expect(binding.value).toBe('foo')
- expect(binding.expression).toBe('a')
- expect(binding.oldValue).toBeUndefined()
- expect(el.parentNode.className).toBe('hi')
- },
- update (el, binding, vnode, oldVnode) {
- updateSpy()
- assertContext(el, binding, vnode)
- expect(el).toBe(vm.$el.children[0])
- expect(oldVnode).not.toBe(vnode)
- expect(binding.expression).toBe('a')
- if (binding.value !== binding.oldValue) {
- expect(binding.value).toBe('bar')
- expect(binding.oldValue).toBe('foo')
- }
- },
- componentUpdated (el, binding, vnode) {
- componentUpdatedSpy()
- assertContext(el, binding, vnode)
- },
- unbind (el, binding, vnode) {
- unbindSpy()
- assertContext(el, binding, vnode)
- }
- }
- }
- })
-
- vm.$mount()
- expect(bindSpy).toHaveBeenCalled()
- expect(insertedSpy).toHaveBeenCalled()
- expect(updateSpy).not.toHaveBeenCalled()
- expect(componentUpdatedSpy).not.toHaveBeenCalled()
- expect(unbindSpy).not.toHaveBeenCalled()
- vm.a = 'bar'
- waitForUpdate(() => {
- expect(updateSpy).toHaveBeenCalled()
- expect(componentUpdatedSpy).toHaveBeenCalled()
- expect(unbindSpy).not.toHaveBeenCalled()
- vm.msg = 'bye'
- }).then(() => {
- expect(componentUpdatedSpy.calls.count()).toBe(2)
- vm.ok = false
- }).then(() => {
- expect(unbindSpy).toHaveBeenCalled()
- }).then(done)
- })
-
- it('function shorthand', done => {
- const spy = jasmine.createSpy('directive')
- const vm = new Vue({
- template: '<div v-test:arg.hello="a"></div>',
- data: { a: 'foo' },
- directives: {
- test (el, binding, vnode) {
- expect(vnode.context).toBe(vm)
- expect(binding.arg).toBe('arg')
- expect(binding.modifiers).toEqual({ hello: true })
- spy(binding.value, binding.oldValue)
- }
- }
- })
- vm.$mount()
- expect(spy).toHaveBeenCalledWith('foo', undefined)
- vm.a = 'bar'
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith('bar', 'foo')
- }).then(done)
- })
-
- it('function shorthand (global)', done => {
- const spy = jasmine.createSpy('directive')
- Vue.directive('test', function (el, binding, vnode) {
- expect(vnode.context).toBe(vm)
- expect(binding.arg).toBe('arg')
- expect(binding.modifiers).toEqual({ hello: true })
- spy(binding.value, binding.oldValue)
- })
- const vm = new Vue({
- template: '<div v-test:arg.hello="a"></div>',
- data: { a: 'foo' }
- })
- vm.$mount()
- expect(spy).toHaveBeenCalledWith('foo', undefined)
- vm.a = 'bar'
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith('bar', 'foo')
- delete Vue.options.directives.test
- }).then(done)
- })
-
- it('should teardown directives on old vnodes when new vnodes have none', done => {
- const vm = new Vue({
- data: {
- ok: true
- },
- template: `
- <div>
- <div v-if="ok" v-test>a</div>
- <div v-else class="b">b</div>
- </div>
- `,
- directives: {
- test: {
- bind: el => { el.id = 'a' },
- unbind: el => { el.id = '' }
- }
- }
- }).$mount()
- expect(vm.$el.children[0].id).toBe('a')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].id).toBe('')
- expect(vm.$el.children[0].className).toBe('b')
- }).then(done)
- })
-
- it('should properly handle same node with different directive sets', done => {
- const spies = {}
- const createSpy = name => (spies[name] = jasmine.createSpy(name))
- const vm = new Vue({
- data: {
- ok: true,
- val: 123
- },
- template: `
- <div>
- <div v-if="ok" v-test="val" v-test.hi="val"></div>
- <div v-if="!ok" v-test.hi="val" v-test2="val"></div>
- </div>
- `,
- directives: {
- test: {
- bind: createSpy('bind1'),
- inserted: createSpy('inserted1'),
- update: createSpy('update1'),
- componentUpdated: createSpy('componentUpdated1'),
- unbind: createSpy('unbind1')
- },
- test2: {
- bind: createSpy('bind2'),
- inserted: createSpy('inserted2'),
- update: createSpy('update2'),
- componentUpdated: createSpy('componentUpdated2'),
- unbind: createSpy('unbind2')
- }
- }
- }).$mount()
-
- expect(spies.bind1.calls.count()).toBe(2)
- expect(spies.inserted1.calls.count()).toBe(2)
- expect(spies.bind2.calls.count()).toBe(0)
- expect(spies.inserted2.calls.count()).toBe(0)
-
- vm.ok = false
- waitForUpdate(() => {
- // v-test with modifier should be updated
- expect(spies.update1.calls.count()).toBe(1)
- expect(spies.componentUpdated1.calls.count()).toBe(1)
-
- // v-test without modifier should be unbound
- expect(spies.unbind1.calls.count()).toBe(1)
-
- // v-test2 should be bound
- expect(spies.bind2.calls.count()).toBe(1)
- expect(spies.inserted2.calls.count()).toBe(1)
-
- vm.ok = true
- }).then(() => {
- // v-test without modifier should be bound again
- expect(spies.bind1.calls.count()).toBe(3)
- expect(spies.inserted1.calls.count()).toBe(3)
-
- // v-test2 should be unbound
- expect(spies.unbind2.calls.count()).toBe(1)
-
- // v-test with modifier should be updated again
- expect(spies.update1.calls.count()).toBe(2)
- expect(spies.componentUpdated1.calls.count()).toBe(2)
-
- vm.val = 234
- }).then(() => {
- expect(spies.update1.calls.count()).toBe(4)
- expect(spies.componentUpdated1.calls.count()).toBe(4)
- }).then(done)
- })
-
- it('warn non-existent', () => {
- new Vue({
- template: '<div v-test></div>'
- }).$mount()
- expect('Failed to resolve directive: test').toHaveBeenWarned()
- })
-
- // #6513
- it('should invoke unbind & inserted on inner component root element change', done => {
- const dir = {
- bind: jasmine.createSpy('bind'),
- inserted: jasmine.createSpy('inserted'),
- unbind: jasmine.createSpy('unbind')
- }
-
- const Child = {
- template: `<div v-if="ok"/><span v-else/>`,
- data: () => ({ ok: true })
- }
-
- const vm = new Vue({
- template: `<child ref="child" v-test />`,
- directives: { test: dir },
- components: { Child }
- }).$mount()
-
- const oldEl = vm.$el
- expect(dir.bind.calls.count()).toBe(1)
- expect(dir.bind.calls.argsFor(0)[0]).toBe(oldEl)
- expect(dir.inserted.calls.count()).toBe(1)
- expect(dir.inserted.calls.argsFor(0)[0]).toBe(oldEl)
- expect(dir.unbind).not.toHaveBeenCalled()
-
- vm.$refs.child.ok = false
- waitForUpdate(() => {
- expect(vm.$el.tagName).toBe('SPAN')
- expect(dir.bind.calls.count()).toBe(2)
- expect(dir.bind.calls.argsFor(1)[0]).toBe(vm.$el)
- expect(dir.inserted.calls.count()).toBe(2)
- expect(dir.inserted.calls.argsFor(1)[0]).toBe(vm.$el)
- expect(dir.unbind.calls.count()).toBe(1)
- expect(dir.unbind.calls.argsFor(0)[0]).toBe(oldEl)
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options el', () => {
- it('basic usage', () => {
- const el = document.createElement('div')
- el.innerHTML = '<span>{{message}}</span>'
- const vm = new Vue({
- el,
- data: { message: 'hello world' }
- })
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('should be replaced when use together with `template` option', () => {
- const el = document.createElement('div')
- el.innerHTML = '<span>{{message}}</span>'
- const vm = new Vue({
- el,
- template: '<p id="app"><span>{{message}}</span></p>',
- data: { message: 'hello world' }
- })
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('should be replaced when use together with `render` option', () => {
- const el = document.createElement('div')
- el.innerHTML = '<span>{{message}}</span>'
- const vm = new Vue({
- el,
- render (h) {
- return h('p', { staticAttrs: { id: 'app' }}, [
- h('span', {}, [this.message])
- ])
- },
- data: { message: 'hello world' }
- })
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('svg element', () => {
- const parent = document.createElement('div')
- parent.innerHTML =
- '<svg>' +
- '<text :x="x" :y="y" :fill="color">{{ text }}</text>' +
- '<g><clipPath><foo></foo></clipPath></g>' +
- '</svg>'
- const vm = new Vue({
- el: parent.childNodes[0],
- data: {
- x: 64,
- y: 128,
- color: 'red',
- text: 'svg text'
- }
- })
- expect(vm.$el.tagName).toBe('svg')
- expect(vm.$el.childNodes[0].getAttribute('x')).toBe(vm.x.toString())
- expect(vm.$el.childNodes[0].getAttribute('y')).toBe(vm.y.toString())
- expect(vm.$el.childNodes[0].getAttribute('fill')).toBe(vm.color)
- expect(vm.$el.childNodes[0].textContent).toBe(vm.text)
- // nested, non-explicitly listed SVG elements
- expect(vm.$el.childNodes[1].childNodes[0].namespaceURI).toContain('svg')
- expect(vm.$el.childNodes[1].childNodes[0].childNodes[0].namespaceURI).toContain('svg')
- })
-
- // https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value
- it('properly decode attribute values when parsing templates from DOM', () => {
- const el = document.createElement('div')
- el.innerHTML = '<a href="/a?foo=bar&baz=qux" name="<abc>" single=\'"hi"\'></a>'
- const vm = new Vue({ el })
- expect(vm.$el.children[0].getAttribute('href')).toBe('/a?foo=bar&baz=qux')
- expect(vm.$el.children[0].getAttribute('name')).toBe('<abc>')
- expect(vm.$el.children[0].getAttribute('single')).toBe('"hi"')
- })
-
- it('decode attribute value newlines when parsing templates from DOM in IE', () => {
- const el = document.createElement('div')
- el.innerHTML = `<a :style="{\ncolor:'red'\n}"></a>`
- const vm = new Vue({ el })
- expect(vm.$el.children[0].style.color).toBe('red')
- })
-
- it('warn cannot find element', () => {
- new Vue({ el: '#non-existent' })
- expect('Cannot find element: #non-existent').toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options errorCaptured', () => {
- let globalSpy
-
- beforeEach(() => {
- globalSpy = Vue.config.errorHandler = jasmine.createSpy()
- })
-
- afterEach(() => {
- Vue.config.errorHandler = null
- })
-
- it('should capture error from child component', () => {
- const spy = jasmine.createSpy()
-
- let child
- let err
- const Child = {
- created () {
- child = this
- err = new Error('child')
- throw err
- },
- render () {}
- }
-
- new Vue({
- errorCaptured: spy,
- render: h => h(Child)
- }).$mount()
-
- expect(spy).toHaveBeenCalledWith(err, child, 'created hook')
- // should propagate by default
- expect(globalSpy).toHaveBeenCalledWith(err, child, 'created hook')
- })
-
- it('should be able to render the error in itself', done => {
- let child
- const Child = {
- created () {
- child = this
- throw new Error('error from child')
- },
- render () {}
- }
-
- const vm = new Vue({
- data: {
- error: null
- },
- errorCaptured (e, vm, info) {
- expect(vm).toBe(child)
- this.error = e.toString() + ' in ' + info
- },
- render (h) {
- if (this.error) {
- return h('pre', this.error)
- }
- return h(Child)
- }
- }).$mount()
-
- waitForUpdate(() => {
- expect(vm.$el.textContent).toContain('error from child')
- expect(vm.$el.textContent).toContain('in created hook')
- }).then(done)
- })
-
- it('should not propagate to global handler when returning true', () => {
- const spy = jasmine.createSpy()
-
- let child
- let err
- const Child = {
- created () {
- child = this
- err = new Error('child')
- throw err
- },
- render () {}
- }
-
- new Vue({
- errorCaptured (err, vm, info) {
- spy(err, vm, info)
- return false
- },
- render: h => h(Child, {})
- }).$mount()
-
- expect(spy).toHaveBeenCalledWith(err, child, 'created hook')
- // should not propagate
- expect(globalSpy).not.toHaveBeenCalled()
- })
-
- it('should propagate to global handler if itself throws error', () => {
- let child
- let err
- const Child = {
- created () {
- child = this
- err = new Error('child')
- throw err
- },
- render () {}
- }
-
- let err2
- const vm = new Vue({
- errorCaptured () {
- err2 = new Error('foo')
- throw err2
- },
- render: h => h(Child, {})
- }).$mount()
-
- expect(globalSpy).toHaveBeenCalledWith(err, child, 'created hook')
- expect(globalSpy).toHaveBeenCalledWith(err2, vm, 'errorCaptured hook')
- })
-
- it('should work across multiple parents, mixins and extends', () => {
- const calls = []
-
- const Child = {
- created () {
- throw new Error('child')
- },
- render () {}
- }
-
- const ErrorBoundaryBase = {
- errorCaptured () {
- calls.push(1)
- }
- }
-
- const mixin = {
- errorCaptured () {
- calls.push(2)
- }
- }
-
- const ErrorBoundaryExtended = {
- extends: ErrorBoundaryBase,
- mixins: [mixin],
- errorCaptured () {
- calls.push(3)
- },
- render: h => h(Child)
- }
-
- Vue.config.errorHandler = () => {
- calls.push(5)
- }
-
- new Vue({
- errorCaptured () {
- calls.push(4)
- },
- render: h => h(ErrorBoundaryExtended)
- }).$mount()
-
- expect(calls).toEqual([1, 2, 3, 4, 5])
- })
-
- it('should work across multiple parents, mixins and extends with return false', () => {
- const calls = []
-
- const Child = {
- created () {
- throw new Error('child')
- },
- render () {}
- }
-
- const ErrorBoundaryBase = {
- errorCaptured () {
- calls.push(1)
- }
- }
-
- const mixin = {
- errorCaptured () {
- calls.push(2)
- }
- }
-
- const ErrorBoundaryExtended = {
- extends: ErrorBoundaryBase,
- mixins: [mixin],
- errorCaptured () {
- calls.push(3)
- return false
- },
- render: h => h(Child)
- }
-
- Vue.config.errorHandler = () => {
- calls.push(5)
- }
-
- new Vue({
- errorCaptured () {
- calls.push(4)
- },
- render: h => h(ErrorBoundaryExtended)
- }).$mount()
-
- expect(calls).toEqual([1, 2, 3])
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { nativeWatch } from 'core/util/env'
-
-describe('Options extends', () => {
- it('should work on objects', () => {
- const A = {
- data () {
- return { a: 1 }
- }
- }
- const B = {
- extends: A,
- data () {
- return { b: 2 }
- }
- }
- const vm = new Vue({
- extends: B,
- data: {
- c: 3
- }
- })
- expect(vm.a).toBe(1)
- expect(vm.b).toBe(2)
- expect(vm.c).toBe(3)
- })
-
- it('should work on extended constructors', () => {
- const A = Vue.extend({
- data () {
- return { a: 1 }
- }
- })
- const B = Vue.extend({
- extends: A,
- data () {
- return { b: 2 }
- }
- })
- const vm = new Vue({
- extends: B,
- data: {
- c: 3
- }
- })
- expect(vm.a).toBe(1)
- expect(vm.b).toBe(2)
- expect(vm.c).toBe(3)
- })
-
- if (nativeWatch) {
- it('should work with global mixins + Object.prototype.watch', done => {
- Vue.mixin({})
-
- const spy = jasmine.createSpy('watch')
- const A = Vue.extend({
- data: function () {
- return { a: 1 }
- },
- watch: {
- a: spy
- },
- created: function () {
- this.a = 2
- }
- })
- new Vue({
- extends: A
- })
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-import { createEmptyVNode } from 'core/vdom/vnode'
-
-describe('Options functional', () => {
- it('should work', done => {
- const vm = new Vue({
- data: { test: 'foo' },
- template: '<div><wrap :msg="test">bar</wrap></div>',
- components: {
- wrap: {
- functional: true,
- props: ['msg'],
- render (h, { props, children }) {
- return h('div', null, [props.msg, ' '].concat(children))
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div>foo bar</div>')
- vm.test = 'qux'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div>qux bar</div>')
- }).then(done)
- })
-
- it('should expose all props when not declared', done => {
- const fn = {
- functional: true,
- render (h, { props }) {
- return h('div', `${props.msg} ${props.kebabMsg}`)
- }
- }
-
- const vm = new Vue({
- data: { test: 'foo' },
- render (h) {
- return h('div', [
- h(fn, {
- props: { msg: this.test },
- attrs: { 'kebab-msg': 'bar' }
- })
- ])
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<div>foo bar</div>')
- vm.test = 'qux'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div>qux bar</div>')
- }).then(done)
- })
-
- it('should expose data.on as listeners', () => {
- const foo = jasmine.createSpy('foo')
- const bar = jasmine.createSpy('bar')
- const vm = new Vue({
- template: '<div><wrap @click="foo" @test="bar"/></div>',
- methods: { foo, bar },
- components: {
- wrap: {
- functional: true,
- render (h, { listeners }) {
- return h('div', {
- on: {
- click: [listeners.click, () => listeners.test('bar')]
- }
- })
- }
- }
- }
- }).$mount()
-
- triggerEvent(vm.$el.children[0], 'click')
- expect(foo).toHaveBeenCalled()
- expect(foo.calls.argsFor(0)[0].type).toBe('click') // should have click event
- triggerEvent(vm.$el.children[0], 'mousedown')
- expect(bar).toHaveBeenCalledWith('bar')
- })
-
- it('should support returning more than one root node', () => {
- const vm = new Vue({
- template: `<div><test></test></div>`,
- components: {
- test: {
- functional: true,
- render (h) {
- return [h('span', 'foo'), h('span', 'bar')]
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>foo</span><span>bar</span>')
- })
-
- it('should support slots', () => {
- const vm = new Vue({
- data: { test: 'foo' },
- template: '<div><wrap><div slot="a">foo</div><div slot="b">bar</div></wrap></div>',
- components: {
- wrap: {
- functional: true,
- props: ['msg'],
- render (h, { slots }) {
- slots = slots()
- return h('div', null, [slots.b, slots.a])
- }
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<div><div>bar</div><div>foo</div></div>')
- })
-
- it('should let vnode raw data pass through', done => {
- const onValid = jasmine.createSpy('valid')
- const vm = new Vue({
- data: { msg: 'hello' },
- template: `<div>
- <validate field="field1" @valid="onValid">
- <input type="text" v-model="msg">
- </validate>
- </div>`,
- components: {
- validate: {
- functional: true,
- props: ['field'],
- render (h, { props, children, data: { on }}) {
- props.child = children[0]
- return h('validate-control', { props, on })
- }
- },
- 'validate-control': {
- props: ['field', 'child'],
- render () {
- return this.child
- },
- mounted () {
- this.$el.addEventListener('input', this.onInput)
- },
- destroyed () {
- this.$el.removeEventListener('input', this.onInput)
- },
- methods: {
- onInput (e) {
- const value = e.target.value
- if (this.validate(value)) {
- this.$emit('valid', this)
- }
- },
- // something validation logic here
- validate (val) {
- return val.length > 0
- }
- }
- }
- },
- methods: { onValid }
- }).$mount()
- document.body.appendChild(vm.$el)
- const input = vm.$el.querySelector('input')
- expect(onValid).not.toHaveBeenCalled()
- waitForUpdate(() => {
- input.value = 'foo'
- triggerEvent(input, 'input')
- }).then(() => {
- expect(onValid).toHaveBeenCalled()
- }).then(() => {
- document.body.removeChild(vm.$el)
- vm.$destroy()
- }).then(done)
- })
-
- it('create empty vnode when render return null', () => {
- const child = {
- functional: true,
- render () {
- return null
- }
- }
- const vm = new Vue({
- components: {
- child
- }
- })
- const h = vm.$createElement
- const vnode = h('child')
- expect(vnode).toEqual(createEmptyVNode())
- })
-
- // #7282
- it('should normalize top-level arrays', () => {
- const Foo = {
- functional: true,
- render (h) {
- return [h('span', 'hi'), null]
- }
- }
- const vm = new Vue({
- template: `<div><foo/></div>`,
- components: { Foo }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<span>hi</span>')
- })
-
- it('should work when used as named slot and returning array', () => {
- const Foo = {
- template: `<div><slot name="test"/></div>`
- }
-
- const Bar = {
- functional: true,
- render: h => ([
- h('div', 'one'),
- h('div', 'two'),
- h(Baz)
- ])
- }
-
- const Baz = {
- functional: true,
- render: h => h('div', 'three')
- }
-
- const vm = new Vue({
- template: `<foo><bar slot="test"/></foo>`,
- components: { Foo, Bar }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<div>one</div><div>two</div><div>three</div>')
- })
-
- it('should apply namespace when returning arrays', () => {
- const Child = {
- functional: true,
- render: h => ([h('foo'), h('bar')])
- }
- const vm = new Vue({
- template: `<svg><child/></svg>`,
- components: { Child }
- }).$mount()
-
- expect(vm.$el.childNodes[0].namespaceURI).toContain('svg')
- expect(vm.$el.childNodes[1].namespaceURI).toContain('svg')
- })
-
- it('should work with render fns compiled from template', done => {
- // code generated via vue-template-es2015-compiler
- var render = function (_h, _vm) {
- var _c = _vm._c
- return _c(
- 'div',
- [
- _c('h2', { staticClass: 'red' }, [_vm._v(_vm._s(_vm.props.msg))]),
- _vm._t('default'),
- _vm._t('slot2'),
- _vm._t('scoped', null, { msg: _vm.props.msg }),
- _vm._m(0),
- _c('div', { staticClass: 'clickable', on: { click: _vm.parent.fn }}, [
- _vm._v('click me')
- ])
- ],
- 2
- )
- }
- var staticRenderFns = [
- function (_h, _vm) {
- var _c = _vm._c
- return _c('div', [_vm._v('Some '), _c('span', [_vm._v('text')])])
- }
- ]
-
- const child = {
- functional: true,
- _compiled: true,
- render,
- staticRenderFns
- }
-
- const parent = new Vue({
- components: {
- child
- },
- data: {
- msg: 'hello'
- },
- template: `
- <div>
- <child :msg="msg">
- <span>{{ msg }}</span>
- <div slot="slot2">Second slot</div>
- <template slot="scoped" slot-scope="scope">{{ scope.msg }}</template>
- </child>
- </div>
- `,
- methods: {
- fn () {
- this.msg = 'bye'
- }
- }
- }).$mount()
-
- function assertMarkup () {
- expect(parent.$el.innerHTML).toBe(
- `<div>` +
- `<h2 class="red">${parent.msg}</h2>` +
- `<span>${parent.msg}</span> ` +
- `<div>Second slot</div>` +
- parent.msg +
- // static
- `<div>Some <span>text</span></div>` +
- `<div class="clickable">click me</div>` +
- `</div>`
- )
- }
-
- assertMarkup()
- triggerEvent(parent.$el.querySelector('.clickable'), 'click')
- waitForUpdate(assertMarkup).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options inheritAttrs', () => {
- it('should work', done => {
- const vm = new Vue({
- template: `<foo :id="foo"/>`,
- data: { foo: 'foo' },
- components: {
- foo: {
- inheritAttrs: false,
- template: `<div>foo</div>`
- }
- }
- }).$mount()
- expect(vm.$el.id).toBe('')
- vm.foo = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.id).toBe('')
- }).then(done)
- })
-
- it('with inner v-bind', done => {
- const vm = new Vue({
- template: `<foo :id="foo"/>`,
- data: { foo: 'foo' },
- components: {
- foo: {
- inheritAttrs: false,
- template: `<div><div v-bind="$attrs"></div></div>`
- }
- }
- }).$mount()
- expect(vm.$el.children[0].id).toBe('foo')
- vm.foo = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.children[0].id).toBe('bar')
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { Observer } from 'core/observer/index'
-import { isNative, isObject, hasOwn } from 'core/util/index'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options provide/inject', () => {
- testObjectOption('inject')
-
- let injected
- const injectedComp = {
- inject: ['foo', 'bar'],
- render () {},
- created () {
- injected = [this.foo, this.bar]
- }
- }
-
- beforeEach(() => {
- injected = null
- })
-
- it('should work', () => {
- new Vue({
- template: `<child/>`,
- provide: {
- foo: 1,
- bar: false
- },
- components: {
- child: {
- template: `<injected-comp/>`,
- components: {
- injectedComp
- }
- }
- }
- }).$mount()
-
- expect(injected).toEqual([1, false])
- })
-
- it('should use closest parent', () => {
- new Vue({
- template: `<child/>`,
- provide: {
- foo: 1,
- bar: null
- },
- components: {
- child: {
- provide: {
- foo: 3
- },
- template: `<injected-comp/>`,
- components: {
- injectedComp
- }
- }
- }
- }).$mount()
-
- expect(injected).toEqual([3, null])
- })
-
- it('provide function', () => {
- new Vue({
- template: `<child/>`,
- data: {
- a: 1,
- b: false
- },
- provide () {
- return {
- foo: this.a,
- bar: this.b
- }
- },
- components: {
- child: {
- template: `<injected-comp/>`,
- components: {
- injectedComp
- }
- }
- }
- }).$mount()
-
- expect(injected).toEqual([1, false])
- })
-
- it('inject with alias', () => {
- const injectAlias = {
- inject: {
- baz: 'foo',
- qux: 'bar'
- },
- render () {},
- created () {
- injected = [this.baz, this.qux]
- }
- }
-
- new Vue({
- template: `<child/>`,
- provide: {
- foo: false,
- bar: 2
- },
- components: {
- child: {
- template: `<inject-alias/>`,
- components: {
- injectAlias
- }
- }
- }
- }).$mount()
-
- expect(injected).toEqual([false, 2])
- })
-
- it('inject before resolving data/props', () => {
- const vm = new Vue({
- provide: {
- foo: 1
- }
- })
-
- const child = new Vue({
- parent: vm,
- inject: ['foo'],
- data () {
- return {
- bar: this.foo + 1
- }
- },
- props: {
- baz: {
- default () {
- return this.foo + 2
- }
- }
- }
- })
-
- expect(child.foo).toBe(1)
- expect(child.bar).toBe(2)
- expect(child.baz).toBe(3)
- })
-
- // GitHub issue #5194
- it('should work with functional', () => {
- new Vue({
- template: `<child/>`,
- provide: {
- foo: 1,
- bar: false
- },
- components: {
- child: {
- functional: true,
- inject: ['foo', 'bar'],
- render (h, context) {
- const { injections } = context
- injected = [injections.foo, injections.bar]
- }
- }
- }
- }).$mount()
-
- expect(injected).toEqual([1, false])
- })
-
- if (typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys)) {
- it('with Symbol keys', () => {
- const s = Symbol()
- const vm = new Vue({
- template: `<child/>`,
- provide: {
- [s]: 123
- },
- components: {
- child: {
- inject: { s },
- template: `<div>{{ s }}</div>`
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('123')
- })
- }
-
- // GitHub issue #5223
- it('should work with reactive array', done => {
- const vm = new Vue({
- template: `<div><child></child></div>`,
- data () {
- return {
- foo: []
- }
- },
- provide () {
- return {
- foo: this.foo
- }
- },
- components: {
- child: {
- inject: ['foo'],
- template: `<span>{{foo.length}}</span>`
- }
- }
- }).$mount()
-
- expect(vm.$el.innerHTML).toEqual(`<span>0</span>`)
- vm.foo.push(vm.foo.length)
- vm.$nextTick(() => {
- expect(vm.$el.innerHTML).toEqual(`<span>1</span>`)
- vm.foo.pop()
- vm.$nextTick(() => {
- expect(vm.$el.innerHTML).toEqual(`<span>0</span>`)
- done()
- })
- })
- })
-
- it('should extend properly', () => {
- const parent = Vue.extend({
- template: `<span/>`,
- inject: ['foo']
- })
-
- const child = parent.extend({
- template: `<span/>`,
- inject: ['bar'],
- created () {
- injected = [this.foo, this.bar]
- }
- })
-
- new Vue({
- template: `<div><parent/><child/></div>`,
- provide: {
- foo: 1,
- bar: false
- },
- components: {
- parent,
- child
- }
- }).$mount()
-
- expect(injected).toEqual([1, false])
- })
-
- it('should merge from mixins properly (objects)', () => {
- const mixinA = { inject: { foo: 'foo' }}
- const mixinB = { inject: { bar: 'bar' }}
- const child = {
- mixins: [mixinA, mixinB],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar]
- }
- }
- new Vue({
- provide: { foo: 'foo', bar: 'bar', baz: 'baz' },
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar'])
- })
-
- it('should merge from mixins properly (arrays)', () => {
- const mixinA = { inject: ['foo'] }
- const mixinB = { inject: ['bar'] }
- const child = {
- mixins: [mixinA, mixinB],
- inject: ['baz'],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar, this.baz]
- }
- }
- new Vue({
- provide: { foo: 'foo', bar: 'bar', baz: 'baz' },
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar', 'baz'])
- })
-
- it('should merge from mixins properly (mix of objects and arrays)', () => {
- const mixinA = { inject: { foo: 'foo' }}
- const mixinB = { inject: ['bar'] }
- const child = {
- mixins: [mixinA, mixinB],
- inject: { qux: 'baz' },
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar, this.qux]
- }
- }
- new Vue({
- provide: { foo: 'foo', bar: 'bar', baz: 'baz' },
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar', 'baz'])
- })
-
- it('should warn when injections has been modified', () => {
- const key = 'foo'
- const vm = new Vue({
- provide: {
- foo: 1
- }
- })
-
- const child = new Vue({
- parent: vm,
- inject: ['foo']
- })
-
- expect(child.foo).toBe(1)
- child.foo = 2
- expect(
- `Avoid mutating an injected value directly since the changes will be ` +
- `overwritten whenever the provided component re-renders. ` +
- `injection being mutated: "${key}"`).toHaveBeenWarned()
- })
-
- it('should warn when injections cannot be found', () => {
- const vm = new Vue({})
- new Vue({
- parent: vm,
- inject: ['foo', 'bar'],
- created () {}
- })
- expect(`Injection "foo" not found`).toHaveBeenWarned()
- expect(`Injection "bar" not found`).toHaveBeenWarned()
- })
-
- it('should not warn when injections can be found', () => {
- const vm = new Vue({
- provide: {
- foo: 1,
- bar: false,
- baz: undefined
- }
- })
- new Vue({
- parent: vm,
- inject: ['foo', 'bar', 'baz'],
- created () {}
- })
- expect(`Injection "foo" not found`).not.toHaveBeenWarned()
- expect(`Injection "bar" not found`).not.toHaveBeenWarned()
- expect(`Injection "baz" not found`).not.toHaveBeenWarned()
- })
-
- it('should not warn when injection key which is not provided is not enumerable', () => {
- const parent = new Vue({ provide: { foo: 1 }})
- const inject = { foo: 'foo' }
- Object.defineProperty(inject, '__ob__', { enumerable: false, value: '__ob__' })
- new Vue({ parent, inject })
- expect(`Injection "__ob__" not found`).not.toHaveBeenWarned()
- })
-
- // Github issue #6097
- it('should not warn when injections cannot be found but have default value', () => {
- const vm = new Vue({})
- new Vue({
- parent: vm,
- inject: {
- foo: { default: 1 },
- bar: { default: false },
- baz: { default: undefined }
- },
- created () {
- injected = [this.foo, this.bar, this.baz]
- }
- })
- expect(injected).toEqual([1, false, undefined])
- })
-
- it('should support name alias and default together', () => {
- const vm = new Vue({
- provide: {
- FOO: 2
- }
- })
- new Vue({
- parent: vm,
- inject: {
- foo: { from: 'FOO', default: 1 },
- bar: { default: false },
- baz: { default: undefined }
- },
- created () {
- injected = [this.foo, this.bar, this.baz]
- }
- })
- expect(injected).toEqual([2, false, undefined])
- })
-
- it('should use provided value even if inject has default', () => {
- const vm = new Vue({
- provide: {
- foo: 1,
- bar: false,
- baz: undefined
- }
- })
- new Vue({
- parent: vm,
- inject: {
- foo: { default: 2 },
- bar: { default: 2 },
- baz: { default: 2 }
- },
- created () {
- injected = [this.foo, this.bar, this.baz]
- }
- })
- expect(injected).toEqual([1, false, undefined])
- })
-
- // Github issue #6008
- it('should merge provide from mixins (objects)', () => {
- const mixinA = { provide: { foo: 'foo' }}
- const mixinB = { provide: { bar: 'bar' }}
- const child = {
- inject: ['foo', 'bar'],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar]
- }
- }
- new Vue({
- mixins: [mixinA, mixinB],
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar'])
- })
-
- it('should merge provide from mixins (functions)', () => {
- const mixinA = { provide: () => ({ foo: 'foo' }) }
- const mixinB = { provide: () => ({ bar: 'bar' }) }
- const child = {
- inject: ['foo', 'bar'],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar]
- }
- }
- new Vue({
- mixins: [mixinA, mixinB],
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar'])
- })
-
- it('should merge provide from mixins (mix of objects and functions)', () => {
- const mixinA = { provide: { foo: 'foo' }}
- const mixinB = { provide: () => ({ bar: 'bar' }) }
- const mixinC = { provide: { baz: 'baz' }}
- const mixinD = { provide: () => ({ bam: 'bam' }) }
- const child = {
- inject: ['foo', 'bar', 'baz', 'bam'],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar, this.baz, this.bam]
- }
- }
- new Vue({
- mixins: [mixinA, mixinB, mixinC, mixinD],
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['foo', 'bar', 'baz', 'bam'])
- })
-
- it('should merge provide from mixins and override existing keys', () => {
- const mixinA = { provide: { foo: 'foo' }}
- const mixinB = { provide: { foo: 'bar' }}
- const child = {
- inject: ['foo'],
- template: `<span/>`,
- created () {
- injected = [this.foo]
- }
- }
- new Vue({
- mixins: [mixinA, mixinB],
- render (h) {
- return h(child)
- }
- }).$mount()
-
- expect(injected).toEqual(['bar'])
- })
-
- it('should merge provide when Vue.extend', () => {
- const mixinA = { provide: () => ({ foo: 'foo' }) }
- const child = {
- inject: ['foo', 'bar'],
- template: `<span/>`,
- created () {
- injected = [this.foo, this.bar]
- }
- }
- const Ctor = Vue.extend({
- mixins: [mixinA],
- provide: { bar: 'bar' },
- render (h) {
- return h(child)
- }
- })
-
- new Ctor().$mount()
-
- expect(injected).toEqual(['foo', 'bar'])
- })
-
- // #5913
- it('should keep the reactive with provide', () => {
- function isObserver (obj) {
- if (isObject(obj)) {
- return hasOwn(obj, '__ob__') && obj.__ob__ instanceof Observer
- }
- return false
- }
-
- const vm = new Vue({
- template: `<div><child ref='child'></child></div>`,
- data () {
- return {
- foo: {},
- $foo: {},
- foo1: []
- }
- },
- provide () {
- return {
- foo: this.foo,
- $foo: this.$foo,
- foo1: this.foo1,
- bar: {},
- baz: []
- }
- },
- components: {
- child: {
- inject: ['foo', '$foo', 'foo1', 'bar', 'baz'],
- template: `<span/>`
- }
- }
- }).$mount()
- const child = vm.$refs.child
- expect(isObserver(child.foo)).toBe(true)
- expect(isObserver(child.$foo)).toBe(false)
- expect(isObserver(child.foo1)).toBe(true)
- expect(isObserver(child.bar)).toBe(false)
- expect(isObserver(child.baz)).toBe(false)
- })
-
- // #6175
- it('merge provide properly from mixins', () => {
- const ProvideFooMixin = {
- provide: {
- foo: 'foo injected'
- }
- }
-
- const ProvideBarMixin = {
- provide: {
- bar: 'bar injected'
- }
- }
-
- const Child = {
- inject: ['foo', 'bar'],
- render (h) {
- return h('div', [`foo: ${this.foo}, `, `bar: ${this.bar}`])
- }
- }
-
- const Parent = {
- mixins: [ProvideFooMixin, ProvideBarMixin],
- render (h) {
- return h(Child)
- }
- }
-
- const vm = new Vue({
- render (h) {
- return h(Parent)
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe(`foo: foo injected, bar: bar injected`)
- })
-
- it('merge provide with object syntax when using Vue.extend', () => {
- const child = {
- inject: ['foo'],
- template: `<span/>`,
- created () {
- injected = this.foo
- }
- }
- const Ctor = Vue.extend({
- provide: { foo: 'foo' },
- render (h) {
- return h(child)
- }
- })
-
- new Ctor().$mount()
-
- expect(injected).toEqual('foo')
- })
-
- // #7284
- it('should not inject prototype properties', () => {
- const vm = new Vue({
- provide: {}
- })
- new Vue({
- parent: vm,
- inject: ['constructor']
- })
- expect(`Injection "constructor" not found`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options lifecycle hooks', () => {
- let spy
- beforeEach(() => {
- spy = jasmine.createSpy('hook')
- })
-
- describe('beforeCreate', () => {
- it('should allow modifying options', () => {
- const vm = new Vue({
- data: {
- a: 1
- },
- beforeCreate () {
- spy()
- expect(this.a).toBeUndefined()
- this.$options.computed = {
- b () {
- return this.a + 1
- }
- }
- }
- })
- expect(spy).toHaveBeenCalled()
- expect(vm.b).toBe(2)
- })
- })
-
- describe('created', () => {
- it('should have completed observation', () => {
- new Vue({
- data: {
- a: 1
- },
- created () {
- expect(this.a).toBe(1)
- spy()
- }
- })
- expect(spy).toHaveBeenCalled()
- })
- })
-
- describe('beforeMount', () => {
- it('should not have mounted', () => {
- const vm = new Vue({
- render () {},
- beforeMount () {
- spy()
- expect(this._isMounted).toBe(false)
- expect(this.$el).toBeUndefined() // due to empty mount
- expect(this._vnode).toBeNull()
- expect(this._watcher).toBeNull()
- }
- })
- expect(spy).not.toHaveBeenCalled()
- vm.$mount()
- expect(spy).toHaveBeenCalled()
- })
- })
-
- describe('mounted', () => {
- it('should have mounted', () => {
- const vm = new Vue({
- template: '<div></div>',
- mounted () {
- spy()
- expect(this._isMounted).toBe(true)
- expect(this.$el.tagName).toBe('DIV')
- expect(this._vnode.tag).toBe('div')
- }
- })
- expect(spy).not.toHaveBeenCalled()
- vm.$mount()
- expect(spy).toHaveBeenCalled()
- })
-
- // #3898
- it('should call for manually mounted instance with parent', () => {
- const parent = new Vue()
- expect(spy).not.toHaveBeenCalled()
- new Vue({
- parent,
- template: '<div></div>',
- mounted () {
- spy()
- }
- }).$mount()
- expect(spy).toHaveBeenCalled()
- })
-
- it('should mount child parent in correct order', () => {
- const calls = []
- new Vue({
- template: '<div><test></test></div>',
- mounted () {
- calls.push('parent')
- },
- components: {
- test: {
- template: '<nested></nested>',
- mounted () {
- expect(this.$el.parentNode).toBeTruthy()
- calls.push('child')
- },
- components: {
- nested: {
- template: '<div></div>',
- mounted () {
- expect(this.$el.parentNode).toBeTruthy()
- calls.push('nested')
- }
- }
- }
- }
- }
- }).$mount()
- expect(calls).toEqual(['nested', 'child', 'parent'])
- })
- })
-
- describe('beforeUpdate', () => {
- it('should be called before update', done => {
- const vm = new Vue({
- template: '<div>{{ msg }}</div>',
- data: { msg: 'foo' },
- beforeUpdate () {
- spy()
- expect(this.$el.textContent).toBe('foo')
- }
- }).$mount()
- expect(spy).not.toHaveBeenCalled()
- vm.msg = 'bar'
- expect(spy).not.toHaveBeenCalled() // should be async
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- }).then(done)
- })
- })
-
- describe('updated', () => {
- it('should be called after update', done => {
- const vm = new Vue({
- template: '<div>{{ msg }}</div>',
- data: { msg: 'foo' },
- updated () {
- spy()
- expect(this.$el.textContent).toBe('bar')
- }
- }).$mount()
- expect(spy).not.toHaveBeenCalled()
- vm.msg = 'bar'
- expect(spy).not.toHaveBeenCalled() // should be async
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalled()
- }).then(done)
- })
-
- it('should be called after children are updated', done => {
- const calls = []
- const vm = new Vue({
- template: '<div><test ref="child">{{ msg }}</test></div>',
- data: { msg: 'foo' },
- components: {
- test: {
- template: `<div><slot></slot></div>`,
- updated () {
- expect(this.$el.textContent).toBe('bar')
- calls.push('child')
- }
- }
- },
- updated () {
- expect(this.$el.textContent).toBe('bar')
- calls.push('parent')
- }
- }).$mount()
-
- expect(calls).toEqual([])
- vm.msg = 'bar'
- expect(calls).toEqual([])
- waitForUpdate(() => {
- expect(calls).toEqual(['child', 'parent'])
- }).then(done)
- })
- })
-
- describe('beforeDestroy', () => {
- it('should be called before destroy', () => {
- const vm = new Vue({
- render () {},
- beforeDestroy () {
- spy()
- expect(this._isBeingDestroyed).toBe(false)
- expect(this._isDestroyed).toBe(false)
- }
- }).$mount()
- expect(spy).not.toHaveBeenCalled()
- vm.$destroy()
- vm.$destroy()
- expect(spy).toHaveBeenCalled()
- expect(spy.calls.count()).toBe(1)
- })
- })
-
- describe('destroyed', () => {
- it('should be called after destroy', () => {
- const vm = new Vue({
- render () {},
- destroyed () {
- spy()
- expect(this._isBeingDestroyed).toBe(true)
- expect(this._isDestroyed).toBe(true)
- }
- }).$mount()
- expect(spy).not.toHaveBeenCalled()
- vm.$destroy()
- vm.$destroy()
- expect(spy).toHaveBeenCalled()
- expect(spy.calls.count()).toBe(1)
- })
- })
-
- it('should emit hook events', () => {
- const created = jasmine.createSpy()
- const mounted = jasmine.createSpy()
- const destroyed = jasmine.createSpy()
- const vm = new Vue({
- render () {},
- beforeCreate () {
- this.$on('hook:created', created)
- this.$on('hook:mounted', mounted)
- this.$on('hook:destroyed', destroyed)
- }
- })
-
- expect(created).toHaveBeenCalled()
- expect(mounted).not.toHaveBeenCalled()
- expect(destroyed).not.toHaveBeenCalled()
-
- vm.$mount()
- expect(mounted).toHaveBeenCalled()
- expect(destroyed).not.toHaveBeenCalled()
-
- vm.$destroy()
- expect(destroyed).toHaveBeenCalled()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options methods', () => {
- testObjectOption('methods')
-
- it('should have correct context', () => {
- const vm = new Vue({
- data: {
- a: 1
- },
- methods: {
- plus () {
- this.a++
- }
- }
- })
- vm.plus()
- expect(vm.a).toBe(2)
- })
-
- it('should warn undefined methods', () => {
- new Vue({
- methods: {
- hello: undefined
- }
- })
- expect(`Method "hello" has an undefined value in the component definition`).toHaveBeenWarned()
- })
-
- it('should warn methods conflicting with data', () => {
- new Vue({
- data: {
- foo: 1
- },
- methods: {
- foo () {}
- }
- })
- expect(`Method "foo" has already been defined as a data property`).toHaveBeenWarned()
- })
-
- it('should warn methods conflicting with internal methods', () => {
- new Vue({
- methods: {
- _update () {}
- }
- })
- expect(`Method "_update" conflicts with an existing Vue instance method`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { mergeOptions } from 'core/util/index'
-
-describe('Options mixins', () => {
- it('vm should have options from mixin', () => {
- const mixin = {
- directives: {
- c: {}
- },
- methods: {
- a: function () {}
- }
- }
-
- const vm = new Vue({
- mixins: [mixin],
- methods: {
- b: function () {}
- }
- })
-
- expect(vm.a).toBeDefined()
- expect(vm.b).toBeDefined()
- expect(vm.$options.directives.c).toBeDefined()
- })
-
- it('should call hooks from mixins first', () => {
- const a = {}
- const b = {}
- const c = {}
- const f1 = function () {}
- const f2 = function () {}
- const f3 = function () {}
- const mixinA = {
- a: 1,
- template: 'foo',
- directives: {
- a: a
- },
- created: f1
- }
- const mixinB = {
- b: 1,
- directives: {
- b: b
- },
- created: f2
- }
- const result = mergeOptions({}, {
- directives: {
- c: c
- },
- template: 'bar',
- mixins: [mixinA, mixinB],
- created: f3
- })
- expect(result.a).toBe(1)
- expect(result.b).toBe(1)
- expect(result.directives.a).toBe(a)
- expect(result.directives.b).toBe(b)
- expect(result.directives.c).toBe(c)
- expect(result.created[0]).toBe(f1)
- expect(result.created[1]).toBe(f2)
- expect(result.created[2]).toBe(f3)
- expect(result.template).toBe('bar')
- })
-
- it('mixin methods should not override defined method', () => {
- const f1 = function () {}
- const f2 = function () {}
- const f3 = function () {}
- const mixinA = {
- methods: {
- xyz: f1
- }
- }
- const mixinB = {
- methods: {
- xyz: f2
- }
- }
- const result = mergeOptions({}, {
- mixins: [mixinA, mixinB],
- methods: {
- xyz: f3
- }
- })
- expect(result.methods.xyz).toBe(f3)
- })
-
- it('should accept constructors as mixins', () => {
- const mixin = Vue.extend({
- directives: {
- c: {}
- },
- methods: {
- a: function () {}
- }
- })
-
- const vm = new Vue({
- mixins: [mixin],
- methods: {
- b: function () {}
- }
- })
-
- expect(vm.a).toBeDefined()
- expect(vm.b).toBeDefined()
- expect(vm.$options.directives.c).toBeDefined()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options name', () => {
- it('should contain itself in self components', () => {
- const vm = Vue.extend({
- name: 'SuperVue'
- })
-
- expect(vm.options.components['SuperVue']).toEqual(vm)
- })
-
- it('should warn when incorrect name given', () => {
- Vue.extend({
- name: 'Hyper*Vue'
- })
-
- /* eslint-disable */
- expect(`Invalid component name: "Hyper*Vue". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.`)
- .toHaveBeenWarned()
- /* eslint-enable */
-
- Vue.extend({
- name: '2Cool2BValid'
- })
-
- /* eslint-disable */
- expect(`Invalid component name: "2Cool2BValid". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.`)
- .toHaveBeenWarned()
- /* eslint-enable */
- })
-
- it('id should not override given name when using Vue.component', () => {
- const SuperComponent = Vue.component('super-component', {
- name: 'SuperVue'
- })
-
- expect(SuperComponent.options.components['SuperVue']).toEqual(SuperComponent)
- expect(SuperComponent.options.components['super-component']).toEqual(SuperComponent)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options parent', () => {
- it('should work', () => {
- const parent = new Vue({
- render () {}
- }).$mount()
-
- const child = new Vue({
- parent: parent,
- render () {}
- }).$mount()
-
- // this option is straight-forward
- // it should register 'parent' as a $parent for 'child'
- // and push 'child' to $children array on 'parent'
- expect(child.$options.parent).toBeDefined()
- expect(child.$options.parent).toEqual(parent)
- expect(child.$parent).toBeDefined()
- expect(child.$parent).toEqual(parent)
- expect(parent.$children).toContain(child)
-
- // destroy 'child' and check if it was removed from 'parent' $children
- child.$destroy()
- expect(parent.$children.length).toEqual(0)
- parent.$destroy()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { hasSymbol } from 'core/util/env'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options props', () => {
- testObjectOption('props')
-
- it('array syntax', done => {
- const vm = new Vue({
- data: {
- b: 'bar'
- },
- template: '<test v-bind:b="b" ref="child"></test>',
- components: {
- test: {
- props: ['b'],
- template: '<div>{{b}}</div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('bar')
- vm.b = 'baz'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('baz')
- vm.$refs.child.b = 'qux'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('qux')
- expect('Avoid mutating a prop directly').toHaveBeenWarned()
- }).then(done)
- })
-
- it('object syntax', done => {
- const vm = new Vue({
- data: {
- b: 'bar'
- },
- template: '<test v-bind:b="b" ref="child"></test>',
- components: {
- test: {
- props: { b: String },
- template: '<div>{{b}}</div>'
- }
- }
- }).$mount()
- expect(vm.$el.innerHTML).toBe('bar')
- vm.b = 'baz'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('baz')
- vm.$refs.child.b = 'qux'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('qux')
- expect('Avoid mutating a prop directly').toHaveBeenWarned()
- }).then(done)
- })
-
- it('warn mixed syntax', () => {
- new Vue({
- props: [{ b: String }]
- })
- expect('props must be strings when using array syntax').toHaveBeenWarned()
- })
-
- it('default values', () => {
- const vm = new Vue({
- data: {
- b: undefined
- },
- template: '<test :b="b"></test>',
- components: {
- test: {
- props: {
- a: {
- default: 'A' // absent
- },
- b: {
- default: 'B' // undefined
- }
- },
- template: '<div>{{a}}{{b}}</div>'
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('AB')
- })
-
- it('default value reactivity', done => {
- const vm = new Vue({
- props: {
- a: {
- default: () => ({ b: 1 })
- }
- },
- propsData: {
- a: undefined
- },
- template: '<div>{{ a.b }}</div>'
- }).$mount()
- expect(vm.$el.textContent).toBe('1')
- vm.a.b = 2
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('2')
- }).then(done)
- })
-
- it('default value Function', () => {
- const func = () => 132
- const vm = new Vue({
- props: {
- a: {
- type: Function,
- default: func
- }
- },
- propsData: {
- a: undefined
- }
- })
- expect(vm.a).toBe(func)
- })
-
- it('warn object/array default values', () => {
- new Vue({
- props: {
- a: {
- default: { b: 1 }
- }
- },
- propsData: {
- a: undefined
- }
- })
- expect('Props with type Object/Array must use a factory function').toHaveBeenWarned()
- })
-
- it('warn missing required', () => {
- new Vue({
- template: '<test></test>',
- components: {
- test: {
- props: { a: { required: true }},
- template: '<div>{{a}}</div>'
- }
- }
- }).$mount()
- expect('Missing required prop: "a"').toHaveBeenWarned()
- })
-
- describe('assertions', () => {
- function makeInstance (value, type, validator, required) {
- return new Vue({
- template: '<test :test="val"></test>',
- data: {
- val: value
- },
- components: {
- test: {
- template: '<div></div>',
- props: {
- test: {
- type,
- validator,
- required
- }
- }
- }
- }
- }).$mount()
- }
-
- it('string', () => {
- makeInstance('hello', String)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(123, String)
- expect('Expected String').toHaveBeenWarned()
- })
-
- it('number', () => {
- makeInstance(123, Number)
- expect(console.error.calls.count()).toBe(0)
- makeInstance('123', Number)
- expect('Expected Number').toHaveBeenWarned()
- })
-
- it('boolean', () => {
- makeInstance(true, Boolean)
- expect(console.error.calls.count()).toBe(0)
- makeInstance('123', Boolean)
- expect('Expected Boolean').toHaveBeenWarned()
- })
-
- it('function', () => {
- makeInstance(() => {}, Function)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(123, Function)
- expect('Expected Function').toHaveBeenWarned()
- })
-
- it('object', () => {
- makeInstance({}, Object)
- expect(console.error.calls.count()).toBe(0)
- makeInstance([], Object)
- expect('Expected Object').toHaveBeenWarned()
- })
-
- it('array', () => {
- makeInstance([], Array)
- expect(console.error.calls.count()).toBe(0)
- makeInstance({}, Array)
- expect('Expected Array').toHaveBeenWarned()
- })
-
- it('primitive wrapper objects', () => {
- /* eslint-disable no-new-wrappers */
- makeInstance(new String('s'), String)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(new Number(1), Number)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(new Boolean(true), Boolean)
- expect(console.error.calls.count()).toBe(0)
- /* eslint-enable no-new-wrappers */
- })
-
- if (hasSymbol) {
- it('symbol', () => {
- makeInstance(Symbol('foo'), Symbol)
- expect(console.error.calls.count()).toBe(0)
- makeInstance({}, Symbol)
- expect('Expected Symbol').toHaveBeenWarned()
- })
- }
-
- it('custom constructor', () => {
- function Class () {}
- makeInstance(new Class(), Class)
- expect(console.error.calls.count()).toBe(0)
- makeInstance({}, Class)
- expect('type check failed').toHaveBeenWarned()
- })
-
- it('multiple types', () => {
- makeInstance([], [Array, Number, Boolean])
- expect(console.error.calls.count()).toBe(0)
- makeInstance({}, [Array, Number, Boolean])
- expect('Expected Array, Number, Boolean, got Object').toHaveBeenWarned()
- })
-
- it('custom validator', () => {
- makeInstance(123, null, v => v === 123)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(123, null, v => v === 234)
- expect('custom validator check failed').toHaveBeenWarned()
- })
-
- it('type check + custom validator', () => {
- makeInstance(123, Number, v => v === 123)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(123, Number, v => v === 234)
- expect('custom validator check failed').toHaveBeenWarned()
- makeInstance(123, String, v => v === 123)
- expect('Expected String').toHaveBeenWarned()
- })
-
- it('multiple types + custom validator', () => {
- makeInstance(123, [Number, String, Boolean], v => v === 123)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(123, [Number, String, Boolean], v => v === 234)
- expect('custom validator check failed').toHaveBeenWarned()
- makeInstance(123, [String, Boolean], v => v === 123)
- expect('Expected String, Boolean').toHaveBeenWarned()
- })
-
- it('optional with type + null/undefined', () => {
- makeInstance(undefined, String)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(null, String)
- expect(console.error.calls.count()).toBe(0)
- })
-
- it('required with type + null/undefined', () => {
- makeInstance(undefined, String, null, true)
- expect(console.error.calls.count()).toBe(1)
- expect('Expected String').toHaveBeenWarned()
- makeInstance(null, Boolean, null, true)
- expect(console.error.calls.count()).toBe(2)
- expect('Expected Boolean').toHaveBeenWarned()
- })
-
- it('optional prop of any type (type: true or prop: true)', () => {
- makeInstance(1, true)
- expect(console.error.calls.count()).toBe(0)
- makeInstance('any', true)
- expect(console.error.calls.count()).toBe(0)
- makeInstance({}, true)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(undefined, true)
- expect(console.error.calls.count()).toBe(0)
- makeInstance(null, true)
- expect(console.error.calls.count()).toBe(0)
- })
- })
-
- it('should work with v-bind', () => {
- const vm = new Vue({
- template: `<test v-bind="{ a: 1, b: 2 }"></test>`,
- components: {
- test: {
- props: ['a', 'b'],
- template: '<div>{{ a }} {{ b }}</div>'
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('1 2')
- })
-
- it('should warn data fields already defined as a prop', () => {
- new Vue({
- template: '<test a="1"></test>',
- components: {
- test: {
- template: '<div></div>',
- data: function () {
- return { a: 123 }
- },
- props: {
- a: null
- }
- }
- }
- }).$mount()
- expect('already declared as a prop').toHaveBeenWarned()
- })
-
- it('should warn methods already defined as a prop', () => {
- new Vue({
- template: '<test a="1"></test>',
- components: {
- test: {
- template: '<div></div>',
- props: {
- a: null
- },
- methods: {
- a () {
-
- }
- }
- }
- }
- }).$mount()
- expect(`Method "a" has already been defined as a prop`).toHaveBeenWarned()
- expect(`Avoid mutating a prop directly`).toHaveBeenWarned()
- })
-
- it('treat boolean props properly', () => {
- const vm = new Vue({
- template: '<comp ref="child" prop-a prop-b="prop-b"></comp>',
- components: {
- comp: {
- template: '<div></div>',
- props: {
- propA: Boolean,
- propB: Boolean,
- propC: Boolean
- }
- }
- }
- }).$mount()
- expect(vm.$refs.child.propA).toBe(true)
- expect(vm.$refs.child.propB).toBe(true)
- expect(vm.$refs.child.propC).toBe(false)
- })
-
- it('should respect default value of a Boolean prop', function () {
- const vm = new Vue({
- template: '<test></test>',
- components: {
- test: {
- props: {
- prop: {
- type: Boolean,
- default: true
- }
- },
- template: '<div>{{prop}}</div>'
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('true')
- })
-
- it('non reactive values passed down as prop should not be converted', done => {
- const a = Object.freeze({
- nested: {
- msg: 'hello'
- }
- })
- const parent = new Vue({
- template: '<comp :a="a.nested"></comp>',
- data: {
- a: a
- },
- components: {
- comp: {
- template: '<div></div>',
- props: ['a']
- }
- }
- }).$mount()
- const child = parent.$children[0]
- expect(child.a.msg).toBe('hello')
- expect(child.a.__ob__).toBeUndefined() // should not be converted
- parent.a = Object.freeze({
- nested: {
- msg: 'yo'
- }
- })
- waitForUpdate(() => {
- expect(child.a.msg).toBe('yo')
- expect(child.a.__ob__).toBeUndefined()
- }).then(done)
- })
-
- it('should not warn for non-required, absent prop', function () {
- new Vue({
- template: '<test></test>',
- components: {
- test: {
- template: '<div></div>',
- props: {
- prop: {
- type: String
- }
- }
- }
- }
- }).$mount()
- expect(console.error.calls.count()).toBe(0)
- })
-
- // #3453
- it('should not fire watcher on object/array props when parent re-renders', done => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- arr: []
- },
- template: '<test :prop="arr">hi</test>',
- components: {
- test: {
- props: ['prop'],
- watch: {
- prop: spy
- },
- template: '<div><slot></slot></div>'
- }
- }
- }).$mount()
- vm.$forceUpdate()
- waitForUpdate(() => {
- expect(spy).not.toHaveBeenCalled()
- }).then(done)
- })
-
- // #4090
- it('should not trigger watcher on default value', done => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- template: `<test :value="a" :test="b"></test>`,
- data: {
- a: 1,
- b: undefined
- },
- components: {
- test: {
- template: '<div>{{ value }}</div>',
- props: {
- value: { type: Number },
- test: {
- type: Object,
- default: () => ({})
- }
- },
- watch: {
- test: spy
- }
- }
- }
- }).$mount()
-
- vm.a++
- waitForUpdate(() => {
- expect(spy).not.toHaveBeenCalled()
- vm.b = {}
- }).then(() => {
- expect(spy.calls.count()).toBe(1)
- }).then(() => {
- vm.b = undefined
- }).then(() => {
- expect(spy.calls.count()).toBe(2)
- vm.a++
- }).then(() => {
- expect(spy.calls.count()).toBe(2)
- }).then(done)
- })
-
- it('warn reserved props', () => {
- const specialAttrs = ['key', 'ref', 'slot', 'is', 'slot-scope']
- new Vue({
- props: specialAttrs
- })
- specialAttrs.forEach(attr => {
- expect(`"${attr}" is a reserved attribute`).toHaveBeenWarned()
- })
- })
-
- it('should consider order when casting [Boolean, String] multi-type props', () => {
- const vm = new Vue({
- template: '<test ref="test" booleanOrString stringOrBoolean />',
- components: {
- test: {
- template: '<div></div>',
- props: {
- booleanOrString: [Boolean, String],
- stringOrBoolean: [String, Boolean]
- }
- }
- }
- }).$mount()
- expect(vm.$refs.test.$props.booleanOrString).toBe(true)
- expect(vm.$refs.test.$props.stringOrBoolean).toBe('')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options propsData', () => {
- it('should work', done => {
- const A = Vue.extend({
- props: ['a'],
- template: '<div>{{ a }}</div>'
- })
- const vm = new A({
- propsData: {
- a: 123
- }
- }).$mount()
- expect(vm.a).toBe(123)
- expect(vm.$el.textContent).toBe('123')
- vm.a = 234
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('234')
- }).then(done)
- })
-
- it('warn non instantiation usage', () => {
- Vue.extend({
- propsData: {
- a: 123
- }
- })
- expect('option "propsData" can only be used during instance creation').toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options render', () => {
- it('basic usage', () => {
- const vm = new Vue({
- render (h) {
- const children = []
- for (let i = 0; i < this.items.length; i++) {
- children.push(h('li', { staticClass: 'task' }, [this.items[i].name]))
- }
- return h('ul', { staticClass: 'tasks' }, children)
- },
- data: {
- items: [{ id: 1, name: 'task1' }, { id: 2, name: 'task2' }]
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('UL')
- for (let i = 0; i < vm.$el.children.length; i++) {
- const li = vm.$el.children[i]
- expect(li.tagName).toBe('LI')
- expect(li.textContent).toBe(vm.items[i].name)
- }
- })
-
- it('allow null data', () => {
- const vm = new Vue({
- render (h) {
- return h('div', null, 'hello' /* string as children*/)
- }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe('hello')
- })
-
- it('should warn non `render` option and non `template` option', () => {
- new Vue().$mount()
- expect('Failed to mount component: template or render function not defined.').toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options renderError', () => {
- it('should be used on render errors', done => {
- Vue.config.errorHandler = () => {}
- const vm = new Vue({
- data: {
- ok: true
- },
- render (h) {
- if (this.ok) {
- return h('div', 'ok')
- } else {
- throw new Error('no')
- }
- },
- renderError (h, err) {
- return h('div', err.toString())
- }
- }).$mount()
- expect(vm.$el.textContent).toBe('ok')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('Error: no')
- Vue.config.errorHandler = null
- }).then(done)
- })
-
- it('should pass on errors in renderError to global handler', () => {
- const spy = Vue.config.errorHandler = jasmine.createSpy()
- const err = new Error('renderError')
- const vm = new Vue({
- render () {
- throw new Error('render')
- },
- renderError () {
- throw err
- }
- }).$mount()
- expect(spy).toHaveBeenCalledWith(err, vm, 'renderError')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('Options template', () => {
- let el
- beforeEach(() => {
- el = document.createElement('script')
- el.type = 'x-template'
- el.id = 'app'
- el.innerHTML = '<p>{{message}}</p>'
- document.body.appendChild(el)
- })
-
- afterEach(() => {
- document.body.removeChild(el)
- })
-
- it('basic usage', () => {
- const vm = new Vue({
- template: '<div>{{message}}</div>',
- data: { message: 'hello world' }
- }).$mount()
- expect(vm.$el.tagName).toBe('DIV')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('id reference', () => {
- const vm = new Vue({
- template: '#app',
- data: { message: 'hello world' }
- }).$mount()
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('DOM element', () => {
- const elm = document.createElement('p')
- elm.innerHTML = '<p>{{message}}</p>'
- const vm = new Vue({
- template: elm,
- data: { message: 'hello world' }
- }).$mount()
- expect(vm.$el.tagName).toBe('P')
- expect(vm.$el.textContent).toBe(vm.message)
- })
-
- it('invalid template', () => {
- new Vue({
- template: Vue,
- data: { message: 'hello world' }
- }).$mount()
- expect('invalid template option').toHaveBeenWarned()
- })
-
- it('warn error in generated function', () => {
- new Vue({
- template: '<div v-if="!@"><span>{{ a"" }}</span><span>{{ do + 1 }}</span></div>'
- }).$mount()
- expect('Error compiling template').toHaveBeenWarned()
- expect('Raw expression: v-if="!@"').toHaveBeenWarned()
- expect('Raw expression: {{ a"" }}').toHaveBeenWarned()
- expect('avoid using JavaScript keyword as property name: "do"').toHaveBeenWarned()
- })
-
- it('should not warn $ prefixed keywords', () => {
- new Vue({
- template: `<div @click="$delete(foo, 'bar')"></div>`
- }).$mount()
- expect('avoid using JavaScript keyword as property name').not.toHaveBeenWarned()
- })
-
- it('warn error in generated function (v-for)', () => {
- new Vue({
- template: '<div><div v-for="(1, 2) in a----"></div></div>'
- }).$mount()
- expect('Error compiling template').toHaveBeenWarned()
- expect('invalid v-for alias "1"').toHaveBeenWarned()
- expect('invalid v-for iterator "2"').toHaveBeenWarned()
- expect('Raw expression: v-for="(1, 2) in a----"').toHaveBeenWarned()
- })
-
- it('warn error in generated function (v-on)', () => {
- new Vue({
- template: `<div @click="delete('Delete')"></div>`,
- methods: { delete: function () {} }
- }).$mount()
- expect('Error compiling template').toHaveBeenWarned()
- expect(
- `avoid using JavaScript unary operator as property name: "delete()" in expression @click="delete('Delete')"`
- ).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import testObjectOption from '../../../helpers/test-object-option'
-
-describe('Options watch', () => {
- let spy
- beforeEach(() => {
- spy = jasmine.createSpy('watch')
- })
-
- testObjectOption('watch')
-
- it('basic usage', done => {
- const vm = new Vue({
- data: {
- a: 1
- },
- watch: {
- a: spy
- }
- })
- expect(spy).not.toHaveBeenCalled()
- vm.a = 2
- expect(spy).not.toHaveBeenCalled()
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
-
- it('string method name', done => {
- const vm = new Vue({
- data: {
- a: 1
- },
- watch: {
- a: 'onChange'
- },
- methods: {
- onChange: spy
- }
- })
- expect(spy).not.toHaveBeenCalled()
- vm.a = 2
- expect(spy).not.toHaveBeenCalled()
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
-
- it('multiple cbs (after option merge)', done => {
- const spy1 = jasmine.createSpy('watch')
- const Test = Vue.extend({
- watch: {
- a: spy1
- }
- })
- const vm = new Test({
- data: { a: 1 },
- watch: {
- a: spy
- }
- })
- vm.a = 2
- waitForUpdate(() => {
- expect(spy1).toHaveBeenCalledWith(2, 1)
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
-
- it('with option: immediate', done => {
- const vm = new Vue({
- data: { a: 1 },
- watch: {
- a: {
- handler: spy,
- immediate: true
- }
- }
- })
- expect(spy).toHaveBeenCalledWith(1)
- vm.a = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(2, 1)
- }).then(done)
- })
-
- it('with option: deep', done => {
- const vm = new Vue({
- data: { a: { b: 1 }},
- watch: {
- a: {
- handler: spy,
- deep: true
- }
- }
- })
- const oldA = vm.a
- expect(spy).not.toHaveBeenCalled()
- vm.a.b = 2
- expect(spy).not.toHaveBeenCalled()
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(vm.a, vm.a)
- vm.a = { b: 3 }
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.a, oldA)
- }).then(done)
- })
-
- it('correctly merges multiple extends', done => {
- var spy2 = jasmine.createSpy('A')
- var spy3 = jasmine.createSpy('B')
- var A = Vue.extend({
- data: function () {
- return {
- a: 0,
- b: 0
- }
- },
- watch: {
- b: spy
- }
- })
-
- var B = Vue.extend({
- extends: A,
- watch: {
- a: spy2
- }
- })
-
- var C = Vue.extend({
- extends: B,
- watch: {
- a: spy3
- }
- })
-
- var vm = new C()
- vm.a = 1
-
- waitForUpdate(() => {
- expect(spy).not.toHaveBeenCalled()
- expect(spy2).toHaveBeenCalledWith(1, 0)
- expect(spy3).toHaveBeenCalledWith(1, 0)
- }).then(done)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('ref', () => {
- const components = {
- test: {
- id: 'test',
- template: '<div>test</div>'
- },
- test2: {
- id: 'test2',
- template: '<div>test2</div>'
- },
- test3: {
- id: 'test3',
- template: '<div>test3</div>'
- }
- }
-
- it('should work', () => {
- const vm = new Vue({
- data: {
- value: 'bar'
- },
- template: `<div>
- <test ref="foo"></test>
- <test2 :ref="value"></test2>
- <test3 :ref="0"></test3>
- </div>`,
- components
- })
- vm.$mount()
- expect(vm.$refs.foo).toBeTruthy()
- expect(vm.$refs.foo.$options.id).toBe('test')
- expect(vm.$refs.bar).toBeTruthy()
- expect(vm.$refs.bar.$options.id).toBe('test2')
- expect(vm.$refs['0']).toBeTruthy()
- expect(vm.$refs['0'].$options.id).toBe('test3')
- })
-
- it('should dynamically update refs', done => {
- const vm = new Vue({
- data: {
- value: 'foo'
- },
- template: '<div :ref="value"></div>'
- }).$mount()
- expect(vm.$refs.foo).toBe(vm.$el)
- vm.value = 'bar'
- waitForUpdate(() => {
- expect(vm.$refs.foo).toBeUndefined()
- expect(vm.$refs.bar).toBe(vm.$el)
- }).then(done)
- })
-
- it('should work as a hyperscript prop', () => {
- const vm = new Vue({
- components,
- render (h) {
- return h('div', null, [
- h('test', { ref: 'test' })
- ])
- }
- })
- vm.$mount()
- expect(vm.$refs.test).toBeTruthy()
- expect(vm.$refs.test.$options.id).toBe('test')
- })
-
- it('should accept HOC component', () => {
- const vm = new Vue({
- template: '<test ref="test"></test>',
- components
- })
- vm.$mount()
- expect(vm.$refs.test).toBeTruthy()
- expect(vm.$refs.test.$options.id).toBe('test')
- })
-
- it('should accept dynamic component', done => {
- const vm = new Vue({
- template: `<div>
- <component :is="test" ref="test"></component>
- </div>`,
- components,
- data: { test: 'test' }
- })
- vm.$mount()
- expect(vm.$refs.test.$options.id).toBe('test')
- vm.test = 'test2'
- waitForUpdate(() => {
- expect(vm.$refs.test.$options.id).toBe('test2')
- vm.test = ''
- }).then(() => {
- expect(vm.$refs.test).toBeUndefined()
- }).then(done)
- })
-
- it('should register as Array when used with v-for', done => {
- const vm = new Vue({
- data: {
- items: [1, 2, 3]
- },
- template: `
- <div>
- <div v-for="n in items" ref="list">{{n}}</div>
- </div>
- `
- }).$mount()
- assertRefs()
- // updating
- vm.items.push(4)
- waitForUpdate(assertRefs)
- .then(() => { vm.items = [] })
- .then(assertRefs)
- .then(done)
-
- function assertRefs () {
- expect(Array.isArray(vm.$refs.list)).toBe(true)
- expect(vm.$refs.list.length).toBe(vm.items.length)
- expect(vm.$refs.list.every((item, i) => item.textContent === String(i + 1))).toBe(true)
- }
- })
-
- it('should register as Array when used with v-for (components)', done => {
- const vm = new Vue({
- data: {
- items: [1, 2, 3]
- },
- template: `
- <div>
- <test v-for="n in items" ref="list" :key="n" :n="n"></test>
- </div>
- `,
- components: {
- test: {
- props: ['n'],
- template: '<div>{{ n }}</div>'
- }
- }
- }).$mount()
- assertRefs()
- // updating
- vm.items.push(4)
- waitForUpdate(assertRefs)
- .then(() => { vm.items = [] })
- .then(assertRefs)
- .then(done)
-
- function assertRefs () {
- expect(Array.isArray(vm.$refs.list)).toBe(true)
- expect(vm.$refs.list.length).toBe(vm.items.length)
- expect(vm.$refs.list.every((comp, i) => comp.$el.textContent === String(i + 1))).toBe(true)
- }
- })
-
- it('should work with v-for on dynamic component', done => {
- components.test3 = {
- id: 'test3',
- template: `<test1 v-if="!normal"></test1><div v-else>test3</div>`,
- data () {
- return { normal: false }
- },
- components: { test1: components.test }
- }
- // a flag that representing whether to test component content or not
- let testContent = false
-
- const vm = new Vue({
- template: `
- <div>
- <component
- v-for="(item, index) in items"
- :key="index"
- :is="item"
- ref="children">
- </component>
- </div>
- `,
- data: {
- items: ['test2', 'test3']
- },
- components
- }).$mount()
- assertRefs()
- expect(vm.$refs.children[0].$el.textContent).toBe('test2')
- expect(vm.$refs.children[1].$el.textContent).toBe('test')
- // updating
- vm.$refs.children[1].normal = true
- testContent = true
- waitForUpdate(assertRefs)
- .then(() => { vm.items.push('test') })
- .then(assertRefs)
- .then(done)
-
- function assertRefs () {
- expect(Array.isArray(vm.$refs.children)).toBe(true)
- expect(vm.$refs.children.length).toBe(vm.items.length)
- if (testContent) {
- expect(
- vm.$refs.children.every((comp, i) => comp.$el.textContent === vm.items[i])
- ).toBe(true)
- }
- }
- })
-
- it('should register on component with empty roots', done => {
- const vm = new Vue({
- template: '<child ref="test"></child>',
- components: {
- child: {
- template: '<div v-if="show"></div>',
- data () {
- return { show: false }
- }
- }
- }
- }).$mount()
- expect(vm.$refs.test).toBe(vm.$children[0])
- vm.$refs.test.show = true
- waitForUpdate(() => {
- expect(vm.$refs.test).toBe(vm.$children[0])
- vm.$refs.test.show = false
- }).then(() => {
- expect(vm.$refs.test).toBe(vm.$children[0])
- }).then(done)
- })
-})
+++ /dev/null
-function insertCSS (text) {
- var cssEl = document.createElement('style')
- cssEl.textContent = text.trim()
- document.head.appendChild(cssEl)
-}
-
-const duration = process.env.TRANSITION_DURATION || 50
-const buffer = process.env.TRANSITION_BUFFER || 10
-let injected = false
-
-export default function injectStyles () {
- if (injected) return { duration, buffer }
- injected = true
- insertCSS(`
- .test {
- -webkit-transition: opacity ${duration}ms ease;
- transition: opacity ${duration}ms ease;
- }
- .group-move {
- -webkit-transition: -webkit-transform ${duration}ms ease;
- transition: transform ${duration}ms ease;
- }
- .v-appear, .v-enter, .v-leave-active,
- .test-appear, .test-enter, .test-leave-active,
- .hello, .bye.active,
- .changed-enter {
- opacity: 0;
- }
- .test-anim-enter-active {
- animation: test-enter ${duration}ms;
- -webkit-animation: test-enter ${duration}ms;
- }
- .test-anim-leave-active {
- animation: test-leave ${duration}ms;
- -webkit-animation: test-leave ${duration}ms;
- }
- .test-anim-long-enter-active {
- animation: test-enter ${duration * 2}ms;
- -webkit-animation: test-enter ${duration * 2}ms;
- }
- .test-anim-long-leave-active {
- animation: test-leave ${duration * 2}ms;
- -webkit-animation: test-leave ${duration * 2}ms;
- }
- @keyframes test-enter {
- from { opacity: 0 }
- to { opacity: 1 }
- }
- @-webkit-keyframes test-enter {
- from { opacity: 0 }
- to { opacity: 1 }
- }
- @keyframes test-leave {
- from { opacity: 1 }
- to { opacity: 0 }
- }
- @-webkit-keyframes test-leave {
- from { opacity: 1 }
- to { opacity: 0 }
- }
- `)
- return { duration, buffer }
-}
-
+++ /dev/null
-import Vue from 'vue'
-import injectStyles from './inject-styles'
-import { isIE9 } from 'core/util/env'
-import { nextFrame } from 'web/runtime/transition-util'
-
-if (!isIE9) {
- describe('Transition group', () => {
- const { duration, buffer } = injectStyles()
-
- let el
- beforeEach(() => {
- el = document.createElement('div')
- document.body.appendChild(el)
- })
-
- function createBasicVM (useIs, appear) {
- const vm = new Vue({
- template: `
- <div>
- ${useIs ? `<span is="transition-group">` : `<transition-group${appear ? ` appear` : ``}>`}
- <div v-for="item in items" :key="item" class="test">{{ item }}</div>
- ${useIs ? `</span>` : `</transition-group>`}
- </div>
- `,
- data: {
- items: ['a', 'b', 'c']
- }
- }).$mount(el)
- if (!appear) {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }
- return vm
- }
-
- it('enter', done => {
- const vm = createBasicVM()
- vm.items.push('d', 'e')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- ['a', 'b', 'c'].map(i => `<div class="test">${i}</div>`).join('') +
- `<div class="test v-enter v-enter-active">d</div>` +
- `<div class="test v-enter v-enter-active">e</div>` +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- ['a', 'b', 'c'].map(i => `<div class="test">${i}</div>`).join('') +
- `<div class="test v-enter-active v-enter-to">d</div>` +
- `<div class="test v-enter-active v-enter-to">e</div>` +
- `</span>`
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }).then(done)
- })
-
- it('leave', done => {
- const vm = createBasicVM()
- vm.items = ['b']
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave v-leave-active">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test v-leave v-leave-active">c</div>` +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave-active v-leave-to">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test v-leave-active v-leave-to">c</div>` +
- `</span>`
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }).then(done)
- })
-
- it('enter + leave', done => {
- const vm = createBasicVM()
- vm.items = ['b', 'c', 'd']
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave v-leave-active">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test v-enter v-enter-active">d</div>` +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave-active v-leave-to">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test v-enter-active v-enter-to">d</div>` +
- `</span>`
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }).then(done)
- })
-
- it('use with "is" attribute', done => {
- const vm = createBasicVM(true)
- vm.items = ['b', 'c', 'd']
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave v-leave-active">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test v-enter v-enter-active">d</div>` +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test v-leave-active v-leave-to">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test v-enter-active v-enter-to">d</div>` +
- `</span>`
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }).then(done)
- })
-
- it('appear', done => {
- const vm = createBasicVM(false, true /* appear */)
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test v-enter v-enter-active">${i}</div>`).join('') +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test v-enter-active v-enter-to">${i}</div>`).join('') +
- `</span>`
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- vm.items.map(i => `<div class="test">${i}</div>`).join('') +
- `</span>`
- )
- }).then(done)
- })
-
- it('events', done => {
- let next
- const beforeEnterSpy = jasmine.createSpy()
- const afterEnterSpy = jasmine.createSpy()
- const afterLeaveSpy = jasmine.createSpy()
- const vm = new Vue({
- template: `
- <div>
- <transition-group @before-enter="beforeEnter" @after-enter="afterEnter" @after-leave="afterLeave">
- <div v-for="item in items" :key="item" class="test">{{ item }}</div>
- </transition-group>
- </div>
- `,
- data: {
- items: ['a', 'b', 'c']
- },
- methods: {
- beforeEnter (el) {
- expect(el.textContent).toBe('d')
- beforeEnterSpy()
- },
- afterEnter (el) {
- expect(el.textContent).toBe('d')
- afterEnterSpy()
- next()
- },
- afterLeave (el) {
- expect(el.textContent).toBe('a')
- afterLeaveSpy()
- next()
- }
- }
- }).$mount(el)
-
- vm.items.push('d')
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test v-enter v-enter-active">d</div>` +
- `</span>`
- )
- expect(beforeEnterSpy.calls.count()).toBe(1)
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test">a</div>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test">d</div>` +
- `</span>`
- )
- expect(afterEnterSpy.calls.count()).toBe(1)
- vm.items.shift()
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- `<span>` +
- `<div class="test">b</div>` +
- `<div class="test">c</div>` +
- `<div class="test">d</div>` +
- `</span>`
- )
- expect(afterLeaveSpy.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('move', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition-group name="group">
- <div v-for="item in items" :key="item" class="test">{{ item }}</div>
- </transition-group>
- </div>
- `,
- data: {
- items: ['a', 'b', 'c']
- }
- }).$mount(el)
-
- vm.items = ['d', 'b', 'a']
- waitForUpdate(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div class="test group-enter group-enter-active">d</div>` +
- `<div class="test">b</div>` +
- `<div class="test group-move">a</div>` +
- `<div class="test group-leave group-leave-active group-move">c</div>` +
- `</span>`
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div class="test group-enter-active group-enter-to">d</div>` +
- `<div class="test">b</div>` +
- `<div class="test group-move">a</div>` +
- `<div class="test group-leave-active group-move group-leave-to">c</div>` +
- `</span>`
- )
- }).thenWaitFor(duration * 2).then(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div class="test">d</div>` +
- `<div class="test">b</div>` +
- `<div class="test">a</div>` +
- `</span>`
- )
- }).then(done)
- })
-
- it('warn unkeyed children', () => {
- new Vue({
- template: `<div><transition-group><div v-for="i in 3"></div></transition-group></div>`
- }).$mount()
- expect('<transition-group> children must be keyed: <div>').toHaveBeenWarned()
- })
-
- // GitHub issue #6006
- it('should work with dynamic name', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition-group :name="name">
- <div v-for="item in items" :key="item">{{ item }}</div>
- </transition-group>
- </div>
- `,
- data: {
- items: ['a', 'b', 'c'],
- name: 'group'
- }
- }).$mount(el)
-
- vm.name = 'invalid-name'
- vm.items = ['b', 'c', 'a']
- waitForUpdate(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div>b</div>` +
- `<div>c</div>` +
- `<div>a</div>` +
- `</span>`
- )
- vm.name = 'group'
- vm.items = ['a', 'b', 'c']
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div class="group-move">a</div>` +
- `<div class="group-move">b</div>` +
- `<div class="group-move">c</div>` +
- `</span>`
- )
- }).thenWaitFor(duration * 2 + buffer).then(() => {
- expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
- `<span>` +
- `<div>a</div>` +
- `<div>b</div>` +
- `<div>c</div>` +
- `</span>`
- )
- }).then(done)
- })
- })
-}
+++ /dev/null
-import Vue from 'vue'
-import injectStyles from './inject-styles'
-import { isIE9 } from 'core/util/env'
-import { nextFrame } from 'web/runtime/transition-util'
-
-if (!isIE9) {
- describe('Transition mode', () => {
- const { duration, buffer } = injectStyles()
- const components = {
- one: { template: '<div>one</div>' },
- two: { template: '<div>two</div>' }
- }
-
- let el
- beforeEach(() => {
- el = document.createElement('div')
- document.body.appendChild(el)
- })
-
- it('dynamic components, simultaneous', done => {
- const vm = new Vue({
- template: `<div>
- <transition>
- <component :is="view" class="test">
- </component>
- </transition>
- </div>`,
- data: { view: 'one' },
- components
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave v-leave-active">one</div>' +
- '<div class="test v-enter v-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave-active v-leave-to">one</div>' +
- '<div class="test v-enter-active v-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('dynamic components, out-in', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-leave="afterLeave">
- <component :is="view" class="test">
- </component>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div><!---->'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- // #3440
- it('dynamic components, out-in (with extra re-render)', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-leave="afterLeave">
- <component :is="view" class="test">
- </component>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div><!---->'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- // Force re-render before the element finishes leaving
- // this should not cause the incoming element to enter early
- vm.$forceUpdate()
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('dynamic components, in-out', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="in-out" @after-enter="afterEnter">
- <component :is="view" class="test">
- </component>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterEnter () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test">two</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('dynamic components, in-out with early cancel', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="in-out" @after-enter="afterEnter">
- <component :is="view" class="test"></component>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterEnter () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- // switch again before enter finishes,
- // this cancels both enter and leave.
- vm.view = 'one'
- }).then(() => {
- // 1. the pending leaving "one" should be removed instantly.
- // 2. the entering "two" should be placed into its final state instantly.
- // 3. a new "one" is created and entering
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter test-enter-active">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test test-enter-active test-enter-to">one</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>' +
- '<div class="test">one</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">two</div>' +
- '<div class="test">one</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>'
- )
- }).then(done).then(done)
- })
-
- it('normal elements with different keys, simultaneous', done => {
- const vm = new Vue({
- template: `<div>
- <transition>
- <div :key="view" class="test">{{view}}</div>
- </transition>
- </div>`,
- data: { view: 'one' },
- components
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave v-leave-active">one</div>' +
- '<div class="test v-enter v-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test v-leave-active v-leave-to">one</div>' +
- '<div class="test v-enter-active v-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('normal elements with different keys, out-in', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="out-in" @after-leave="afterLeave">
- <div :key="view" class="test">{{view}}</div>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterLeave () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div><!---->'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div><!---->'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('normal elements with different keys, in-out', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" mode="in-out" @after-enter="afterEnter">
- <div :key="view" class="test">{{view}}</div>
- </transition>
- </div>`,
- data: { view: 'one' },
- components,
- methods: {
- afterEnter () {
- next()
- }
- }
- }).$mount(el)
- expect(vm.$el.textContent).toBe('one')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter test-enter-active">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test test-enter-active test-enter-to">two</div>'
- )
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">one</div>' +
- '<div class="test">two</div>'
- )
- }).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave test-leave-active">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test test-leave-active test-leave-to">one</div>' +
- '<div class="test">two</div>'
- )
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe(
- '<div class="test">two</div>'
- )
- }).then(done)
- })
-
- it('transition out-in on async component (resolve before leave complete)', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test-anim" mode="out-in">
- <component-a v-if="ok"></component-a>
- <component-b v-else></component-b>
- </transition>
- </div>
- `,
- components: {
- componentA: resolve => {
- setTimeout(() => {
- resolve({ template: '<div><h1>component A</h1></div>' })
- next1()
- }, duration / 2)
- },
- componentB: resolve => {
- setTimeout(() => {
- resolve({ template: '<div><h1>component B</h1></div>' })
- }, duration / 2)
- }
- },
- data: {
- ok: true
- }
- }).$mount(el)
-
- expect(vm.$el.innerHTML).toBe('<!---->')
-
- function next1 () {
- Vue.nextTick(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component A')
- expect(vm.$el.children[0].className).toBe('test-anim-enter test-anim-enter-active')
- nextFrame(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-enter-active test-anim-enter-to')
- setTimeout(() => {
- expect(vm.$el.children[0].className).toBe('')
- vm.ok = false
- next2()
- }, duration + buffer)
- })
- })
- }
-
- function next2 () {
- waitForUpdate(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component A')
- expect(vm.$el.children[0].className).toBe('test-anim-leave test-anim-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-leave-active test-anim-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component B')
- expect(vm.$el.children[0].className).toMatch('test-anim-enter-active')
- }).thenWaitFor(duration * 2).then(() => {
- expect(vm.$el.children[0].className).toBe('')
- }).then(done)
- }
- })
-
- it('transition out-in on async component (resolve after leave complete)', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test-anim" mode="out-in">
- <component-a v-if="ok"></component-a>
- <component-b v-else></component-b>
- </transition>
- </div>
- `,
- components: {
- componentA: { template: '<div><h1>component A</h1></div>' },
- componentB: resolve => {
- setTimeout(() => {
- resolve({ template: '<div><h1>component B</h1></div>' })
- Vue.nextTick(next)
- }, (duration + buffer) * 1.5)
- }
- },
- data: {
- ok: true
- }
- }).$mount(el)
-
- expect(vm.$el.innerHTML).toBe('<div><h1>component A</h1></div>')
-
- let next
-
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component A')
- expect(vm.$el.children[0].className).toBe('test-anim-leave test-anim-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-leave-active test-anim-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).thenWaitFor(_next => { next = _next }).then(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component B')
- expect(vm.$el.children[0].className).toBe('test-anim-enter test-anim-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-enter-active test-anim-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component B')
- expect(vm.$el.children[0].className).toBe('')
- }).then(done)
- })
-
- it('transition in-out on async component', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test-anim" mode="in-out">
- <component-a v-if="ok"></component-a>
- <component-b v-else></component-b>
- </transition>
- </div>
- `,
- components: {
- componentA: resolve => {
- setTimeout(() => {
- resolve({ template: '<div><h1>component A</h1></div>' })
- next1()
- }, duration / 2)
- },
- componentB: resolve => {
- setTimeout(() => {
- resolve({ template: '<div><h1>component B</h1></div>' })
- next2()
- }, duration / 2)
- }
- },
- data: {
- ok: true
- }
- }).$mount(el)
-
- expect(vm.$el.innerHTML).toBe('<!---->')
-
- function next1 () {
- Vue.nextTick(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component A')
- expect(vm.$el.children[0].className).toBe('test-anim-enter test-anim-enter-active')
- nextFrame(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-enter-active test-anim-enter-to')
- setTimeout(() => {
- expect(vm.$el.children[0].className).toBe('')
- vm.ok = false
- }, duration + buffer)
- })
- })
- }
-
- function next2 () {
- waitForUpdate(() => {
- expect(vm.$el.children.length).toBe(2)
- expect(vm.$el.textContent).toBe('component Acomponent B')
- expect(vm.$el.children[0].className).toBe('')
- expect(vm.$el.children[1].className).toBe('test-anim-enter test-anim-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[1].className).toBe('test-anim-enter-active test-anim-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(2)
- expect(vm.$el.textContent).toBe('component Acomponent B')
- expect(vm.$el.children[0].className).toMatch('test-anim-leave-active')
- expect(vm.$el.children[1].className).toBe('')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(1)
- expect(vm.$el.textContent).toBe('component B')
- expect(vm.$el.children[0].className).toBe('')
- }).then(done)
- }
- })
-
- it('warn invalid mode', () => {
- new Vue({
- template: '<transition mode="foo"><div>123</div></transition>'
- }).$mount()
- expect('invalid <transition> mode: foo').toHaveBeenWarned()
- })
- })
-}
+++ /dev/null
-import Vue from 'vue'
-import injectStyles from './inject-styles'
-import { isIE9 } from 'core/util/env'
-import { nextFrame } from 'web/runtime/transition-util'
-
-if (!isIE9) {
- describe('Transition basic', () => {
- const { duration, buffer } = injectStyles()
- const explicitDuration = duration * 2
-
- let el
- beforeEach(() => {
- el = document.createElement('div')
- document.body.appendChild(el)
- })
-
- it('basic transition', done => {
- const vm = new Vue({
- template: '<div><transition><div v-if="ok" class="test">foo</div></transition></div>',
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('named transition', done => {
- const vm = new Vue({
- template: '<div><transition name="test"><div v-if="ok" class="test">foo</div></transition></div>',
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('custom transition classes', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition
- enter-class="hello"
- enter-active-class="hello-active"
- enter-to-class="hello-to"
- leave-class="bye"
- leave-to-class="bye-to"
- leave-active-class="byebye active more ">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test bye byebye active more')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test byebye active more bye-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test hello hello-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test hello-active hello-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('dynamic transition', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition :name="trans">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: {
- ok: true,
- trans: 'test'
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- vm.trans = 'changed'
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test changed-enter changed-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test changed-enter-active changed-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('inline transition object', done => {
- const enter = jasmine.createSpy('enter')
- const leave = jasmine.createSpy('leave')
- const vm = new Vue({
- render (h) {
- return h('div', null, [
- h('transition', {
- props: {
- name: 'inline',
- enterClass: 'hello',
- enterToClass: 'hello-to',
- enterActiveClass: 'hello-active',
- leaveClass: 'bye',
- leaveToClass: 'bye-to',
- leaveActiveClass: 'byebye active'
- },
- on: {
- enter,
- leave
- }
- }, this.ok ? [h('div', { class: 'test' }, 'foo')] : undefined)
- ])
- },
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test bye byebye active')
- expect(leave).toHaveBeenCalled()
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test byebye active bye-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test hello hello-active')
- expect(enter).toHaveBeenCalled()
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test hello-active hello-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition events', done => {
- const onLeaveSpy = jasmine.createSpy('leave')
- const onEnterSpy = jasmine.createSpy('enter')
- const beforeLeaveSpy = jasmine.createSpy('beforeLeave')
- const beforeEnterSpy = jasmine.createSpy('beforeEnter')
- const afterLeaveSpy = jasmine.createSpy('afterLeave')
- const afterEnterSpy = jasmine.createSpy('afterEnter')
-
- const vm = new Vue({
- template: `
- <div>
- <transition
- name="test"
- @before-enter="beforeEnter"
- @enter="enter"
- @after-enter="afterEnter"
- @before-leave="beforeLeave"
- @leave="leave"
- @after-leave="afterLeave">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true },
- methods: {
- beforeLeave: (el) => {
- expect(el).toBe(vm.$el.children[0])
- expect(el.className).toBe('test')
- beforeLeaveSpy(el)
- },
- leave: (el) => onLeaveSpy(el),
- afterLeave: (el) => afterLeaveSpy(el),
- beforeEnter: (el) => {
- expect(vm.$el.contains(el)).toBe(false)
- expect(el.className).toBe('test')
- beforeEnterSpy(el)
- },
- enter: (el) => {
- expect(vm.$el.contains(el)).toBe(true)
- onEnterSpy(el)
- },
- afterEnter: (el) => afterEnterSpy(el)
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
-
- let _el = vm.$el.children[0]
- vm.ok = false
- waitForUpdate(() => {
- expect(beforeLeaveSpy).toHaveBeenCalledWith(_el)
- expect(onLeaveSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(afterLeaveSpy).not.toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(afterLeaveSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- _el = vm.$el.children[0]
- expect(beforeEnterSpy).toHaveBeenCalledWith(_el)
- expect(onEnterSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(afterEnterSpy).not.toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(afterEnterSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition events (v-show)', done => {
- const onLeaveSpy = jasmine.createSpy('leave')
- const onEnterSpy = jasmine.createSpy('enter')
- const beforeLeaveSpy = jasmine.createSpy('beforeLeave')
- const beforeEnterSpy = jasmine.createSpy('beforeEnter')
- const afterLeaveSpy = jasmine.createSpy('afterLeave')
- const afterEnterSpy = jasmine.createSpy('afterEnter')
-
- const vm = new Vue({
- template: `
- <div>
- <transition
- name="test"
- @before-enter="beforeEnter"
- @enter="enter"
- @after-enter="afterEnter"
- @before-leave="beforeLeave"
- @leave="leave"
- @after-leave="afterLeave">
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true },
- methods: {
- beforeLeave: (el) => {
- expect(el.style.display).toBe('')
- expect(el).toBe(vm.$el.children[0])
- expect(el.className).toBe('test')
- beforeLeaveSpy(el)
- },
- leave: (el) => {
- expect(el.style.display).toBe('')
- onLeaveSpy(el)
- },
- afterLeave: (el) => {
- expect(el.style.display).toBe('none')
- afterLeaveSpy(el)
- },
- beforeEnter: (el) => {
- expect(el.className).toBe('test')
- expect(el.style.display).toBe('none')
- beforeEnterSpy(el)
- },
- enter: (el) => {
- expect(el.style.display).toBe('')
- onEnterSpy(el)
- },
- afterEnter: (el) => {
- expect(el.style.display).toBe('')
- afterEnterSpy(el)
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
-
- let _el = vm.$el.children[0]
- vm.ok = false
- waitForUpdate(() => {
- expect(beforeLeaveSpy).toHaveBeenCalledWith(_el)
- expect(onLeaveSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(afterLeaveSpy).not.toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(afterLeaveSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].style.display).toBe('none')
- vm.ok = true
- }).then(() => {
- _el = vm.$el.children[0]
- expect(beforeEnterSpy).toHaveBeenCalledWith(_el)
- expect(onEnterSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(afterEnterSpy).not.toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(afterEnterSpy).toHaveBeenCalledWith(_el)
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('explicit user callback in JavaScript hooks', done => {
- let next
- const vm = new Vue({
- template: `<div>
- <transition name="test" @enter="enter" @leave="leave">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>`,
- data: { ok: true },
- methods: {
- enter: (el, cb) => {
- next = cb
- },
- leave: (el, cb) => {
- next = cb
- }
- }
- }).$mount(el)
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- expect(next).toBeTruthy()
- next()
- expect(vm.$el.children.length).toBe(0)
- }).then(() => {
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- expect(next).toBeTruthy()
- next()
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('css: false', done => {
- const enterSpy = jasmine.createSpy('enter')
- const leaveSpy = jasmine.createSpy('leave')
- const vm = new Vue({
- template: `
- <div>
- <transition :css="false" name="test" @enter="enter" @leave="leave">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true },
- methods: {
- enter: enterSpy,
- leave: leaveSpy
- }
- }).$mount(el)
-
- vm.ok = false
- waitForUpdate(() => {
- expect(leaveSpy).toHaveBeenCalled()
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.ok = true
- }).then(() => {
- expect(enterSpy).toHaveBeenCalled()
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- }).then(done)
- })
-
- it('no transition detected', done => {
- const enterSpy = jasmine.createSpy('enter')
- const leaveSpy = jasmine.createSpy('leave')
- const vm = new Vue({
- template: '<div><transition name="nope" @enter="enter" @leave="leave"><div v-if="ok">foo</div></transition></div>',
- data: { ok: true },
- methods: {
- enter: enterSpy,
- leave: leaveSpy
- }
- }).$mount(el)
-
- vm.ok = false
- waitForUpdate(() => {
- expect(leaveSpy).toHaveBeenCalled()
- expect(vm.$el.innerHTML).toBe('<div class="nope-leave nope-leave-active">foo</div><!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.ok = true
- }).then(() => {
- expect(enterSpy).toHaveBeenCalled()
- expect(vm.$el.innerHTML).toBe('<div class="nope-enter nope-enter-active">foo</div>')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.innerHTML).toBe('<div>foo</div>')
- }).then(done)
- })
-
- it('enterCancelled', done => {
- const spy = jasmine.createSpy('enterCancelled')
- const vm = new Vue({
- template: `
- <div>
- <transition name="test" @enter-cancelled="enterCancelled">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: false },
- methods: {
- enterCancelled: spy
- }
- }).$mount(el)
-
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.ok = true
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration / 2).then(() => {
- vm.ok = false
- }).then(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- }).then(done)
- })
-
- it('should remove stale leaving elements', done => {
- const spy = jasmine.createSpy('afterLeave')
- const vm = new Vue({
- template: `
- <div>
- <transition name="test" @after-leave="afterLeave">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true },
- methods: {
- afterLeave: spy
- }
- }).$mount(el)
-
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(duration / 2).then(() => {
- vm.ok = true
- }).then(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.$el.children.length).toBe(1) // should have removed leaving element
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- }).then(done)
- })
-
- it('transition with v-show', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test">
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.textContent).toBe('foo')
- expect(vm.$el.children[0].style.display).toBe('')
- expect(vm.$el.children[0].className).toBe('test')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].style.display).toBe('none')
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].style.display).toBe('')
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition with v-show, inside child component', done => {
- const vm = new Vue({
- template: `
- <div>
- <test v-show="ok"></test>
- </div>
- `,
- data: { ok: true },
- components: {
- test: {
- template: `<transition name="test"><div class="test">foo</div></transition>`
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.textContent).toBe('foo')
- expect(vm.$el.children[0].style.display).toBe('')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].style.display).toBe('none')
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].style.display).toBe('')
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('leaveCancelled (v-show only)', done => {
- const spy = jasmine.createSpy('leaveCancelled')
- const vm = new Vue({
- template: `
- <div>
- <transition name="test" @leave-cancelled="leaveCancelled">
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true },
- methods: {
- leaveCancelled: spy
- }
- }).$mount(el)
-
- expect(vm.$el.children[0].style.display).toBe('')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(10).then(() => {
- vm.ok = true
- }).then(() => {
- expect(spy).toHaveBeenCalled()
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].style.display).toBe('')
- }).then(done)
- })
-
- it('leave transition with v-show: cancelled on next frame', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test">
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- vm.ok = false
- waitForUpdate(() => {
- vm.ok = true
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('enter transition with v-show: cancelled on next frame', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test">
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: false }
- }).$mount(el)
-
- vm.ok = true
- waitForUpdate(() => {
- vm.ok = false
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('animations', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test-anim">
- <div v-if="ok">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div>foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-leave test-anim-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-leave-active test-anim-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-enter test-anim-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test-anim-enter-active test-anim-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('')
- }).then(done)
- })
-
- it('explicit transition type', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test-anim-long" type="animation">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-anim-long-leave test-anim-long-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-anim-long-leave-active test-anim-long-leave-to')
- }).thenWaitFor(duration + 5).then(() => {
- // should not end early due to transition presence
- expect(vm.$el.children[0].className).toBe('test test-anim-long-leave-active test-anim-long-leave-to')
- }).thenWaitFor(duration + 5).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-anim-long-enter test-anim-long-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-anim-long-enter-active test-anim-long-enter-to')
- }).thenWaitFor(duration + 5).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-anim-long-enter-active test-anim-long-enter-to')
- }).thenWaitFor(duration + 5).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition on appear', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test"
- appear
- appear-class="test-appear"
- appear-to-class="test-appear-to"
- appear-active-class="test-appear-active">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-appear test-appear-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-appear-active test-appear-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition on appear with v-show', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition name="test" appear>
- <div v-show="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition on SVG elements', done => {
- const vm = new Vue({
- template: `
- <svg>
- <transition>
- <circle cx="0" cy="0" r="10" v-if="ok" class="test"></circle>
- </transition>
- </svg>
- `,
- data: { ok: true }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.childNodes.length).toBe(1)
- expect(vm.$el.childNodes[0].nodeType).toBe(8) // should be an empty comment node
- expect(vm.$el.childNodes[0].textContent).toBe('')
- vm.ok = true
- }).then(() => {
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.childNodes[0].getAttribute('class')).toBe('test')
- }).then(done)
- })
-
- it('transition on child components', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition>
- <test v-if="ok" class="test"></test>
- </transition>
- </div>
- `,
- data: { ok: true },
- components: {
- test: {
- template: `
- <transition name="test">
- <div>foo</div>
- </transition>
- ` // test transition override from parent
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('transition inside child component', done => {
- const vm = new Vue({
- template: `
- <div>
- <test v-if="ok" class="test"></test>
- </div>
- `,
- data: { ok: true },
- components: {
- test: {
- template: `
- <transition>
- <div>foo</div>
- </transition>
- `
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('custom transition higher-order component', done => {
- const vm = new Vue({
- template: '<div><my-transition><div v-if="ok" class="test">foo</div></my-transition></div>',
- data: { ok: true },
- components: {
- 'my-transition': {
- functional: true,
- render (h, { data, children }) {
- (data.props || (data.props = {})).name = 'test'
- return h('transition', data, children)
- }
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave test-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-leave-active test-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter test-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test test-enter-active test-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('warn when used on multiple elements', () => {
- new Vue({
- template: `<transition><p>1</p><p>2</p></transition>`
- }).$mount()
- expect(`<transition> can only be used on a single element`).toHaveBeenWarned()
- })
-
- describe('explicit durations -', () => {
- it('single value', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition duration="${explicitDuration}">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- vm.ok = false
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(explicitDuration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(explicitDuration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('enter and auto leave', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition :duration="{ enter: ${explicitDuration} }">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- vm.ok = false
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(explicitDuration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('leave and auto enter', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition :duration="{ leave: ${explicitDuration} }">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- vm.ok = false
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(explicitDuration + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('separate enter and leave', done => {
- const enter = explicitDuration
- const leave = explicitDuration * 2
-
- const vm = new Vue({
- template: `
- <div>
- <transition :duration="{ enter: ${enter}, leave: ${leave} }">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: { ok: true }
- }).$mount(el)
-
- vm.ok = false
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(leave + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(enter + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- })
-
- it('enter and leave + duration change', done => {
- const enter1 = explicitDuration * 2
- const enter2 = explicitDuration
- const leave1 = explicitDuration * 0.5
- const leave2 = explicitDuration * 3
-
- const vm = new Vue({
- template: `
- <div>
- <transition :duration="{ enter: enter, leave: leave }">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: {
- ok: true,
- enter: enter1,
- leave: leave1
- }
- }).$mount(el)
-
- vm.ok = false
-
- waitForUpdate(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(leave1 + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(enter1 + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- vm.enter = enter2
- vm.leave = leave2
- }).then(() => {
- vm.ok = false
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave v-leave-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(leave2 + buffer).then(() => {
- expect(vm.$el.children.length).toBe(0)
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter v-enter-active')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(enter2 + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- }).then(done)
- }, 10000)
-
- it('warn invalid durations', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition :duration="{ enter: NaN, leave: 'foo' }">
- <div v-if="ok" class="test">foo</div>
- </transition>
- </div>
- `,
- data: {
- ok: true
- }
- }).$mount(el)
-
- vm.ok = false
- waitForUpdate(() => {
- expect(`<transition> explicit leave duration is not a valid number - got "foo"`).toHaveBeenWarned()
- }).thenWaitFor(duration + buffer).then(() => {
- vm.ok = true
- }).then(() => {
- expect(`<transition> explicit enter duration is NaN`).toHaveBeenWarned()
- }).then(done)
- })
- })
-
- // #6687
- it('transition on child components with empty root node', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition mode="out-in">
- <component class="test" :is="view"></component>
- </transition>
- </div>
- `,
- data: { view: 'one' },
- components: {
- 'one': {
- template: '<div v-if="false">one</div>'
- },
- 'two': {
- template: '<div>two</div>'
- }
- }
- }).$mount(el)
-
- // should not apply transition on initial render by default
- expect(vm.$el.innerHTML).toBe('<!---->')
- vm.view = 'two'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div class="test v-enter v-enter-active">two</div>')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-enter-active v-enter-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.children[0].className).toBe('test')
- vm.view = 'one'
- }).then(() => {
- // incoming comment node is appended instantly because it doesn't have
- // data and therefore doesn't go through the transition module.
- expect(vm.$el.innerHTML).toBe('<div class="test v-leave v-leave-active">two</div><!---->')
- }).thenWaitFor(nextFrame).then(() => {
- expect(vm.$el.children[0].className).toBe('test v-leave-active v-leave-to')
- }).thenWaitFor(duration + buffer).then(() => {
- expect(vm.$el.innerHTML).toBe('<!---->')
- }).then(done)
- })
- })
-}
+++ /dev/null
-require('es6-promise/auto')
-
-// import all helpers
-const helpersContext = require.context('../helpers', true)
-helpersContext.keys().forEach(helpersContext)
-
-// require all test files
-const testsContext = require.context('./', true, /\.spec$/)
-testsContext.keys().forEach(testsContext)
+++ /dev/null
-var alias = require('../../scripts/alias')
-var webpack = require('webpack')
-
-var webpackConfig = {
- resolve: {
- alias: alias
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- loader: 'babel-loader',
- exclude: /node_modules/
- }
- ]
- },
- plugins: [
- new webpack.DefinePlugin({
- __WEEX__: false,
- 'process.env': {
- NODE_ENV: '"development"',
- TRANSITION_DURATION: process.env.CI ? 100 : 50,
- TRANSITION_BUFFER: 10
- }
- })
- ],
- devtool: '#inline-source-map'
-}
-
-// shared config for all unit tests
-module.exports = {
- frameworks: ['jasmine'],
- files: [
- './index.js'
- ],
- preprocessors: {
- './index.js': ['webpack', 'sourcemap']
- },
- webpack: webpackConfig,
- webpackMiddleware: {
- noInfo: true
- },
- plugins: [
- 'karma-jasmine',
- 'karma-mocha-reporter',
- 'karma-sourcemap-loader',
- 'karma-webpack'
- ]
-}
+++ /dev/null
-var base = require('./karma.base.config.js')
-
-module.exports = function (config) {
- var options = Object.assign(base, {
- browsers: ['PhantomJS'],
- reporters: ['mocha', 'coverage'],
- coverageReporter: {
- reporters: [
- { type: 'lcov', dir: '../../coverage', subdir: '.' },
- { type: 'text-summary', dir: '../../coverage', subdir: '.' }
- ]
- },
- singleRun: true,
- plugins: base.plugins.concat([
- 'karma-coverage',
- 'karma-phantomjs-launcher'
- ])
- })
-
- // add babel-plugin-istanbul for code instrumentation
- options.webpack.module.rules[0].options = {
- plugins: [['istanbul', {
- exclude: [
- 'test/',
- 'src/compiler/parser/html-parser.js',
- 'src/core/instance/proxy.js',
- 'src/sfc/deindent.js',
- 'src/platforms/weex/'
- ]
- }]]
- }
-
- config.set(options)
-}
+++ /dev/null
-var base = require('./karma.base.config.js')
-
-module.exports = function (config) {
- config.set(Object.assign(base, {
- browsers: ['PhantomJS'],
- reporters: ['progress'],
- plugins: base.plugins.concat([
- 'karma-phantomjs-launcher'
- ])
- }))
-}
+++ /dev/null
-var webpack = require('webpack')
-var base = require('./karma.base.config.js')
-
-base.webpack.plugins = [
- new webpack.DefinePlugin({
- __WEEX__: false,
- 'process.env': {
- NODE_ENV: '"development"',
- // sauce lab vms are slow!
- TRANSITION_DURATION: 500,
- TRANSITION_BUFFER: 50
- }
- })
-]
-
-/**
- * Having too many tests running concurrently on saucelabs
- * causes timeouts and errors, so we have to run them in
- * smaller batches.
- */
-
-var batches = [
- // the cool kids
- {
- sl_chrome: {
- base: 'SauceLabs',
- browserName: 'chrome',
- platform: 'Windows 7'
- },
- sl_firefox: {
- base: 'SauceLabs',
- browserName: 'firefox'
- },
- sl_mac_safari: {
- base: 'SauceLabs',
- browserName: 'safari',
- platform: 'OS X 10.10'
- }
- },
- // ie family
- {
- sl_ie_9: {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 7',
- version: '9'
- },
- sl_ie_10: {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 8',
- version: '10'
- },
- sl_ie_11: {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 8.1',
- version: '11'
- },
- sl_edge: {
- base: 'SauceLabs',
- browserName: 'MicrosoftEdge',
- platform: 'Windows 10'
- }
- },
- // mobile
- {
- sl_ios_safari_9: {
- base: 'SauceLabs',
- browserName: 'iphone',
- version: '10.3'
- },
- sl_android_6_0: {
- base: 'SauceLabs',
- browserName: 'android',
- version: '6.0'
- }
- }
-]
-
-module.exports = function (config) {
- var batch = batches[process.argv[4] || 0]
-
- config.set(Object.assign(base, {
- singleRun: true,
- browsers: Object.keys(batch),
- customLaunchers: batch,
- reporters: process.env.CI
- ? ['dots', 'saucelabs'] // avoid spamming CI output
- : ['progress', 'saucelabs'],
- sauceLabs: {
- testName: 'Vue.js unit tests',
- recordScreenshots: false,
- connectOptions: {
- 'no-ssl-bump-domains': 'all' // Ignore SSL error on Android emulator
- },
- build: process.env.CIRCLE_BUILD_NUM || process.env.SAUCE_BUILD_ID || Date.now()
- },
- // mobile emulators are really slow
- captureTimeout: 300000,
- browserNoActivityTimeout: 300000,
- plugins: base.plugins.concat([
- 'karma-sauce-launcher'
- ])
- }))
-}
+++ /dev/null
-var base = require('./karma.base.config.js')
-
-module.exports = function (config) {
- config.set(Object.assign(base, {
- browsers: ['Chrome', 'Firefox', 'Safari'],
- reporters: ['progress'],
- singleRun: true,
- plugins: base.plugins.concat([
- 'karma-chrome-launcher',
- 'karma-firefox-launcher',
- 'karma-safari-launcher'
- ])
- }))
-}
+++ /dev/null
-import { parse } from 'compiler/parser/index'
-import { optimize } from 'compiler/optimizer'
-import { generate } from 'compiler/codegen'
-import { isObject, extend } from 'shared/util'
-import { isReservedTag } from 'web/util/index'
-import { baseOptions } from 'web/compiler/options'
-
-function assertCodegen (template, generatedCode, ...args) {
- let staticRenderFnCodes = []
- let generateOptions = baseOptions
- let proc = null
- let len = args.length
- while (len--) {
- const arg = args[len]
- if (Array.isArray(arg)) {
- staticRenderFnCodes = arg
- } else if (isObject(arg)) {
- generateOptions = arg
- } else if (typeof arg === 'function') {
- proc = arg
- }
- }
- const ast = parse(template, baseOptions)
- optimize(ast, baseOptions)
- proc && proc(ast)
- const res = generate(ast, generateOptions)
- expect(res.render).toBe(generatedCode)
- expect(res.staticRenderFns).toEqual(staticRenderFnCodes)
-}
-
-/* eslint-disable quotes */
-describe('codegen', () => {
- it('generate directive', () => {
- assertCodegen(
- '<p v-custom1:arg1.modifier="value1" v-custom2></p>',
- `with(this){return _c('p',{directives:[{name:"custom1",rawName:"v-custom1:arg1.modifier",value:(value1),expression:"value1",arg:"arg1",modifiers:{"modifier":true}},{name:"custom2",rawName:"v-custom2"}]})}`
- )
- })
-
- it('generate filters', () => {
- assertCodegen(
- '<div :id="a | b | c">{{ d | e | f }}</div>',
- `with(this){return _c('div',{attrs:{"id":_f("c")(_f("b")(a))}},[_v(_s(_f("f")(_f("e")(d))))])}`
- )
- })
-
- it('generate filters with no arguments', () => {
- assertCodegen(
- '<div>{{ d | e() }}</div>',
- `with(this){return _c('div',[_v(_s(_f("e")(d)))])}`
- )
- })
-
- it('generate v-for directive', () => {
- assertCodegen(
- '<div><li v-for="item in items" :key="item.uid"></li></div>',
- `with(this){return _c('div',_l((items),function(item){return _c('li',{key:item.uid})}))}`
- )
- // iterator syntax
- assertCodegen(
- '<div><li v-for="(item, i) in items"></li></div>',
- `with(this){return _c('div',_l((items),function(item,i){return _c('li')}))}`
- )
- assertCodegen(
- '<div><li v-for="(item, key, index) in items"></li></div>',
- `with(this){return _c('div',_l((items),function(item,key,index){return _c('li')}))}`
- )
- // destructuring
- assertCodegen(
- '<div><li v-for="{ a, b } in items"></li></div>',
- `with(this){return _c('div',_l((items),function({ a, b }){return _c('li')}))}`
- )
- assertCodegen(
- '<div><li v-for="({ a, b }, key, index) in items"></li></div>',
- `with(this){return _c('div',_l((items),function({ a, b },key,index){return _c('li')}))}`
- )
- // v-for with extra element
- assertCodegen(
- '<div><p></p><li v-for="item in items"></li></div>',
- `with(this){return _c('div',[_c('p'),_l((items),function(item){return _c('li')})],2)}`
- )
- })
-
- it('generate v-if directive', () => {
- assertCodegen(
- '<p v-if="show">hello</p>',
- `with(this){return (show)?_c('p',[_v("hello")]):_e()}`
- )
- })
-
- it('generate v-else directive', () => {
- assertCodegen(
- '<div><p v-if="show">hello</p><p v-else>world</p></div>',
- `with(this){return _c('div',[(show)?_c('p',[_v("hello")]):_c('p',[_v("world")])])}`
- )
- })
-
- it('generate v-else-if directive', () => {
- assertCodegen(
- '<div><p v-if="show">hello</p><p v-else-if="hide">world</p></div>',
- `with(this){return _c('div',[(show)?_c('p',[_v("hello")]):(hide)?_c('p',[_v("world")]):_e()])}`
- )
- })
-
- it('generate v-else-if with v-else directive', () => {
- assertCodegen(
- '<div><p v-if="show">hello</p><p v-else-if="hide">world</p><p v-else>bye</p></div>',
- `with(this){return _c('div',[(show)?_c('p',[_v("hello")]):(hide)?_c('p',[_v("world")]):_c('p',[_v("bye")])])}`
- )
- })
-
- it('generate multi v-else-if with v-else directive', () => {
- assertCodegen(
- '<div><p v-if="show">hello</p><p v-else-if="hide">world</p><p v-else-if="3">elseif</p><p v-else>bye</p></div>',
- `with(this){return _c('div',[(show)?_c('p',[_v("hello")]):(hide)?_c('p',[_v("world")]):(3)?_c('p',[_v("elseif")]):_c('p',[_v("bye")])])}`
- )
- })
-
- it('generate ref', () => {
- assertCodegen(
- '<p ref="component1"></p>',
- `with(this){return _c('p',{ref:"component1"})}`
- )
- })
-
- it('generate ref on v-for', () => {
- assertCodegen(
- '<ul><li v-for="item in items" ref="component1"></li></ul>',
- `with(this){return _c('ul',_l((items),function(item){return _c('li',{ref:"component1",refInFor:true})}))}`
- )
- })
-
- it('generate v-bind directive', () => {
- assertCodegen(
- '<p v-bind="test"></p>',
- `with(this){return _c('p',_b({},'p',test,false))}`
- )
- })
-
- it('generate v-bind with prop directive', () => {
- assertCodegen(
- '<p v-bind.prop="test"></p>',
- `with(this){return _c('p',_b({},'p',test,true))}`
- )
- })
-
- it('generate v-bind directive with sync modifier', () => {
- assertCodegen(
- '<p v-bind.sync="test"></p>',
- `with(this){return _c('p',_b({},'p',test,false,true))}`
- )
- })
-
- it('generate template tag', () => {
- assertCodegen(
- '<div><template><p>{{hello}}</p></template></div>',
- `with(this){return _c('div',[[_c('p',[_v(_s(hello))])]],2)}`
- )
- })
-
- it('generate single slot', () => {
- assertCodegen(
- '<div><slot></slot></div>',
- `with(this){return _c('div',[_t("default")],2)}`
- )
- })
-
- it('generate named slot', () => {
- assertCodegen(
- '<div><slot name="one"></slot></div>',
- `with(this){return _c('div',[_t("one")],2)}`
- )
- })
-
- it('generate slot fallback content', () => {
- assertCodegen(
- '<div><slot><div>hi</div></slot></div>',
- `with(this){return _c('div',[_t("default",[_c('div',[_v("hi")])])],2)}`
- )
- })
-
- it('generate slot target', () => {
- assertCodegen(
- '<p slot="one">hello world</p>',
- `with(this){return _c('p',{attrs:{"slot":"one"},slot:"one"},[_v("hello world")])}`
- )
- })
-
- it('generate scoped slot', () => {
- assertCodegen(
- '<foo><template slot-scope="bar">{{ bar }}</template></foo>',
- `with(this){return _c('foo',{scopedSlots:_u([{key:"default",fn:function(bar){return [_v(_s(bar))]}}])})}`
- )
- assertCodegen(
- '<foo><div slot-scope="bar">{{ bar }}</div></foo>',
- `with(this){return _c('foo',{scopedSlots:_u([{key:"default",fn:function(bar){return _c('div',{},[_v(_s(bar))])}}])})}`
- )
- })
-
- it('generate named scoped slot', () => {
- assertCodegen(
- '<foo><template slot="foo" slot-scope="bar">{{ bar }}</template></foo>',
- `with(this){return _c('foo',{scopedSlots:_u([{key:"foo",fn:function(bar){return [_v(_s(bar))]}}])})}`
- )
- assertCodegen(
- '<foo><div slot="foo" slot-scope="bar">{{ bar }}</div></foo>',
- `with(this){return _c('foo',{scopedSlots:_u([{key:"foo",fn:function(bar){return _c('div',{},[_v(_s(bar))])}}])})}`
- )
- })
-
- it('generate class binding', () => {
- // static
- assertCodegen(
- '<p class="class1">hello world</p>',
- `with(this){return _c('p',{staticClass:"class1"},[_v("hello world")])}`,
- )
- // dynamic
- assertCodegen(
- '<p :class="class1">hello world</p>',
- `with(this){return _c('p',{class:class1},[_v("hello world")])}`
- )
- })
-
- it('generate style binding', () => {
- assertCodegen(
- '<p :style="error">hello world</p>',
- `with(this){return _c('p',{style:(error)},[_v("hello world")])}`
- )
- })
-
- it('generate v-show directive', () => {
- assertCodegen(
- '<p v-show="shown">hello world</p>',
- `with(this){return _c('p',{directives:[{name:"show",rawName:"v-show",value:(shown),expression:"shown"}]},[_v("hello world")])}`
- )
- })
-
- it('generate DOM props with v-bind directive', () => {
- // input + value
- assertCodegen(
- '<input :value="msg">',
- `with(this){return _c('input',{domProps:{"value":msg}})}`
- )
- // non input
- assertCodegen(
- '<p :value="msg"/>',
- `with(this){return _c('p',{attrs:{"value":msg}})}`
- )
- })
-
- it('generate attrs with v-bind directive', () => {
- assertCodegen(
- '<input :name="field1">',
- `with(this){return _c('input',{attrs:{"name":field1}})}`
- )
- })
-
- it('generate static attrs', () => {
- assertCodegen(
- '<input name="field1">',
- `with(this){return _c('input',{attrs:{"name":"field1"}})}`
- )
- })
-
- it('generate events with v-on directive', () => {
- assertCodegen(
- '<input @input="onInput">',
- `with(this){return _c('input',{on:{"input":onInput}})}`
- )
- })
-
- it('generate events with method call', () => {
- assertCodegen(
- '<input @input="onInput($event);">',
- `with(this){return _c('input',{on:{"input":function($event){onInput($event);}}})}`
- )
- // empty arguments
- assertCodegen(
- '<input @input="onInput();">',
- `with(this){return _c('input',{on:{"input":function($event){onInput();}}})}`
- )
- // without semicolon
- assertCodegen(
- '<input @input="onInput($event)">',
- `with(this){return _c('input',{on:{"input":function($event){onInput($event)}}})}`
- )
- // multiple args
- assertCodegen(
- '<input @input="onInput($event, \'abc\', 5);">',
- `with(this){return _c('input',{on:{"input":function($event){onInput($event, 'abc', 5);}}})}`
- )
- // expression in args
- assertCodegen(
- '<input @input="onInput($event, 2+2);">',
- `with(this){return _c('input',{on:{"input":function($event){onInput($event, 2+2);}}})}`
- )
- // tricky symbols in args
- assertCodegen(
- '<input @input="onInput(\');[\'());\');">',
- `with(this){return _c('input',{on:{"input":function($event){onInput(');[\'());');}}})}`
- )
- })
-
- it('generate events with multiple statements', () => {
- // normal function
- assertCodegen(
- '<input @input="onInput1();onInput2()">',
- `with(this){return _c('input',{on:{"input":function($event){onInput1();onInput2()}}})}`
- )
- // function with multiple args
- assertCodegen(
- '<input @input="onInput1($event, \'text\');onInput2(\'text2\', $event)">',
- `with(this){return _c('input',{on:{"input":function($event){onInput1($event, 'text');onInput2('text2', $event)}}})}`
- )
- })
-
- it('generate events with keycode', () => {
- assertCodegen(
- '<input @input.enter="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){if(!('button' in $event)&&_k($event.keyCode,"enter",13,$event.key,"Enter"))return null;return onInput($event)}}})}`
- )
- // multiple keycodes (delete)
- assertCodegen(
- '<input @input.delete="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){if(!('button' in $event)&&_k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete"]))return null;return onInput($event)}}})}`
- )
- // multiple keycodes (chained)
- assertCodegen(
- '<input @keydown.enter.delete="onInput">',
- `with(this){return _c('input',{on:{"keydown":function($event){if(!('button' in $event)&&_k($event.keyCode,"enter",13,$event.key,"Enter")&&_k($event.keyCode,"delete",[8,46],$event.key,["Backspace","Delete"]))return null;return onInput($event)}}})}`
- )
- // number keycode
- assertCodegen(
- '<input @input.13="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){if(!('button' in $event)&&$event.keyCode!==13)return null;return onInput($event)}}})}`
- )
- // custom keycode
- assertCodegen(
- '<input @input.custom="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){if(!('button' in $event)&&_k($event.keyCode,"custom",undefined,$event.key,undefined))return null;return onInput($event)}}})}`
- )
- })
-
- it('generate events with generic modifiers', () => {
- assertCodegen(
- '<input @input.stop="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){$event.stopPropagation();return onInput($event)}}})}`
- )
- assertCodegen(
- '<input @input.prevent="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){$event.preventDefault();return onInput($event)}}})}`
- )
- assertCodegen(
- '<input @input.self="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){if($event.target !== $event.currentTarget)return null;return onInput($event)}}})}`
- )
- })
-
- // GitHub Issues #5146
- it('generate events with generic modifiers and keycode correct order', () => {
- assertCodegen(
- '<input @keydown.enter.prevent="onInput">',
- `with(this){return _c('input',{on:{"keydown":function($event){if(!('button' in $event)&&_k($event.keyCode,"enter",13,$event.key,"Enter"))return null;$event.preventDefault();return onInput($event)}}})}`
- )
-
- assertCodegen(
- '<input @keydown.enter.stop="onInput">',
- `with(this){return _c('input',{on:{"keydown":function($event){if(!('button' in $event)&&_k($event.keyCode,"enter",13,$event.key,"Enter"))return null;$event.stopPropagation();return onInput($event)}}})}`
- )
- })
-
- it('generate events with mouse event modifiers', () => {
- assertCodegen(
- '<input @click.ctrl="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if(!$event.ctrlKey)return null;return onClick($event)}}})}`
- )
- assertCodegen(
- '<input @click.shift="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if(!$event.shiftKey)return null;return onClick($event)}}})}`
- )
- assertCodegen(
- '<input @click.alt="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if(!$event.altKey)return null;return onClick($event)}}})}`
- )
- assertCodegen(
- '<input @click.meta="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if(!$event.metaKey)return null;return onClick($event)}}})}`
- )
- assertCodegen(
- '<input @click.exact="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey)return null;return onClick($event)}}})}`
- )
- assertCodegen(
- '<input @click.ctrl.exact="onClick">',
- `with(this){return _c('input',{on:{"click":function($event){if(!$event.ctrlKey)return null;if($event.shiftKey||$event.altKey||$event.metaKey)return null;return onClick($event)}}})}`
- )
- })
-
- it('generate events with multiple modifiers', () => {
- assertCodegen(
- '<input @input.stop.prevent.self="onInput">',
- `with(this){return _c('input',{on:{"input":function($event){$event.stopPropagation();$event.preventDefault();if($event.target !== $event.currentTarget)return null;return onInput($event)}}})}`
- )
- })
-
- it('generate events with capture modifier', () => {
- assertCodegen(
- '<input @input.capture="onInput">',
- `with(this){return _c('input',{on:{"!input":function($event){return onInput($event)}}})}`
- )
- })
-
- it('generate events with once modifier', () => {
- assertCodegen(
- '<input @input.once="onInput">',
- `with(this){return _c('input',{on:{"~input":function($event){return onInput($event)}}})}`
- )
- })
-
- it('generate events with capture and once modifier', () => {
- assertCodegen(
- '<input @input.capture.once="onInput">',
- `with(this){return _c('input',{on:{"~!input":function($event){return onInput($event)}}})}`
- )
- })
-
- it('generate events with once and capture modifier', () => {
- assertCodegen(
- '<input @input.once.capture="onInput">',
- `with(this){return _c('input',{on:{"~!input":function($event){return onInput($event)}}})}`
- )
- })
-
- it('generate events with inline statement', () => {
- assertCodegen(
- '<input @input="current++">',
- `with(this){return _c('input',{on:{"input":function($event){current++}}})}`
- )
- })
-
- it('generate events with inline function expression', () => {
- // normal function
- assertCodegen(
- '<input @input="function () { current++ }">',
- `with(this){return _c('input',{on:{"input":function () { current++ }}})}`
- )
- // arrow with no args
- assertCodegen(
- '<input @input="()=>current++">',
- `with(this){return _c('input',{on:{"input":()=>current++}})}`
- )
- // arrow with parens, single arg
- assertCodegen(
- '<input @input="(e) => current++">',
- `with(this){return _c('input',{on:{"input":(e) => current++}})}`
- )
- // arrow with parens, multi args
- assertCodegen(
- '<input @input="(a, b, c) => current++">',
- `with(this){return _c('input',{on:{"input":(a, b, c) => current++}})}`
- )
- // arrow with destructuring
- assertCodegen(
- '<input @input="({ a, b }) => current++">',
- `with(this){return _c('input',{on:{"input":({ a, b }) => current++}})}`
- )
- // arrow single arg no parens
- assertCodegen(
- '<input @input="e=>current++">',
- `with(this){return _c('input',{on:{"input":e=>current++}})}`
- )
- // with modifiers
- assertCodegen(
- `<input @keyup.enter="e=>current++">`,
- `with(this){return _c('input',{on:{"keyup":function($event){if(!('button' in $event)&&_k($event.keyCode,"enter",13,$event.key,"Enter"))return null;return (e=>current++)($event)}}})}`
- )
- })
-
- // #3893
- it('should not treat handler with unexpected whitespace as inline statement', () => {
- assertCodegen(
- '<input @input=" onInput ">',
- `with(this){return _c('input',{on:{"input":onInput}})}`
- )
- })
-
- it('generate unhandled events', () => {
- assertCodegen(
- '<input @input="current++">',
- `with(this){return _c('input',{on:{"input":function(){}}})}`,
- ast => {
- ast.events.input = undefined
- }
- )
- })
-
- it('generate multiple event handlers', () => {
- assertCodegen(
- '<input @input="current++" @input.stop="onInput">',
- `with(this){return _c('input',{on:{"input":[function($event){current++},function($event){$event.stopPropagation();return onInput($event)}]}})}`
- )
- })
-
- it('generate component', () => {
- assertCodegen(
- '<my-component name="mycomponent1" :msg="msg" @notify="onNotify"><div>hi</div></my-component>',
- `with(this){return _c('my-component',{attrs:{"name":"mycomponent1","msg":msg},on:{"notify":onNotify}},[_c('div',[_v("hi")])])}`
- )
- })
-
- it('generate svg component with children', () => {
- assertCodegen(
- '<svg><my-comp><circle :r="10"></circle></my-comp></svg>',
- `with(this){return _c('svg',[_c('my-comp',[_c('circle',{attrs:{"r":10}})])],1)}`
- )
- })
-
- it('generate is attribute', () => {
- assertCodegen(
- '<div is="component1"></div>',
- `with(this){return _c("component1",{tag:"div"})}`
- )
- assertCodegen(
- '<div :is="component1"></div>',
- `with(this){return _c(component1,{tag:"div"})}`
- )
- })
-
- it('generate component with inline-template', () => {
- // have "inline-template'"
- assertCodegen(
- '<my-component inline-template><p><span>hello world</span></p></my-component>',
- `with(this){return _c('my-component',{inlineTemplate:{render:function(){with(this){return _m(0)}},staticRenderFns:[function(){with(this){return _c('p',[_c('span',[_v("hello world")])])}}]}})}`
- )
- // "have inline-template attrs, but not having exactly one child element
- assertCodegen(
- '<my-component inline-template><hr><hr></my-component>',
- `with(this){return _c('my-component',{inlineTemplate:{render:function(){with(this){return _c('hr')}},staticRenderFns:[]}})}`
- )
- try {
- assertCodegen(
- '<my-component inline-template></my-component>',
- ''
- )
- } catch (e) {}
- expect('Inline-template components must have exactly one child element.').toHaveBeenWarned()
- expect(console.error.calls.count()).toBe(2)
- })
-
- it('generate static trees inside v-for', () => {
- assertCodegen(
- `<div><div v-for="i in 10"><p><span></span></p></div></div>`,
- `with(this){return _c('div',_l((10),function(i){return _c('div',[_m(0,true)])}))}`,
- [`with(this){return _c('p',[_c('span')])}`]
- )
- })
-
- it('generate component with v-for', () => {
- // normalize type: 2
- assertCodegen(
- '<div><child></child><template v-for="item in list">{{ item }}</template></div>',
- `with(this){return _c('div',[_c('child'),_l((list),function(item){return [_v(_s(item))]})],2)}`
- )
- })
-
- it('generate component with comment', () => {
- const options = extend({
- comments: true
- }, baseOptions)
- const template = '<div><!--comment--></div>'
- const generatedCode = `with(this){return _c('div',[_e("comment")])}`
-
- const ast = parse(template, options)
- optimize(ast, options)
- const res = generate(ast, options)
- expect(res.render).toBe(generatedCode)
- })
-
- // #6150
- it('generate comments with special characters', () => {
- const options = extend({
- comments: true
- }, baseOptions)
- const template = '<div><!--\n\'comment\'\n--></div>'
- const generatedCode = `with(this){return _c('div',[_e("\\n'comment'\\n")])}`
-
- const ast = parse(template, options)
- optimize(ast, options)
- const res = generate(ast, options)
- expect(res.render).toBe(generatedCode)
- })
-
- it('not specified ast type', () => {
- const res = generate(null, baseOptions)
- expect(res.render).toBe(`with(this){return _c("div")}`)
- expect(res.staticRenderFns).toEqual([])
- })
-
- it('not specified directives option', () => {
- assertCodegen(
- '<p v-if="show">hello world</p>',
- `with(this){return (show)?_c('p',[_v("hello world")]):_e()}`,
- { isReservedTag }
- )
- })
-})
-/* eslint-enable quotes */
+++ /dev/null
-import Vue from 'vue'
-import { compile } from 'web/compiler'
-import { getAndRemoveAttr } from 'compiler/helpers'
-
-describe('compile options', () => {
- it('should be compiled', () => {
- const { render, staticRenderFns, errors } = compile(`
- <div>
- <input type="text" v-model="msg" required max="8" v-validate:field1.group1.group2>
- </div>
- `, {
- directives: {
- validate (el, dir) {
- if (dir.name === 'validate' && dir.arg) {
- el.validate = {
- field: dir.arg,
- groups: dir.modifiers ? Object.keys(dir.modifiers) : []
- }
- }
- }
- },
- modules: [
- {
- transformNode (el) {
- el.validators = el.validators || []
- const validators = ['required', 'min', 'max', 'pattern', 'maxlength', 'minlength']
- validators.forEach(name => {
- const rule = getAndRemoveAttr(el, name)
- if (rule !== undefined) {
- el.validators.push({ name, rule })
- }
- })
- },
- genData (el) {
- let data = ''
- if (el.validate) {
- data += `validate:${JSON.stringify(el.validate)},`
- }
- if (el.validators) {
- data += `validators:${JSON.stringify(el.validators)},`
- }
- return data
- },
- transformCode (el, code) {
- // check
- if (!el.validate || !el.validators) {
- return code
- }
- // setup validation result props
- const result = { dirty: false } // define something other prop
- el.validators.forEach(validator => {
- result[validator.name] = null
- })
- // generate code
- return `_c('validate',{props:{
- field:${JSON.stringify(el.validate.field)},
- groups:${JSON.stringify(el.validate.groups)},
- validators:${JSON.stringify(el.validators)},
- result:${JSON.stringify(result)},
- child:${code}}
- })`
- }
- }
- ]
- })
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
-
- const renderFn = new Function(render)
- const vm = new Vue({
- data: {
- msg: 'hello'
- },
- components: {
- validate: {
- props: ['field', 'groups', 'validators', 'result', 'child'],
- render (h) {
- return this.child
- },
- computed: {
- valid () {
- let ret = true
- for (let i = 0; i > this.validators.length; i++) {
- const { name } = this.validators[i]
- if (!this.result[name]) {
- ret = false
- break
- }
- }
- return ret
- }
- },
- mounted () {
- // initialize validation
- const value = this.$el.value
- this.validators.forEach(validator => {
- const ret = this[validator.name](value, validator.rule)
- this.result[validator.name] = ret
- })
- },
- methods: {
- // something validators logic
- required (val) {
- return val.length > 0
- },
- max (val, rule) {
- return !(parseInt(val, 10) > parseInt(rule, 10))
- }
- }
- }
- },
- render: renderFn,
- staticRenderFns
- }).$mount()
- expect(vm.$el.innerHTML).toBe('<input type="text">')
- expect(vm.$children[0].valid).toBe(true)
- })
-
- it('should collect errors', () => {
- let compiled = compile('hello')
- expect(compiled.errors.length).toBe(1)
- expect(compiled.errors[0]).toContain('root element')
-
- compiled = compile('<div v-if="a----">{{ b++++ }}</div>')
- expect(compiled.errors.length).toBe(2)
- expect(compiled.errors[0]).toContain('Raw expression: v-if="a----"')
- expect(compiled.errors[1]).toContain('Raw expression: {{ b++++ }}')
- })
-})
+++ /dev/null
-import { parse } from 'compiler/parser/index'
-import { extend } from 'shared/util'
-import { optimize } from 'compiler/optimizer'
-import { baseOptions } from 'web/compiler/options'
-
-describe('optimizer', () => {
- it('simple', () => {
- const ast = parse('<h1 id="section1"><span>hello world</span></h1>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(true) // h1
- expect(ast.staticRoot).toBe(true)
- expect(ast.children[0].static).toBe(true) // span
- })
-
- it('simple with comment', () => {
- const options = extend({
- comments: true
- }, baseOptions)
- const ast = parse('<h1 id="section1"><span>hello world</span><!--comment--></h1>', options)
- optimize(ast, options)
- expect(ast.static).toBe(true) // h1
- expect(ast.staticRoot).toBe(true)
- expect(ast.children.length).toBe(2)
- expect(ast.children[0].static).toBe(true) // span
- expect(ast.children[1].static).toBe(true) // comment
- })
-
- it('skip simple nodes', () => {
- const ast = parse('<h1 id="section1">hello</h1>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(true)
- expect(ast.staticRoot).toBe(false) // this is too simple to warrant a static tree
- })
-
- it('interpolation', () => {
- const ast = parse('<h1>{{msg}}</h1>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false) // h1
- expect(ast.children[0].static).toBe(false) // text node with interpolation
- })
-
- it('nested elements', () => {
- const ast = parse('<ul><li>hello</li><li>world</li></ul>', baseOptions)
- optimize(ast, baseOptions)
- // ul
- expect(ast.static).toBe(true)
- expect(ast.staticRoot).toBe(true)
- // li
- expect(ast.children[0].static).toBe(true) // first
- expect(ast.children[1].static).toBe(true) // second
- // text node inside li
- expect(ast.children[0].children[0].static).toBe(true) // first
- expect(ast.children[1].children[0].static).toBe(true) // second
- })
-
- it('nested complex elements', () => {
- const ast = parse('<ul><li>{{msg1}}</li><li>---</li><li>{{msg2}}</li></ul>', baseOptions)
- optimize(ast, baseOptions)
- // ul
- expect(ast.static).toBe(false) // ul
- // li
- expect(ast.children[0].static).toBe(false) // first
- expect(ast.children[1].static).toBe(true) // second
- expect(ast.children[2].static).toBe(false) // third
- // text node inside li
- expect(ast.children[0].children[0].static).toBe(false) // first
- expect(ast.children[1].children[0].static).toBe(true) // second
- expect(ast.children[2].children[0].static).toBe(false) // third
- })
-
- it('v-if directive', () => {
- const ast = parse('<div id="section1" v-if="show"><p><span>hello world</span></p></div>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(true)
- })
-
- it('v-else directive', () => {
- const ast = parse('<div><p v-if="show">hello world</p><div v-else><p><span>foo bar</span></p></div></div>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(false)
- expect(ast.children[0].ifConditions[0].block.static).toBe(false)
- expect(ast.children[0].ifConditions[1].block.static).toBe(false)
- expect(ast.children[0].ifConditions[0].block.children[0].static).toBe(true)
- expect(ast.children[0].ifConditions[1].block.children[0].static).toBe(true)
- })
-
- it('v-pre directive', () => {
- const ast = parse('<ul v-pre><li>{{msg}}</li><li>world</li></ul>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(true)
- expect(ast.staticRoot).toBe(true)
- expect(ast.children[0].static).toBe(true)
- expect(ast.children[1].static).toBe(true)
- expect(ast.children[0].children[0].static).toBe(true)
- expect(ast.children[1].children[0].static).toBe(true)
- })
-
- it('v-for directive', () => {
- const ast = parse('<ul><li v-for="item in items">hello world {{$index}}</li></ul>', baseOptions)
- optimize(ast, baseOptions)
- // ul
- expect(ast.static).toBe(false)
- // li with v-for
- expect(ast.children[0].static).toBe(false)
- expect(ast.children[0].children[0].static).toBe(false)
- })
-
- it('v-once directive', () => {
- const ast = parse('<p v-once>{{msg}}</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false) // p
- expect(ast.children[0].static).toBe(false) // text node
- })
-
- it('single slot', () => {
- const ast = parse('<div><slot>hello</slot></div>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.children[0].static).toBe(false) // slot
- expect(ast.children[0].children[0].static).toBe(true) // text node
- })
-
- it('named slot', () => {
- const ast = parse('<div><slot name="one">hello world</slot></div>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.children[0].static).toBe(false) // slot
- expect(ast.children[0].children[0].static).toBe(true) // text node
- })
-
- it('slot target', () => {
- const ast = parse('<p slot="one">hello world</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false) // slot
- expect(ast.children[0].static).toBe(true) // text node
- })
-
- it('component', () => {
- const ast = parse('<my-component></my-component>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false) // component
- })
-
- it('component for inline-template', () => {
- const ast = parse('<my-component inline-template><p>hello world</p><p>{{msg}}</p></my-component>', baseOptions)
- optimize(ast, baseOptions)
- // component
- expect(ast.static).toBe(false) // component
- // p
- expect(ast.children[0].static).toBe(true) // first
- expect(ast.children[1].static).toBe(false) // second
- // text node inside p
- expect(ast.children[0].children[0].static).toBe(true) // first
- expect(ast.children[1].children[0].static).toBe(false) // second
- })
-
- it('class binding', () => {
- const ast = parse('<p :class="class1">hello world</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(true)
- })
-
- it('style binding', () => {
- const ast = parse('<p :style="error">{{msg}}</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(false)
- })
-
- it('key', () => {
- const ast = parse('<p key="foo">hello world</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(true)
- })
-
- it('ref', () => {
- const ast = parse('<p ref="foo">hello world</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(true)
- })
-
- it('transition', () => {
- const ast = parse('<p v-if="show" transition="expand">hello world</p>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(true)
- })
-
- it('v-bind directive', () => {
- const ast = parse('<input type="text" name="field1" :value="msg">', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- })
-
- it('v-on directive', () => {
- const ast = parse('<input type="text" name="field1" :value="msg" @input="onInput">', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- })
-
- it('custom directive', () => {
- const ast = parse('<form><input type="text" name="field1" :value="msg" v-validate:field1="required"></form>', baseOptions)
- optimize(ast, baseOptions)
- expect(ast.static).toBe(false)
- expect(ast.children[0].static).toBe(false)
- })
-
- it('not root ast', () => {
- const ast = null
- optimize(ast, baseOptions)
- expect(ast).toBe(null)
- })
-
- it('not specified isReservedTag option', () => {
- const ast = parse('<h1 id="section1">hello world</h1>', baseOptions)
- optimize(ast, {})
- expect(ast.static).toBe(false)
- })
-
- it('mark static trees inside v-for', () => {
- const ast = parse(`<div><div v-for="i in 10"><p><span>hi</span></p></div></div>`, baseOptions)
- optimize(ast, baseOptions)
- expect(ast.children[0].children[0].staticRoot).toBe(true)
- expect(ast.children[0].children[0].staticInFor).toBe(true)
- })
-
- it('mark static trees inside v-for with nested v-else and v-once', () => {
- const ast = parse(`
- <div v-if="1"></div>
- <div v-else-if="2">
- <div v-for="i in 10" :key="i">
- <div v-if="1">{{ i }}</div>
- <div v-else-if="2" v-once>{{ i }}</div>
- <div v-else v-once>{{ i }}</div>
- </div>
- </div>
- <div v-else>
- <div v-for="i in 10" :key="i">
- <div v-if="1">{{ i }}</div>
- <div v-else v-once>{{ i }}</div>
- </div>
- </div>
- `, baseOptions)
- optimize(ast, baseOptions)
- expect(ast.ifConditions[1].block.children[0].children[0].ifConditions[1].block.staticRoot).toBe(false)
- expect(ast.ifConditions[1].block.children[0].children[0].ifConditions[1].block.staticInFor).toBe(true)
-
- expect(ast.ifConditions[1].block.children[0].children[0].ifConditions[2].block.staticRoot).toBe(false)
- expect(ast.ifConditions[1].block.children[0].children[0].ifConditions[2].block.staticInFor).toBe(true)
-
- expect(ast.ifConditions[2].block.children[0].children[0].ifConditions[1].block.staticRoot).toBe(false)
- expect(ast.ifConditions[2].block.children[0].children[0].ifConditions[1].block.staticInFor).toBe(true)
- })
-})
+++ /dev/null
-import { parse } from 'compiler/parser/index'
-import { extend } from 'shared/util'
-import { baseOptions } from 'web/compiler/options'
-import { isIE, isEdge } from 'core/util/env'
-
-describe('parser', () => {
- it('simple element', () => {
- const ast = parse('<h1>hello world</h1>', baseOptions)
- expect(ast.tag).toBe('h1')
- expect(ast.plain).toBe(true)
- expect(ast.children[0].text).toBe('hello world')
- })
-
- it('interpolation in element', () => {
- const ast = parse('<h1>{{msg}}</h1>', baseOptions)
- expect(ast.tag).toBe('h1')
- expect(ast.plain).toBe(true)
- expect(ast.children[0].expression).toBe('_s(msg)')
- })
-
- it('child elements', () => {
- const ast = parse('<ul><li>hello world</li></ul>', baseOptions)
- expect(ast.tag).toBe('ul')
- expect(ast.plain).toBe(true)
- expect(ast.children[0].tag).toBe('li')
- expect(ast.children[0].plain).toBe(true)
- expect(ast.children[0].children[0].text).toBe('hello world')
- expect(ast.children[0].parent).toBe(ast)
- })
-
- it('unary element', () => {
- const ast = parse('<hr>', baseOptions)
- expect(ast.tag).toBe('hr')
- expect(ast.plain).toBe(true)
- expect(ast.children.length).toBe(0)
- })
-
- it('svg element', () => {
- const ast = parse('<svg><text>hello world</text></svg>', baseOptions)
- expect(ast.tag).toBe('svg')
- expect(ast.ns).toBe('svg')
- expect(ast.plain).toBe(true)
- expect(ast.children[0].tag).toBe('text')
- expect(ast.children[0].children[0].text).toBe('hello world')
- expect(ast.children[0].parent).toBe(ast)
- })
-
- it('camelCase element', () => {
- const ast = parse('<MyComponent><p>hello world</p></MyComponent>', baseOptions)
- expect(ast.tag).toBe('MyComponent')
- expect(ast.plain).toBe(true)
- expect(ast.children[0].tag).toBe('p')
- expect(ast.children[0].plain).toBe(true)
- expect(ast.children[0].children[0].text).toBe('hello world')
- expect(ast.children[0].parent).toBe(ast)
- })
-
- it('forbidden element', () => {
- // style
- const styleAst = parse('<style>error { color: red; }</style>', baseOptions)
- expect(styleAst.tag).toBe('style')
- expect(styleAst.plain).toBe(true)
- expect(styleAst.forbidden).toBe(true)
- expect(styleAst.children[0].text).toBe('error { color: red; }')
- expect('Templates should only be responsible for mapping the state').toHaveBeenWarned()
- // script
- const scriptAst = parse('<script type="text/javascript">alert("hello world!")</script>', baseOptions)
- expect(scriptAst.tag).toBe('script')
- expect(scriptAst.plain).toBe(false)
- expect(scriptAst.forbidden).toBe(true)
- expect(scriptAst.children[0].text).toBe('alert("hello world!")')
- expect('Templates should only be responsible for mapping the state').toHaveBeenWarned()
- })
-
- it('not contain root element', () => {
- parse('hello world', baseOptions)
- expect('Component template requires a root element, rather than just text').toHaveBeenWarned()
- })
-
- it('warn text before root element', () => {
- parse('before root {{ interpolation }}<div></div>', baseOptions)
- expect('text "before root {{ interpolation }}" outside root element will be ignored.').toHaveBeenWarned()
- })
-
- it('warn text after root element', () => {
- parse('<div></div>after root {{ interpolation }}', baseOptions)
- expect('text "after root {{ interpolation }}" outside root element will be ignored.').toHaveBeenWarned()
- })
-
- it('warn multiple root elements', () => {
- parse('<div></div><div></div>', baseOptions)
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('remove duplicate whitespace text nodes caused by comments', () => {
- const ast = parse(`<div><a></a> <!----> <a></a></div>`, baseOptions)
- expect(ast.children.length).toBe(3)
- expect(ast.children[0].tag).toBe('a')
- expect(ast.children[1].text).toBe(' ')
- expect(ast.children[2].tag).toBe('a')
- })
-
- it('remove text nodes between v-if conditions', () => {
- const ast = parse(`<div><div v-if="1"></div> <div v-else-if="2"></div> <div v-else></div> <span></span></div>`, baseOptions)
- expect(ast.children.length).toBe(3)
- expect(ast.children[0].tag).toBe('div')
- expect(ast.children[0].ifConditions.length).toBe(3)
- expect(ast.children[1].text).toBe(' ') // text
- expect(ast.children[2].tag).toBe('span')
- })
-
- it('warn non whitespace text between v-if conditions', () => {
- parse(`<div><div v-if="1"></div> foo <div v-else></div></div>`, baseOptions)
- expect(`text "foo" between v-if and v-else(-if) will be ignored`).toHaveBeenWarned()
- })
-
- it('not warn 2 root elements with v-if and v-else', () => {
- parse('<div v-if="1"></div><div v-else></div>', baseOptions)
- expect('Component template should contain exactly one root element')
- .not.toHaveBeenWarned()
- })
-
- it('not warn 3 root elements with v-if, v-else-if and v-else', () => {
- parse('<div v-if="1"></div><div v-else-if="2"></div><div v-else></div>', baseOptions)
- expect('Component template should contain exactly one root element')
- .not.toHaveBeenWarned()
- })
-
- it('not warn 2 root elements with v-if and v-else on separate lines', () => {
- parse(`
- <div v-if="1"></div>
- <div v-else></div>
- `, baseOptions)
- expect('Component template should contain exactly one root element')
- .not.toHaveBeenWarned()
- })
-
- it('not warn 3 or more root elements with v-if, v-else-if and v-else on separate lines', () => {
- parse(`
- <div v-if="1"></div>
- <div v-else-if="2"></div>
- <div v-else></div>
- `, baseOptions)
- expect('Component template should contain exactly one root element')
- .not.toHaveBeenWarned()
-
- parse(`
- <div v-if="1"></div>
- <div v-else-if="2"></div>
- <div v-else-if="3"></div>
- <div v-else-if="4"></div>
- <div v-else></div>
- `, baseOptions)
- expect('Component template should contain exactly one root element')
- .not.toHaveBeenWarned()
- })
-
- it('generate correct ast for 2 root elements with v-if and v-else on separate lines', () => {
- const ast = parse(`
- <div v-if="1"></div>
- <p v-else></p>
- `, baseOptions)
- expect(ast.tag).toBe('div')
- expect(ast.ifConditions[1].block.tag).toBe('p')
- })
-
- it('generate correct ast for 3 or more root elements with v-if and v-else on separate lines', () => {
- const ast = parse(`
- <div v-if="1"></div>
- <span v-else-if="2"></span>
- <p v-else></p>
- `, baseOptions)
- expect(ast.tag).toBe('div')
- expect(ast.ifConditions[0].block.tag).toBe('div')
- expect(ast.ifConditions[1].block.tag).toBe('span')
- expect(ast.ifConditions[2].block.tag).toBe('p')
-
- const astMore = parse(`
- <div v-if="1"></div>
- <span v-else-if="2"></span>
- <div v-else-if="3"></div>
- <span v-else-if="4"></span>
- <p v-else></p>
- `, baseOptions)
- expect(astMore.tag).toBe('div')
- expect(astMore.ifConditions[0].block.tag).toBe('div')
- expect(astMore.ifConditions[1].block.tag).toBe('span')
- expect(astMore.ifConditions[2].block.tag).toBe('div')
- expect(astMore.ifConditions[3].block.tag).toBe('span')
- expect(astMore.ifConditions[4].block.tag).toBe('p')
- })
-
- it('warn 2 root elements with v-if', () => {
- parse('<div v-if="1"></div><div v-if="2"></div>', baseOptions)
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('warn 3 root elements with v-if and v-else on first 2', () => {
- parse('<div v-if="1"></div><div v-else></div><div></div>', baseOptions)
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('warn 3 root elements with v-if and v-else-if on first 2', () => {
- parse('<div v-if="1"></div><div v-else-if></div><div></div>', baseOptions)
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('warn 4 root elements with v-if, v-else-if and v-else on first 2', () => {
- parse('<div v-if="1"></div><div v-else-if></div><div v-else></div><div></div>', baseOptions)
- expect('Component template should contain exactly one root element').toHaveBeenWarned()
- })
-
- it('warn 2 root elements with v-if and v-else with v-for on 2nd', () => {
- parse('<div v-if="1"></div><div v-else v-for="i in [1]"></div>', baseOptions)
- expect('Cannot use v-for on stateful component root element because it renders multiple elements')
- .toHaveBeenWarned()
- })
-
- it('warn 2 root elements with v-if and v-else-if with v-for on 2nd', () => {
- parse('<div v-if="1"></div><div v-else-if="2" v-for="i in [1]"></div>', baseOptions)
- expect('Cannot use v-for on stateful component root element because it renders multiple elements')
- .toHaveBeenWarned()
- })
-
- it('warn <template> as root element', () => {
- parse('<template></template>', baseOptions)
- expect('Cannot use <template> as component root element').toHaveBeenWarned()
- })
-
- it('warn <slot> as root element', () => {
- parse('<slot></slot>', baseOptions)
- expect('Cannot use <slot> as component root element').toHaveBeenWarned()
- })
-
- it('warn v-for on root element', () => {
- parse('<div v-for="item in items"></div>', baseOptions)
- expect('Cannot use v-for on stateful component root element').toHaveBeenWarned()
- })
-
- it('warn <template> key', () => {
- parse('<div><template v-for="i in 10" :key="i"></template></div>', baseOptions)
- expect('<template> cannot be keyed').toHaveBeenWarned()
- })
-
- it('v-pre directive', () => {
- const ast = parse('<div v-pre id="message1"><p>{{msg}}</p></div>', baseOptions)
- expect(ast.pre).toBe(true)
- expect(ast.attrs[0].name).toBe('id')
- expect(ast.attrs[0].value).toBe('"message1"')
- expect(ast.children[0].children[0].text).toBe('{{msg}}')
- })
-
- it('v-for directive basic syntax', () => {
- const ast = parse('<ul><li v-for="item in items"></li></ul>', baseOptions)
- const liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('item')
- })
-
- it('v-for directive iteration syntax', () => {
- const ast = parse('<ul><li v-for="(item, index) in items"></li></ul>', baseOptions)
- const liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('item')
- expect(liAst.iterator1).toBe('index')
- expect(liAst.iterator2).toBeUndefined()
- })
-
- it('v-for directive iteration syntax (multiple)', () => {
- const ast = parse('<ul><li v-for="(item, key, index) in items"></li></ul>', baseOptions)
- const liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('item')
- expect(liAst.iterator1).toBe('key')
- expect(liAst.iterator2).toBe('index')
- })
-
- it('v-for directive key', () => {
- const ast = parse('<ul><li v-for="item in items" :key="item.uid"></li></ul>', baseOptions)
- const liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('item')
- expect(liAst.key).toBe('item.uid')
- })
-
- it('v-for directive destructuring', () => {
- let ast = parse('<ul><li v-for="{ foo } in items"></li></ul>', baseOptions)
- let liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo }')
-
- // with paren
- ast = parse('<ul><li v-for="({ foo }) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo }')
-
- // multi-var destructuring
- ast = parse('<ul><li v-for="{ foo, bar, baz } in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo, bar, baz }')
-
- // multi-var destructuring with paren
- ast = parse('<ul><li v-for="({ foo, bar, baz }) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo, bar, baz }')
-
- // with index
- ast = parse('<ul><li v-for="({ foo }, i) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo }')
- expect(liAst.iterator1).toBe('i')
-
- // with key + index
- ast = parse('<ul><li v-for="({ foo }, i, j) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo }')
- expect(liAst.iterator1).toBe('i')
- expect(liAst.iterator2).toBe('j')
-
- // multi-var destructuring with index
- ast = parse('<ul><li v-for="({ foo, bar, baz }, i) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo, bar, baz }')
- expect(liAst.iterator1).toBe('i')
-
- // array
- ast = parse('<ul><li v-for="[ foo ] in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo ]')
-
- // multi-array
- ast = parse('<ul><li v-for="[ foo, bar, baz ] in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo, bar, baz ]')
-
- // array with paren
- ast = parse('<ul><li v-for="([ foo ]) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo ]')
-
- // multi-array with paren
- ast = parse('<ul><li v-for="([ foo, bar, baz ]) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo, bar, baz ]')
-
- // array with index
- ast = parse('<ul><li v-for="([ foo ], i) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo ]')
- expect(liAst.iterator1).toBe('i')
-
- // array with key + index
- ast = parse('<ul><li v-for="([ foo ], i, j) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo ]')
- expect(liAst.iterator1).toBe('i')
- expect(liAst.iterator2).toBe('j')
-
- // multi-array with paren
- ast = parse('<ul><li v-for="([ foo, bar, baz ]) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo, bar, baz ]')
-
- // multi-array with index
- ast = parse('<ul><li v-for="([ foo, bar, baz ], i) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo, bar, baz ]')
- expect(liAst.iterator1).toBe('i')
-
- // nested
- ast = parse('<ul><li v-for="({ foo, bar: { baz }, qux: [ n ] }, i, j) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('{ foo, bar: { baz }, qux: [ n ] }')
- expect(liAst.iterator1).toBe('i')
- expect(liAst.iterator2).toBe('j')
-
- // array nested
- ast = parse('<ul><li v-for="([ foo, { bar }, baz ], i, j) in items"></li></ul>', baseOptions)
- liAst = ast.children[0]
- expect(liAst.for).toBe('items')
- expect(liAst.alias).toBe('[ foo, { bar }, baz ]')
- expect(liAst.iterator1).toBe('i')
- expect(liAst.iterator2).toBe('j')
- })
-
- it('v-for directive invalid syntax', () => {
- parse('<ul><li v-for="item into items"></li></ul>', baseOptions)
- expect('Invalid v-for expression').toHaveBeenWarned()
- })
-
- it('v-if directive syntax', () => {
- const ast = parse('<p v-if="show">hello world</p>', baseOptions)
- expect(ast.if).toBe('show')
- expect(ast.ifConditions[0].exp).toBe('show')
- })
-
- it('v-else-if directive syntax', () => {
- const ast = parse('<div><p v-if="show">hello</p><span v-else-if="2">elseif</span><p v-else>world</p></div>', baseOptions)
- const ifAst = ast.children[0]
- const conditionsAst = ifAst.ifConditions
- expect(conditionsAst.length).toBe(3)
- expect(conditionsAst[1].block.children[0].text).toBe('elseif')
- expect(conditionsAst[1].block.parent).toBe(ast)
- expect(conditionsAst[2].block.children[0].text).toBe('world')
- expect(conditionsAst[2].block.parent).toBe(ast)
- })
-
- it('v-else directive syntax', () => {
- const ast = parse('<div><p v-if="show">hello</p><p v-else>world</p></div>', baseOptions)
- const ifAst = ast.children[0]
- const conditionsAst = ifAst.ifConditions
- expect(conditionsAst.length).toBe(2)
- expect(conditionsAst[1].block.children[0].text).toBe('world')
- expect(conditionsAst[1].block.parent).toBe(ast)
- })
-
- it('v-else-if directive invalid syntax', () => {
- parse('<div><p v-else-if="1">world</p></div>', baseOptions)
- expect('v-else-if="1" used on element').toHaveBeenWarned()
- })
-
- it('v-else directive invalid syntax', () => {
- parse('<div><p v-else>world</p></div>', baseOptions)
- expect('v-else used on element').toHaveBeenWarned()
- })
-
- it('v-once directive syntax', () => {
- const ast = parse('<p v-once>world</p>', baseOptions)
- expect(ast.once).toBe(true)
- })
-
- it('slot tag single syntax', () => {
- const ast = parse('<div><slot></slot></div>', baseOptions)
- expect(ast.children[0].tag).toBe('slot')
- expect(ast.children[0].slotName).toBeUndefined()
- })
-
- it('slot tag named syntax', () => {
- const ast = parse('<div><slot name="one">hello world</slot></div>', baseOptions)
- expect(ast.children[0].tag).toBe('slot')
- expect(ast.children[0].slotName).toBe('"one"')
- })
-
- it('slot target', () => {
- const ast = parse('<p slot="one">hello world</p>', baseOptions)
- expect(ast.slotTarget).toBe('"one"')
- })
-
- it('component properties', () => {
- const ast = parse('<my-component :msg="hello"></my-component>', baseOptions)
- expect(ast.attrs[0].name).toBe('msg')
- expect(ast.attrs[0].value).toBe('hello')
- })
-
- it('component "is" attribute', () => {
- const ast = parse('<my-component is="component1"></my-component>', baseOptions)
- expect(ast.component).toBe('"component1"')
- })
-
- it('component "inline-template" attribute', () => {
- const ast = parse('<my-component inline-template>hello world</my-component>', baseOptions)
- expect(ast.inlineTemplate).toBe(true)
- })
-
- it('class binding', () => {
- // static
- const ast1 = parse('<p class="class1">hello world</p>', baseOptions)
- expect(ast1.staticClass).toBe('"class1"')
- // dynamic
- const ast2 = parse('<p :class="class1">hello world</p>', baseOptions)
- expect(ast2.classBinding).toBe('class1')
- // interpolation warning
- parse('<p class="{{error}}">hello world</p>', baseOptions)
- expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
- })
-
- it('style binding', () => {
- const ast = parse('<p :style="error">hello world</p>', baseOptions)
- expect(ast.styleBinding).toBe('error')
- })
-
- it('attribute with v-bind', () => {
- const ast = parse('<input type="text" name="field1" :value="msg">', baseOptions)
- expect(ast.attrsList[0].name).toBe('type')
- expect(ast.attrsList[0].value).toBe('text')
- expect(ast.attrsList[1].name).toBe('name')
- expect(ast.attrsList[1].value).toBe('field1')
- expect(ast.attrsMap['type']).toBe('text')
- expect(ast.attrsMap['name']).toBe('field1')
- expect(ast.attrs[0].name).toBe('type')
- expect(ast.attrs[0].value).toBe('"text"')
- expect(ast.attrs[1].name).toBe('name')
- expect(ast.attrs[1].value).toBe('"field1"')
- expect(ast.props[0].name).toBe('value')
- expect(ast.props[0].value).toBe('msg')
- })
-
- // #6887
- it('special case static attribute that must be props', () => {
- const ast = parse('<video muted></video>', baseOptions)
- expect(ast.attrs[0].name).toBe('muted')
- expect(ast.attrs[0].value).toBe('""')
- expect(ast.props[0].name).toBe('muted')
- expect(ast.props[0].value).toBe('true')
- })
-
- it('attribute with v-on', () => {
- const ast = parse('<input type="text" name="field1" :value="msg" @input="onInput">', baseOptions)
- expect(ast.events.input.value).toBe('onInput')
- })
-
- it('attribute with directive', () => {
- const ast = parse('<input type="text" name="field1" :value="msg" v-validate:field1="required">', baseOptions)
- expect(ast.directives[0].name).toBe('validate')
- expect(ast.directives[0].value).toBe('required')
- expect(ast.directives[0].arg).toBe('field1')
- })
-
- it('attribute with modifiered directive', () => {
- const ast = parse('<input type="text" name="field1" :value="msg" v-validate.on.off>', baseOptions)
- expect(ast.directives[0].modifiers.on).toBe(true)
- expect(ast.directives[0].modifiers.off).toBe(true)
- })
-
- it('literal attribute', () => {
- // basic
- const ast1 = parse('<input type="text" name="field1" value="hello world">', baseOptions)
- expect(ast1.attrsList[0].name).toBe('type')
- expect(ast1.attrsList[0].value).toBe('text')
- expect(ast1.attrsList[1].name).toBe('name')
- expect(ast1.attrsList[1].value).toBe('field1')
- expect(ast1.attrsList[2].name).toBe('value')
- expect(ast1.attrsList[2].value).toBe('hello world')
- expect(ast1.attrsMap['type']).toBe('text')
- expect(ast1.attrsMap['name']).toBe('field1')
- expect(ast1.attrsMap['value']).toBe('hello world')
- expect(ast1.attrs[0].name).toBe('type')
- expect(ast1.attrs[0].value).toBe('"text"')
- expect(ast1.attrs[1].name).toBe('name')
- expect(ast1.attrs[1].value).toBe('"field1"')
- expect(ast1.attrs[2].name).toBe('value')
- expect(ast1.attrs[2].value).toBe('"hello world"')
- // interpolation warning
- parse('<input type="text" name="field1" value="{{msg}}">', baseOptions)
- expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
- })
-
- if (!isIE && !isEdge) {
- it('duplicate attribute', () => {
- parse('<p class="class1" class="class1">hello world</p>', baseOptions)
- expect('duplicate attribute').toHaveBeenWarned()
- })
- }
-
- it('custom delimiter', () => {
- const ast = parse('<p>{msg}</p>', extend({ delimiters: ['{', '}'] }, baseOptions))
- expect(ast.children[0].expression).toBe('_s(msg)')
- })
-
- it('not specified getTagNamespace option', () => {
- const options = extend({}, baseOptions)
- delete options.getTagNamespace
- const ast = parse('<svg><text>hello world</text></svg>', options)
- expect(ast.tag).toBe('svg')
- expect(ast.ns).toBeUndefined()
- })
-
- it('not specified mustUseProp', () => {
- const options = extend({}, baseOptions)
- delete options.mustUseProp
- const ast = parse('<input type="text" name="field1" :value="msg">', options)
- expect(ast.props).toBeUndefined()
- })
-
- it('use prop when prop modifier was explicitly declared', () => {
- const ast = parse('<component is="textarea" :value.prop="val" />', baseOptions)
- expect(ast.attrs).toBeUndefined()
- expect(ast.props.length).toBe(1)
- expect(ast.props[0].name).toBe('value')
- expect(ast.props[0].value).toBe('val')
- })
-
- it('pre/post transforms', () => {
- const options = extend({}, baseOptions)
- const spy1 = jasmine.createSpy('preTransform')
- const spy2 = jasmine.createSpy('postTransform')
- options.modules = options.modules.concat([{
- preTransformNode (el) {
- spy1(el.tag)
- },
- postTransformNode (el) {
- expect(el.attrs.length).toBe(1)
- spy2(el.tag)
- }
- }])
- parse('<img v-pre src="hi">', options)
- expect(spy1).toHaveBeenCalledWith('img')
- expect(spy2).toHaveBeenCalledWith('img')
- })
-
- it('preserve whitespace in <pre> tag', function () {
- const options = extend({}, baseOptions)
- const ast = parse('<pre><code> \n<span>hi</span>\n </code><span> </span></pre>', options)
- const code = ast.children[0]
- expect(code.children[0].type).toBe(3)
- expect(code.children[0].text).toBe(' \n')
- expect(code.children[2].type).toBe(3)
- expect(code.children[2].text).toBe('\n ')
-
- const span = ast.children[1]
- expect(span.children[0].type).toBe(3)
- expect(span.children[0].text).toBe(' ')
- })
-
- // #5992
- it('ignore the first newline in <pre> tag', function () {
- const options = extend({}, baseOptions)
- const ast = parse('<div><pre>\nabc</pre>\ndef<pre>\n\nabc</pre></div>', options)
- const pre = ast.children[0]
- expect(pre.children[0].type).toBe(3)
- expect(pre.children[0].text).toBe('abc')
- const text = ast.children[1]
- expect(text.type).toBe(3)
- expect(text.text).toBe('\ndef')
- const pre2 = ast.children[2]
- expect(pre2.children[0].type).toBe(3)
- expect(pre2.children[0].text).toBe('\nabc')
- })
-
- it('forgivingly handle < in plain text', () => {
- const options = extend({}, baseOptions)
- const ast = parse('<p>1 < 2 < 3</p>', options)
- expect(ast.tag).toBe('p')
- expect(ast.children.length).toBe(1)
- expect(ast.children[0].type).toBe(3)
- expect(ast.children[0].text).toBe('1 < 2 < 3')
- })
-
- it('IE conditional comments', () => {
- const options = extend({}, baseOptions)
- const ast = parse(`
- <div>
- <!--[if lte IE 8]>
- <p>Test 1</p>
- <![endif]-->
- </div>
- `, options)
- expect(ast.tag).toBe('div')
- expect(ast.children.length).toBe(0)
- })
-
- it('parse content in textarea as text', () => {
- const options = extend({}, baseOptions)
-
- const whitespace = parse(`
- <textarea>
- <p>Test 1</p>
- test2
- </textarea>
- `, options)
- expect(whitespace.tag).toBe('textarea')
- expect(whitespace.children.length).toBe(1)
- expect(whitespace.children[0].type).toBe(3)
- // textarea is whitespace sensitive
- expect(whitespace.children[0].text).toBe(` <p>Test 1</p>
- test2
- `)
-
- const comment = parse('<textarea><!--comment--></textarea>', options)
- expect(comment.tag).toBe('textarea')
- expect(comment.children.length).toBe(1)
- expect(comment.children[0].type).toBe(3)
- expect(comment.children[0].text).toBe('<!--comment-->')
- })
-
- // #5526
- it('should not decode text in script tags', () => {
- const options = extend({}, baseOptions)
- const ast = parse(`<script type="x/template">><foo><</script>`, options)
- expect(ast.children[0].text).toBe(`><foo><`)
- })
-
- it('should ignore comments', () => {
- const options = extend({}, baseOptions)
- const ast = parse(`<div>123<!--comment here--></div>`, options)
- expect(ast.tag).toBe('div')
- expect(ast.children.length).toBe(1)
- expect(ast.children[0].type).toBe(3)
- expect(ast.children[0].text).toBe('123')
- })
-
- it('should kept comments', () => {
- const options = extend({
- comments: true
- }, baseOptions)
- const ast = parse(`<div>123<!--comment here--></div>`, options)
- expect(ast.tag).toBe('div')
- expect(ast.children.length).toBe(2)
- expect(ast.children[0].type).toBe(3)
- expect(ast.children[0].text).toBe('123')
- expect(ast.children[1].type).toBe(3) // parse comment with ASTText
- expect(ast.children[1].isComment).toBe(true) // parse comment with ASTText
- expect(ast.children[1].text).toBe('comment here')
- })
-})
+++ /dev/null
-import Dep from 'core/observer/dep'
-
-describe('Dep', () => {
- let dep
-
- beforeEach(() => {
- dep = new Dep()
- })
-
- describe('instance', () => {
- it('should be created with correct properties', () => {
- expect(dep.subs.length).toBe(0)
- expect(new Dep().id).toBe(dep.id + 1)
- })
- })
-
- describe('addSub()', () => {
- it('should add sub', () => {
- dep.addSub(null)
- expect(dep.subs.length).toBe(1)
- expect(dep.subs[0]).toBe(null)
- })
- })
-
- describe('removeSub()', () => {
- it('should remove sub', () => {
- dep.subs.push(null)
- dep.removeSub(null)
- expect(dep.subs.length).toBe(0)
- })
- })
-
- describe('depend()', () => {
- let _target
-
- beforeAll(() => {
- _target = Dep.target
- })
-
- afterAll(() => {
- Dep.target = _target
- })
-
- it('should do nothing if no target', () => {
- Dep.target = null
- dep.depend()
- })
-
- it('should add itself to target', () => {
- Dep.target = jasmine.createSpyObj('TARGET', ['addDep'])
- dep.depend()
- expect(Dep.target.addDep).toHaveBeenCalledWith(dep)
- })
- })
-
- describe('notify()', () => {
- it('should notify subs', () => {
- dep.subs.push(jasmine.createSpyObj('SUB', ['update']))
- dep.notify()
- expect(dep.subs[0].update).toHaveBeenCalled()
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import {
- Observer,
- observe,
- set as setProp,
- del as delProp
-} from 'core/observer/index'
-import Dep from 'core/observer/dep'
-import { hasOwn } from 'core/util/index'
-
-describe('Observer', () => {
- it('create on non-observables', () => {
- // skip primitive value
- const ob1 = observe(1)
- expect(ob1).toBeUndefined()
- // avoid vue instance
- const ob2 = observe(new Vue())
- expect(ob2).toBeUndefined()
- // avoid frozen objects
- const ob3 = observe(Object.freeze({}))
- expect(ob3).toBeUndefined()
- })
-
- it('create on object', () => {
- // on object
- const obj = {
- a: {},
- b: {}
- }
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
- // should've walked children
- expect(obj.a.__ob__ instanceof Observer).toBe(true)
- expect(obj.b.__ob__ instanceof Observer).toBe(true)
- // should return existing ob on already observed objects
- const ob2 = observe(obj)
- expect(ob2).toBe(ob1)
- })
-
- it('create on null', () => {
- // on null
- const obj = Object.create(null)
- obj.a = {}
- obj.b = {}
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
- // should've walked children
- expect(obj.a.__ob__ instanceof Observer).toBe(true)
- expect(obj.b.__ob__ instanceof Observer).toBe(true)
- // should return existing ob on already observed objects
- const ob2 = observe(obj)
- expect(ob2).toBe(ob1)
- })
-
- it('create on already observed object', () => {
- // on object
- const obj = {}
- let val = 0
- let getCount = 0
- Object.defineProperty(obj, 'a', {
- configurable: true,
- enumerable: true,
- get () {
- getCount++
- return val
- },
- set (v) { val = v }
- })
-
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
-
- getCount = 0
- // Each read of 'a' should result in only one get underlying get call
- obj.a
- expect(getCount).toBe(1)
- obj.a
- expect(getCount).toBe(2)
-
- // should return existing ob on already observed objects
- const ob2 = observe(obj)
- expect(ob2).toBe(ob1)
-
- // should call underlying setter
- obj.a = 10
- expect(val).toBe(10)
- })
-
- it('create on property with only getter', () => {
- // on object
- const obj = {}
- Object.defineProperty(obj, 'a', {
- configurable: true,
- enumerable: true,
- get () { return 123 }
- })
-
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
-
- // should be able to read
- expect(obj.a).toBe(123)
-
- // should return existing ob on already observed objects
- const ob2 = observe(obj)
- expect(ob2).toBe(ob1)
-
- // since there is no setter, you shouldn't be able to write to it
- // PhantomJS throws when a property with no setter is set
- // but other real browsers don't
- try {
- obj.a = 101
- } catch (e) {}
- expect(obj.a).toBe(123)
- })
-
- it('create on property with only setter', () => {
- // on object
- const obj = {}
- let val = 10
- Object.defineProperty(obj, 'a', { // eslint-disable-line accessor-pairs
- configurable: true,
- enumerable: true,
- set (v) { val = v }
- })
-
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
-
- // reads should return undefined
- expect(obj.a).toBe(undefined)
-
- // should return existing ob on already observed objects
- const ob2 = observe(obj)
- expect(ob2).toBe(ob1)
-
- // writes should call the set function
- obj.a = 100
- expect(val).toBe(100)
- })
-
- it('create on property which is marked not configurable', () => {
- // on object
- const obj = {}
- Object.defineProperty(obj, 'a', {
- configurable: false,
- enumerable: true,
- val: 10
- })
-
- const ob1 = observe(obj)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(obj)
- expect(obj.__ob__).toBe(ob1)
- })
-
- it('create on array', () => {
- // on object
- const arr = [{}, {}]
- const ob1 = observe(arr)
- expect(ob1 instanceof Observer).toBe(true)
- expect(ob1.value).toBe(arr)
- expect(arr.__ob__).toBe(ob1)
- // should've walked children
- expect(arr[0].__ob__ instanceof Observer).toBe(true)
- expect(arr[1].__ob__ instanceof Observer).toBe(true)
- })
-
- it('observing object prop change', () => {
- const obj = { a: { b: 2 }, c: NaN }
- observe(obj)
- // mock a watcher!
- const watcher = {
- deps: [],
- addDep (dep) {
- this.deps.push(dep)
- dep.addSub(this)
- },
- update: jasmine.createSpy()
- }
- // collect dep
- Dep.target = watcher
- obj.a.b
- Dep.target = null
- expect(watcher.deps.length).toBe(3) // obj.a + a + a.b
- obj.a.b = 3
- expect(watcher.update.calls.count()).toBe(1)
- // swap object
- obj.a = { b: 4 }
- expect(watcher.update.calls.count()).toBe(2)
- watcher.deps = []
-
- Dep.target = watcher
- obj.a.b
- obj.c
- Dep.target = null
- expect(watcher.deps.length).toBe(4)
- // set on the swapped object
- obj.a.b = 5
- expect(watcher.update.calls.count()).toBe(3)
- // should not trigger on NaN -> NaN set
- obj.c = NaN
- expect(watcher.update.calls.count()).toBe(3)
- })
-
- it('observing object prop change on defined property', () => {
- const obj = { val: 2 }
- Object.defineProperty(obj, 'a', {
- configurable: true,
- enumerable: true,
- get () { return this.val },
- set (v) {
- this.val = v
- return this.val
- }
- })
-
- observe(obj)
- // mock a watcher!
- const watcher = {
- deps: [],
- addDep: function (dep) {
- this.deps.push(dep)
- dep.addSub(this)
- },
- update: jasmine.createSpy()
- }
- // collect dep
- Dep.target = watcher
- expect(obj.a).toBe(2) // Make sure 'this' is preserved
- Dep.target = null
- obj.a = 3
- expect(obj.val).toBe(3) // make sure 'setter' was called
- obj.val = 5
- expect(obj.a).toBe(5) // make sure 'getter' was called
- })
-
- it('observing set/delete', () => {
- const obj1 = { a: 1 }
- const ob1 = observe(obj1)
- const dep1 = ob1.dep
- spyOn(dep1, 'notify')
- setProp(obj1, 'b', 2)
- expect(obj1.b).toBe(2)
- expect(dep1.notify.calls.count()).toBe(1)
- delProp(obj1, 'a')
- expect(hasOwn(obj1, 'a')).toBe(false)
- expect(dep1.notify.calls.count()).toBe(2)
- // set existing key, should be a plain set and not
- // trigger own ob's notify
- setProp(obj1, 'b', 3)
- expect(obj1.b).toBe(3)
- expect(dep1.notify.calls.count()).toBe(2)
- // set non-existing key
- setProp(obj1, 'c', 1)
- expect(obj1.c).toBe(1)
- expect(dep1.notify.calls.count()).toBe(3)
- // should ignore deleting non-existing key
- delProp(obj1, 'a')
- expect(dep1.notify.calls.count()).toBe(3)
- // should work on non-observed objects
- const obj2 = { a: 1 }
- delProp(obj2, 'a')
- expect(hasOwn(obj2, 'a')).toBe(false)
- // should work on Object.create(null)
- const obj3 = Object.create(null)
- obj3.a = 1
- const ob3 = observe(obj3)
- const dep3 = ob3.dep
- spyOn(dep3, 'notify')
- setProp(obj3, 'b', 2)
- expect(obj3.b).toBe(2)
- expect(dep3.notify.calls.count()).toBe(1)
- delProp(obj3, 'a')
- expect(hasOwn(obj3, 'a')).toBe(false)
- expect(dep3.notify.calls.count()).toBe(2)
- // set and delete non-numeric key on array
- const arr2 = ['a']
- const ob2 = observe(arr2)
- const dep2 = ob2.dep
- spyOn(dep2, 'notify')
- setProp(arr2, 'b', 2)
- expect(arr2.b).toBe(2)
- expect(dep2.notify.calls.count()).toBe(1)
- delProp(arr2, 'b')
- expect(hasOwn(arr2, 'b')).toBe(false)
- expect(dep2.notify.calls.count()).toBe(2)
- })
-
- it('warning set/delete on a Vue instance', done => {
- const vm = new Vue({
- template: '<div>{{a}}</div>',
- data: { a: 1 }
- }).$mount()
- expect(vm.$el.outerHTML).toBe('<div>1</div>')
- Vue.set(vm, 'a', 2)
- waitForUpdate(() => {
- expect(vm.$el.outerHTML).toBe('<div>2</div>')
- expect('Avoid adding reactive properties to a Vue instance').not.toHaveBeenWarned()
- Vue.delete(vm, 'a')
- }).then(() => {
- expect('Avoid deleting properties on a Vue instance').toHaveBeenWarned()
- expect(vm.$el.outerHTML).toBe('<div>2</div>')
- Vue.set(vm, 'b', 123)
- expect('Avoid adding reactive properties to a Vue instance').toHaveBeenWarned()
- }).then(done)
- })
-
- it('warning set/delete on Vue instance root $data', done => {
- const data = { a: 1 }
- const vm = new Vue({
- template: '<div>{{a}}</div>',
- data
- }).$mount()
- expect(vm.$el.outerHTML).toBe('<div>1</div>')
- expect(Vue.set(data, 'a', 2)).toBe(2)
- waitForUpdate(() => {
- expect(vm.$el.outerHTML).toBe('<div>2</div>')
- expect('Avoid adding reactive properties to a Vue instance').not.toHaveBeenWarned()
- Vue.delete(data, 'a')
- }).then(() => {
- expect('Avoid deleting properties on a Vue instance').toHaveBeenWarned()
- expect(vm.$el.outerHTML).toBe('<div>2</div>')
- expect(Vue.set(data, 'b', 123)).toBe(123)
- expect('Avoid adding reactive properties to a Vue instance').toHaveBeenWarned()
- }).then(done)
- })
-
- it('observing array mutation', () => {
- const arr = []
- const ob = observe(arr)
- const dep = ob.dep
- spyOn(dep, 'notify')
- const objs = [{}, {}, {}]
- arr.push(objs[0])
- arr.pop()
- arr.unshift(objs[1])
- arr.shift()
- arr.splice(0, 0, objs[2])
- arr.sort()
- arr.reverse()
- expect(dep.notify.calls.count()).toBe(7)
- // inserted elements should be observed
- objs.forEach(obj => {
- expect(obj.__ob__ instanceof Observer).toBe(true)
- })
- })
-
- it('warn set/delete on non valid values', () => {
- try {
- setProp(null, 'foo', 1)
- } catch (e) {}
- expect(`Cannot set reactive property on undefined, null, or primitive value`).toHaveBeenWarned()
-
- try {
- delProp(null, 'foo')
- } catch (e) {}
- expect(`Cannot delete reactive property on undefined, null, or primitive value`).toHaveBeenWarned()
- })
-
- it('should lazy invoke existing getters', () => {
- const obj = {}
- let called = false
- Object.defineProperty(obj, 'getterProp', {
- enumerable: true,
- get: () => {
- called = true
- return 'some value'
- }
- })
- observe(obj)
- expect(called).toBe(false)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import {
- MAX_UPDATE_COUNT,
- queueWatcher as _queueWatcher
-} from 'core/observer/scheduler'
-
-function queueWatcher (watcher) {
- watcher.vm = {} // mock vm
- _queueWatcher(watcher)
-}
-
-describe('Scheduler', () => {
- let spy
- beforeEach(() => {
- spy = jasmine.createSpy('scheduler')
- })
-
- it('queueWatcher', done => {
- queueWatcher({
- run: spy
- })
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('dedup', done => {
- queueWatcher({
- id: 1,
- run: spy
- })
- queueWatcher({
- id: 1,
- run: spy
- })
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(1)
- }).then(done)
- })
-
- it('allow duplicate when flushing', done => {
- const job = {
- id: 1,
- run: spy
- }
- queueWatcher(job)
- queueWatcher({
- id: 2,
- run () { queueWatcher(job) }
- })
- waitForUpdate(() => {
- expect(spy.calls.count()).toBe(2)
- }).then(done)
- })
-
- it('call user watchers before component re-render', done => {
- const calls = []
- const vm = new Vue({
- data: {
- a: 1
- },
- template: '<div>{{ a }}</div>',
- watch: {
- a () { calls.push(1) }
- },
- beforeUpdate () {
- calls.push(2)
- }
- }).$mount()
- vm.a = 2
- waitForUpdate(() => {
- expect(calls).toEqual([1, 2])
- }).then(done)
- })
-
- it('call user watcher triggered by component re-render immediately', done => {
- // this happens when a component re-render updates the props of a child
- const calls = []
- const vm = new Vue({
- data: {
- a: 1
- },
- watch: {
- a () {
- calls.push(1)
- }
- },
- beforeUpdate () {
- calls.push(2)
- },
- template: '<div><test :a="a"></test></div>',
- components: {
- test: {
- props: ['a'],
- template: '<div>{{ a }}</div>',
- watch: {
- a () {
- calls.push(3)
- }
- },
- beforeUpdate () {
- calls.push(4)
- }
- }
- }
- }).$mount()
- vm.a = 2
- waitForUpdate(() => {
- expect(calls).toEqual([1, 2, 3, 4])
- }).then(done)
- })
-
- it('warn against infinite update loops', function (done) {
- let count = 0
- const job = {
- id: 1,
- run () {
- count++
- queueWatcher(job)
- }
- }
- queueWatcher(job)
- waitForUpdate(() => {
- expect(count).toBe(MAX_UPDATE_COUNT + 1)
- expect('infinite update loop').toHaveBeenWarned()
- }).then(done)
- })
-
- it('should call newly pushed watcher after current watcher is done', done => {
- const callOrder = []
- queueWatcher({
- id: 1,
- user: true,
- run () {
- callOrder.push(1)
- queueWatcher({
- id: 2,
- run () {
- callOrder.push(3)
- }
- })
- callOrder.push(2)
- }
- })
- waitForUpdate(() => {
- expect(callOrder).toEqual([1, 2, 3])
- }).then(done)
- })
-
- // GitHub issue #5191
- it('emit should work when updated hook called', done => {
- const el = document.createElement('div')
- const vm = new Vue({
- template: `<div><child @change="bar" :foo="foo"></child></div>`,
- data: {
- foo: 0
- },
- methods: {
- bar: spy
- },
- components: {
- child: {
- template: `<div>{{foo}}</div>`,
- props: ['foo'],
- updated () {
- this.$emit('change')
- }
- }
- }
- }).$mount(el)
- vm.$nextTick(() => {
- vm.foo = 1
- vm.$nextTick(() => {
- expect(vm.$el.innerHTML).toBe('<div>1</div>')
- expect(spy).toHaveBeenCalled()
- done()
- })
- })
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import Watcher from 'core/observer/watcher'
-
-describe('Watcher', () => {
- let vm, spy
- beforeEach(() => {
- vm = new Vue({
- template: '<div></div>',
- data: {
- a: 1,
- b: {
- c: 2,
- d: 4
- },
- c: 'c',
- msg: 'yo'
- }
- }).$mount()
- spy = jasmine.createSpy('watcher')
- })
-
- it('path', done => {
- const watcher = new Watcher(vm, 'b.c', spy)
- expect(watcher.value).toBe(2)
- vm.b.c = 3
- waitForUpdate(() => {
- expect(watcher.value).toBe(3)
- expect(spy).toHaveBeenCalledWith(3, 2)
- vm.b = { c: 4 } // swapping the object
- }).then(() => {
- expect(watcher.value).toBe(4)
- expect(spy).toHaveBeenCalledWith(4, 3)
- }).then(done)
- })
-
- it('non-existent path, set later', done => {
- const watcher1 = new Watcher(vm, 'b.e', spy)
- expect(watcher1.value).toBeUndefined()
- // check $add should not affect isolated children
- const child2 = new Vue({ parent: vm })
- const watcher2 = new Watcher(child2, 'b.e', spy)
- expect(watcher2.value).toBeUndefined()
- Vue.set(vm.b, 'e', 123)
- waitForUpdate(() => {
- expect(watcher1.value).toBe(123)
- expect(watcher2.value).toBeUndefined()
- expect(spy.calls.count()).toBe(1)
- expect(spy).toHaveBeenCalledWith(123, undefined)
- }).then(done)
- })
-
- it('delete', done => {
- const watcher = new Watcher(vm, 'b.c', spy)
- expect(watcher.value).toBe(2)
- Vue.delete(vm.b, 'c')
- waitForUpdate(() => {
- expect(watcher.value).toBeUndefined()
- expect(spy).toHaveBeenCalledWith(undefined, 2)
- }).then(done)
- })
-
- it('path containing $data', done => {
- const watcher = new Watcher(vm, '$data.b.c', spy)
- expect(watcher.value).toBe(2)
- vm.b = { c: 3 }
- waitForUpdate(() => {
- expect(watcher.value).toBe(3)
- expect(spy).toHaveBeenCalledWith(3, 2)
- vm.$data.b.c = 4
- }).then(() => {
- expect(watcher.value).toBe(4)
- expect(spy).toHaveBeenCalledWith(4, 3)
- }).then(done)
- })
-
- it('deep watch', done => {
- let oldB
- new Watcher(vm, 'b', spy, {
- deep: true
- })
- vm.b.c = { d: 4 }
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
- oldB = vm.b
- vm.b = { c: [{ a: 1 }] }
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, oldB)
- expect(spy.calls.count()).toBe(2)
- vm.b.c[0].a = 2
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
- expect(spy.calls.count()).toBe(3)
- }).then(done)
- })
-
- it('deep watch $data', done => {
- new Watcher(vm, '$data', spy, {
- deep: true
- })
- vm.b.c = 3
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(vm.$data, vm.$data)
- }).then(done)
- })
-
- it('deep watch with circular references', done => {
- new Watcher(vm, 'b', spy, {
- deep: true
- })
- Vue.set(vm.b, '_', vm.b)
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
- expect(spy.calls.count()).toBe(1)
- vm.b._.c = 1
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
- expect(spy.calls.count()).toBe(2)
- }).then(done)
- })
-
- it('fire change for prop addition/deletion in non-deep mode', done => {
- new Watcher(vm, 'b', spy)
- Vue.set(vm.b, 'e', 123)
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
- expect(spy.calls.count()).toBe(1)
- Vue.delete(vm.b, 'e')
- }).then(() => {
- expect(spy.calls.count()).toBe(2)
- }).then(done)
- })
-
- it('watch function', done => {
- const watcher = new Watcher(vm, function () {
- return this.a + this.b.d
- }, spy)
- expect(watcher.value).toBe(5)
- vm.a = 2
- waitForUpdate(() => {
- expect(spy).toHaveBeenCalledWith(6, 5)
- vm.b = { d: 2 }
- }).then(() => {
- expect(spy).toHaveBeenCalledWith(4, 6)
- }).then(done)
- })
-
- it('lazy mode', done => {
- const watcher = new Watcher(vm, function () {
- return this.a + this.b.d
- }, null, { lazy: true })
- expect(watcher.lazy).toBe(true)
- expect(watcher.value).toBeUndefined()
- expect(watcher.dirty).toBe(true)
- watcher.evaluate()
- expect(watcher.value).toBe(5)
- expect(watcher.dirty).toBe(false)
- vm.a = 2
- waitForUpdate(() => {
- expect(watcher.value).toBe(5)
- expect(watcher.dirty).toBe(true)
- watcher.evaluate()
- expect(watcher.value).toBe(6)
- expect(watcher.dirty).toBe(false)
- }).then(done)
- })
-
- it('teardown', done => {
- const watcher = new Watcher(vm, 'b.c', spy)
- watcher.teardown()
- vm.b.c = 3
- waitForUpdate(() => {
- expect(watcher.active).toBe(false)
- expect(spy).not.toHaveBeenCalled()
- }).then(done)
- })
-
- it('warn not support path', () => {
- new Watcher(vm, 'd.e + c', spy)
- expect('Failed watching path:').toHaveBeenWarned()
- })
-})
+++ /dev/null
-import { parseComponent } from 'sfc/parser'
-
-describe('Single File Component parser', () => {
- it('should parse', () => {
- const res = parseComponent(`
- <template>
- <div>hi</div>
- </template>
- <style src="./test.css"></style>
- <style lang="stylus" scoped>
- h1
- color red
- h2
- color green
- </style>
- <style module>
- h1 { font-weight: bold }
- </style>
- <style bool-attr val-attr="test"></style>
- <script>
- export default {}
- </script>
- <div>
- <style>nested should be ignored</style>
- </div>
- `)
- expect(res.template.content.trim()).toBe('<div>hi</div>')
- expect(res.styles.length).toBe(4)
- expect(res.styles[0].src).toBe('./test.css')
- expect(res.styles[1].lang).toBe('stylus')
- expect(res.styles[1].scoped).toBe(true)
- expect(res.styles[1].content.trim()).toBe('h1\n color red\nh2\n color green')
- expect(res.styles[2].module).toBe(true)
- expect(res.styles[3].attrs['bool-attr']).toBe(true)
- expect(res.styles[3].attrs['val-attr']).toBe('test')
- expect(res.script.content.trim()).toBe('export default {}')
- })
-
- it('should parse template with closed input', () => {
- const res = parseComponent(`
- <template>
- <input type="text"/>
- </template>
- `)
-
- expect(res.template.content.trim()).toBe('<input type="text"/>')
- })
-
- it('should handle nested template', () => {
- const res = parseComponent(`
- <template>
- <div><template v-if="ok">hi</template></div>
- </template>
- `)
- expect(res.template.content.trim()).toBe('<div><template v-if="ok">hi</template></div>')
- })
-
- it('pad content', () => {
- const content = `
- <template>
- <div></div>
- </template>
- <script>
- export default {}
- </script>
- <style>
- h1 { color: red }
- </style>
-`
- const padDefault = parseComponent(content.trim(), { pad: true })
- const padLine = parseComponent(content.trim(), { pad: 'line' })
- const padSpace = parseComponent(content.trim(), { pad: 'space' })
-
- expect(padDefault.script.content).toBe(Array(3 + 1).join('//\n') + '\nexport default {}\n')
- expect(padDefault.styles[0].content).toBe(Array(6 + 1).join('\n') + '\nh1 { color: red }\n')
- expect(padLine.script.content).toBe(Array(3 + 1).join('//\n') + '\nexport default {}\n')
- expect(padLine.styles[0].content).toBe(Array(6 + 1).join('\n') + '\nh1 { color: red }\n')
- expect(padSpace.script.content).toBe(`<template>
- <div></div>
- </template>
- <script>`.replace(/./g, ' ') + '\nexport default {}\n')
- expect(padSpace.styles[0].content).toBe(`<template>
- <div></div>
- </template>
- <script>
- export default {}
- </script>
- <style>`.replace(/./g, ' ') + '\nh1 { color: red }\n')
- })
-
- it('should handle template blocks with lang as special text', () => {
- const res = parseComponent(`
- <template lang="pug">
- div
- h1(v-if='1 < 2') hello
- </template>
- `)
- expect(res.template.content.trim()).toBe(`div\n h1(v-if='1 < 2') hello`)
- })
-
- it('should handle component contains "<" only', () => {
- const res = parseComponent(`
- <template>
- <span><</span>
- </template>
- `)
- expect(res.template.content.trim()).toBe(`<span><</span>`)
- })
-
- it('should handle custom blocks without parsing them', () => {
- const res = parseComponent(`
- <template>
- <div></div>
- </template>
- <example name="simple">
- <my-button ref="button">Hello</my-button>
- </example>
- <example name="with props">
- <my-button color="red">Hello</my-button>
- </example>
- <test name="simple" foo="bar">
- export default function simple (vm) {
- describe('Hello', () => {
- it('should display Hello', () => {
- this.vm.$refs.button.$el.innerText.should.equal('Hello')
- }))
- }))
- }
- </test>
- `)
- expect(res.customBlocks.length).toBe(3)
-
- const simpleExample = res.customBlocks[0]
- expect(simpleExample.type).toBe('example')
- expect(simpleExample.content.trim()).toBe('<my-button ref="button">Hello</my-button>')
- expect(simpleExample.attrs.name).toBe('simple')
-
- const withProps = res.customBlocks[1]
- expect(withProps.type).toBe('example')
- expect(withProps.content.trim()).toBe('<my-button color="red">Hello</my-button>')
- expect(withProps.attrs.name).toBe('with props')
-
- const simpleTest = res.customBlocks[2]
- expect(simpleTest.type).toBe('test')
- expect(simpleTest.content.trim()).toBe(`export default function simple (vm) {
- describe('Hello', () => {
- it('should display Hello', () => {
- this.vm.$refs.button.$el.innerText.should.equal('Hello')
- }))
- }))
-}`)
- expect(simpleTest.attrs.name).toBe('simple')
- expect(simpleTest.attrs.foo).toBe('bar')
- })
-
- // Regression #4289
- it('accepts nested template tag', () => {
- const raw = `<div>
- <template v-if="true === true">
- <section class="section">
- <div class="container">
- Should be shown
- </div>
- </section>
- </template>
- <template v-else>
- <p>Should not be shown</p>
- </template>
- </div>`
- const res = parseComponent(`<template>${raw}</template>`)
- expect(res.template.content.trim()).toBe(raw)
- })
-
- it('should not hang on trailing text', () => {
- const res = parseComponent(`<template>hi</`)
- expect(res.template.content).toBe('hi')
- })
-})
+++ /dev/null
-import { nextTick } from 'core/util/next-tick'
-
-describe('nextTick', () => {
- it('accepts a callback', done => {
- nextTick(done)
- })
-
- it('returns undefined when passed a callback', () => {
- expect(nextTick(() => {})).toBeUndefined()
- })
-
- if (typeof Promise !== 'undefined') {
- it('returns a Promise when provided no callback', done => {
- nextTick().then(done)
- })
-
- it('returns a Promise with a context argument when provided a falsy callback and an object', done => {
- const obj = {}
- nextTick(undefined, obj).then(ctx => {
- expect(ctx).toBe(obj)
- done()
- })
- })
-
- it('returned Promise should resolve correctly vs callback', done => {
- const spy = jasmine.createSpy()
- nextTick(spy)
- nextTick().then(() => {
- expect(spy).toHaveBeenCalled()
- done()
- })
- })
- }
-})
+++ /dev/null
-import Vue from 'vue'
-import { createComponent } from 'core/vdom/create-component'
-
-describe('create-component', () => {
- let vm
- beforeEach(done => {
- vm = new Vue({
- template: '<p>{{msg}}</p>',
- data () {
- return { msg: 'hello, my children' }
- }
- }).$mount()
- Vue.nextTick(done)
- })
-
- it('create a component basically', () => {
- const child = {
- name: 'child',
- props: ['msg'],
- render () {}
- }
- const data = {
- props: { msg: 'hello world' },
- attrs: { id: 1 },
- staticAttrs: { class: 'foo' },
- on: { notify: 'onNotify' }
- }
- const vnode = createComponent(child, data, vm, vm)
- expect(vnode.tag).toMatch(/vue-component-[0-9]+-child/)
- expect(vnode.data.attrs).toEqual({ id: 1 })
- expect(vnode.data.staticAttrs).toEqual({ class: 'foo' })
- expect(vnode.componentOptions.propsData).toEqual({ msg: 'hello world' })
- expect(vnode.componentOptions.listeners).toEqual({ notify: 'onNotify' })
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- })
-
- it('create a component when resolved with async loading', done => {
- let vnode = null
- const data = {
- props: {},
- staticAttrs: { class: 'foo' }
- }
- spyOn(vm, '$forceUpdate')
- function async (resolve, reject) {
- setTimeout(() => {
- resolve({
- name: 'child',
- props: ['msg']
- })
- Vue.nextTick(loaded)
- }, 0)
- }
- function go () {
- vnode = createComponent(async, data, vm, vm)
- expect(vnode.isComment).toBe(true) // not to be loaded yet.
- expect(vnode.asyncFactory).toBe(async)
- }
- function loaded () {
- vnode = createComponent(async, data, vm, vm)
- expect(vnode.tag).toMatch(/vue-component-[0-9]+-child/)
- expect(vnode.data.staticAttrs).toEqual({ class: 'foo' })
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- expect(vm.$forceUpdate).toHaveBeenCalled()
- done()
- }
- go()
- })
-
- it('not create a component when rejected with async loading', done => {
- let vnode = null
- const data = {
- props: { msg: 'hello world' },
- attrs: { id: 1 }
- }
- const reason = 'failed!!'
- function async (resolve, reject) {
- setTimeout(() => {
- reject(reason)
- Vue.nextTick(failed)
- }, 0)
- }
- function go () {
- vnode = createComponent(async, data, vm, vm)
- expect(vnode.isComment).toBe(true) // not to be loaded yet.
- }
- function failed () {
- vnode = createComponent(async, data, vm, vm)
- expect(vnode.isComment).toBe(true) // failed, still a comment node
- expect(`Failed to resolve async component: ${async}\nReason: ${reason}`).toHaveBeenWarned()
- done()
- }
- go()
- })
-
- it('not create a component when specified with falsy', () => {
- const vnode = createComponent(null, {}, vm, vm)
- expect(vnode).toBeUndefined()
- })
-
- it('warn component definition type', () => {
- const Ctor = 'child'
- const vnode = createComponent(Ctor, {}, vm, vm)
- expect(vnode).toBeUndefined()
- expect(`Invalid Component definition: ${Ctor}`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { createEmptyVNode } from 'core/vdom/vnode'
-
-describe('create-element', () => {
- it('render vnode with basic reserved tag using createElement', () => {
- const vm = new Vue({
- data: { msg: 'hello world' }
- })
- const h = vm.$createElement
- const vnode = h('p', {})
- expect(vnode.tag).toBe('p')
- expect(vnode.data).toEqual({})
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- })
-
- it('render vnode with component using createElement', () => {
- const vm = new Vue({
- data: { message: 'hello world' },
- components: {
- 'my-component': {
- props: ['msg']
- }
- }
- })
- const h = vm.$createElement
- const vnode = h('my-component', { props: { msg: vm.message }})
- expect(vnode.tag).toMatch(/vue-component-[0-9]+/)
- expect(vnode.componentOptions.propsData).toEqual({ msg: vm.message })
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- })
-
- it('render vnode with custom tag using createElement', () => {
- const vm = new Vue({
- data: { msg: 'hello world' }
- })
- const h = vm.$createElement
- const tag = 'custom-tag'
- const vnode = h(tag, {})
- expect(vnode.tag).toBe('custom-tag')
- expect(vnode.data).toEqual({})
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- expect(vnode.componentOptions).toBeUndefined()
- })
-
- it('render empty vnode with falsy tag using createElement', () => {
- const vm = new Vue({
- data: { msg: 'hello world' }
- })
- const h = vm.$createElement
- const vnode = h(null, {})
- expect(vnode).toEqual(createEmptyVNode())
- })
-
- it('render vnode with not string tag using createElement', () => {
- const vm = new Vue({
- data: { msg: 'hello world' }
- })
- const h = vm.$createElement
- const vnode = h(Vue.extend({ // Component class
- props: ['msg']
- }), { props: { msg: vm.message }})
- expect(vnode.tag).toMatch(/vue-component-[0-9]+/)
- expect(vnode.componentOptions.propsData).toEqual({ msg: vm.message })
- expect(vnode.children).toBeUndefined()
- expect(vnode.text).toBeUndefined()
- expect(vnode.elm).toBeUndefined()
- expect(vnode.ns).toBeUndefined()
- expect(vnode.context).toEqual(vm)
- })
-
- it('render vnode with createElement with children', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('p', void 0, [h('br'), 'hello world', h('br')])
- expect(vnode.children[0].tag).toBe('br')
- expect(vnode.children[1].text).toBe('hello world')
- expect(vnode.children[2].tag).toBe('br')
- })
-
- it('render vnode with children, omitting data', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('p', [h('br'), 'hello world', h('br')])
- expect(vnode.children[0].tag).toBe('br')
- expect(vnode.children[1].text).toBe('hello world')
- expect(vnode.children[2].tag).toBe('br')
- })
-
- it('render vnode with children, including boolean and null type', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('p', [h('br'), true, 123, h('br'), 'abc', null])
- expect(vnode.children.length).toBe(4)
- expect(vnode.children[0].tag).toBe('br')
- expect(vnode.children[1].text).toBe('123')
- expect(vnode.children[2].tag).toBe('br')
- expect(vnode.children[3].text).toBe('abc')
- })
-
- it('render svg elements with correct namespace', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('svg', [h('a', [h('foo', [h('bar')])])])
- expect(vnode.ns).toBe('svg')
- // should apply ns to children recursively
- expect(vnode.children[0].ns).toBe('svg')
- expect(vnode.children[0].children[0].ns).toBe('svg')
- expect(vnode.children[0].children[0].children[0].ns).toBe('svg')
- })
-
- it('render MathML elements with correct namespace', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('math', [h('matrix')])
- expect(vnode.ns).toBe('math')
- // should apply ns to children
- expect(vnode.children[0].ns).toBe('math')
- // although not explicitly listed, elements nested under <math>
- // should not be treated as component
- expect(vnode.children[0].componentOptions).toBeUndefined()
- })
-
- it('render svg foreignObject with correct namespace', () => {
- const vm = new Vue({})
- const h = vm.$createElement
- const vnode = h('svg', [h('foreignObject', [h('p'), h('svg')])])
- expect(vnode.ns).toBe('svg')
- expect(vnode.children[0].ns).toBe('svg')
- expect(vnode.children[0].children[0].ns).toBeUndefined()
- // #7330
- expect(vnode.children[0].children[1].ns).toBe('svg')
- })
-
- // #6642
- it('render svg foreignObject component with correct namespace', () => {
- const vm = new Vue({
- template: `
- <svg>
- <test></test>
- </svg>
- `,
- components: {
- test: {
- template: `
- <foreignObject>
- <p xmlns="http://www.w3.org/1999/xhtml"></p>
- </foreignObject>
- `
- }
- }
- }).$mount()
- const testComp = vm.$children[0]
- expect(testComp.$vnode.ns).toBe('svg')
- expect(testComp._vnode.tag).toBe('foreignObject')
- expect(testComp._vnode.ns).toBe('svg')
- expect(testComp._vnode.children[0].tag).toBe('p')
- expect(testComp._vnode.children[0].ns).toBeUndefined()
- })
-
- // #6506
- it('render SVGAElement in a component correctly', () => {
- const vm = new Vue({
- template: `
- <svg>
- <test></test>
- </svg>
- `,
- components: {
- test: { render: h => h('a') }
- }
- }).$mount()
- const testComp = vm.$children[0]
- expect(testComp.$vnode.ns).toBe('svg')
- expect(testComp._vnode.tag).toBe('a')
- expect(testComp._vnode.ns).toBe('svg')
- })
-
- it('warn observed data objects', () => {
- new Vue({
- data: {
- data: {}
- },
- render (h) {
- return h('div', this.data)
- }
- }).$mount()
- expect('Avoid using observed data object as vnode data').toHaveBeenWarned()
- })
-
- it('warn non-primitive key', () => {
- new Vue({
- render (h) {
- return h('div', { key: {}})
- }
- }).$mount()
- expect('Avoid using non-primitive value as key').toHaveBeenWarned()
- })
-
- it('doesn\'t warn boolean key', () => {
- new Vue({
- render (h) {
- return h('div', { key: true })
- }
- }).$mount()
- expect('Avoid using non-primitive value as key').not.toHaveBeenWarned()
- })
-
- it('doesn\'t warn symbol key', () => {
- new Vue({
- render (h) {
- return h('div', { key: Symbol('symbol') })
- }
- }).$mount()
- expect('Avoid using non-primitive value as key').not.toHaveBeenWarned()
- })
-
- it('nested child elements should be updated correctly', done => {
- const vm = new Vue({
- data: { n: 1 },
- render (h) {
- const list = []
- for (let i = 0; i < this.n; i++) {
- list.push(h('span', i))
- }
- const input = h('input', {
- attrs: {
- value: 'a',
- type: 'text'
- }
- })
- return h('div', [[...list, input]])
- }
- }).$mount()
- expect(vm.$el.innerHTML).toContain('<span>0</span><input')
- const el = vm.$el.querySelector('input')
- el.value = 'b'
- vm.n++
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toContain('<span>0</span><span>1</span><input')
- expect(vm.$el.querySelector('input')).toBe(el)
- expect(vm.$el.querySelector('input').value).toBe('b')
- }).then(done)
- })
-
- // #7786
- it('creates element with vnode reference in :class or :style', () => {
- const vm = new Vue({
- components: {
- foo: {
- render (h) {
- return h('div', {
- class: {
- 'has-vnode': this.$vnode
- }
- }, 'foo')
- }
- }
- },
- render: h => h('foo')
- }).$mount()
- expect(vm.$el.innerHTML).toContain('foo')
- expect(vm.$el.classList.contains('has-vnode')).toBe(true)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-import { xlinkNS } from 'web/util/index'
-
-describe('vdom attrs module', () => {
- it('should create an element with attrs', () => {
- const vnode = new VNode('p', { attrs: { id: 1, class: 'class1' }})
- const elm = patch(null, vnode)
- expect(elm.id).toBe('1')
- expect(elm).toHaveClass('class1')
- })
-
- it('should change the elements attrs', () => {
- const vnode1 = new VNode('i', { attrs: { id: '1', class: 'i am vdom' }})
- const vnode2 = new VNode('i', { attrs: { id: '2', class: 'i am' }})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.id).toBe('2')
- expect(elm).toHaveClass('i')
- expect(elm).toHaveClass('am')
- expect(elm).not.toHaveClass('vdom')
- })
-
- it('should remove the elements attrs', () => {
- const vnode1 = new VNode('i', { attrs: { id: '1', class: 'i am vdom' }})
- const vnode2 = new VNode('i', { attrs: { id: '1' }})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.id).toBe('1')
- expect(elm.className).toBe('')
- })
-
- it('should remove the elements attrs for new nodes without attrs data', () => {
- const vnode1 = new VNode('i', { attrs: { id: '1', class: 'i am vdom' }})
- const vnode2 = new VNode('i', {})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.id).toBe('')
- expect(elm.className).toBe('')
- })
-
- it('should remove the falsy value from boolean attr', () => {
- const vnode = new VNode('option', { attrs: { disabled: null }})
- const elm = patch(null, vnode)
- expect(elm.getAttribute('disabled')).toBe(null)
- })
-
- it('should set the attr name to boolean attr', () => {
- const vnode = new VNode('option', { attrs: { disabled: true }})
- const elm = patch(null, vnode)
- expect(elm.getAttribute('disabled')).toBe('disabled')
- })
-
- it('should set the falsy value to enumerated attr', () => {
- const vnode = new VNode('div', { attrs: { contenteditable: null }})
- const elm = patch(null, vnode)
- expect(elm.getAttribute('contenteditable')).toBe('false')
- })
-
- it('should set the boolean string value to enumerated attr', () => {
- const vnode = new VNode('div', { attrs: { contenteditable: 'true' }})
- const elm = patch(null, vnode)
- expect(elm.getAttribute('contenteditable')).toBe('true')
- })
-
- it('should set the xlink value to attr', () => {
- const vnode = new VNode('a', { attrs: { 'xlink:href': '#id1' }})
- const elm = patch(null, vnode)
- expect(elm.getAttributeNS(xlinkNS, 'href')).toBe('#id1')
- })
-
- it('should set the xlink boolean string value to attr', () => {
- const vnode = new VNode('option', { attrs: { 'xlink:disabled': true }})
- const elm = patch(null, vnode)
- expect(elm.getAttributeNS(xlinkNS, 'disabled')).toBe('true')
- })
-
- it('should handle mutating observed attrs object', done => {
- const vm = new Vue({
- data: {
- attrs: {
- id: 'foo'
- }
- },
- render (h) {
- return h('div', {
- attrs: this.attrs
- })
- }
- }).$mount()
-
- expect(vm.$el.id).toBe('foo')
- vm.attrs.id = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.id).toBe('bar')
- vm.attrs = { id: 'baz' }
- }).then(() => {
- expect(vm.$el.id).toBe('baz')
- }).then(done)
- })
-})
+++ /dev/null
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom class module', () => {
- it('should create an element with staticClass', () => {
- const vnode = new VNode('p', { staticClass: 'class1' })
- const elm = patch(null, vnode)
- expect(elm).toHaveClass('class1')
- })
-
- it('should create an element with class', () => {
- const vnode = new VNode('p', { class: 'class1' })
- const elm = patch(null, vnode)
- expect(elm).toHaveClass('class1')
- })
-
- it('should create an element with array class', () => {
- const vnode = new VNode('p', { class: ['class1', 'class2'] })
- const elm = patch(null, vnode)
- expect(elm).toHaveClass('class1')
- expect(elm).toHaveClass('class2')
- })
-
- it('should create an element with object class', () => {
- const vnode = new VNode('p', {
- class: { class1: true, class2: false, class3: true }
- })
- const elm = patch(null, vnode)
- expect(elm).toHaveClass('class1')
- expect(elm).not.toHaveClass('class2')
- expect(elm).toHaveClass('class3')
- })
-
- it('should create an element with mixed class', () => {
- const vnode = new VNode('p', {
- class: [{ class1: false, class2: true, class3: false }, 'class4', ['class5', 'class6']]
- })
- const elm = patch(null, vnode)
- expect(elm).not.toHaveClass('class1')
- expect(elm).toHaveClass('class2')
- expect(elm).not.toHaveClass('class3')
- expect(elm).toHaveClass('class4')
- expect(elm).toHaveClass('class5')
- expect(elm).toHaveClass('class6')
- })
-
- it('should create an element with staticClass and class', () => {
- const vnode = new VNode('p', { staticClass: 'class1', class: 'class2' })
- const elm = patch(null, vnode)
- expect(elm).toHaveClass('class1')
- expect(elm).toHaveClass('class2')
- })
-
- it('should handle transition class', () => {
- const vnode1 = new VNode('p', {
- class: { class1: true, class2: false, class3: true }
- })
- let elm = patch(null, vnode1)
- elm._transitionClasses = ['class4']
- const vnode2 = new VNode('p', {
- class: { class1: true, class2: true, class3: true }
- })
- elm = patch(vnode1, vnode2)
- expect(elm).toHaveClass('class1')
- expect(elm).toHaveClass('class2')
- expect(elm).toHaveClass('class3')
- expect(elm).toHaveClass('class4')
- })
-
- it('should change the elements class', () => {
- const vnode1 = new VNode('p', {
- class: { class1: true, class2: false, class3: true }
- })
- const vnode2 = new VNode('p', { staticClass: 'foo bar' })
- let elm = patch(null, vnode1)
- elm = patch(vnode1, vnode2)
- expect(elm).not.toHaveClass('class1')
- expect(elm).not.toHaveClass('class2')
- expect(elm).not.toHaveClass('class3')
- expect(elm).toHaveClass('foo')
- expect(elm).toHaveClass('bar')
- })
-
- it('should remove the elements class', () => {
- const vnode1 = new VNode('p', {
- class: { class1: true, class2: false, class3: true }
- })
- const vnode2 = new VNode('p', { class: {}})
- let elm = patch(null, vnode1)
- elm = patch(vnode1, vnode2)
- expect(elm).not.toHaveClass('class1')
- expect(elm).not.toHaveClass('class2')
- expect(elm).not.toHaveClass('class3')
- })
-
- it('should remove class for new nodes without class data', () => {
- const vnode1 = new VNode('p', {
- class: { class1: true, class2: false, class3: true }
- })
- const vnode2 = new VNode('p', {})
- let elm = patch(null, vnode1)
- elm = patch(vnode1, vnode2)
- expect(elm).not.toHaveClass('class1')
- expect(elm).not.toHaveClass('class2')
- expect(elm).not.toHaveClass('class3')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom directive module', () => {
- it('should work', () => {
- const directive1 = {
- bind: jasmine.createSpy('bind'),
- update: jasmine.createSpy('update'),
- unbind: jasmine.createSpy('unbind')
- }
- const vm = new Vue({ directives: { directive1 }})
- // create
- const vnode1 = new VNode('div', {}, [
- new VNode('p', {
- directives: [{
- name: 'directive1', value: 'hello', arg: 'arg1', modifiers: { modifier1: true }
- }]
- }, undefined, 'hello world', undefined, vm)
- ])
- patch(null, vnode1)
- expect(directive1.bind).toHaveBeenCalled()
- // update
- const vnode2 = new VNode('div', {}, [
- new VNode('p', {
- directives: [{
- name: 'directive1', value: 'world', arg: 'arg1', modifiers: { modifier1: true }
- }]
- }, undefined, 'hello world', undefined, vm)
- ])
- patch(vnode1, vnode2)
- expect(directive1.update).toHaveBeenCalled()
- // destroy
- const vnode3 = new VNode('div')
- patch(vnode2, vnode3)
- expect(directive1.unbind).toHaveBeenCalled()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom domProps module', () => {
- it('should create an element with domProps', () => {
- const vnode = new VNode('a', { domProps: { src: 'http://localhost/' }})
- const elm = patch(null, vnode)
- expect(elm.src).toBe('http://localhost/')
- })
-
- it('should change the elements domProps', () => {
- const vnode1 = new VNode('a', { domProps: { src: 'http://localhost/' }})
- const vnode2 = new VNode('a', { domProps: { src: 'https://vuejs.org/' }})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.src).toBe('https://vuejs.org/')
- })
-
- it('should remove the elements domProps', () => {
- const vnode1 = new VNode('a', { domProps: { src: 'http://localhost/' }})
- const vnode2 = new VNode('a', { domProps: {}})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.src).toBe('')
- })
-
- it('should initialize the elements value to zero', () => {
- const vnode = new VNode('input', { domProps: { value: 0 }})
- const elm = patch(null, vnode)
- expect(elm.value).toBe('0')
- })
-
- it('should save raw value on element', () => {
- const value = {}
- const vnode = new VNode('input', { domProps: { value }})
- const elm = patch(null, vnode)
- expect(elm._value).toBe(value)
- })
-
- it('should discard vnode children if the node has innerHTML or textContent as a prop', () => {
- const vnode = new VNode('div', { domProps: { innerHTML: 'hi' }}, [
- new VNode('span'), new VNode('span')
- ])
- const elm = patch(null, vnode)
- expect(elm.innerHTML).toBe('hi')
- expect(vnode.children.length).toBe(0)
-
- const vnode2 = new VNode('div', { domProps: { textContent: 'hi' }}, [
- new VNode('span'), new VNode('span')
- ])
- const elm2 = patch(null, vnode2)
- expect(elm2.textContent).toBe('hi')
- expect(vnode2.children.length).toBe(0)
-
- const vnode3 = new VNode('div', undefined, undefined, '123')
- patch(null, vnode3)
- const elm3 = patch(vnode3, vnode2)
- expect(elm3.textContent).toBe('hi')
-
- const vnode4 = new VNode('div', undefined, undefined, new VNode('span'))
- patch(null, vnode4)
- const elm4 = patch(vnode4, vnode)
- expect(elm4.textContent).toBe('hi')
- })
-
- it('should handle mutating observed props object', done => {
- const vm = new Vue({
- data: {
- props: {
- id: 'foo'
- }
- },
- render (h) {
- return h('div', {
- domProps: this.props
- })
- }
- }).$mount()
-
- expect(vm.$el.id).toBe('foo')
- vm.props.id = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.id).toBe('bar')
- vm.props = { id: 'baz' }
- }).then(() => {
- expect(vm.$el.id).toBe('baz')
- }).then(done)
- })
-})
+++ /dev/null
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom events module', () => {
- it('should attach event handler to element', () => {
- const click = jasmine.createSpy()
- const vnode = new VNode('a', { on: { click }})
-
- const elm = patch(null, vnode)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- })
-
- it('should not duplicate the same listener', () => {
- const click = jasmine.createSpy()
- const vnode1 = new VNode('a', { on: { click }})
- const vnode2 = new VNode('a', { on: { click }})
-
- const elm = patch(null, vnode1)
- patch(vnode1, vnode2)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- })
-
- it('should update different listener', () => {
- const click = jasmine.createSpy()
- const click2 = jasmine.createSpy()
- const vnode1 = new VNode('a', { on: { click }})
- const vnode2 = new VNode('a', { on: { click: click2 }})
-
- const elm = patch(null, vnode1)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(0)
-
- patch(vnode1, vnode2)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(1)
- })
-
- it('should attach Array of multiple handlers', () => {
- const click = jasmine.createSpy()
- const vnode = new VNode('a', { on: { click: [click, click] }})
-
- const elm = patch(null, vnode)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(2)
- })
-
- it('should update Array of multiple handlers', () => {
- const click = jasmine.createSpy()
- const click2 = jasmine.createSpy()
- const vnode1 = new VNode('a', { on: { click: [click, click2] }})
- const vnode2 = new VNode('a', { on: { click: [click] }})
-
- const elm = patch(null, vnode1)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(1)
-
- patch(vnode1, vnode2)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(2)
- expect(click2.calls.count()).toBe(1)
- })
-
- it('should remove handlers that are no longer present', () => {
- const click = jasmine.createSpy()
- const vnode1 = new VNode('a', { on: { click }})
- const vnode2 = new VNode('a', {})
-
- const elm = patch(null, vnode1)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
-
- patch(vnode1, vnode2)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- })
-
- it('should remove Array handlers that are no longer present', () => {
- const click = jasmine.createSpy()
- const vnode1 = new VNode('a', { on: { click: [click, click] }})
- const vnode2 = new VNode('a', {})
-
- const elm = patch(null, vnode1)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(2)
-
- patch(vnode1, vnode2)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(2)
- })
-
- // #4650
- it('should handle single -> array or array -> single handler changes', () => {
- const click = jasmine.createSpy()
- const click2 = jasmine.createSpy()
- const click3 = jasmine.createSpy()
- const vnode0 = new VNode('a', { on: { click: click }})
- const vnode1 = new VNode('a', { on: { click: [click, click2] }})
- const vnode2 = new VNode('a', { on: { click: click }})
- const vnode3 = new VNode('a', { on: { click: [click2, click3] }})
-
- const elm = patch(null, vnode0)
- document.body.appendChild(elm)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(1)
- expect(click2.calls.count()).toBe(0)
-
- patch(vnode0, vnode1)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(2)
- expect(click2.calls.count()).toBe(1)
-
- patch(vnode1, vnode2)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(3)
- expect(click2.calls.count()).toBe(1)
-
- patch(vnode2, vnode3)
- triggerEvent(elm, 'click')
- expect(click.calls.count()).toBe(3)
- expect(click2.calls.count()).toBe(2)
- expect(click3.calls.count()).toBe(1)
- })
-})
+++ /dev/null
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom style module', () => {
- it('should create an element with style', () => {
- const vnode = new VNode('p', { style: { fontSize: '12px' }})
- const elm = patch(null, vnode)
- expect(elm.style.fontSize).toBe('12px')
- })
-
- it('should create an element with array style', () => {
- const vnode = new VNode('p', { style: [{ fontSize: '12px' }, { color: 'red' }] })
- const elm = patch(null, vnode)
- expect(elm.style.fontSize).toBe('12px')
- expect(elm.style.color).toBe('red')
- })
-
- it('should change elements style', () => {
- const vnode1 = new VNode('p', { style: { fontSize: '12px' }})
- const vnode2 = new VNode('p', { style: { fontSize: '10px', display: 'block' }})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.style.fontSize).toBe('10px')
- expect(elm.style.display).toBe('block')
- })
-
- it('should remove elements attrs', () => {
- const vnode1 = new VNode('p', { style: { fontSize: '12px' }})
- const vnode2 = new VNode('p', { style: { display: 'block' }})
- patch(null, vnode1)
- const elm = patch(vnode1, vnode2)
- expect(elm.style.fontSize).toBe('')
- expect(elm.style.display).toBe('block')
- })
-})
+++ /dev/null
-import { patch } from 'web/runtime/patch'
-import VNode, { createEmptyVNode } from 'core/vdom/vnode'
-
-function prop (name) {
- return obj => { return obj[name] }
-}
-
-function map (fn, list) {
- const ret = []
- for (let i = 0; i < list.length; i++) {
- ret[i] = fn(list[i])
- }
- return ret
-}
-
-function spanNum (n) {
- if (typeof n === 'string') {
- return new VNode('span', {}, undefined, n)
- } else {
- return new VNode('span', { key: n }, undefined, n.toString())
- }
-}
-
-function shuffle (array) {
- let currentIndex = array.length
- let temporaryValue
- let randomIndex
-
- // while there remain elements to shuffle...
- while (currentIndex !== 0) {
- // pick a remaining element...
- randomIndex = Math.floor(Math.random() * currentIndex)
- currentIndex -= 1
- // and swap it with the current element.
- temporaryValue = array[currentIndex]
- array[currentIndex] = array[randomIndex]
- array[randomIndex] = temporaryValue
- }
- return array
-}
-
-const inner = prop('innerHTML')
-const tag = prop('tagName')
-
-describe('vdom patch: children', () => {
- let vnode0
- beforeEach(() => {
- vnode0 = new VNode('p', { attrs: { id: '1' }}, [createTextVNode('hello world')])
- patch(null, vnode0)
- })
-
- it('should appends elements', () => {
- const vnode1 = new VNode('p', {}, [1].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 3].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(1)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(3)
- expect(elm.children[1].innerHTML).toBe('2')
- expect(elm.children[2].innerHTML).toBe('3')
- })
-
- it('should prepends elements', () => {
- const vnode1 = new VNode('p', {}, [4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(2)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3', '4', '5'])
- })
-
- it('should add elements in the middle', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(4)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3', '4', '5'])
- })
-
- it('should add elements at begin and end', () => {
- const vnode1 = new VNode('p', {}, [2, 3, 4].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(3)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3', '4', '5'])
- })
-
- it('should add children to parent with no children', () => {
- const vnode1 = new VNode('p', { key: 'p' })
- const vnode2 = new VNode('p', { key: 'p' }, [1, 2, 3].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(0)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3'])
- })
-
- it('should remove all children from parent', () => {
- const vnode1 = new VNode('p', { key: 'p' }, [1, 2, 3].map(spanNum))
- const vnode2 = new VNode('p', { key: 'p' })
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3'])
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(0)
- })
-
- it('should remove elements from the beginning', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [3, 4, 5].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(5)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['3', '4', '5'])
- })
-
- it('should removes elements from end', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 3].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(5)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(3)
- expect(map(inner, elm.children)).toEqual(['1', '2', '3'])
- })
-
- it('should remove elements from the middle', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 2, 4, 5].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(5)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(4)
- expect(map(inner, elm.children)).toEqual(['1', '2', '4', '5'])
- })
-
- it('should moves element forward', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4].map(spanNum))
- const vnode2 = new VNode('p', {}, [2, 3, 1, 4].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(4)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(4)
- expect(map(inner, elm.children)).toEqual(['2', '3', '1', '4'])
- })
-
- it('should move elements to end', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3].map(spanNum))
- const vnode2 = new VNode('p', {}, [2, 3, 1].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(3)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(3)
- expect(map(inner, elm.children)).toEqual(['2', '3', '1'])
- })
-
- it('should move element backwards', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4].map(spanNum))
- const vnode2 = new VNode('p', {}, [1, 4, 2, 3].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(4)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(4)
- expect(map(inner, elm.children)).toEqual(['1', '4', '2', '3'])
- })
-
- it('should swap first and last', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4].map(spanNum))
- const vnode2 = new VNode('p', {}, [4, 2, 3, 1].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(4)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(4)
- expect(map(inner, elm.children)).toEqual(['4', '2', '3', '1'])
- })
-
- it('should move to left and replace', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [4, 1, 2, 3, 6].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(5)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(5)
- expect(map(inner, elm.children)).toEqual(['4', '1', '2', '3', '6'])
- })
-
- it('should move to left and leaves hold', () => {
- const vnode1 = new VNode('p', {}, [1, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [4, 6].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(3)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['4', '6'])
- })
-
- it('should handle moved and set to undefined element ending at the end', () => {
- const vnode1 = new VNode('p', {}, [2, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [4, 5, 3].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(3)
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(3)
- expect(map(inner, elm.children)).toEqual(['4', '5', '3'])
- })
-
- it('should move a key in non-keyed nodes with a size up', () => {
- const vnode1 = new VNode('p', {}, [1, 'a', 'b', 'c'].map(spanNum))
- const vnode2 = new VNode('p', {}, ['d', 'a', 'b', 'c', 1, 'e'].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(4)
- expect(elm.textContent, '1abc')
- elm = patch(vnode1, vnode2)
- expect(elm.children.length).toBe(6)
- expect(elm.textContent, 'dabc1e')
- })
-
- it('should reverse element', () => {
- const vnode1 = new VNode('p', {}, [1, 2, 3, 4, 5, 6, 7, 8].map(spanNum))
- const vnode2 = new VNode('p', {}, [8, 7, 6, 5, 4, 3, 2, 1].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(8)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['8', '7', '6', '5', '4', '3', '2', '1'])
- })
-
- it('something', () => {
- const vnode1 = new VNode('p', {}, [0, 1, 2, 3, 4, 5].map(spanNum))
- const vnode2 = new VNode('p', {}, [4, 3, 2, 1, 5, 0].map(spanNum))
- let elm = patch(vnode0, vnode1)
- expect(elm.children.length).toBe(6)
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['4', '3', '2', '1', '5', '0'])
- })
-
- it('should handle random shuffle', () => {
- let n
- let i
- const arr = []
- const opacities = []
- const elms = 14
- const samples = 5
- function spanNumWithOpacity (n, o) {
- return new VNode('span', { key: n, style: { opacity: o }}, undefined, n.toString())
- }
-
- for (n = 0; n < elms; ++n) { arr[n] = n }
- for (n = 0; n < samples; ++n) {
- const vnode1 = new VNode('span', {}, arr.map(n => {
- return spanNumWithOpacity(n, '1')
- }))
- const shufArr = shuffle(arr.slice(0))
- let elm = patch(vnode0, vnode1)
- for (i = 0; i < elms; ++i) {
- expect(elm.children[i].innerHTML).toBe(i.toString())
- opacities[i] = Math.random().toFixed(5).toString()
- }
- const vnode2 = new VNode('span', {}, arr.map(n => {
- return spanNumWithOpacity(shufArr[n], opacities[n])
- }))
- elm = patch(vnode1, vnode2)
- for (i = 0; i < elms; ++i) {
- expect(elm.children[i].innerHTML).toBe(shufArr[i].toString())
- expect(opacities[i].indexOf(elm.children[i].style.opacity)).toBe(0)
- }
- }
- })
-
- it('should append elements with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'hello')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'hello'),
- new VNode('span', {}, undefined, 'world')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['hello'])
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['hello', 'world'])
- })
-
- it('should handle unmoved text nodes with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- createTextVNode('text'),
- new VNode('span', {}, undefined, 'hello')
- ])
- const vnode2 = new VNode('div', {}, [
- createTextVNode('text'),
- new VNode('span', {}, undefined, 'hello')
- ])
- let elm = patch(vnode0, vnode1)
- expect(elm.childNodes[0].textContent).toBe('text')
- elm = patch(vnode1, vnode2)
- expect(elm.childNodes[0].textContent).toBe('text')
- })
-
- it('should handle changing text children with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- createTextVNode('text'),
- new VNode('span', {}, undefined, 'hello')
- ])
- const vnode2 = new VNode('div', {}, [
- createTextVNode('text2'),
- new VNode('span', {}, undefined, 'hello')
- ])
- let elm = patch(vnode0, vnode1)
- expect(elm.childNodes[0].textContent).toBe('text')
- elm = patch(vnode1, vnode2)
- expect(elm.childNodes[0].textContent).toBe('text2')
- })
-
- it('should prepend element with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'world')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'hello'),
- new VNode('span', {}, undefined, 'world')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['world'])
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['hello', 'world'])
- })
-
- it('should prepend element of different tag type with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'world')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('div', {}, undefined, 'hello'),
- new VNode('span', {}, undefined, 'world')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['world'])
- elm = patch(vnode1, vnode2)
- expect(map(prop('tagName'), elm.children)).toEqual(['DIV', 'SPAN'])
- expect(map(inner, elm.children)).toEqual(['hello', 'world'])
- })
-
- it('should remove elements with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'one'),
- new VNode('span', {}, undefined, 'two'),
- new VNode('span', {}, undefined, 'three')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'one'),
- new VNode('span', {}, undefined, 'three')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['one', 'two', 'three'])
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['one', 'three'])
- })
-
- it('should remove a single text node with updating children without keys', () => {
- const vnode1 = new VNode('div', {}, undefined, 'one')
- const vnode2 = new VNode('div', {})
- let elm = patch(vnode0, vnode1)
- expect(elm.textContent).toBe('one')
- elm = patch(vnode1, vnode2)
- expect(elm.textContent).toBe('')
- })
-
- it('should remove a single text node when children are updated', () => {
- const vnode1 = new VNode('div', {}, undefined, 'one')
- const vnode2 = new VNode('div', {}, [
- new VNode('div', {}, undefined, 'two'),
- new VNode('span', {}, undefined, 'three')
- ])
- let elm = patch(vnode0, vnode1)
- expect(elm.textContent).toBe('one')
- elm = patch(vnode1, vnode2)
- expect(map(prop('textContent'), elm.childNodes)).toEqual(['two', 'three'])
- })
-
- it('should remove a text node among other elements', () => {
- const vnode1 = new VNode('div', {}, [
- createTextVNode('one'),
- new VNode('span', {}, undefined, 'two')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('div', {}, undefined, 'three')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(prop('textContent'), elm.childNodes)).toEqual(['one', 'two'])
- elm = patch(vnode1, vnode2)
- expect(elm.childNodes.length).toBe(1)
- expect(elm.childNodes[0].tagName).toBe('DIV')
- expect(elm.childNodes[0].textContent).toBe('three')
- })
-
- it('should reorder elements', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'one'),
- new VNode('div', {}, undefined, 'two'),
- new VNode('b', {}, undefined, 'three')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('b', {}, undefined, 'three'),
- new VNode('span', {}, undefined, 'two'),
- new VNode('div', {}, undefined, 'one')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(inner, elm.children)).toEqual(['one', 'two', 'three'])
- elm = patch(vnode1, vnode2)
- expect(map(inner, elm.children)).toEqual(['three', 'two', 'one'])
- })
-
- it('should handle children with the same key but with different tag', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('div', { key: 1 }, undefined, 'one'),
- new VNode('div', { key: 2 }, undefined, 'two'),
- new VNode('div', { key: 3 }, undefined, 'three'),
- new VNode('div', { key: 4 }, undefined, 'four')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('div', { key: 4 }, undefined, 'four'),
- new VNode('span', { key: 3 }, undefined, 'three'),
- new VNode('span', { key: 2 }, undefined, 'two'),
- new VNode('div', { key: 1 }, undefined, 'one')
- ])
- let elm = patch(vnode0, vnode1)
- expect(map(tag, elm.children)).toEqual(['DIV', 'DIV', 'DIV', 'DIV'])
- expect(map(inner, elm.children)).toEqual(['one', 'two', 'three', 'four'])
- elm = patch(vnode1, vnode2)
- expect(map(tag, elm.children)).toEqual(['DIV', 'SPAN', 'SPAN', 'DIV'])
- expect(map(inner, elm.children)).toEqual(['four', 'three', 'two', 'one'])
- })
-
- it('should handle children with the same tag, same key, but one with data and one without data', () => {
- const vnode1 = new VNode('div', {}, [
- new VNode('div', { class: 'hi' }, undefined, 'one')
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('div', undefined, undefined, 'four')
- ])
- let elm = patch(vnode0, vnode1)
- const child1 = elm.children[0]
- expect(child1.className).toBe('hi')
- elm = patch(vnode1, vnode2)
- const child2 = elm.children[0]
- expect(child1).not.toBe(child2)
- expect(child2.className).toBe('')
- })
-
- it('should handle static vnodes properly', () => {
- function makeNode (text) {
- return new VNode('div', undefined, [
- new VNode(undefined, undefined, undefined, text)
- ])
- }
- const b = makeNode('B')
- b.isStatic = true
- b.key = `__static__1`
- const vnode1 = new VNode('div', {}, [makeNode('A'), b, makeNode('C')])
- const vnode2 = new VNode('div', {}, [b])
- const vnode3 = new VNode('div', {}, [makeNode('A'), b, makeNode('C')])
-
- let elm = patch(vnode0, vnode1)
- expect(elm.textContent).toBe('ABC')
- elm = patch(vnode1, vnode2)
- expect(elm.textContent).toBe('B')
- elm = patch(vnode2, vnode3)
- expect(elm.textContent).toBe('ABC')
- })
-
- it('should handle static vnodes inside ', () => {
- function makeNode (text) {
- return new VNode('div', undefined, [
- new VNode(undefined, undefined, undefined, text)
- ])
- }
- const b = makeNode('B')
- b.isStatic = true
- b.key = `__static__1`
- const vnode1 = new VNode('div', {}, [makeNode('A'), b, makeNode('C')])
- const vnode2 = new VNode('div', {}, [b])
- const vnode3 = new VNode('div', {}, [makeNode('A'), b, makeNode('C')])
-
- let elm = patch(vnode0, vnode1)
- expect(elm.textContent).toBe('ABC')
- elm = patch(vnode1, vnode2)
- expect(elm.textContent).toBe('B')
- elm = patch(vnode2, vnode3)
- expect(elm.textContent).toBe('ABC')
- })
-
- // #6502
- it('should not de-opt when both head and tail are changed', () => {
- const vnode1 = new VNode('div', {}, [
- createEmptyVNode(),
- new VNode('div'),
- createEmptyVNode()
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('p'),
- new VNode('div'),
- new VNode('p')
- ])
- let root = patch(null, vnode1)
- const original = root.childNodes[1]
-
- root = patch(vnode1, vnode2)
- const postPatch = root.childNodes[1]
-
- expect(postPatch).toBe(original)
- })
-
- it('should warn with duplicate keys: createChildren', () => {
- function makeNode (key) {
- return new VNode('div', { key: key })
- }
-
- const vnode = new VNode('p', {}, ['b', 'a', 'c', 'b'].map(makeNode))
- patch(null, vnode)
- expect(`Duplicate keys detected: 'b'`).toHaveBeenWarned()
- })
-
- it('should warn with duplicate keys: updateChildren', () => {
- function makeNode (key) {
- return new VNode('div', { key: key })
- }
-
- const vnode2 = new VNode('p', {}, ['b', 'a', 'c', 'b'].map(makeNode))
- const vnode3 = new VNode('p', {}, ['b', 'x', 'd', 'b'].map(makeNode))
- patch(vnode0, vnode2)
- expect(`Duplicate keys detected: 'b'`).toHaveBeenWarned()
- patch(vnode2, vnode3)
- expect(`Duplicate keys detected: 'b'`).toHaveBeenWarned()
- })
-})
+++ /dev/null
-import Vue from 'vue'
-
-describe('vdom patch: edge cases', () => {
- // exposed by #3406
- // When a static vnode is inside v-for, it's possible for the same vnode
- // to be used in multiple places, and its element will be replaced. This
- // causes patch errors when node ops depend on the vnode's element position.
- it('should handle static vnodes by key', done => {
- const vm = new Vue({
- data: {
- ok: true
- },
- template: `
- <div>
- <div v-for="i in 2">
- <div v-if="ok">a</div><div>b</div><div v-if="!ok">c</div><div>d</div>
- </div>
- </div>
- `
- }).$mount()
- expect(vm.$el.textContent).toBe('abdabd')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toBe('bcdbcd')
- }).then(done)
- })
-
- // exposed by #7705
- // methods and function expressions with modifiers should return result instead of undefined
- // skipped odd children[1,3, ...] because they are rendered as text nodes with undefined value
- it('should return listener\'s result for method name and function expression with and w/o modifiers', done => {
- const dummyEvt = { preventDefault: () => {} }
- new Vue({
- template: `
- <div v-test>
- <div @click="addFive"></div>
- <div @click.prevent="addFive"></div>
- <div @click="addFive($event, 5)"></div>
- <div @click.prevent="addFive($event, 5)"></div>
- </div>
- `,
- methods: {
- addFive ($event, toAdd = 0) {
- return toAdd + 5
- }
- },
- directives: {
- test: {
- bind (el, binding, vnode) {
- waitForUpdate(() => {
- expect(vnode.children[0].data.on.click()).toBe(5)
- }).then(() => {
- expect(vnode.children[2].data.on.click(dummyEvt)).toBe(5)
- }).then(() => {
- expect(vnode.children[4].data.on.click()).not.toBeDefined()
- }).then(() => {
- expect(vnode.children[6].data.on.click(dummyEvt)).not.toBeDefined()
- }).then(done)
- }
- }
- }
- }).$mount()
- })
-
- // #3533
- // a static node is reused in createElm, which changes its elm reference
- // and is inserted into a different parent.
- // later when patching the next element a DOM insertion uses it as the
- // reference node, causing a parent mismatch.
- it('should handle static node edge case when it\'s reused AND used as a reference node for insertion', done => {
- const vm = new Vue({
- data: {
- ok: true
- },
- template: `
- <div>
- <button @click="ok = !ok">toggle</button>
- <div class="b" v-if="ok">123</div>
- <div class="c">
- <div><span/></div><p>{{ 1 }}</p>
- </div>
- <div class="d">
- <label>{{ 2 }}</label>
- </div>
- <div class="b" v-if="ok">123</div>
- </div>
- `
- }).$mount()
-
- expect(vm.$el.querySelector('.c').textContent).toBe('1')
- expect(vm.$el.querySelector('.d').textContent).toBe('2')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.querySelector('.c').textContent).toBe('1')
- expect(vm.$el.querySelector('.d').textContent).toBe('2')
- }).then(done)
- })
-
- it('should handle slot nodes being reused across render', done => {
- const vm = new Vue({
- template: `
- <foo ref="foo">
- <div>slot</div>
- </foo>
- `,
- components: {
- foo: {
- data () {
- return { ok: true }
- },
- render (h) {
- const children = [
- this.ok ? h('div', 'toggler ') : null,
- h('div', [this.$slots.default, h('span', ' 1')]),
- h('div', [h('label', ' 2')])
- ]
- return h('div', children)
- }
- }
- }
- }).$mount()
- expect(vm.$el.textContent).toContain('toggler slot 1 2')
- vm.$refs.foo.ok = false
- waitForUpdate(() => {
- expect(vm.$el.textContent).toContain('slot 1 2')
- vm.$refs.foo.ok = true
- }).then(() => {
- expect(vm.$el.textContent).toContain('toggler slot 1 2')
- vm.$refs.foo.ok = false
- }).then(() => {
- expect(vm.$el.textContent).toContain('slot 1 2')
- vm.$refs.foo.ok = true
- }).then(done)
- })
-
- it('should synchronize vm\' vnode', done => {
- const comp = {
- data: () => ({ swap: true }),
- render (h) {
- return this.swap
- ? h('a', 'atag')
- : h('span', 'span')
- }
- }
-
- const wrapper = {
- render: h => h('comp'),
- components: { comp }
- }
-
- const vm = new Vue({
- render (h) {
- const children = [
- h('wrapper'),
- h('div', 'row')
- ]
- if (this.swap) {
- children.reverse()
- }
- return h('div', children)
- },
- data: () => ({ swap: false }),
- components: { wrapper }
- }).$mount()
-
- expect(vm.$el.innerHTML).toBe('<a>atag</a><div>row</div>')
- const wrapperVm = vm.$children[0]
- const compVm = wrapperVm.$children[0]
- vm.swap = true
- waitForUpdate(() => {
- expect(compVm.$vnode.parent).toBe(wrapperVm.$vnode)
- expect(vm.$el.innerHTML).toBe('<div>row</div><a>atag</a>')
- vm.swap = false
- }).then(() => {
- expect(compVm.$vnode.parent).toBe(wrapperVm.$vnode)
- expect(vm.$el.innerHTML).toBe('<a>atag</a><div>row</div>')
- compVm.swap = false
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>span</span><div>row</div>')
- expect(compVm.$vnode.parent).toBe(wrapperVm.$vnode)
- vm.swap = true
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<div>row</div><span>span</span>')
- expect(compVm.$vnode.parent).toBe(wrapperVm.$vnode)
- vm.swap = true
- }).then(done)
- })
-
- // #4530
- it('should not reset value when patching between dynamic/static bindings', done => {
- const vm = new Vue({
- data: { ok: true },
- template: `
- <div>
- <input type="button" v-if="ok" value="a">
- <input type="button" :value="'b'">
- </div>
- `
- }).$mount()
- expect(vm.$el.children[0].value).toBe('a')
- vm.ok = false
- waitForUpdate(() => {
- expect(vm.$el.children[0].value).toBe('b')
- vm.ok = true
- }).then(() => {
- expect(vm.$el.children[0].value).toBe('a')
- }).then(done)
- })
-
- // #6313
- it('should not replace node when switching between text-like inputs', done => {
- const vm = new Vue({
- data: { show: false },
- template: `
- <div>
- <input :type="show ? 'text' : 'password'">
- </div>
- `
- }).$mount()
- const node = vm.$el.children[0]
- expect(vm.$el.children[0].type).toBe('password')
- vm.$el.children[0].value = 'test'
- vm.show = true
- waitForUpdate(() => {
- expect(vm.$el.children[0]).toBe(node)
- expect(vm.$el.children[0].value).toBe('test')
- expect(vm.$el.children[0].type).toBe('text')
- vm.show = false
- }).then(() => {
- expect(vm.$el.children[0]).toBe(node)
- expect(vm.$el.children[0].value).toBe('test')
- expect(vm.$el.children[0].type).toBe('password')
- }).then(done)
- })
-
- it('should properly patch nested HOC when root element is replaced', done => {
- const vm = new Vue({
- template: `<foo class="hello" ref="foo" />`,
- components: {
- foo: {
- template: `<bar ref="bar" />`,
- components: {
- bar: {
- template: `<div v-if="ok"></div><span v-else></span>`,
- data () {
- return { ok: true }
- }
- }
- }
- }
- }
- }).$mount()
-
- expect(vm.$refs.foo.$refs.bar.$el.tagName).toBe('DIV')
- expect(vm.$refs.foo.$refs.bar.$el.className).toBe(`hello`)
-
- vm.$refs.foo.$refs.bar.ok = false
- waitForUpdate(() => {
- expect(vm.$refs.foo.$refs.bar.$el.tagName).toBe('SPAN')
- expect(vm.$refs.foo.$refs.bar.$el.className).toBe(`hello`)
- }).then(done)
- })
-
- // #6790
- it('should not render undefined for empty nested arrays', () => {
- const vm = new Vue({
- template: `<div><template v-for="i in emptyArr"></template></div>`,
- data: { emptyArr: [] }
- }).$mount()
- expect(vm.$el.textContent).toBe('')
- })
-
- // #6803
- it('backwards compat with checkbox code generated before 2.4', () => {
- const spy = jasmine.createSpy()
- const vm = new Vue({
- data: {
- label: 'foobar',
- name: 'foobar'
- },
- computed: {
- value: {
- get () {
- return 1
- },
- set: spy
- }
- },
- render (h) {
- const _vm = this
- return h('div', {},
- [h('input', {
- directives: [{
- name: 'model',
- rawName: 'v-model',
- value: (_vm.value),
- expression: 'value'
- }],
- attrs: {
- 'type': 'radio',
- 'name': _vm.name
- },
- domProps: {
- 'value': _vm.label,
- 'checked': _vm._q(_vm.value, _vm.label)
- },
- on: {
- '__c': function ($event) {
- _vm.value = _vm.label
- }
- }
- })])
- }
- }).$mount()
-
- document.body.appendChild(vm.$el)
- vm.$el.children[0].click()
- expect(spy).toHaveBeenCalled()
- })
-
- // #7041
- it('transition children with only deep bindings should be patched on update', done => {
- const vm = new Vue({
- template: `
- <div>
- <transition>
- <div :style="style"></div>
- </transition>
- </div>
- `,
- data: () => ({
- style: { color: 'red' }
- })
- }).$mount()
- expect(vm.$el.children[0].style.color).toBe('red')
- vm.style.color = 'green'
- waitForUpdate(() => {
- expect(vm.$el.children[0].style.color).toBe('green')
- }).then(done)
- })
-
- // #7294
- it('should cleanup component inline events on patch when no events are present', done => {
- const log = jasmine.createSpy()
- const vm = new Vue({
- data: { ok: true },
- template: `
- <div>
- <foo v-if="ok" @custom="log"/>
- <foo v-else/>
- </div>
- `,
- components: {
- foo: {
- render () {}
- }
- },
- methods: { log }
- }).$mount()
-
- vm.ok = false
- waitForUpdate(() => {
- vm.$children[0].$emit('custom')
- expect(log).not.toHaveBeenCalled()
- }).then(done)
- })
-
- // #6864
- it('should not special-case boolean attributes for custom elements', () => {
- Vue.config.ignoredElements = [/^custom-/]
- const vm = new Vue({
- template: `<div><custom-foo selected="1"/></div>`
- }).$mount()
- expect(vm.$el.querySelector('custom-foo').getAttribute('selected')).toBe('1')
- Vue.config.ignoredElements = []
- })
-
- // #7805
- it('should not cause duplicate init when components share data object', () => {
- const Base = {
- render (h) {
- return h('div', this.$options.name)
- }
- }
-
- const Foo = {
- name: 'Foo',
- extends: Base
- }
-
- const Bar = {
- name: 'Bar',
- extends: Base
- }
-
- const vm = new Vue({
- render (h) {
- const data = { staticClass: 'text-red' }
-
- return h('div', [
- h(Foo, data),
- h(Bar, data)
- ])
- }
- }).$mount()
-
- expect(vm.$el.textContent).toBe('FooBar')
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import { patch } from 'web/runtime/patch'
-import VNode from 'core/vdom/vnode'
-
-describe('vdom patch: element', () => {
- it('should create an element', () => {
- const vnode = new VNode('p', { attrs: { id: '1' }}, [createTextVNode('hello world')])
- const elm = patch(null, vnode)
- expect(elm.tagName).toBe('P')
- expect(elm.outerHTML).toBe('<p id="1">hello world</p>')
- })
-
- it('should create an element which having the namespace', () => {
- const vnode = new VNode('svg', {})
- vnode.ns = 'svg'
- const elm = patch(null, vnode)
- expect(elm.namespaceURI).toBe('http://www.w3.org/2000/svg')
- })
-
- const el = document.createElement('unknown')
- // Android Browser <= 4.2 doesn't use correct class name,
- // but it doesn't matter because no one's gonna use it as their primary
- // development browser.
- if (/HTMLUnknownElement/.test(el.toString())) {
- it('should warn unknown element', () => {
- const vnode = new VNode('unknown')
- patch(null, vnode)
- expect(`Unknown custom element: <unknown>`).toHaveBeenWarned()
- })
- }
-
- it('should warn unknown element with hyphen', () => {
- const vnode = new VNode('unknown-foo')
- patch(null, vnode)
- expect(`Unknown custom element: <unknown-foo>`).toHaveBeenWarned()
- })
-
- it('should create an elements which having text content', () => {
- const vnode = new VNode('div', {}, [createTextVNode('hello world')])
- const elm = patch(null, vnode)
- expect(elm.innerHTML).toBe('hello world')
- })
-
- it('should create create an elements which having span and text content', () => {
- const vnode = new VNode('div', {}, [
- new VNode('span'),
- createTextVNode('hello world')
- ])
- const elm = patch(null, vnode)
- expect(elm.childNodes[0].tagName).toBe('SPAN')
- expect(elm.childNodes[1].textContent).toBe('hello world')
- })
-
- it('should create element with scope attribute', () => {
- const vnode = new VNode('div')
- vnode.context = new Vue({ _scopeId: 'foo' })
- const elm = patch(null, vnode)
- expect(elm.hasAttribute('foo')).toBe(true)
- })
-})
+++ /dev/null
-import { patch } from 'web/runtime/patch'
-import { createPatchFunction } from 'core/vdom/patch'
-import baseModules from 'core/vdom/modules/index'
-import * as nodeOps from 'web/runtime/node-ops'
-import platformModules from 'web/runtime/modules/index'
-import VNode from 'core/vdom/vnode'
-
-const modules = baseModules.concat(platformModules)
-
-describe('vdom patch: hooks', () => {
- let vnode0
- beforeEach(() => {
- vnode0 = new VNode('p', { attrs: { id: '1' }}, [createTextVNode('hello world')])
- patch(null, vnode0)
- })
-
- it('should call `insert` listener after both parents, siblings and children have been inserted', () => {
- const result = []
- function insert (vnode) {
- expect(vnode.elm.children.length).toBe(2)
- expect(vnode.elm.parentNode.children.length).toBe(3)
- result.push(vnode)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { insert }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ]),
- new VNode('span', {}, undefined, 'can touch me')
- ])
- patch(vnode0, vnode1)
- expect(result.length).toBe(1)
- })
-
- it('should call `prepatch` listener', () => {
- const result = []
- function prepatch (oldVnode, newVnode) {
- expect(oldVnode).toEqual(vnode1.children[1])
- expect(newVnode).toEqual(vnode2.children[1])
- result.push(newVnode)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { prepatch }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { prepatch }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(result.length).toBe(1)
- })
-
- it('should call `postpatch` after `prepatch` listener', () => {
- const pre = []
- const post = []
- function prepatch (oldVnode, newVnode) {
- pre.push(pre)
- }
- function postpatch (oldVnode, newVnode) {
- expect(pre.length).toBe(post.length + 1)
- post.push(post)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { prepatch, postpatch }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { prepatch, postpatch }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(pre.length).toBe(1)
- expect(post.length).toBe(1)
- })
-
- it('should call `update` listener', () => {
- const result1 = []
- const result2 = []
- function cb (result, oldVnode, newVnode) {
- if (result.length > 1) {
- expect(result[result.length - 1]).toEqual(oldVnode)
- }
- result.push(newVnode)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { update: cb.bind(null, result1) }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', { hook: { update: cb.bind(null, result2) }}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { update: cb.bind(null, result1) }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', { hook: { update: cb.bind(null, result2) }}, undefined, 'child 2')
- ])
- ])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(result1.length).toBe(1)
- expect(result2.length).toBe(1)
- })
-
- it('should call `remove` listener', () => {
- const result = []
- function remove (vnode, rm) {
- const parent = vnode.elm.parentNode
- expect(vnode.elm.children.length).toBe(2)
- expect(vnode.elm.children.length).toBe(2)
- result.push(vnode)
- rm()
- expect(parent.children.length).toBe(1)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { remove }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling')
- ])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(result.length).toBe(1)
- })
-
- it('should call `init` and `prepatch` listeners on root', () => {
- let count = 0
- function init (vnode) { count++ }
- function prepatch (oldVnode, newVnode) { count++ }
- const vnode1 = new VNode('div', { hook: { init, prepatch }})
- patch(vnode0, vnode1)
- expect(count).toBe(1)
- const vnode2 = new VNode('span', { hook: { init, prepatch }})
- patch(vnode1, vnode2)
- expect(count).toBe(2)
- })
-
- it('should remove element when all remove listeners are done', () => {
- let rm1, rm2, rm3
- const patch1 = createPatchFunction({
- nodeOps,
- modules: modules.concat([
- { remove (_, rm) { rm1 = rm } },
- { remove (_, rm) { rm2 = rm } }
- ])
- })
- const vnode1 = new VNode('div', {}, [
- new VNode('a', { hook: { remove (_, rm) { rm3 = rm } }})
- ])
- const vnode2 = new VNode('div', {}, [])
- let elm = patch1(vnode0, vnode1)
- expect(elm.children.length).toBe(1)
- elm = patch1(vnode1, vnode2)
- expect(elm.children.length).toBe(1)
- rm1()
- expect(elm.children.length).toBe(1)
- rm3()
- expect(elm.children.length).toBe(1)
- rm2()
- expect(elm.children.length).toBe(0)
- })
-
- it('should invoke the remove hook on replaced root', () => {
- const result = []
- const parent = nodeOps.createElement('div')
- vnode0 = nodeOps.createElement('div')
- parent.appendChild(vnode0)
- function remove (vnode, rm) {
- result.push(vnode)
- rm()
- }
- const vnode1 = new VNode('div', { hook: { remove }}, [
- new VNode('b', {}, undefined, 'child 1'),
- new VNode('i', {}, undefined, 'child 2')
- ])
- const vnode2 = new VNode('span', {}, [
- new VNode('b', {}, undefined, 'child 1'),
- new VNode('i', {}, undefined, 'child 2')
- ])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(result.length).toBe(1)
- })
-
- it('should invoke global `destroy` hook for all removed children', () => {
- const result = []
- function destroy (vnode) { result.push(vnode) }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', {}, [
- new VNode('span', { hook: { destroy }}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div')
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- expect(result.length).toBe(1)
- })
-
- it('should handle text vnodes with `undefined` `data` property', () => {
- const vnode1 = new VNode('div', {}, [createTextVNode(' ')])
- const vnode2 = new VNode('div', {}, [])
- patch(vnode0, vnode1)
- patch(vnode1, vnode2)
- })
-
- it('should invoke `destroy` module hook for all removed children', () => {
- let created = 0
- let destroyed = 0
- const patch1 = createPatchFunction({
- nodeOps,
- modules: modules.concat([
- { create () { created++ } },
- { destroy () { destroyed++ } }
- ])
- })
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', {}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ])
- ])
- const vnode2 = new VNode('div', {})
- patch1(vnode0, vnode1)
- expect(destroyed).toBe(1) // should invoke for replaced root nodes too
- patch1(vnode1, vnode2)
- expect(created).toBe(5)
- expect(destroyed).toBe(5)
- })
-
- it('should not invoke `create` and `remove` module hook for text nodes', () => {
- let created = 0
- let removed = 0
- const patch1 = createPatchFunction({
- nodeOps,
- modules: modules.concat([
- { create () { created++ } },
- { remove () { removed++ } }
- ])
- })
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first child'),
- createTextVNode(''),
- new VNode('span', {}, undefined, 'third child')
- ])
- const vnode2 = new VNode('div', {})
- patch1(vnode0, vnode1)
- patch1(vnode1, vnode2)
- expect(created).toBe(3)
- expect(removed).toBe(2)
- })
-
- it('should not invoke `destroy` module hook for text nodes', () => {
- let created = 0
- let destroyed = 0
- const patch1 = createPatchFunction({
- nodeOps,
- modules: modules.concat([
- { create () { created++ } },
- { destroy () { destroyed++ } }
- ])
- })
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', {}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, [
- createTextVNode('text1'),
- createTextVNode('text2')
- ])
- ])
- ])
- const vnode2 = new VNode('div', {})
- patch1(vnode0, vnode1)
- expect(destroyed).toBe(1) // should invoke for replaced root nodes too
- patch1(vnode1, vnode2)
- expect(created).toBe(5)
- expect(destroyed).toBe(5)
- })
-
- it('should call `create` listener before inserted into parent but after children', () => {
- const result = []
- function create (empty, vnode) {
- expect(vnode.elm.children.length).toBe(2)
- expect(vnode.elm.parentNode).toBe(null)
- result.push(vnode)
- }
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}, undefined, 'first sibling'),
- new VNode('div', { hook: { create }}, [
- new VNode('span', {}, undefined, 'child 1'),
- new VNode('span', {}, undefined, 'child 2')
- ]),
- new VNode('span', {}, undefined, 'can\'t touch me')
- ])
- patch(vnode0, vnode1)
- expect(result.length).toBe(1)
- })
-})
+++ /dev/null
-import Vue from 'vue'
-import VNode from 'core/vdom/vnode'
-import { patch } from 'web/runtime/patch'
-import { SSR_ATTR } from 'shared/constants'
-
-function createMockSSRDOM (innerHTML) {
- const dom = document.createElement('div')
- dom.setAttribute(SSR_ATTR, 'true')
- dom.innerHTML = innerHTML
- return dom
-}
-
-describe('vdom patch: hydration', () => {
- let vnode0
- beforeEach(() => {
- vnode0 = new VNode('p', { attrs: { id: '1' }}, [createTextVNode('hello world')])
- patch(null, vnode0)
- })
-
- it('should hydrate elements when server-rendered DOM tree is same as virtual DOM tree', () => {
- const result = []
- function init (vnode) { result.push(vnode) }
- function createServerRenderedDOM () {
- const root = document.createElement('div')
- root.setAttribute(SSR_ATTR, 'true')
- const span = document.createElement('span')
- root.appendChild(span)
- const div = document.createElement('div')
- const child1 = document.createElement('span')
- const child2 = document.createElement('span')
- child1.textContent = 'hi'
- child2.textContent = 'ho'
- div.appendChild(child1)
- div.appendChild(child2)
- root.appendChild(div)
- return root
- }
- const node0 = createServerRenderedDOM()
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}),
- new VNode('div', { hook: { init }}, [
- new VNode('span', {}, [new VNode(undefined, undefined, undefined, 'hi')]),
- new VNode('span', {}, [new VNode(undefined, undefined, undefined, 'ho')])
- ])
- ])
- patch(node0, vnode1)
- expect(result.length).toBe(1)
-
- function traverseAndAssert (vnode, element) {
- expect(vnode.elm).toBe(element)
- if (vnode.children) {
- vnode.children.forEach((node, i) => {
- traverseAndAssert(node, element.childNodes[i])
- })
- }
- }
- // ensure vnodes are correctly associated with actual DOM
- traverseAndAssert(vnode1, node0)
-
- // check update
- const vnode2 = new VNode('div', { attrs: { id: 'foo' }}, [
- new VNode('span', { attrs: { id: 'bar' }}),
- new VNode('div', { hook: { init }}, [
- new VNode('span', {}),
- new VNode('span', {})
- ])
- ])
- patch(vnode1, vnode2)
- expect(node0.id).toBe('foo')
- expect(node0.children[0].id).toBe('bar')
- })
-
- it('should warn message that virtual DOM tree is not matching when hydrate element', () => {
- function createServerRenderedDOM () {
- const root = document.createElement('div')
- root.setAttribute(SSR_ATTR, 'true')
- const span = document.createElement('span')
- root.appendChild(span)
- const div = document.createElement('div')
- const child1 = document.createElement('span')
- div.appendChild(child1)
- root.appendChild(div)
- return root
- }
- const node0 = createServerRenderedDOM()
- const vnode1 = new VNode('div', {}, [
- new VNode('span', {}),
- new VNode('div', {}, [
- new VNode('span', {}),
- new VNode('span', {})
- ])
- ])
- patch(node0, vnode1)
- expect('The client-side rendered virtual DOM tree is not matching').toHaveBeenWarned()
- })
-
- // component hydration is better off with a more e2e approach
- it('should hydrate components when server-rendered DOM tree is same as virtual DOM tree', done => {
- const dom = createMockSSRDOM('<span>foo</span><div class="b a"><span>foo qux</span></div><!---->')
- const originalNode1 = dom.children[0]
- const originalNode2 = dom.children[1]
-
- const vm = new Vue({
- template: '<div><span>{{msg}}</span><test class="a" :msg="msg"></test><p v-if="ok"></p></div>',
- data: {
- msg: 'foo',
- ok: false
- },
- components: {
- test: {
- props: ['msg'],
- data () {
- return { a: 'qux' }
- },
- template: '<div class="b"><span>{{msg}} {{a}}</span></div>'
- }
- }
- })
-
- expect(() => { vm.$mount(dom) }).not.toThrow()
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(vm.$el).toBe(dom)
- expect(vm.$children[0].$el).toBe(originalNode2)
- expect(vm.$el.children[0]).toBe(originalNode1)
- expect(vm.$el.children[1]).toBe(originalNode2)
- vm.msg = 'bar'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<span>bar</span><div class="b a"><span>bar qux</span></div><!---->')
- vm.$children[0].a = 'ququx'
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>bar</span><div class="b a"><span>bar ququx</span></div><!---->')
- vm.ok = true
- }).then(() => {
- expect(vm.$el.innerHTML).toBe('<span>bar</span><div class="b a"><span>bar ququx</span></div><p></p>')
- }).then(done)
- })
-
- it('should warn failed hydration for non-matching DOM in child component', () => {
- const dom = createMockSSRDOM('<div><span></span></div>')
-
- new Vue({
- template: '<div><test></test></div>',
- components: {
- test: {
- template: '<div><a></a></div>'
- }
- }
- }).$mount(dom)
-
- expect('not matching server-rendered content').toHaveBeenWarned()
- })
-
- it('should warn failed hydration when component is not properly registered', () => {
- const dom = createMockSSRDOM('<div><foo></foo></div>')
-
- new Vue({
- template: '<div><foo></foo></div>'
- }).$mount(dom)
-
- expect('not matching server-rendered content').toHaveBeenWarned()
- expect('Unknown custom element: <foo>').toHaveBeenWarned()
- })
-
- it('should overwrite textNodes in the correct position but with mismatching text without warning', () => {
- const dom = createMockSSRDOM('<div><span>foo</span></div>')
-
- new Vue({
- template: '<div><test></test></div>',
- components: {
- test: {
- data () {
- return { a: 'qux' }
- },
- template: '<div><span>{{a}}</span></div>'
- }
- }
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(dom.querySelector('span').textContent).toBe('qux')
- })
-
- it('should pick up elements with no children and populate without warning', done => {
- const dom = createMockSSRDOM('<div><span></span></div>')
- const span = dom.querySelector('span')
-
- const vm = new Vue({
- template: '<div><test></test></div>',
- components: {
- test: {
- data () {
- return { a: 'qux' }
- },
- template: '<div><span>{{a}}</span></div>'
- }
- }
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(span).toBe(vm.$el.querySelector('span'))
- expect(vm.$el.innerHTML).toBe('<div><span>qux</span></div>')
-
- vm.$children[0].a = 'foo'
- waitForUpdate(() => {
- expect(vm.$el.innerHTML).toBe('<div><span>foo</span></div>')
- }).then(done)
- })
-
- it('should hydrate async component', done => {
- const dom = createMockSSRDOM('<span>foo</span>')
- const span = dom.querySelector('span')
-
- const Foo = resolve => setTimeout(() => {
- resolve({
- data: () => ({ msg: 'foo' }),
- template: `<span>{{ msg }}</span>`
- })
- }, 0)
-
- const vm = new Vue({
- template: '<div><foo ref="foo" /></div>',
- components: { Foo }
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(dom.innerHTML).toBe('<span>foo</span>')
- expect(vm.$refs.foo).toBeUndefined()
-
- setTimeout(() => {
- expect(dom.innerHTML).toBe('<span>foo</span>')
- expect(vm.$refs.foo).not.toBeUndefined()
- vm.$refs.foo.msg = 'bar'
- waitForUpdate(() => {
- expect(dom.innerHTML).toBe('<span>bar</span>')
- expect(dom.querySelector('span')).toBe(span)
- }).then(done)
- }, 50)
- })
-
- it('should hydrate async component without showing loading', done => {
- const dom = createMockSSRDOM('<span>foo</span>')
- const span = dom.querySelector('span')
-
- const Foo = () => ({
- component: new Promise(resolve => {
- setTimeout(() => {
- resolve({
- data: () => ({ msg: 'foo' }),
- template: `<span>{{ msg }}</span>`
- })
- }, 10)
- }),
- delay: 1,
- loading: {
- render: h => h('span', 'loading')
- }
- })
-
- const vm = new Vue({
- template: '<div><foo ref="foo" /></div>',
- components: { Foo }
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(dom.innerHTML).toBe('<span>foo</span>')
- expect(vm.$refs.foo).toBeUndefined()
-
- setTimeout(() => {
- expect(dom.innerHTML).toBe('<span>foo</span>')
- }, 2)
-
- setTimeout(() => {
- expect(dom.innerHTML).toBe('<span>foo</span>')
- expect(vm.$refs.foo).not.toBeUndefined()
- vm.$refs.foo.msg = 'bar'
- waitForUpdate(() => {
- expect(dom.innerHTML).toBe('<span>bar</span>')
- expect(dom.querySelector('span')).toBe(span)
- }).then(done)
- }, 50)
- })
-
- it('should hydrate async component by replacing DOM if error occurs', done => {
- const dom = createMockSSRDOM('<span>foo</span>')
-
- const Foo = () => ({
- component: new Promise((resolve, reject) => {
- setTimeout(() => {
- reject('something went wrong')
- }, 10)
- }),
- error: {
- render: h => h('span', 'error')
- }
- })
-
- new Vue({
- template: '<div><foo ref="foo" /></div>',
- components: { Foo }
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- expect(dom.innerHTML).toBe('<span>foo</span>')
-
- setTimeout(() => {
- expect('Failed to resolve async').toHaveBeenWarned()
- expect(dom.innerHTML).toBe('<span>error</span>')
- done()
- }, 50)
- })
-
- it('should hydrate v-html with children', () => {
- const dom = createMockSSRDOM('<span>foo</span>')
-
- new Vue({
- data: {
- html: `<span>foo</span>`
- },
- template: `<div v-html="html">hello</div>`
- }).$mount(dom)
-
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- })
-
- it('should warn mismatching v-html', () => {
- const dom = createMockSSRDOM('<span>bar</span>')
-
- new Vue({
- data: {
- html: `<span>foo</span>`
- },
- template: `<div v-html="html">hello</div>`
- }).$mount(dom)
-
- expect('not matching server-rendered content').toHaveBeenWarned()
- })
-
- it('should hydrate with adjacent text nodes from array children (e.g. slots)', () => {
- const dom = createMockSSRDOM('<div>foo</div> hello')
-
- new Vue({
- template: `<test>hello</test>`,
- components: {
- test: {
- template: `
- <div>
- <div>foo</div>
- <slot/>
- </div>
- `
- }
- }
- }).$mount(dom)
- expect('not matching server-rendered content').not.toHaveBeenWarned()
- })
-
- // #7063
- it('should properly initialize dynamic style bindings for future updates', done => {
- const dom = createMockSSRDOM('<div style="padding-left:0px"></div>')
-
- const vm = new Vue({
- data: {
- style: { paddingLeft: '0px' }
- },
- template: `<div><div :style="style"></div></div>`
- }).$mount(dom)
-
- // should update
- vm.style.paddingLeft = '100px'
- waitForUpdate(() => {
- expect(dom.children[0].style.paddingLeft).toBe('100px')
- }).then(done)
- })
-
- it('should properly initialize dynamic class bindings for future updates', done => {
- const dom = createMockSSRDOM('<div class="foo bar"></div>')
-
- const vm = new Vue({
- data: {
- cls: [{ foo: true }, 'bar']
- },
- template: `<div><div :class="cls"></div></div>`
- }).$mount(dom)
-
- // should update
- vm.cls[0].foo = false
- waitForUpdate(() => {
- expect(dom.children[0].className).toBe('bar')
- }).then(done)
- })
-})
+++ /dev/null
-{
- "env": {
- "jasmine": true
- },
- "plugins": ["jasmine"],
- "rules": {
- "jasmine/no-focused-tests": 2
- }
-}
+++ /dev/null
-import {
- readFile,
- readObject,
- compileVue,
- compileWithDeps,
- createInstance,
- addTaskHook,
- resetTaskHook,
- getRoot,
- getEvents,
- fireEvent
-} from '../helpers'
-
-// Create one-off render test case
-function createRenderTestCase (name) {
- const source = readFile(`${name}.vue`)
- const target = readObject(`${name}.vdom.js`)
- return done => {
- compileVue(source).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- expect(getRoot(instance)).toEqual(target)
- instance.$destroy()
- done()
- }, 50)
- }).catch(done.fail)
- }
-}
-
-// Create event test case, will trigger the first bind event
-function createEventTestCase (name) {
- const source = readFile(`${name}.vue`)
- const before = readObject(`${name}.before.vdom.js`)
- const after = readObject(`${name}.after.vdom.js`)
- return done => {
- compileVue(source).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- expect(getRoot(instance)).toEqual(before)
- const event = getEvents(instance)[0]
- fireEvent(instance, event.ref, event.type, {})
- setTimeout(() => {
- expect(getRoot(instance)).toEqual(after)
- instance.$destroy()
- done()
- }, 50)
- }, 50)
- }).catch(done.fail)
- }
-}
-
-describe('Usage', () => {
- describe('render', () => {
- it('sample', createRenderTestCase('render/sample'))
- })
-
- describe('event', () => {
- it('click', createEventTestCase('event/click'))
- })
-
- describe('recycle-list', () => {
- it('text node', createRenderTestCase('recycle-list/text-node'))
- it('attributes', createRenderTestCase('recycle-list/attrs'))
- // it('class name', createRenderTestCase('recycle-list/classname'))
- it('inline style', createRenderTestCase('recycle-list/inline-style'))
- it('v-if', createRenderTestCase('recycle-list/v-if'))
- it('v-else', createRenderTestCase('recycle-list/v-else'))
- it('v-else-if', createRenderTestCase('recycle-list/v-else-if'))
- it('v-for', createRenderTestCase('recycle-list/v-for'))
- it('v-for-iterator', createRenderTestCase('recycle-list/v-for-iterator'))
- it('v-on', createRenderTestCase('recycle-list/v-on'))
- it('v-on-inline', createRenderTestCase('recycle-list/v-on-inline'))
- it('v-once', createRenderTestCase('recycle-list/v-once'))
-
- it('stateless component', done => {
- compileWithDeps('recycle-list/components/stateless.vue', [{
- name: 'banner',
- path: 'recycle-list/components/banner.vue'
- }]).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- const target = readObject('recycle-list/components/stateless.vdom.js')
- expect(getRoot(instance)).toEqual(target)
- instance.$destroy()
- done()
- }, 50)
- }).catch(done.fail)
- })
-
- it('stateless component with props', done => {
- compileWithDeps('recycle-list/components/stateless-with-props.vue', [{
- name: 'poster',
- path: 'recycle-list/components/poster.vue'
- }]).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- const target = readObject('recycle-list/components/stateless-with-props.vdom.js')
- expect(getRoot(instance)).toEqual(target)
- instance.$destroy()
- done()
- }, 50)
- }).catch(done.fail)
- })
-
- it('multi stateless components', done => {
- compileWithDeps('recycle-list/components/stateless-multi-components.vue', [{
- name: 'banner',
- path: 'recycle-list/components/banner.vue'
- }, {
- name: 'poster',
- path: 'recycle-list/components/poster.vue'
- }, {
- name: 'footer',
- path: 'recycle-list/components/footer.vue'
- }]).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- const target = readObject('recycle-list/components/stateless-multi-components.vdom.js')
- expect(getRoot(instance)).toEqual(target)
- instance.$destroy()
- done()
- }, 50)
- }).catch(done.fail)
- })
-
- it('stateful component', done => {
- const tasks = []
- addTaskHook((_, task) => tasks.push(task))
- compileWithDeps('recycle-list/components/stateful.vue', [{
- name: 'counter',
- path: 'recycle-list/components/counter.vue'
- }]).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- // expect(tasks.length).toEqual(3)
- setTimeout(() => {
- // check the render results
- const target = readObject('recycle-list/components/stateful.vdom.js')
- expect(getRoot(instance)).toEqual(target)
- tasks.length = 0
-
- // // trigger component hooks
- // instance.$triggerHook(
- // 2, // cid of the virtual component template
- // 'create', // lifecycle hook name
-
- // // arguments for the callback
- // [
- // 'x-1', // componentId of the virtual component
- // { start: 3 } // propsData of the virtual component
- // ]
- // )
- // instance.$triggerHook(2, 'create', ['x-2', { start: 11 }])
-
- // // the state (_data) of the virtual component should be sent to native
- // expect(tasks.length).toEqual(2)
- // expect(tasks[0].method).toEqual('updateComponentData')
- // expect(tasks[0].args).toEqual(['x-1', { count: 6 }, ''])
- // expect(tasks[1].method).toEqual('updateComponentData')
- // expect(tasks[1].args).toEqual(['x-2', { count: 22 }, ''])
-
- // instance.$triggerHook('x-1', 'attach')
- // instance.$triggerHook('x-2', 'attach')
- // tasks.length = 0
-
- // // simulate a click event
- // // the event will be caught by the virtual component template and
- // // should be dispatched to virtual component according to the componentId
- // const event = getEvents(instance)[0]
- // fireEvent(instance, event.ref, 'click', { componentId: 'x-1' })
- setTimeout(() => {
- // expect(tasks.length).toEqual(1)
- // expect(tasks[0].method).toEqual('updateComponentData')
- // expect(tasks[0].args).toEqual([{ count: 7 }])
- instance.$destroy()
- resetTaskHook()
- done()
- })
- }, 50)
- }).catch(done.fail)
- })
-
- // it('component lifecycle', done => {
- // global.__lifecycles = []
- // compileWithDeps('recycle-list/components/stateful-lifecycle.vue', [{
- // name: 'lifecycle',
- // path: 'recycle-list/components/lifecycle.vue'
- // }]).then(code => {
- // const id = String(Date.now() * Math.random())
- // const instance = createInstance(id, code)
- // setTimeout(() => {
- // const target = readObject('recycle-list/components/stateful-lifecycle.vdom.js')
- // expect(getRoot(instance)).toEqual(target)
-
- // instance.$triggerHook(2, 'create', ['y-1'])
- // instance.$triggerHook('y-1', 'attach')
- // instance.$triggerHook('y-1', 'detach')
- // expect(global.__lifecycles).toEqual([
- // 'beforeCreate undefined',
- // 'created 0',
- // 'beforeMount 1',
- // 'mounted 1',
- // 'beforeUpdate 2',
- // 'updated 2',
- // 'beforeDestroy 2',
- // 'destroyed 2'
- // ])
-
- // delete global.__lifecycles
- // instance.$destroy()
- // done()
- // }, 50)
- // }).catch(done.fail)
- // })
-
- it('stateful component with v-model', done => {
- compileWithDeps('recycle-list/components/stateful-v-model.vue', [{
- name: 'editor',
- path: 'recycle-list/components/editor.vue'
- }]).then(code => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, code)
- setTimeout(() => {
- const target = readObject('recycle-list/components/stateful-v-model.vdom.js')
- expect(getRoot(instance)).toEqual(target)
- instance.$destroy()
- done()
- }, 50)
- }).catch(done.fail)
- })
- })
-})
+++ /dev/null
-({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- attr: {
- value: '43'
- }
- }]
-})
+++ /dev/null
-({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- attr: {
- value: '42'
- }
- }]
-})
+++ /dev/null
-<template>
- <div @click="inc">
- <text>{{count}}</text>
- </div>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- count: 42
- }
- },
- methods: {
- inc () {
- this.count++
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', count: 1, source: 'http://whatever.com/x.png' },
- { type: 'A', count: 2, source: 'http://whatever.com/y.png' },
- { type: 'A', count: 3, source: 'http://whatever.com/z.png' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'image',
- attr: {
- resize: 'cover',
- src: {
- '@binding': 'item.source'
- }
- }
- }, {
- type: 'text',
- attr: {
- lines: '3',
- count: {
- '@binding': 'item.count'
- }
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <image resize="cover" :src="item.source">
- <text lines="3" v-bind:count="item.count"></text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', count: 1, source: 'http://whatever.com/x.png' },
- { type: 'A', count: 2, source: 'http://whatever.com/y.png' },
- { type: 'A', count: 3, source: 'http://whatever.com/z.png' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', color: 'red' },
- { type: 'A', color: 'blue' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- style: {
- backgroundColor: '#FF6600'
- },
- children: [{
- type: 'text',
- attr: {
- // not supported yet
- // classList: ['text', { '@binding': 'item.color' }],
- value: 'content'
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A" class="cell">
- <text :class="['text', item.color]">content</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<style scoped>
- .cell {
- background-color: #FF6600;
- }
- .text {
- font-size: 100px;
- text-align: center;
- }
- .red {
- color: #FF0000;
- }
- .blue {
- color: #0000FF;
- }
-</style>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', color: 'red' },
- { type: 'A', color: 'blue' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-<template recyclable="true">
- <div class="banner">
- <text class="title">BANNER</text>
- </div>
-</template>
-
-<style scoped>
- .banner {
- height: 120px;
- justify-content: center;
- align-items: center;
- background-color: rgb(162, 217, 192);
- }
- .title {
- font-weight: bold;
- color: #41B883;
- font-size: 60px;
- }
-</style>
+++ /dev/null
-<template recyclable="true">
- <div>
- <text class="output">{{count}}</text>
- <text class="button" @click="inc">+</text>
- </div>
-</template>
-
-<script>
- module.exports = {
- props: ['start'],
- data () {
- return {
- count: parseInt(this.start, 10) * 2 || 42
- }
- },
- methods: {
- inc () {
- this.count++
- }
- }
- }
-</script>
-
-<style scoped>
- .output {
- font-size: 150px;
- text-align: center;
- }
- .button {
- font-size: 100px;
- text-align: center;
- border-width: 2px;
- border-color: #DDD;
- background-color: #F5F5F5;
- }
-</style>
+++ /dev/null
-<template recyclable="true">
- <div>
- <text class="output">{{output}}</text>
- <input class="input" type="text" v-model="output" />
- </div>
-</template>
-
-<script>
- module.exports = {
- props: ['message'],
- data () {
- return {
- output: this.message || ''
- }
- }
- }
-</script>
-
-<style scoped>
- .output {
- height: 80px;
- font-size: 60px;
- color: #41B883;
- }
- .input {
- font-size: 50px;
- color: #666666;
- border-width: 2px;
- border-color: #41B883;
- }
-</style>
+++ /dev/null
-<template recyclable="true">
- <div class="footer">
- <text class="copyright">All rights reserved.</text>
- </div>
-</template>
-
-<style scoped>
- .footer {
- height: 80px;
- justify-content: center;
- background-color: #EEEEEE;
- }
- .copyright {
- color: #AAAAAA;
- font-size: 32px;
- text-align: center;
- }
-</style>
+++ /dev/null
-<template recyclable="true">
- <div>
- <text>{{number}}</text>
- </div>
-</template>
-
-<script>
- module.exports = {
- data () {
- return { number: 0 }
- },
- beforeCreate () {
- try { __lifecycles.push('beforeCreate ' + this.number) } catch (e) {}
- },
- created () {
- try { __lifecycles.push('created ' + this.number) } catch (e) {}
- this.number++
- },
- beforeMount () {
- try { __lifecycles.push('beforeMount ' + this.number) } catch (e) {}
- },
- mounted () {
- try { __lifecycles.push('mounted ' + this.number) } catch (e) {}
- this.number++
- },
- beforeUpdate () {
- try { __lifecycles.push('beforeUpdate ' + this.number) } catch (e) {}
- },
- updated () {
- try { __lifecycles.push('updated ' + this.number) } catch (e) {}
- },
- beforeDestroy () {
- try { __lifecycles.push('beforeDestroy ' + this.number) } catch (e) {}
- },
- destroyed () {
- try { __lifecycles.push('destroyed ' + this.number) } catch (e) {}
- }
- }
-</script>
+++ /dev/null
-<template recyclable="true">
- <div>
- <image class="image" :src="imageUrl"></image>
- <text class="title">{{title}}</text>
- </div>
-</template>
-
-<script>
- module.exports = {
- props: {
- imageUrl: {
- type: String,
- default: 'https://gw.alicdn.com/tfs/TB1KF_ybRTH8KJjy0FiXXcRsXXa-890-1186.png'
- },
- title: {
- type: String,
- default: 'I WANT YOU!'
- }
- }
- }
-</script>
-
-<style scoped>
- .image {
- width: 750px;
- height: 1000px;
- }
- .title {
- font-size: 80px;
- text-align: center;
- color: #E95659;
- }
-</style>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'X' },
- { type: 'X' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'X' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {}
- },
- children: [{
- type: 'text',
- attr: {
- value: { '@binding': 'number' }
- }
- }]
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="X">
- <lifecycle></lifecycle>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./lifecycle.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'X' },
- { type: 'X' }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {
- message: 'No binding'
- }
- },
- children: [{
- type: 'text',
- classList: ['output'],
- attr: {
- value: { '@binding': 'output' }
- }
- }, {
- type: 'input',
- event: ['input'],
- classList: ['input'],
- attr: {
- type: 'text',
- value: 'No binding'
- }
- }]
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <editor message="No binding"></editor>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./editor.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', number: 24 },
- { type: 'A', number: 42 }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {
- start: { '@binding': 'item.number' }
- }
- },
- children: [{
- type: 'text',
- classList: ['output'],
- attr: {
- value: { '@binding': 'count' } // need confirm
- }
- }, {
- type: 'text',
- event: ['click'],
- classList: ['button'],
- attr: { value: '+' }
- }]
- }, {
- type: 'text',
- attr: { value: 'other' }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <counter :start="item.number"></counter>
- <text>other</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./counter.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', number: 24 },
- { type: 'A', number: 42 }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'B', poster: 'yy', title: 'y' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {}
- },
- classList: ['banner'],
- children: [{
- type: 'text',
- classList: ['title'],
- attr: { value: 'BANNER' }
- }]
- }, {
- type: 'text',
- attr: { value: '----' }
- }, {
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {}
- },
- classList: ['footer'],
- children: [{
- type: 'text',
- classList: ['copyright'],
- attr: { value: 'All rights reserved.' }
- }]
- }]
- }, {
- type: 'cell-slot',
- attr: { append: 'tree', case: 'B' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {}
- },
- classList: ['banner'],
- children: [{
- type: 'text',
- classList: ['title'],
- attr: { value: 'BANNER' }
- }]
- }, {
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {
- imageUrl: { '@binding': 'item.poster' },
- title: { '@binding': 'item.title' }
- }
- },
- children: [{
- type: 'image',
- classList: ['image'],
- attr: {
- src: { '@binding': 'imageUrl' }
- }
- }, {
- type: 'text',
- classList: ['title'],
- attr: {
- value: { '@binding': 'title' }
- }
- }]
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <banner></banner>
- <text>----</text>
- <footer></footer>
- </cell-slot>
- <cell-slot case="B">
- <banner></banner>
- <poster :image-url="item.poster" :title="item.title"></poster>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./banner.vue')
- // require('./footer.vue')
- // require('./poster.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'B', poster: 'yy', title: 'y' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', poster: 'xx', title: 'x' },
- { type: 'A', poster: 'yy', title: 'y' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {
- imageUrl: { '@binding': 'item.poster' },
- title: { '@binding': 'item.title' }
- }
- },
- children: [{
- type: 'image',
- classList: ['image'],
- attr: {
- src: { '@binding': 'imageUrl' }
- }
- }, {
- type: 'text',
- classList: ['title'],
- attr: {
- value: { '@binding': 'title' }
- }
- }]
- }, {
- type: 'text',
- attr: {
- value: 'content'
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <poster :image-url="item.poster" :title="item.title"></poster>
- <text>content</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./poster.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', poster: 'xx', title: 'x' },
- { type: 'A', poster: 'yy', title: 'y' }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '@isComponentRoot': true,
- '@componentProps': {}
- },
- classList: ['banner'],
- children: [{
- type: 'text',
- classList: ['title'],
- attr: {
- value: 'BANNER'
- }
- }]
- }, {
- type: 'text',
- attr: {
- value: 'content'
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <banner></banner>
- <text>content</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- // require('./banner.vue')
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', color: '#606060' },
- { type: 'A', color: '#E5E5E5' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- style: {
- backgroundColor: '#FF6600'
- },
- children: [{
- type: 'text',
- style: {
- fontSize: '100px',
- color: { '@binding': 'item.color' }
- },
- attr: {
- value: 'content'
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A" style="background-color:#FF6600">
- <text :style="{ fontSize: '100px', color: item.color }">content</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', color: '#606060' },
- { type: 'A', color: '#E5E5E5' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A', dynamic: 'decimal', two: '2', four: '4' },
- { type: 'A', dynamic: 'binary', two: '10', four: '100' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'text',
- attr: {
- value: 'static'
- }
- }, {
- type: 'text',
- attr: {
- value: { '@binding': 'item.dynamic' }
- }
- }, {
- type: 'text',
- attr: {
- value: [
- 'one ',
- { '@binding': 'item.two' },
- ' three ',
- { '@binding': 'item.four' },
- ' five'
- ]
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <text>static</text>
- <text>{{item.dynamic}}</text>
- <text>one {{item.two}} three {{ item.four }} five</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A', dynamic: 'decimal', two: '2', four: '4' },
- { type: 'A', dynamic: 'binary', two: '10', four: '100' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'image',
- attr: {
- '[[match]]': 'item.sourceA',
- src: { '@binding': 'item.sourceA' }
- }
- }, {
- type: 'image',
- attr: {
- '[[match]]': '!(item.sourceA) && (item.sourceB)',
- src: { '@binding': 'item.sourceB' }
- }
- }, {
- type: 'image',
- attr: {
- '[[match]]': '!(item.sourceA || item.sourceB)',
- src: { '@binding': 'item.placeholder' }
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <image v-if="item.sourceA" :src="item.sourceA"></image>
- <image v-else-if="item.sourceB" :src="item.sourceB"></image>
- <image v-else :src="item.placeholder"></image>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'image',
- attr: {
- '[[match]]': 'item.source',
- src: { '@binding': 'item.source' }
- }
- }, {
- type: 'image',
- attr: {
- '[[match]]': '!(item.source)',
- src: { '@binding': 'item.placeholder' }
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <image v-if="item.source" :src="item.source"></image>
- <image v-else v-bind:src="item.placeholder"></image>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '[[repeat]]': {
- '@expression': 'item.list',
- '@index': 'index',
- '@alias': 'object'
- }
- },
- children: [{
- type: 'text',
- attr: {
- value: {
- '@binding': 'object.name'
- }
- }
- }, {
- type: 'text',
- attr: {
- '[[repeat]]': {
- '@expression': 'object',
- '@alias': 'v',
- '@key': 'k',
- '@index': 'i'
- },
- value: {
- '@binding': 'v'
- }
- }
- }]
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <div v-for="(object, index) in item.list" :key="index">
- <text>{{object.name}}</text>
- <text v-for="(v, k, i) in object" :key="k">{{v}}</text>
- </div>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'div',
- attr: {
- '[[repeat]]': {
- '@expression': 'item.list',
- '@alias': 'panel'
- }
- },
- children: [{
- type: 'text',
- attr: {
- value: {
- '@binding': 'panel.label'
- }
- }
- }]
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <div v-for="panel in item.list" :key="panel.id">
- <text>{{panel.label}}</text>
- </div>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'image',
- attr: {
- '[[match]]': 'item.source',
- src: { '@binding': 'item.source' }
- }
- }, {
- type: 'text',
- attr: {
- '[[match]]': '!item.source',
- value: 'Title'
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <image v-if="item.source" :src="item.source"></image>
- <text v-if="!item.source">Title</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'text',
- event: ['click', {
- type: 'longpress',
- params: [{ '@binding': 'item.key' }]
- }]
- }, {
- type: 'text',
- event: [{
- type: 'appear',
- params: [
- { '@binding': 'item.index' },
- { '@binding': 'item.type' }
- ]
- }],
- attr: { value: 'Button' }
- }, {
- type: 'text',
- event: [{ type: 'disappear' }],
- attr: { value: 'Tips' }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <text v-on:click="toggle()" @longpress="toggle(item.key)"></text>
- <text @appear="onappear(item.index, 'static', item.type, $event)">Button</text>
- <text @disappear="onappear(25, 'static')">Tips</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- },
- methods: {
- hide () {},
- toggle () {},
- onappear () {}
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- switch: 'type',
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree', case: 'A' },
- children: [{
- type: 'text',
- event: ['click', 'longpress'],
- attr: { value: 'A' }
- }, {
- type: 'text',
- event: ['touchend'],
- attr: { value: 'B' }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in longList" switch="type">
- <cell-slot case="A">
- <text v-on:click="handler" @longpress="move">A</text>
- <text @touchend="move">B</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- longList: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- },
- methods: {
- handler () {},
- move () {}
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'recycle-list',
- attr: {
- append: 'tree',
- listData: [
- { type: 'A' },
- { type: 'A' }
- ],
- alias: 'item'
- },
- children: [{
- type: 'cell-slot',
- attr: { append: 'tree' },
- children: [{
- type: 'text',
- attr: {
- '[[once]]': true,
- value: { '@binding': 'item.type' }
- }
- }]
- }]
-})
+++ /dev/null
-<template>
- <recycle-list for="item in list">
- <cell-slot>
- <text v-once>{{item.type}}</text>
- </cell-slot>
- </recycle-list>
-</template>
-
-<script>
- module.exports = {
- data () {
- return {
- list: [
- { type: 'A' },
- { type: 'A' }
- ]
- }
- }
- }
-</script>
-
+++ /dev/null
-({
- type: 'div',
- style: {
- justifyContent: 'center'
- },
- children: [{
- type: 'text',
- attr: {
- value: 'Yo'
- },
- classList: ['freestyle']
- }]
-})
+++ /dev/null
-<template>
- <div style="justify-content:center">
- <text class="freestyle">{{string}}</text>
- </div>
-</template>
-
-<style scoped>
- .freestyle {
- color: #41B883;
- font-size: 233px;
- text-align: center;
- }
-</style>
-
-<script>
- module.exports = {
- data () {
- return {
- string: 'Yo'
- }
- }
- }
-</script>
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('append props', () => {
- it('add append="tree" on <cell>', () => {
- const { render, staticRenderFns, errors } = compile(`<list><cell></cell></list>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(1)
- expect(staticRenderFns).toMatch(strToRegExp(`appendAsTree:true`))
- expect(staticRenderFns).toMatch(strToRegExp(`attrs:{"append":"tree"}`))
- expect(errors).toEqual([])
- })
-
- it('override append="node" on <cell>', () => {
- const { render, staticRenderFns, errors } = compile(`<list><cell append="node"></cell></list>`)
- expect(render + staticRenderFns).toMatch(strToRegExp(`attrs:{"append":"node"}`))
- expect(errors).toEqual([])
- })
-
- it('add append="tree" on <header>', () => {
- const { render, staticRenderFns, errors } = compile(`<list><header></header></list>`)
- expect(render + staticRenderFns).toMatch(strToRegExp(`appendAsTree:true`))
- expect(render + staticRenderFns).toMatch(strToRegExp(`attrs:{"append":"tree"}`))
- expect(errors).toEqual([])
- })
-
- it('add append="tree" on <recycle-list>', () => {
- const { render, staticRenderFns, errors } = compile(`<recycle-list for="item in list"><div></div></recycle-list>`)
- expect(render + staticRenderFns).toMatch(strToRegExp(`appendAsTree:true`))
- expect(render + staticRenderFns).toMatch(strToRegExp(`"append":"tree"`))
- expect(errors).toEqual([])
- })
-
- it('add append="tree" on <cell-slot>', () => {
- const { render, staticRenderFns, errors } = compile(`<list><cell-slot></cell-slot></list>`)
- expect(render + staticRenderFns).toMatch(strToRegExp(`appendAsTree:true`))
- expect(render + staticRenderFns).toMatch(strToRegExp(`attrs:{"append":"tree"}`))
- expect(errors).toEqual([])
- })
-
- it('override append="node" on <cell-slot>', () => {
- const { render, staticRenderFns, errors } = compile(`<list><cell-slot append="node"></cell-slot></list>`)
- expect(render + staticRenderFns).toMatch(strToRegExp(`attrs:{"append":"node"}`))
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('compile class', () => {
- it('should be compiled', () => {
- const { render, staticRenderFns, errors } = compile(`<div class="a b c"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`staticClass:["a","b","c"]`))
- expect(errors).toEqual([])
- })
-
- it('should compile dynamic class', () => {
- const { render, staticRenderFns, errors } = compile(`<div class="a {{b}} c"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`class:["a",_s(b),"c"]`))
- expect(errors).not.toBeUndefined()
- expect(errors.length).toEqual(1)
- expect(errors[0]).toMatch(strToRegExp(`a {{b}} c`))
- expect(errors[0]).toMatch(strToRegExp(`v-bind`))
- })
-
- it('should compile class binding of array', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:class="['a', 'b', c]"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`class:['a', 'b', c]`))
- expect(errors).toEqual([])
- })
-
- it('should compile class binding of map', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:class="{ a: true, b: x }"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`class:{ a: true, b: x }`))
- expect(errors).toEqual([])
- })
-
- it('should compile class binding of a variable', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:class="x"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`class:x`))
- expect(errors).toEqual([])
- })
-
- it('should compile class binding by shorthand', () => {
- const { render, staticRenderFns, errors } = compile(`<div :class="['a', 'b', c]"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`class:['a', 'b', c]`))
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('compile basic', () => {
- it('should be compiled', () => {
- const { render, staticRenderFns, errors } = compile(`<div>{{hi}}</div>`)
- expect(render).toEqual(`with(this){return _c('div',[_v(_s(hi))])}`)
- expect(staticRenderFns.length).toBe(0)
- expect(errors).toEqual([])
- })
-
- it('should compile data bindings', () => {
- const { render, staticRenderFns, errors } = compile(`<div :a="b"></div>`)
- expect(render).toEqual(`with(this){return _c('div',{attrs:{"a":b}})}`)
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile event bindings', () => {
- const { render, staticRenderFns, errors } = compile(`<div @click="x"></div>`)
- expect(render).toEqual(`with(this){return _c('div',{on:{"click":x}})}`)
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile data bindings with children', () => {
- const { render, staticRenderFns, errors } = compile(`<foo :a="b"><text>Hello</text></foo>`)
- expect(render).toEqual(`with(this){return _c('foo',{attrs:{"a":b}},[_c('text',[_v("Hello")])])}`)
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile unary tag', () => {
- const inputCase = compile(`<div><input><text>abc</text></div>`)
- expect(inputCase.render).toMatch(strToRegExp(`return _m(0)`))
- expect(inputCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('input'),_c('text',[_v("abc")])])`))
- expect(inputCase.errors).toEqual([])
-
- const imageCase = compile(`<div><image src="path"><text>abc</text></div>`)
- expect(imageCase.render).toMatch(strToRegExp(`return _m(0)`))
- expect(imageCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('image',{attrs:{"src":"path"}}),_c('text',[_v("abc")])])`))
- expect(imageCase.errors).toEqual([])
-
- const complexCase = compile(`
- <div>
- <image src="path">
- <image></image>
- <div>
- <embed>
- <text>start</text>
- <input type="text">
- <input type="url" />
- <text>end</text>
- </div>
- </div>
- `)
- expect(complexCase.render).toMatch(strToRegExp(`return _m(0)`))
- expect(complexCase.staticRenderFns).toMatch(strToRegExp(`_c('image',{attrs:{"src":"path"}}),_c('image'),_c('div'`))
- expect(complexCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('embed'),_c('text',[_v("start")]),_c('input',{attrs:{"type":"text"}}),_c('input',{attrs:{"type":"url"}}),_c('text',[_v("end")])]`))
- expect(complexCase.errors).toEqual([])
- })
-
- it('should compile more complex situation', () => {
- // from examples of https://github.com/alibaba/weex
- const { render, staticRenderFns, errors } = compile(`
- <refresh class="refresh" @refresh="handleRefresh" :display="displayRefresh"
- style="flex-direction:row;">
- <loading-indicator></loading-indicator>
- <text style="margin-left:36px;color:#eee;">Load more...</text>
- </refresh>
- `)
- expect(render).toEqual(`with(this){return _c('refresh',{staticClass:["refresh"],staticStyle:{flexDirection:"row"},attrs:{"display":displayRefresh},on:{"refresh":handleRefresh}},[_c('loading-indicator'),_c('text',{staticStyle:{marginLeft:"36px",color:"#eee"}},[_v("Load more...")])])}`)
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import { generateBinding } from '../../../src/platforms/weex/util/parser'
-
-describe('expression parser', () => {
- describe('generateBinding', () => {
- it('primitive literal', () => {
- expect(generateBinding('15')).toEqual(15)
- expect(generateBinding('"xxx"')).toEqual('xxx')
- })
-
- it('identifiers', () => {
- expect(generateBinding('x')).toEqual({ '@binding': 'x' })
- expect(generateBinding('x.y')).toEqual({ '@binding': 'x.y' })
- expect(generateBinding(`x.y['z']`)).toEqual({ '@binding': `x.y['z']` })
- })
-
- it('object literal', () => {
- expect(generateBinding('{}')).toEqual({})
- expect(generateBinding('{ abc: 25 }')).toEqual({ abc: 25 })
- expect(generateBinding('{ abc: 25, def: "xxx" }')).toEqual({ abc: 25, def: 'xxx' })
- expect(generateBinding('{ a: 3, b: { bb: "bb", bbb: { bbc: "BBC" } } }'))
- .toEqual({ a: 3, b: { bb: 'bb', bbb: { bbc: 'BBC' }}})
- })
-
- it('array literal', () => {
- expect(generateBinding('[]')).toEqual([])
- expect(generateBinding('[{ abc: 25 }]')).toEqual([{ abc: 25 }])
- expect(generateBinding('[{ abc: 25, def: ["xxx"] }]')).toEqual([{ abc: 25, def: ['xxx'] }])
- expect(generateBinding('{ a: [3,16], b: [{ bb: ["aa","bb"], bbb: [{bbc:"BBC"}] }] }'))
- .toEqual({ a: [3, 16], b: [{ bb: ['aa', 'bb'], bbb: [{ bbc: 'BBC' }] }] })
- })
-
- it('expressions', () => {
- expect(generateBinding(`3 + 5`)).toEqual({ '@binding': `3 + 5` })
- expect(generateBinding(`'x' + 2`)).toEqual({ '@binding': `'x' + 2` })
- expect(generateBinding(`\`xx\` + 2`)).toEqual({ '@binding': `\`xx\` + 2` })
- expect(generateBinding(`item.size * 23 + 'px'`)).toEqual({ '@binding': `item.size * 23 + 'px'` })
- })
-
- it('object bindings', () => {
- expect(generateBinding(`{ color: textColor }`)).toEqual({
- color: { '@binding': 'textColor' }
- })
- expect(generateBinding(`{ color: '#FF' + 66 * 100, fontSize: item.size }`)).toEqual({
- color: { '@binding': `'#FF' + 66 * 100` },
- fontSize: { '@binding': 'item.size' }
- })
- expect(generateBinding(`{
- x: { xx: obj, xy: -2 + 5 },
- y: {
- yy: { yyy: obj.y || yy },
- yz: typeof object.yz === 'string' ? object.yz : ''
- }
- }`)).toEqual({
- x: { xx: { '@binding': 'obj' }, xy: { '@binding': '-2 + 5' }},
- y: {
- yy: { yyy: { '@binding': 'obj.y || yy' }},
- yz: { '@binding': `typeof object.yz === 'string' ? object.yz : ''` }
- }
- })
- })
-
- it('array bindings', () => {
- expect(generateBinding(`[textColor, 3 + 5, 'string']`)).toEqual([
- { '@binding': 'textColor' },
- { '@binding': '3 + 5' },
- 'string'
- ])
- expect(generateBinding(`[
- { color: '#FF' + 66 * -100 },
- item && item.style,
- { fontSize: item.size | 0 }
- ]`)).toEqual([
- { color: { '@binding': `'#FF' + 66 * -100` }},
- { '@binding': 'item && item.style' },
- { fontSize: { '@binding': 'item.size | 0' }}
- ])
- expect(generateBinding(`[{
- x: [{ xx: [fn instanceof Function ? 'function' : '' , 25] }],
- y: {
- yy: [{ yyy: [obj.yy.y, obj.y.yy] }],
- yz: [object.yz, void 0]
- }
- }]`)).toEqual([{
- x: [{ xx: [{ '@binding': `fn instanceof Function ? 'function' : ''` }, 25] }],
- y: {
- yy: [{ yyy: [{ '@binding': 'obj.yy.y' }, { '@binding': 'obj.y.yy' }] }],
- yz: [{ '@binding': 'object.yz' }, { '@binding': 'void 0' }]
- }
- }])
- })
-
- it('unsupported bindings', () => {
- expect(generateBinding('() => {}')).toEqual('')
- expect(generateBinding('function(){}')).toEqual('')
- expect(generateBinding('(function(){})()')).toEqual('')
- expect(generateBinding('var abc = 35')).toEqual('')
- expect(generateBinding('abc++')).toEqual('')
- expect(generateBinding('x.y(0)')).toEqual('')
- expect(generateBinding('class X {}')).toEqual('')
- expect(generateBinding('if (typeof x == null) { 35 }')).toEqual('')
- expect(generateBinding('while (x == null)')).toEqual('')
- expect(generateBinding('new Function()')).toEqual('')
- })
- })
-})
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('compile props', () => {
- it('custom props', () => {
- const { render, staticRenderFns, errors } = compile(`<div custom="whatever"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`attrs:{"custom":"whatever"}`))
- expect(errors).toEqual([])
- })
-
- it('camelize props', () => {
- const { render, staticRenderFns, errors } = compile(`<div kebab-case="whatever"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`attrs:{"kebabCase":"whatever"}`))
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('compile style', () => {
- it('should be compiled', () => {
- const { render, staticRenderFns, errors } = compile(`<div style="a: x; b: y"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`staticStyle:{a:"x",b:"y"}`))
- expect(errors).toEqual([])
- })
-
- it('should compile empty style value', () => {
- const { render, staticRenderFns, errors } = compile(`<div style=""></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(/[(^style|^staticStyle)]/)
- expect(errors).toEqual([])
- })
-
- it('should compile style value with trailing semicolon', () => {
- const { render, staticRenderFns, errors } = compile(`<div style="a: x; b: y;"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`staticStyle:{a:"x",b:"y"}`))
- expect(errors).toEqual([])
- })
-
- it('should compile hyphenated style name & value', () => {
- const { render, staticRenderFns, errors } = compile(`<div style="-abc-def: x-y; abc-def: x-y"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).not.toBeUndefined()
- expect(staticRenderFns.length).toEqual(0)
- expect(render).toMatch(strToRegExp(`staticStyle:{AbcDef:"x-y",abcDef:"x-y"}`))
- expect(errors).toEqual([])
- })
-
- it('should compile dynamic style', () => {
- const { render, staticRenderFns, errors } = compile(`<div style="a: x; b: {{y}}"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`style:{a:"x",b:_s(y)}`))
- expect(errors).not.toBeUndefined()
- expect(errors.length).toEqual(1)
- expect(errors[0]).toMatch(strToRegExp(`b: {{y}}`))
- expect(errors[0]).toMatch(strToRegExp(`v-bind`))
- })
-
- it('should compile style binding of array', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:style="[a, b, c]"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`style:[a, b, c]`))
- expect(errors).toEqual([])
- })
-
- it('should compile style binding of map', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:style="{ a: x, b: 'y' + z }"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`style:{ a: x, b: 'y' + z }`))
- expect(errors).toEqual([])
- })
-
- it('should compile style binding of a variable', () => {
- const { render, staticRenderFns, errors } = compile(`<div v-bind:style="x"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`style:x`))
- expect(errors).toEqual([])
- })
-
- it('should compile style binding by shorthand', () => {
- const { render, staticRenderFns, errors } = compile(`<div :style="[a, b, c]"></div>`)
- expect(render).not.toBeUndefined()
- expect(staticRenderFns).toEqual([])
- expect(render).toMatch(strToRegExp(`style:[a, b, c]`))
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import { compile } from '../../../packages/weex-template-compiler'
-import { strToRegExp } from '../helpers/index'
-
-describe('compile v-model', () => {
- it('should compile modelable native component', () => {
- const { render, staticRenderFns, errors } = compile(`<div><input v-model="x" /></div>`)
- expect(render).not.toBeUndefined()
- expect(render).toMatch(strToRegExp(`attrs:{"value":(x)}`))
- expect(render).toMatch(strToRegExp(`on:{"input":function($event){x=$event.target.attr.value}}`))
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile other component with whole $event as the value', () => {
- const { render, staticRenderFns, errors } = compile(`<div><foo v-model="x" /></div>`)
- expect(render).not.toBeUndefined()
- expect(render).toMatch(strToRegExp(`model:{value:(x),callback:function ($$v) {x=$$v},expression:"x"}`))
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile with trim modifier for modelable native component', () => {
- const { render, staticRenderFns, errors } = compile(`<div><input v-model.trim="x" /></div>`)
- expect(render).not.toBeUndefined()
- expect(render).toMatch(strToRegExp(`attrs:{"value":(x)}`))
- expect(render).toMatch(strToRegExp(`on:{"input":function($event){x=$event.target.attr.value.trim()}}`))
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-
- it('should compile with trim & lazy modifier', () => {
- const { render, staticRenderFns, errors } = compile(`<div><input v-model.trim.lazy="x" /><input v-model.lazy.trim="y" /></div>`)
- expect(render).not.toBeUndefined()
- expect(render).toMatch(strToRegExp(`attrs:{"value":(x)}`))
- expect(render).toMatch(strToRegExp(`attrs:{"value":(y)}`))
- expect(render).toMatch(strToRegExp(`on:{"change":function($event){x=$event.target.attr.value.trim()}}`))
- expect(render).toMatch(strToRegExp(`on:{"change":function($event){y=$event.target.attr.value.trim()}}`))
- expect(staticRenderFns).toEqual([])
- expect(errors).toEqual([])
- })
-})
+++ /dev/null
-import fs from 'fs'
-import path from 'path'
-import * as Vue from '../../../packages/weex-vue-framework'
-import { compile } from '../../../packages/weex-template-compiler'
-import WeexRuntime from 'weex-js-runtime'
-import styler from 'weex-styler'
-
-const styleRE = /<\s*style\s*\w*>([^(<\/)]*)<\/\s*style\s*>/g
-const scriptRE = /<\s*script.*>([^]*)<\/\s*script\s*>/
-const templateRE = /<\s*template\s*([^>]*)>([^]*)<\/\s*template\s*>/
-
-export function readFile (filename) {
- return fs.readFileSync(path.resolve(__dirname, '../cases/', filename), 'utf8')
-}
-
-export function readObject (filename) {
- return (new Function(`return ${readFile(filename)}`))()
-}
-
-console.debug = () => {}
-
-// http://stackoverflow.com/a/35478115
-const matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g
-export function strToRegExp (str) {
- return new RegExp(str.replace(matchOperatorsRe, '\\$&'))
-}
-
-function parseStatic (fns) {
- return '[' + fns.map(fn => `function () { ${fn} }`).join(',') + ']'
-}
-
-export function compileAndStringify (template) {
- const { render, staticRenderFns } = compile(template)
- return {
- render: `function () { ${render} }`,
- staticRenderFns: parseStatic(staticRenderFns)
- }
-}
-
-/**
- * Compile *.vue file into js code
- * @param {string} source raw text of *.vue file
- * @param {string} componentName whether compile to a component
- */
-export function compileVue (source, componentName) {
- return new Promise((resolve, reject) => {
- if (!templateRE.test(source)) {
- return reject('No Template!')
- }
- const scriptMatch = scriptRE.exec(source)
- const script = scriptMatch ? scriptMatch[1] : ''
- const templateMatch = templateRE.exec(source)
- const compileOptions = {}
- if (/\s*recyclable\=?/i.test(templateMatch[1])) {
- compileOptions.recyclable = true
- }
- const res = compile(templateMatch[2], compileOptions)
-
- const name = 'test_case_' + (Math.random() * 99999999).toFixed(0)
- const generateCode = styles => (`
- try { weex.document.registerStyleSheets("${name}", [${JSON.stringify(styles)}]) } catch(e) {};
- var ${name} = Object.assign({
- _scopeId: "${name}",
- style: ${JSON.stringify(styles)},
- render: function () { ${res.render} },
- ${res['@render'] ? ('"@render": function () {' + res['@render'] + '},') : ''}
- staticRenderFns: ${parseStatic(res.staticRenderFns)},
- }, (function(){
- var module = { exports: {} };
- ${script};
- return module.exports;
- })());
- ` + (componentName
- ? `Vue.component('${componentName}', ${name});\n`
- : `${name}.el = 'body';new Vue(${name});`)
- )
-
- let cssText = ''
- let styleMatch = null
- while ((styleMatch = styleRE.exec(source))) {
- cssText += `\n${styleMatch[1]}\n`
- }
- styler.parse(cssText, (error, result) => {
- if (error) {
- return reject(error)
- }
- resolve(generateCode(result.jsonStyle))
- })
- resolve(generateCode({}))
- })
-}
-
-export function compileWithDeps (entryPath, deps) {
- return new Promise((resolve, reject) => {
- if (Array.isArray(deps)) {
- Promise.all(deps.map(dep => {
- return compileVue(readFile(dep.path), dep.name).catch(reject)
- })).then(depCodes => {
- compileVue(readFile(entryPath)).then(entryCode => {
- resolve(depCodes.join('\n') + entryCode)
- }).catch(reject)
- }).catch(reject)
- }
- })
-}
-
-function isObject (object) {
- return object !== null && typeof object === 'object'
-}
-
-function isEmptyObject (object) {
- return isObject(object) && Object.keys(object).length < 1
-}
-
-function omitUseless (object) {
- if (isObject(object)) {
- delete object.ref
- for (const key in object) {
- omitUseless(object[key])
- if (key === '@styleScope' ||
- key === '@templateId' ||
- key === 'bindingExpression') {
- delete object[key]
- }
- if (key.charAt(0) !== '@' &&
- (isEmptyObject(object[key]) || object[key] === undefined)) {
- delete object[key]
- }
- }
- }
- return object
-}
-
-export function getRoot (instance) {
- return omitUseless(instance.$getRoot())
-}
-
-// Get all binding events in the instance
-export function getEvents (instance) {
- const events = []
- const recordEvent = node => {
- if (!node) { return }
- if (Array.isArray(node.event)) {
- node.event.forEach(type => {
- events.push({ ref: node.ref, type })
- })
- }
- if (Array.isArray(node.children)) {
- node.children.forEach(recordEvent)
- }
- }
- recordEvent(instance.$getRoot())
- return events
-}
-
-export function fireEvent (instance, ref, type, event = {}) {
- const el = instance.document.getRef(ref)
- if (el) {
- instance.document.fireEvent(el, type, event)
- }
-}
-
-export function createInstance (id, code, ...args) {
- WeexRuntime.config.frameworks = { Vue }
- const context = WeexRuntime.init(WeexRuntime.config)
- context.registerModules({
- timer: ['setTimeout', 'setInterval']
- })
- const instance = context.createInstance(id, `// { "framework": "Vue" }\n${code}`, ...args) || {}
- instance.document = context.getDocument(id)
- instance.$getRoot = () => context.getRoot(id)
- instance.$refresh = (data) => context.refreshInstance(id, data)
- instance.$destroy = () => {
- delete instance.document
- context.destroyInstance(id)
- }
- instance.$triggerHook = (id, hook, args) => {
- instance.document.taskCenter.triggerHook(id, 'lifecycle', hook, { args })
- }
- return instance
-}
-
-export function compileAndExecute (template, additional = '') {
- return new Promise(resolve => {
- const id = String(Date.now() * Math.random())
- const { render, staticRenderFns } = compile(template)
- const instance = createInstance(id, `
- new Vue({
- el: '#whatever',
- render: function () { ${render} },
- staticRenderFns: ${parseStatic(staticRenderFns)},
- ${additional}
- })
- `)
- setTimeout(() => resolve(instance), 10)
- })
-}
-
-export function syncPromise (arr) {
- let p = Promise.resolve()
- arr.forEach(item => {
- p = p.then(item)
- })
- return p
-}
-
-export function checkRefresh (instance, data, checker) {
- return () => new Promise(res => {
- instance.$refresh(data)
- setTimeout(() => {
- checker(getRoot(instance))
- res()
- })
- })
-}
-
-export function addTaskHook (hook) {
- global.callNative = function callNative (id, tasks) {
- if (Array.isArray(tasks) && typeof hook === 'function') {
- tasks.forEach(task => {
- hook(id, {
- module: task.module,
- method: task.method,
- args: Array.from(task.args)
- })
- })
- }
- }
-}
-
-export function resetTaskHook () {
- delete global.callNative
-}
+++ /dev/null
-{
- "spec_dir": "test/weex",
- "spec_files": [
- "**/*[sS]pec.js"
- ],
- "helpers": [
- "../../node_modules/babel-register/lib/node.js"
- ]
-}
+++ /dev/null
-import { getRoot, fireEvent, compileAndExecute } from '../helpers/index'
-
-describe('generate attribute', () => {
- it('should be generated', (done) => {
- compileAndExecute(`
- <div>
- <text value="Hello World" style="font-size: 100"></text>
- </div>
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- style: { fontSize: '100' },
- attr: { value: 'Hello World' }
- }]
- })
- done()
- }).catch(e => done.fail(e))
- })
-
- it('should be updated', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text :value="x"></text>
- </div>
- `, `
- data: { x: 'Hello World' },
- methods: {
- foo: function () {
- this.x = 'Hello Vue'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [
- { type: 'text', attr: { value: 'Hello World' }}
- ]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [
- { type: 'text', attr: { value: 'Hello Vue' }}
- ]
- })
- done()
- }).catch(e => done.fail(e))
- })
-
- it('should be cleared', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text :value="x"></text>
- </div>
- `, `
- data: { x: 'Hello World' },
- methods: {
- foo: function () {
- this.x = ''
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [
- { type: 'text', attr: { value: 'Hello World' }}
- ]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [
- { type: 'text', attr: { value: '' }}
- ]
- })
- done()
- })
- })
-})
+++ /dev/null
-import { getRoot, fireEvent, compileAndExecute } from '../helpers/index'
-
-describe('generate class', () => {
- it('should be generated', () => {
- compileAndExecute(`
- <div>
- <text class="a b c">Hello World</text>
- </div>
- `, `
- style: {
- a: { fontSize: '100' },
- b: { color: '#ff0000' },
- c: { fontWeight: 'bold' }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- classList: ['a', 'b', 'c'],
- attr: { value: 'Hello World' }
- }]
- })
- })
- })
-
- it('should be updated', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text :class="['a', x]">Hello World</text>
- </div>
- `, `
- data: { x: 'b' },
- style: {
- a: { fontSize: '100' },
- b: { color: '#ff0000' },
- c: { fontWeight: 'bold' },
- d: {
- color: '#0000ff',
- fontWeight: 'bold'
- }
- },
- methods: {
- foo: function () {
- this.x = 'd'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['a', 'b'],
- attr: { value: 'Hello World' }
- }]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['a', 'd'],
- attr: { value: 'Hello World' }
- }]
- })
- done()
- })
- })
-
- it('should be applied in order', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text :class="arr">Hello World</text>
- </div>
- `, `
- data: {
- arr: ['b', 'a']
- },
- style: {
- a: { color: '#ff0000' },
- b: { color: '#00ff00' },
- c: { color: '#0000ff' }
- },
- methods: {
- foo: function () {
- this.arr.push('c')
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['b', 'a'],
- attr: { value: 'Hello World' }
- }]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['b', 'a', 'c'],
- attr: { value: 'Hello World' }
- }]
- })
- done()
- })
- })
-
- it('should be cleared', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text :class="['a', x]">Hello World</text>
- </div>
- `, `
- data: { x: 'b' },
- style: {
- a: { fontSize: '100' },
- b: { color: '#ff0000' },
- c: { fontWeight: 'bold' }
- },
- methods: {
- foo: function () {
- this.x = 'c'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['a', 'b'],
- attr: { value: 'Hello World' }
- }]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- classList: ['a', 'c'],
- attr: { value: 'Hello World' }
- }]
- })
- done()
- })
- })
-})
+++ /dev/null
-import {
- compileAndStringify,
- getRoot,
- fireEvent,
- createInstance
-} from '../../helpers/index'
-
-function compileSnippet (snippet, additional) {
- const { render, staticRenderFns } = compileAndStringify(`<div>${snippet}</div>`)
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- el: 'body',
- render: ${render},
- staticRenderFns: ${staticRenderFns},
- ${additional}
- })
- `)
- return getRoot(instance).children[0]
-}
-
-describe('richtext component', () => {
- it('with no child', () => {
- expect(compileSnippet(`
- <richtext></richtext>
- `)).toEqual({
- type: 'richtext'
- })
- })
-
- it('with single text node', () => {
- expect(compileSnippet(`
- <richtext>single</richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: {
- value: 'single'
- }
- }]
- }
- })
- })
-
- describe('span', () => {
- it('single node', () => {
- expect(compileSnippet(`
- <richtext>
- <span>single</span>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: {
- value: 'single'
- }
- }]
- }
- })
- })
-
- it('multiple node', () => {
- expect(compileSnippet(`
- <richtext>
- <span>AAA</span>
- <span>BBB</span>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'AAA' }
- }, {
- type: 'span',
- attr: { value: 'BBB' }
- }]
- }
- })
- })
-
- it('with raw text', () => {
- expect(compileSnippet(`
- <richtext>
- AAA
- <span>BBB</span>CCC
- <span>DDD</span>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'AAA' }
- }, {
- type: 'span',
- attr: { value: 'BBB' }
- }, {
- type: 'span',
- attr: { value: 'CCC' }
- }, {
- type: 'span',
- attr: { value: 'DDD' }
- }]
- }
- })
- })
- })
-
- describe('a', () => {
- it('single node', () => {
- expect(compileSnippet(`
- <richtext>
- <a href="http://whatever.com"></a>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'a',
- attr: { href: 'http://whatever.com' }
- }]
- }
- })
- })
-
- it('multiple node', () => {
- expect(compileSnippet(`
- <richtext>
- <a href="http://a.whatever.com"></a>
- <a href="http://b.whatever.com"></a>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'a',
- attr: { href: 'http://a.whatever.com' }
- }, {
- type: 'a',
- attr: { href: 'http://b.whatever.com' }
- }]
- }
- })
- })
- })
-
- describe('image', () => {
- it('single node', () => {
- expect(compileSnippet(`
- <richtext>
- <image src="path/to/profile.png"></image>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'image',
- attr: { src: 'path/to/profile.png' }
- }]
- }
- })
- })
-
- it('multiple node', () => {
- expect(compileSnippet(`
- <richtext>
- <image src="path/to/A.png"></image>
- <image src="path/to/B.png"></image>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'image',
- attr: { src: 'path/to/A.png' }
- }, {
- type: 'image',
- attr: { src: 'path/to/B.png' }
- }]
- }
- })
- })
-
- it('with width and height', () => {
- expect(compileSnippet(`
- <richtext>
- <image
- style="width:150px;height:150px;"
- src="path/to/profile.png">
- </image>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'image',
- style: { width: '150px', height: '150px' },
- attr: { src: 'path/to/profile.png' }
- }]
- }
- })
- })
- })
-
- describe('nested', () => {
- it('span', () => {
- expect(compileSnippet(`
- <richtext>
- <span>AAA
- <span>
- <span>BBB</span>
- <span><span>CCC</span>DDD</span>
- </span>
- </span>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- children: [{
- type: 'span',
- attr: { value: 'AAA' }
- }, {
- type: 'span',
- children: [{
- type: 'span',
- attr: { value: 'BBB' }
- }, {
- type: 'span',
- children: [{
- type: 'span',
- attr: { value: 'CCC' }
- }, {
- type: 'span',
- attr: { value: 'DDD' }
- }]
- }]
- }]
- }]
- }
- })
- })
-
- it('image and a', () => {
- expect(compileSnippet(`
- <richtext>
- <span>title</span>
- <a href="http://remote.com/xx.js">
- <span><span>name</span></span>
- <image src="path/to/yy.gif"></image>
- </a>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'title' }
- }, {
- type: 'a',
- attr: { href: 'http://remote.com/xx.js' },
- children: [{
- type: 'span',
- children: [{
- type: 'span',
- attr: { value: 'name' }
- }]
- }, {
- type: 'image',
- attr: { src: 'path/to/yy.gif' }
- }]
- }]
- }
- })
- })
- })
-
- describe('with styles', () => {
- it('inline', () => {
- expect(compileSnippet(`
- <richtext>
- <span style="font-size:16px;color:#FF6600;">ABCD</span>
- <image style="width:33.33px;height:66.67px" src="path/to/A.png"></image>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- style: { fontSize: '16px', color: '#FF6600' },
- attr: { value: 'ABCD' }
- }, {
- type: 'image',
- style: { width: '33.33px', height: '66.67px' },
- attr: { src: 'path/to/A.png' }
- }]
- }
- })
- })
-
- it('class list', () => {
- expect(compileSnippet(`
- <richtext>
- <image class="icon" src="path/to/A.png"></image>
- <span class="title large">ABCD</span>
- </richtext>
- `, `
- style: {
- title: { color: '#FF6600' },
- large: { fontSize: 24 },
- icon: { width: 40, height: 60 }
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'image',
- style: { width: 40, height: 60 },
- attr: { src: 'path/to/A.png' }
- }, {
- type: 'span',
- style: { fontSize: 24, color: '#FF6600' },
- attr: { value: 'ABCD' }
- }]
- }
- })
- })
- })
-
- describe('data binding', () => {
- it('simple', () => {
- expect(compileSnippet(`
- <richtext>
- <span>{{name}}</span>
- </richtext>
- `, `data: { name: 'ABCDEFG' }`)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'ABCDEFG' }
- }]
- }
- })
- })
-
- it('nested', () => {
- expect(compileSnippet(`
- <richtext>
- <span>{{a}}</span>
- <span>{{b}}<span>{{c.d}}</span></span>
- <span>{{e}}</span>
- </richtext>
- `, `
- data: { a: 'A', b: 'B', c: { d: 'CD' }, e: 'E' }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'A' }
- }, {
- type: 'span',
- children: [{
- type: 'span',
- attr: { value: 'B' }
- }, {
- type: 'span',
- attr: { value: 'CD' }
- }]
- }, {
- type: 'span',
- attr: { value: 'E' }
- }]
- }
- })
- })
-
- it('update', () => {
- expect(compileSnippet(`
- <richtext>
- <span>{{name}}</span>
- </richtext>
- `, `
- data: { name: 'default' },
- created: function () {
- this.name = 'updated'
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'updated' }
- }]
- }
- })
- })
-
- it('attribute', () => {
- expect(compileSnippet(`
- <richtext>
- <span :label="label">{{name}}</span>
- </richtext>
- `, `
- data: {
- label: 'uid',
- name: '10100'
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: {
- label: 'uid',
- value: '10100'
- }
- }]
- }
- })
- })
-
- it('update attribute', () => {
- expect(compileSnippet(`
- <richtext>
- <span :label="label">{{name}}</span>
- </richtext>
- `, `
- data: {
- label: 'name',
- name: 'Hanks'
- },
- created: function () {
- this.label = 'uid';
- this.name = '10100';
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- attr: {
- label: 'uid',
- value: '10100'
- }
- }]
- }
- })
- })
-
- it('inline style', () => {
- expect(compileSnippet(`
- <richtext>
- <span :style="styleObject">ABCD</span>
- <span :style="{ textAlign: align, color: 'red' }">EFGH</span>
- </richtext>
- `, `
- data: {
- styleObject: { fontSize: '32px', color: '#F6F660' },
- align: 'center'
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- style: { fontSize: '32px', color: '#F6F660' },
- attr: { value: 'ABCD' }
- }, {
- type: 'span',
- style: { textAlign: 'center', color: 'red' },
- attr: { value: 'EFGH' }
- }]
- }
- })
- })
-
- it('class list', () => {
- expect(compileSnippet(`
- <richtext>
- <image :class="classList" src="path/to/A.png"></image>
- <span :class="['title', size]">ABCD</span>
- <span class="large" style="color:#F6F0F4">EFGH</span>
- </richtext>
- `, `
- style: {
- title: { color: '#FF6600' },
- large: { fontSize: 24 },
- icon: { width: 40, height: 60 }
- },
- data: {
- classList: ['unknown'],
- size: 'small'
- },
- created: function () {
- this.classList = ['icon'];
- this.size = 'large';
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'image',
- style: { width: 40, height: 60 },
- attr: { src: 'path/to/A.png' }
- }, {
- type: 'span',
- style: { fontSize: 24, color: '#FF6600' },
- attr: { value: 'ABCD' }
- }, {
- type: 'span',
- style: { fontSize: 24, color: '#F6F0F4' },
- attr: { value: 'EFGH' }
- }]
- }
- })
- })
-
- it('update inline style', () => {
- expect(compileSnippet(`
- <richtext>
- <span :style="styleObject">ABCD</span>
- <span :style="{ textAlign: align, color: 'red' }">EFGH</span>
- </richtext>
- `, `
- data: {
- styleObject: { fontSize: '32px', color: '#F6F660' }
- },
- created: function () {
- this.styleObject = { fontSize: '24px', color: 'blue' }
- this.styleObject.color = '#ABCDEF'
- this.align = 'left'
- }
- `)).toEqual({
- type: 'richtext',
- attr: {
- value: [{
- type: 'span',
- style: { fontSize: '24px', color: '#ABCDEF' },
- attr: { value: 'ABCD' }
- }, {
- type: 'span',
- style: { textAlign: 'left', color: 'red' },
- attr: { value: 'EFGH' }
- }]
- }
- })
- })
- })
-
- describe('itself', () => {
- it('inline styles', () => {
- expect(compileSnippet(`
- <richtext style="background-color:red">
- <span>empty</span>
- </richtext>
- `)).toEqual({
- type: 'richtext',
- style: { backgroundColor: 'red' },
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'empty' }
- }]
- }
- })
- })
-
- it('class list', () => {
- expect(compileSnippet(`
- <richtext class="title">
- <span class="large">ABCD</span>
- </richtext>
- `, `
- style: {
- title: { backgroundColor: '#FF6600', height: 200 },
- large: { fontSize: 24 }
- }
- `)).toEqual({
- type: 'richtext',
- classList: ['title'],
- attr: {
- value: [{
- type: 'span',
- style: { fontSize: 24 },
- attr: { value: 'ABCD' }
- }]
- }
- })
- })
-
- it('update styles', () => {
- expect(compileSnippet(`
- <richtext :class="classList" :style="{ backgroundColor: color }">
- <span class="large">ABCD</span>
- </richtext>
- `, `
- data: { classList: ['unknow'], color: '#FF6600' },
- style: {
- title: { height: 200 },
- large: { fontSize: 24 }
- },
- created: function () {
- this.classList = ['title']
- }
- `)).toEqual({
- type: 'richtext',
- classList: ['title'],
- style: { backgroundColor: '#FF6600' },
- attr: {
- value: [{
- type: 'span',
- style: { fontSize: 24 },
- attr: { value: 'ABCD' }
- }]
- }
- })
- })
-
- it('bind events', (done) => {
- const { render, staticRenderFns } = compileAndStringify(`
- <div>
- <richtext @click="handler">
- <span>Label: {{label}}</span>
- </richtext>
- </div>
- `)
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- el: 'body',
- render: ${render},
- staticRenderFns: ${staticRenderFns},
- data: { label: 'AAA' },
- methods: {
- handler: function () {
- this.label = 'BBB'
- }
- }
- })
- `)
- const richtext = instance.document.body.children[0]
- fireEvent(instance, richtext.ref, 'click')
- setTimeout(() => {
- expect(getRoot(instance).children[0]).toEqual({
- type: 'richtext',
- event: ['click'],
- attr: {
- value: [{
- type: 'span',
- attr: { value: 'Label: BBB' }
- }]
- }
- })
- done()
- }, 0)
- })
-
- it('v-for', () => {
- expect(compileSnippet(`
- <div>
- <richtext v-for="k in labels">
- <span>{{k}}</span>
- </richtext>
- </div>
- `, `
- data: {
- labels: ['A', 'B', 'C']
- }
- `)).toEqual({
- type: 'div',
- children: [{
- type: 'richtext',
- attr: { value: [{ type: 'span', attr: { value: 'A' }}] }
- }, {
- type: 'richtext',
- attr: { value: [{ type: 'span', attr: { value: 'B' }}] }
- }, {
- type: 'richtext',
- attr: { value: [{ type: 'span', attr: { value: 'C' }}] }
- }]
- })
- })
- })
-})
+++ /dev/null
-import { getRoot, fireEvent, compileAndStringify, compileAndExecute } from '../helpers/index'
-
-describe('generate events', () => {
- it('should be bound and fired for native component', (done) => {
- compileAndExecute(`
- <div @click="foo">
- <text>Hello {{x}}</text>
- </div>
- `, `
- data: { x: 'World' },
- methods: {
- foo: function () {
- this.x = 'Weex'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- attr: { value: 'Hello World' }
- }]
- })
- fireEvent(instance, '_root', 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- event: ['click'],
- children: [{
- type: 'text',
- attr: { value: 'Hello Weex' }
- }]
- })
- done()
- })
- })
-
- it('should be bound and fired by custom component', (done) => {
- const { render, staticRenderFns } = compileAndStringify(`<text>Hello {{x}}</text>`)
- compileAndExecute(`
- <div>
- <text>Hello {{x}}</text>
- <sub @click="foo" @click.native="bar"></sub>
- </div>
- `, `
- data: { x: 'World' },
- components: {
- sub: {
- data: function () {
- return { x: 'Sub' }
- },
- render: ${render},
- staticRenderFns: ${staticRenderFns},
- created: function () {
- this.$emit('click')
- }
- }
- },
- methods: {
- foo: function () {
- this.x = 'Foo'
- },
- bar: function () {
- this.x = 'Bar'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- attr: { value: 'Hello Foo' }
- }, {
- type: 'text',
- event: ['click'],
- attr: { value: 'Hello Sub' }
- }]
- })
- fireEvent(instance, instance.document.body.children[1].ref, 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- attr: { value: 'Hello Bar' }
- }, {
- type: 'text',
- event: ['click'],
- attr: { value: 'Hello Sub' }
- }]
- })
- done()
- })
- })
-})
+++ /dev/null
-import { getRoot, createInstance } from '../helpers/index'
-
-describe('framework APIs', () => {
- it('createInstance', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, [])
- ])
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- })
-
- it('createInstance with config', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: JSON.stringify(weex.config) }}, [])
- ])
- },
- el: "body"
- })
- `, { bundleType: 'Vue', bundleUrl: 'http://example.com/', a: 1, b: 2 })
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- attr: { value: '{"bundleType":"Vue","bundleUrl":"http://example.com/","a":1,"b":2,"env":{}}' }
- }]
- })
- })
-
- it('createInstance with external data', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- a: 1,
- b: 2
- },
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: this.a + '-' + this.b }}, [])
- ])
- },
- el: "body"
- })
- `, undefined, { a: 111 })
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: '111-2' }}]
- })
- })
-
- it('destroyInstance', (done) => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- x: 'Hello'
- },
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: this.x }}, [])
- ])
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- instance.$destroy()
- setTimeout(() => {
- expect(instance.document).toBeUndefined()
- expect(instance.app).toBeUndefined()
- done()
- }, 0)
- })
-
- it('refreshInstance', (done) => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- x: 'Hello'
- },
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: this.x }}, [])
- ])
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- instance.$refresh({ x: 'World' })
- setTimeout(() => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'World' }}]
- })
- instance.$destroy()
- const result = instance.$refresh({ x: 'World' })
- expect(result instanceof Error).toBe(true)
- done()
- })
- })
-
- it('registering global assets', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- Vue.component('test', {
- render (h) {
- return h('div', 'Hello')
- }
- })
- new Vue({
- render (h) {
- return h('test')
- },
- el: 'body'
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- })
-
- it('adding prototype methods', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- Vue.prototype.$test = () => 'Hello'
- const Test = {
- render (h) {
- return h('div', this.$test())
- }
- }
- new Vue({
- render (h) {
- return h(Test)
- },
- el: 'body'
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- })
-
- it('using global mixins', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- Vue.mixin({
- created () {
- this.test = true
- }
- })
- const Test = {
- data: () => ({ test: false }),
- render (h) {
- return h('div', this.test ? 'Hello' : 'nope')
- }
- }
- new Vue({
- data: { test: false },
- render (h) {
- return this.test ? h(Test) : h('p')
- },
- el: 'body'
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{ type: 'text', attr: { value: 'Hello' }}]
- })
- })
-})
+++ /dev/null
-import {
- compileAndStringify,
- createInstance,
- getRoot,
- syncPromise,
- checkRefresh
-} from '../helpers/index'
-
-describe('node in render function', () => {
- it('should be generated', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, [])
- ])
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }}
- ]
- })
- })
-
- it('should be generated with all types of text', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- 'World',
- createElement('text', {}, ['Weex'])
- ])
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- })
-
- it('should be generated with comments', () => {
- // todo
- })
-
- it('should be generated with module diff', (done) => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- counter: 0
- },
- methods: {
- foo: function () {}
- },
- render: function (createElement) {
- switch (this.counter) {
- case 1:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'World' }}, [])
- ])
-
- case 2:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'World' }, style: { fontSize: 100 }}, [])
- ])
-
- case 3:
- return createElement('div', {}, [
- createElement('text', {
- attrs: { value: 'World' },
- style: { fontSize: 100 },
- on: { click: this.foo }
- }, [])
- ])
-
- case 4:
- return createElement('div', {}, [
- createElement('text', {
- attrs: { value: 'Weex' },
- style: { color: '#ff0000' }
- }, [])
- ])
-
- default:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, [])
- ])
- }
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }}
- ]
- })
-
- syncPromise([
- checkRefresh(instance, { counter: 1 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'World' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 2 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'World' }, style: { fontSize: 100 }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 3 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'World' }, style: { fontSize: 100 }, event: ['click'] }
- ]
- })
- }),
- checkRefresh(instance, { counter: 4 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Weex' }, style: { fontSize: '', color: '#ff0000' }}
- ]
- })
- done()
- })
- ])
- })
-
- it('should be generated with sub components', () => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- render: function (createElement) {
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- createElement('foo', { props: { x: 'Weex' }})
- ])
- },
- components: {
- foo: {
- props: {
- x: { default: 'World' }
- },
- render: function (createElement) {
- return createElement('text', { attrs: { value: this.x }}, [])
- }
- }
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- })
-
- it('should be generated with if/for diff', (done) => {
- const { render, staticRenderFns } = compileAndStringify(`
- <div>
- <text v-for="item in list" v-if="item.x">{{item.v}}</text>
- </div>
- `)
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- list: [
- { v: 'Hello', x: true },
- { v: 'World', x: false },
- { v: 'Weex', x: true }
- ]
- },
- computed: {
- x: {
- get: function () { return 0 },
- set: function (v) {
- switch (v) {
- case 1:
- this.list[1].x = true
- break
- case 2:
- this.list.push({ v: 'v-if' })
- break
- case 3:
- this.list.push({ v: 'v-for', x: true })
- break
- case 4:
- this.list.splice(1, 2)
- break
- }
- }
- }
- },
- render: ${render},
- staticRenderFns: ${staticRenderFns},
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
-
- syncPromise([
- checkRefresh(instance, { x: 1 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { x: 2 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { x: 3 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }},
- { type: 'text', attr: { value: 'Weex' }},
- { type: 'text', attr: { value: 'v-for' }}
- ]
- })
- }),
- checkRefresh(instance, { x: 4 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'v-for' }}
- ]
- })
- done()
- })
- ])
- })
-
- it('should be generated with node structure diff', (done) => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- counter: 0
- },
- render: function (createElement) {
- switch (this.counter) {
- case 1:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- createElement('text', { attrs: { value: 'World' }}, [])
- ])
-
- case 2:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- createElement('text', { attrs: { value: 'World' }}, []),
- createElement('text', { attrs: { value: 'Weex' }}, [])
- ])
-
- case 3:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- createElement('text', { attrs: { value: 'Weex' }}, [])
- ])
-
- case 4:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Weex' }}, [])
- ])
-
- case 5:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- createElement('text', { attrs: { value: 'Weex' }}, [])
- ])
-
- case 6:
- return createElement('div', {}, [
- createElement('input', { attrs: { value: 'Hello' }}, []),
- createElement('text', { attrs: { value: 'Weex' }}, [])
- ])
-
- default:
- return createElement('div', {}, [
- createElement('text', { attrs: { value: 'Hello' }}, []),
- ])
- }
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }}
- ]
- })
-
- syncPromise([
- checkRefresh(instance, { counter: 1 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 2 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'World' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 3 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 4 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 5 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 6 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'input', attr: { value: 'Hello' }},
- { type: 'text', attr: { value: 'Weex' }}
- ]
- })
- done()
- })
- ])
- })
-
- it('should be generated with component diff', (done) => {
- const id = String(Date.now() * Math.random())
- const instance = createInstance(id, `
- new Vue({
- data: {
- counter: 0
- },
- components: {
- foo: {
- props: { a: { default: '1' }, b: { default: '2' }},
- render: function (createElement) {
- return createElement('text', { attrs: { value: this.a + '-' + this.b }}, [])
- }
- },
- bar: {
- render: function (createElement) {
- return createElement('text', { attrs: { value: 'Bar' }, style: { fontSize: 100 }})
- }
- },
- baz: {
- render: function (createElement) {
- return createElement('image', { attrs: { src: 'http://example.com/favicon.ico' }})
- }
- }
- },
- render: function (createElement) {
- switch (this.counter) {
- case 1:
- return createElement('div', {}, [
- createElement('foo', { props: { a: '111', b: '222' }}, [])
- ])
-
- case 2:
- return createElement('div', {}, [
- createElement('foo', {}, [])
- ])
-
- case 3:
- return createElement('div', {}, [
- createElement('bar', {}, [])
- ])
-
- case 4:
- return createElement('div', {}, [
- createElement('baz', {}, [])
- ])
-
- case 5:
- return createElement('div', {}, [
- createElement('foo', {}, []),
- createElement('bar', {}, []),
- createElement('baz', {}, [])
- ])
-
- default:
- return createElement('div', {}, [
- createElement('foo', { props: { a: '111' }}, [])
- ])
- }
- },
- el: "body"
- })
- `)
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: '111-2' }}
- ]
- })
-
- syncPromise([
- checkRefresh(instance, { counter: 1 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: '111-222' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 2 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: '1-2' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 3 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: 'Bar' }, style: { fontSize: 100 }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 4 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'image', attr: { src: 'http://example.com/favicon.ico' }}
- ]
- })
- }),
- checkRefresh(instance, { counter: 5 }, result => {
- expect(result).toEqual({
- type: 'div',
- children: [
- { type: 'text', attr: { value: '1-2' }},
- { type: 'text', attr: { value: 'Bar' }, style: { fontSize: 100 }},
- { type: 'image', attr: { src: 'http://example.com/favicon.ico' }}
- ]
- })
- done()
- })
- ])
- })
-})
+++ /dev/null
-import { getRoot, fireEvent, compileAndExecute } from '../helpers/index'
-
-describe('generate style', () => {
- it('should be generated', () => {
- compileAndExecute(`
- <div>
- <text style="font-size: 100">Hello World</text>
- </div>
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [{
- type: 'text',
- style: { fontSize: '100' },
- attr: { value: 'Hello World' }
- }]
- })
- })
- })
-
- it('should be generated by array binding', (done) => {
- compileAndExecute(`
- <div>
- <text :style="[x, y]" @click="foo">Hello {{z}}</text>
- </div>
- `, `
- data: {
- x: { fontSize: 100, color: '#00ff00' },
- y: { color: '#ff0000', fontWeight: 'bold' },
- z: 'World'
- },
- methods: {
- foo: function () {
- this.x.fontSize = 200
- this.x.color = '#0000ff'
- Vue.delete(this.y, 'fontWeight')
- this.z = 'Weex'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- {
- type: 'text',
- event: ['click'],
- style: { fontSize: 100, color: '#ff0000', fontWeight: 'bold' },
- attr: { value: 'Hello World' }
- }
- ]
- })
- fireEvent(instance, instance.document.body.children[0].ref, 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- {
- type: 'text',
- event: ['click'],
- style: { fontSize: 200, color: '#ff0000', fontWeight: '' },
- attr: { value: 'Hello Weex' }
- }
- ]
- })
- done()
- })
- })
-
- it('should be generated by map binding', (done) => {
- compileAndExecute(`
- <div>
- <text :style="{ fontSize: x, color: '#00ff00' }" @click="foo">Hello</text>
- <text :style="y">{{z}}</text>
- </div>
- `, `
- data: {
- x: 100,
- y: { color: '#ff0000', fontWeight: 'bold' },
- z: 'World'
- },
- methods: {
- foo: function () {
- this.x = 200
- this.y.color = '#0000ff'
- Vue.delete(this.y, 'fontWeight')
- this.z = 'Weex'
- }
- }
- `).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- {
- type: 'text',
- event: ['click'],
- style: { fontSize: 100, color: '#00ff00' },
- attr: { value: 'Hello' }
- },
- {
- type: 'text',
- style: { color: '#ff0000', fontWeight: 'bold' },
- attr: { value: 'World' }
- }
- ]
- })
- fireEvent(instance, instance.document.body.children[0].ref, 'click')
- return instance
- }).then(instance => {
- expect(getRoot(instance)).toEqual({
- type: 'div',
- children: [
- {
- type: 'text',
- event: ['click'],
- style: { fontSize: 200, color: '#00ff00' },
- attr: { value: 'Hello' }
- },
- {
- type: 'text',
- style: { color: '#0000ff', fontWeight: '' },
- attr: { value: 'Weex' }
- }
- ]
- })
- done()
- })
- })
-})
+++ /dev/null
-import { Vue } from "./vue";
-
-export default Vue;
-
-export {
- CreateElement,
- VueConstructor
-} from "./vue";
-
-export {
- Component,
- AsyncComponent,
- ComponentOptions,
- FunctionalComponentOptions,
- RenderContext,
- PropOptions,
- ComputedOptions,
- WatchHandler,
- WatchOptions,
- WatchOptionsWithHandler,
- DirectiveFunction,
- DirectiveOptions
-} from "./options";
-
-export {
- PluginFunction,
- PluginObject
-} from "./plugin";
-
-export {
- VNodeChildren,
- VNodeChildrenArrayContents,
- VNode,
- VNodeComponentOptions,
- VNodeData,
- VNodeDirective
-} from "./vnode";
+++ /dev/null
-import { Vue, CreateElement, CombinedVueInstance } from "./vue";
-import { VNode, VNodeData, VNodeDirective } from "./vnode";
-
-type Constructor = {
- new (...args: any[]): any;
-}
-
-// we don't support infer props in async component
-// N.B. ComponentOptions<V> is contravariant, the default generic should be bottom type
-export type Component<Data=DefaultData<never>, Methods=DefaultMethods<never>, Computed=DefaultComputed, Props=DefaultProps> =
- | typeof Vue
- | FunctionalComponentOptions<Props>
- | ComponentOptions<never, Data, Methods, Computed, Props>
-
-interface EsModuleComponent {
- default: Component
-}
-
-export type AsyncComponent<Data=DefaultData<never>, Methods=DefaultMethods<never>, Computed=DefaultComputed, Props=DefaultProps> = (
- resolve: (component: Component<Data, Methods, Computed, Props>) => void,
- reject: (reason?: any) => void
-) => Promise<Component | EsModuleComponent> | void;
-
-/**
- * When the `Computed` type parameter on `ComponentOptions` is inferred,
- * it should have a property with the return type of every get-accessor.
- * Since there isn't a way to query for the return type of a function, we allow TypeScript
- * to infer from the shape of `Accessors<Computed>` and work backwards.
- */
-export type Accessors<T> = {
- [K in keyof T]: (() => T[K]) | ComputedOptions<T[K]>
-}
-
-type DataDef<Data, Props, V> = Data | ((this: Readonly<Props> & V) => Data)
-/**
- * This type should be used when an array of strings is used for a component's `props` value.
- */
-export type ThisTypedComponentOptionsWithArrayProps<V extends Vue, Data, Methods, Computed, PropNames extends string> =
- object &
- ComponentOptions<V, DataDef<Data, Record<PropNames, any>, V>, Methods, Computed, PropNames[], Record<PropNames, any>> &
- ThisType<CombinedVueInstance<V, Data, Methods, Computed, Readonly<Record<PropNames, any>>>>;
-
-/**
- * This type should be used when an object mapped to `PropOptions` is used for a component's `props` value.
- */
-export type ThisTypedComponentOptionsWithRecordProps<V extends Vue, Data, Methods, Computed, Props> =
- object &
- ComponentOptions<V, DataDef<Data, Props, V>, Methods, Computed, RecordPropsDefinition<Props>, Props> &
- ThisType<CombinedVueInstance<V, Data, Methods, Computed, Readonly<Props>>>;
-
-type DefaultData<V> = object | ((this: V) => object);
-type DefaultProps = Record<string, any>;
-type DefaultMethods<V> = { [key: string]: (this: V, ...args: any[]) => any };
-type DefaultComputed = { [key: string]: any };
-export interface ComponentOptions<
- V extends Vue,
- Data=DefaultData<V>,
- Methods=DefaultMethods<V>,
- Computed=DefaultComputed,
- PropsDef=PropsDefinition<DefaultProps>,
- Props=DefaultProps> {
- data?: Data;
- props?: PropsDef;
- propsData?: object;
- computed?: Accessors<Computed>;
- methods?: Methods;
- watch?: Record<string, WatchOptionsWithHandler<any> | WatchHandler<any> | string>;
-
- el?: Element | string;
- template?: string;
- // hack is for funcitonal component type inference, should not used in user code
- render?(createElement: CreateElement, hack: RenderContext<Props>): VNode;
- renderError?: (h: () => VNode, err: Error) => VNode;
- staticRenderFns?: ((createElement: CreateElement) => VNode)[];
-
- beforeCreate?(this: V): void;
- created?(): void;
- beforeDestroy?(): void;
- destroyed?(): void;
- beforeMount?(): void;
- mounted?(): void;
- beforeUpdate?(): void;
- updated?(): void;
- activated?(): void;
- deactivated?(): void;
- errorCaptured?(err: Error, vm: Vue, info: string): boolean | void;
-
- directives?: { [key: string]: DirectiveFunction | DirectiveOptions };
- components?: { [key: string]: Component<any, any, any, any> | AsyncComponent<any, any, any, any> };
- transitions?: { [key: string]: object };
- filters?: { [key: string]: Function };
-
- provide?: object | (() => object);
- inject?: InjectOptions;
-
- model?: {
- prop?: string;
- event?: string;
- };
-
- parent?: Vue;
- mixins?: (ComponentOptions<Vue> | typeof Vue)[];
- name?: string;
- // TODO: support properly inferred 'extends'
- extends?: ComponentOptions<Vue> | typeof Vue;
- delimiters?: [string, string];
- comments?: boolean;
- inheritAttrs?: boolean;
-}
-
-export interface FunctionalComponentOptions<Props = DefaultProps, PropDefs = PropsDefinition<Props>> {
- name?: string;
- props?: PropDefs;
- inject?: InjectOptions;
- functional: boolean;
- render?(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode;
-}
-
-export interface RenderContext<Props=DefaultProps> {
- props: Props;
- children: VNode[];
- slots(): any;
- data: VNodeData;
- parent: Vue;
- listeners: { [key: string]: Function | Function[] };
- injections: any
-}
-
-export type Prop<T> = { (): T } | { new (...args: any[]): T & object }
-
-export type PropValidator<T> = PropOptions<T> | Prop<T> | Prop<T>[];
-
-export interface PropOptions<T=any> {
- type?: Prop<T> | Prop<T>[];
- required?: boolean;
- default?: T | null | undefined | (() => object);
- validator?(value: T): boolean;
-}
-
-export type RecordPropsDefinition<T> = {
- [K in keyof T]: PropValidator<T[K]>
-}
-export type ArrayPropsDefinition<T> = (keyof T)[];
-export type PropsDefinition<T> = ArrayPropsDefinition<T> | RecordPropsDefinition<T>;
-
-export interface ComputedOptions<T> {
- get?(): T;
- set?(value: T): void;
- cache?: boolean;
-}
-
-export type WatchHandler<T> = (val: T, oldVal: T) => void;
-
-export interface WatchOptions {
- deep?: boolean;
- immediate?: boolean;
-}
-
-export interface WatchOptionsWithHandler<T> extends WatchOptions {
- handler: WatchHandler<T>;
-}
-
-export type DirectiveFunction = (
- el: HTMLElement,
- binding: VNodeDirective,
- vnode: VNode,
- oldVnode: VNode
-) => void;
-
-export interface DirectiveOptions {
- bind?: DirectiveFunction;
- inserted?: DirectiveFunction;
- update?: DirectiveFunction;
- componentUpdated?: DirectiveFunction;
- unbind?: DirectiveFunction;
-}
-
-export type InjectKey = string | symbol;
-
-export type InjectOptions = {
- [key: string]: InjectKey | { from?: InjectKey, default?: any }
-} | string[];
+++ /dev/null
-import { Vue as _Vue } from "./vue";
-
-export type PluginFunction<T> = (Vue: typeof _Vue, options?: T) => void;
-
-export interface PluginObject<T> {
- install: PluginFunction<T>;
- [key: string]: any;
-}
+++ /dev/null
-import Vue from "../index";
-
-declare module "../vue" {
- // add instance property and method
- interface Vue {
- $instanceProperty: string;
- $instanceMethod(): void;
- }
-
- // add static property and method
- interface VueConstructor {
- staticProperty: string;
- staticMethod(): void;
- }
-}
-
-// augment ComponentOptions
-declare module "../options" {
- interface ComponentOptions<V extends Vue> {
- foo?: string;
- }
-}
-
-const vm = new Vue({
- props: ["bar"],
- data: {
- a: true
- },
- foo: "foo",
- methods: {
- foo() {
- this.a = false;
- }
- },
- computed: {
- BAR(): string {
- return this.bar.toUpperCase();
- }
- }
-});
-
-vm.$instanceProperty;
-vm.$instanceMethod();
-
-Vue.staticProperty;
-Vue.staticMethod();
+++ /dev/null
-export default {
- data() {
- return {}
- }
-}
+++ /dev/null
-import Vue, { VNode } from "../index";
-import { AsyncComponent, ComponentOptions, FunctionalComponentOptions, Component } from "../index";
-import { CreateElement } from "../vue";
-
-interface MyComponent extends Vue {
- a: number;
-}
-
-const option: ComponentOptions<MyComponent> = {
- data() {
- return {
- a: 123
- }
- }
-}
-
-// contravariant generic should use never
-const anotherOption: ComponentOptions<never> = option
-const componentType: Component = option
-
-Vue.component('sub-component', {
- components: {
- a: Vue.component(""),
- b: {}
- }
-});
-
-Vue.component('prop-component', {
- props: {
- size: Number,
- name: {
- type: String,
- default: '0',
- required: true,
- }
- },
- data() {
- return {
- fixedSize: this.size.toFixed(),
- capName: this.name.toUpperCase()
- }
- }
-});
-
-Vue.component('string-prop', {
- props: ['size', 'name'],
- data() {
- return {
- fixedSize: this.size.whatever,
- capName: this.name.isany
- }
- }
-});
-
-class User {
- private u = 1
-}
-class Cat {
- private u = 1
-}
-
-Vue.component('union-prop', {
- props: {
- primitive: [String, Number],
- object: [Cat, User],
- regex: RegExp,
- mixed: [RegExp, Array],
- union: [User, Number] as {new(): User | Number}[] // requires annotation
- },
- data() {
- this.primitive;
- this.object;
- this.union;
- this.regex.compile;
- this.mixed;
- return {
- fixedSize: this.union,
- }
- }
-});
-
-Vue.component('component', {
- data() {
- this.$mount
- this.size
- return {
- a: 1
- }
- },
- props: {
- size: Number,
- name: {
- type: String,
- default: '0',
- required: true,
- }
- },
- propsData: {
- msg: "Hello"
- },
- computed: {
- aDouble(): number {
- return this.a * 2;
- },
- aPlus: {
- get(): number {
- return this.a + 1;
- },
- set(v: number) {
- this.a = v - 1;
- },
- cache: false
- }
- },
- methods: {
- plus() {
- this.a++;
- this.aDouble.toFixed();
- this.aPlus = 1;
- this.size.toFixed();
- }
- },
- watch: {
- 'a': function(val: number, oldVal: number) {
- console.log(`new: ${val}, old: ${oldVal}`);
- },
- 'b': 'someMethod',
- 'c': {
- handler(val, oldVal) {
- this.a = val
- },
- deep: true
- }
- },
- el: "#app",
- template: "<div>{{ message }}</div>",
- render(createElement) {
- return createElement("div", {
- attrs: {
- id: "foo"
- },
- props: {
- myProp: "bar"
- },
- domProps: {
- innerHTML: "baz"
- },
- on: {
- click: new Function
- },
- nativeOn: {
- click: new Function
- },
- class: {
- foo: true,
- bar: false
- },
- style: {
- color: 'red',
- fontSize: '14px'
- },
- key: 'myKey',
- ref: 'myRef'
- }, [
- createElement(),
- createElement("div", "message"),
- createElement(Vue.component("component")),
- createElement({} as ComponentOptions<Vue>),
- createElement({
- functional: true,
- render(c: CreateElement) {
- return createElement()
- }
- }),
-
- createElement(() => Vue.component("component")),
- createElement(() => ( {} as ComponentOptions<Vue> )),
- createElement((resolve, reject) => {
- resolve({} as ComponentOptions<Vue>);
- reject();
- }),
-
- "message",
-
- [createElement("div", "message")]
- ]);
- },
- staticRenderFns: [],
-
- beforeCreate() {
- (this as any).a = 1;
- },
- created() {},
- beforeDestroy() {},
- destroyed() {},
- beforeMount() {},
- mounted() {},
- beforeUpdate() {},
- updated() {},
- activated() {},
- deactivated() {},
- errorCaptured(err, vm, info) {
- err.message
- vm.$emit('error')
- info.toUpperCase()
- return true
- },
-
- directives: {
- a: {
- bind() {},
- inserted() {},
- update() {},
- componentUpdated() {},
- unbind() {}
- },
- b(el, binding, vnode, oldVnode) {
- el.textContent;
-
- binding.name;
- binding.value;
- binding.oldValue;
- binding.expression;
- binding.arg;
- binding.modifiers["modifier"];
- }
- },
- components: {
- a: Vue.component(""),
- b: {} as ComponentOptions<Vue>
- },
- transitions: {},
- filters: {
- double(value: number) {
- return value * 2;
- }
- },
- parent: new Vue,
- mixins: [Vue.component(""), ({} as ComponentOptions<Vue>)],
- name: "Component",
- extends: {} as ComponentOptions<Vue>,
- delimiters: ["${", "}"]
-});
-
-Vue.component('provide-inject', {
- provide: {
- foo: 1
- },
- inject: {
- injectFoo: 'foo',
- injectBar: Symbol(),
- injectBaz: { from: 'baz' },
- injectQux: { default: 1 },
- injectQuux: { from: 'quuz', default: () => ({ value: 1 })}
- }
-})
-
-Vue.component('provide-function', {
- provide: () => ({
- foo: 1
- })
-})
-
-Vue.component('component-with-scoped-slot', {
- render (h) {
- interface ScopedSlotProps {
- msg: string
- }
-
- return h('div', [
- h('child', [
- // default scoped slot as children
- (props: ScopedSlotProps) => [h('span', [props.msg])]
- ]),
- h('child', {
- scopedSlots: {
- // named scoped slot as vnode data
- item: (props: ScopedSlotProps) => [h('span', [props.msg])]
- }
- })
- ])
- },
- components: {
- child: {
- render (this: Vue, h: CreateElement) {
- return h('div', [
- this.$scopedSlots['default']({ msg: 'hi' }),
- this.$scopedSlots['item']({ msg: 'hello' })
- ])
- }
- }
- }
-})
-
-Vue.component('narrow-array-of-vnode-type', {
- render (h): VNode {
- const slot = this.$scopedSlots.default({})
- if (typeof slot !== 'string') {
- const first = slot[0]
- if (!Array.isArray(first) && typeof first !== 'string') {
- return first;
- }
- }
- return h();
- }
-})
-
-Vue.component('functional-component', {
- props: ['prop'],
- functional: true,
- inject: ['foo'],
- render(createElement, context) {
- context.props;
- context.children;
- context.slots();
- context.data;
- context.parent;
- context.listeners.click;
- return createElement("div", {}, context.children);
- }
-});
-
-Vue.component('functional-component-object-inject', {
- functional: true,
- inject: {
- foo: 'foo',
- bar: Symbol(),
- baz: { from: 'baz' },
- qux: { default: 1 },
- quux: { from: 'quuz', default: () => ({ value: 1 })}
- },
- render(h) {
- return h('div')
- }
-})
-
-Vue.component('functional-component-check-optional', {
- functional: true
-})
-
-Vue.component("async-component", ((resolve, reject) => {
- setTimeout(() => {
- resolve(Vue.component("component"));
- }, 0);
- return new Promise((resolve) => {
- resolve({
- functional: true,
- render(h: CreateElement) { return h('div') }
- });
- })
-}));
-
-Vue.component('async-es-module-component', () => import('./es-module'))
+++ /dev/null
-import Vue from "../index";
-import { PluginFunction, PluginObject } from "../index";
-
-class Option {
- prefix: string = "";
- suffix: string = "";
-}
-
-const plugin: PluginObject<Option> = {
- install(Vue, option) {
- if (typeof option !== "undefined") {
- const {prefix, suffix} = option;
- }
- }
-}
-const installer: PluginFunction<Option> = function(Vue, option) { }
-
-Vue.use(plugin, new Option);
-Vue.use(installer, new Option);
-Vue.use(installer, new Option, new Option, new Option);
+++ /dev/null
-import Vue, { VNode, VNodeDirective } from '../index';
-import VueSSRClientPlugin = require('../../packages/vue-server-renderer/client-plugin');
-import VueSSRServerPlugin = require('../../packages/vue-server-renderer/server-plugin');
-import webpack = require('webpack');
-import { readFileSync } from 'fs';
-import { createRenderer, createBundleRenderer } from '../../packages/vue-server-renderer';
-
-function createApp (context: any) {
- return new Vue({
- data: {
- url: context.url
- },
- template: `<div>The visited URL is: {{ url }}</div>`
- });
-}
-
-// Renderer test
-const app = createApp({ url: 'http://localhost:8000/' });
-
-const renderer = createRenderer({
- template: readFileSync('./index.template.html', 'utf-8')
-});
-
-const context = {
- title: 'Hello',
- meta: `
- <meta name="description" content="Vue.js SSR Example">
- `
-};
-
-renderer.renderToString(app, (err, html) => {
- if (err) throw err;
- const res: string = html;
-});
-
-renderer.renderToString(app, context, (err, html) => {
- if (err) throw err;
- const res: string = html;
-});
-
-renderer.renderToString(app)
- .then(html => {
- const res: string = html;
- })
- .catch(err => {
- throw err;
- });
-
-renderer.renderToString(app, context)
- .then(html => {
- const res: string = html;
- })
- .catch(err => {
- throw err;
- });
-
-renderer.renderToStream(app, context).on('data', chunk => {
- const html = chunk.toString();
-});
-
-// Bundle renderer test
-declare const cacheClient: { [key: string]: string };
-
-const bundleRenderer = createBundleRenderer('/path/to/vue-ssr-server-bundle.json', {
- inject: false,
- runInNewContext: 'once',
- basedir: '/path/to/base',
-
- shouldPreload: (file, type) => {
- if (type === 'script' || type === 'style') {
- return true;
- }
- if (type === 'font') {
- return /\.woff2$/.test(file);
- }
- if (type === 'image') {
- return file === 'hero.jpg';
- }
- return false;
- },
-
- cache: {
- get: key => {
- return cacheClient[key];
- },
- set: (key, val) => {
- cacheClient[key] = val;
- },
- has: key => {
- return !!cacheClient[key];
- }
- },
-
- directives: {
- example (vnode: VNode, directiveMeta: VNodeDirective) {
- // transform vnode based on directive binding metadata
- }
- }
-});
-
-bundleRenderer.renderToString(context, (err, html) => {
- if (err) throw err;
- const res: string = html;
-});
-
-bundleRenderer.renderToString().then(html => {
- const res: string = html;
-});
-
-bundleRenderer.renderToString(context).then(html => {
- const res: string = html;
-});
-
-bundleRenderer.renderToStream(context).on('data', chunk => {
- const html = chunk.toString();
-});
-
-// webpack plugins
-webpack({
- plugins: [
- new VueSSRClientPlugin({
- filename: 'client-manifest.json'
- }),
- new VueSSRServerPlugin({
- filename: 'server-bundle.json'
- })
- ]
-});
+++ /dev/null
-{
- "compilerOptions": {
- "target": "es5",
- "lib": [
- "dom",
- "es2015"
- ],
- "module": "commonjs",
- "strict": true,
- "noEmit": true,
- "baseUrl": ".",
- "paths": {
- "vue": ["../index.d.ts"]
- }
- },
- "files": [
- "../index.d.ts",
- "../options.d.ts",
- "../plugin.d.ts",
- "../vnode.d.ts",
- "../vue.d.ts",
- "options-test.ts",
- "plugin-test.ts",
- "vue-test.ts",
- "augmentation-test.ts",
- "ssr-test.ts"
- ],
- "compileOnSave": false
-}
+++ /dev/null
-import Vue, { VNode } from "../index";
-import { ComponentOptions } from "../options";
-
-class Test extends Vue {
- a: number = 0;
-
- testProperties() {
- this.$data;
- this.$el;
- this.$options;
- this.$parent;
- this.$root;
- this.$children;
- this.$refs;
- this.$slots;
- this.$isServer;
- this.$ssrContext;
- this.$vnode;
- }
-
- // test property reification
- $refs!: {
- vue: Vue,
- element: HTMLInputElement,
- vues: Vue[],
- elements: HTMLInputElement[]
- }
- testReification() {
- this.$refs.vue.$data;
- this.$refs.element.value;
- this.$refs.vues[0].$data;
- this.$refs.elements[0].value;
- }
-
- testMethods() {
- this.$mount("#app", false);
- this.$forceUpdate();
- this.$destroy();
- this.$set({}, "key", "value");
- this.$delete({}, "key");
- this.$watch("a", (val: number, oldVal: number) => {}, {
- immediate: true,
- deep: false
- })();
- this.$watch(() => this.a, (val: number) => {});
- this.$on("", () => {});
- this.$once("", () => {});
- this.$off("", () => {});
- this.$emit("", 1, 2, 3);
- this.$nextTick(function() {
- this.$nextTick;
- });
- this.$nextTick().then(() => {});
- this.$createElement("div", {}, "message");
- }
-
- static testConfig() {
- const { config } = this;
- config.silent;
- config.optionMergeStrategies;
- config.devtools;
- config.errorHandler = (err, vm) => {
- if (vm instanceof Test) {
- vm.testProperties();
- vm.testMethods();
- }
- };
- config.warnHandler = (msg, vm) => {
- if (vm instanceof Test) {
- vm.testProperties();
- vm.testMethods();
- }
- };
- config.keyCodes = { esc: 27 };
- config.ignoredElements = ['foo', /^ion-/];
- }
-
- static testMethods() {
- this.extend({
- data() {
- return {
- msg: ""
- };
- }
- });
- this.nextTick(() => {});
- this.nextTick().then(() => {});
- this.set({}, "", "");
- this.set([true, false, true], 1, true);
- this.delete({}, "");
- this.delete([true, false], 0);
- this.directive("", {bind() {}});
- this.filter("", (value: number) => value);
- this.component("", { data: () => ({}) });
- this.component("", { functional: true, render(h) { return h("div", "hello!") } });
- this.use;
- this.mixin(Test);
- this.compile("<div>{{ message }}</div>");
- }
-}
-
-const HelloWorldComponent = Vue.extend({
- props: ["name"],
- data() {
- return {
- message: "Hello " + this.name,
- }
- },
- computed: {
- shouted(): string {
- return this.message.toUpperCase();
- }
- },
- methods: {
- getMoreExcited() {
- this.message += "!";
- }
- },
- watch: {
- message(a: string) {
- console.log(`Message ${this.message} was changed!`);
- }
- }
-});
-
-const FunctionalHelloWorldComponent = Vue.extend({
- functional: true,
- props: ["name"],
- render(createElement, ctxt) {
- return createElement("div", "Hello " + ctxt.props.name)
- }
-});
-
-const Parent = Vue.extend({
- data() {
- return { greeting: 'Hello' }
- }
-});
-
-const Child = Parent.extend({
- methods: {
- foo() {
- console.log(this.greeting.toLowerCase());
- }
- }
-});
-
-const GrandChild = Child.extend({
- computed: {
- lower(): string {
- return this.greeting.toLowerCase();
- }
- }
-});
-
-new GrandChild().lower.toUpperCase();
-for (let _ in (new Test()).$options) {
-}
-declare const options: ComponentOptions<Vue>;
-Vue.extend(options);
-Vue.component('test-comp', options);
-new Vue(options);
-
-// cyclic example
-Vue.extend({
- props: {
- bar: {
- type: String
- }
- },
- methods: {
- foo() {}
- },
- mounted () {
- this.foo()
- },
- // manual annotation
- render (h): VNode {
- const a = this.bar
- return h('canvas', {}, [a])
- }
-})
+++ /dev/null
-{\r
- "compilerOptions": {\r
- "strict": true,\r
- "lib": [\r
- "es2015", "dom"\r
- ]\r
- },\r
- "include": [\r
- "./*.ts"\r
- ]\r
-}
\ No newline at end of file
+++ /dev/null
-{
- "name": "vue",
- "main": "index.d.ts"
-}
+++ /dev/null
-import { Vue } from "./vue";
-
-export type ScopedSlot = (props: any) => VNodeChildrenArrayContents | string;
-
-export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string;
-export interface VNodeChildrenArrayContents extends Array<VNode | string | VNodeChildrenArrayContents> {}
-
-export interface VNode {
- tag?: string;
- data?: VNodeData;
- children?: VNode[];
- text?: string;
- elm?: Node;
- ns?: string;
- context?: Vue;
- key?: string | number;
- componentOptions?: VNodeComponentOptions;
- componentInstance?: Vue;
- parent?: VNode;
- raw?: boolean;
- isStatic?: boolean;
- isRootInsert: boolean;
- isComment: boolean;
-}
-
-export interface VNodeComponentOptions {
- Ctor: typeof Vue;
- propsData?: object;
- listeners?: object;
- children?: VNodeChildren;
- tag?: string;
-}
-
-export interface VNodeData {
- key?: string | number;
- slot?: string;
- scopedSlots?: { [key: string]: ScopedSlot };
- ref?: string;
- tag?: string;
- staticClass?: string;
- class?: any;
- staticStyle?: { [key: string]: any };
- style?: object[] | object;
- props?: { [key: string]: any };
- attrs?: { [key: string]: any };
- domProps?: { [key: string]: any };
- hook?: { [key: string]: Function };
- on?: { [key: string]: Function | Function[] };
- nativeOn?: { [key: string]: Function | Function[] };
- transition?: object;
- show?: boolean;
- inlineTemplate?: {
- render: Function;
- staticRenderFns: Function[];
- };
- directives?: VNodeDirective[];
- keepAlive?: boolean;
-}
-
-export interface VNodeDirective {
- readonly name: string;
- readonly value: any;
- readonly oldValue: any;
- readonly expression: any;
- readonly arg: string;
- readonly modifiers: { [key: string]: boolean };
-}
+++ /dev/null
-import {
- Component,
- AsyncComponent,
- ComponentOptions,
- FunctionalComponentOptions,
- WatchOptionsWithHandler,
- WatchHandler,
- DirectiveOptions,
- DirectiveFunction,
- RecordPropsDefinition,
- ThisTypedComponentOptionsWithArrayProps,
- ThisTypedComponentOptionsWithRecordProps,
- WatchOptions,
-} from "./options";
-import { VNode, VNodeData, VNodeChildren, ScopedSlot } from "./vnode";
-import { PluginFunction, PluginObject } from "./plugin";
-
-export interface CreateElement {
- (tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), children?: VNodeChildren): VNode;
- (tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), data?: VNodeData, children?: VNodeChildren): VNode;
-}
-
-export interface Vue {
- readonly $el: HTMLElement;
- readonly $options: ComponentOptions<Vue>;
- readonly $parent: Vue;
- readonly $root: Vue;
- readonly $children: Vue[];
- readonly $refs: { [key: string]: Vue | Element | Vue[] | Element[] };
- readonly $slots: { [key: string]: VNode[] };
- readonly $scopedSlots: { [key: string]: ScopedSlot };
- readonly $isServer: boolean;
- readonly $data: Record<string, any>;
- readonly $props: Record<string, any>;
- readonly $ssrContext: any;
- readonly $vnode: VNode;
- readonly $attrs: Record<string, string>;
- readonly $listeners: Record<string, Function | Function[]>;
-
- $mount(elementOrSelector?: Element | string, hydrating?: boolean): this;
- $forceUpdate(): void;
- $destroy(): void;
- $set: typeof Vue.set;
- $delete: typeof Vue.delete;
- $watch(
- expOrFn: string,
- callback: (this: this, n: any, o: any) => void,
- options?: WatchOptions
- ): (() => void);
- $watch<T>(
- expOrFn: (this: this) => T,
- callback: (this: this, n: T, o: T) => void,
- options?: WatchOptions
- ): (() => void);
- $on(event: string | string[], callback: Function): this;
- $once(event: string, callback: Function): this;
- $off(event?: string | string[], callback?: Function): this;
- $emit(event: string, ...args: any[]): this;
- $nextTick(callback: (this: this) => void): void;
- $nextTick(): Promise<void>;
- $createElement: CreateElement;
-}
-
-export type CombinedVueInstance<Instance extends Vue, Data, Methods, Computed, Props> = Data & Methods & Computed & Props & Instance;
-export type ExtendedVue<Instance extends Vue, Data, Methods, Computed, Props> = VueConstructor<CombinedVueInstance<Instance, Data, Methods, Computed, Props> & Vue>;
-
-export interface VueConfiguration {
- silent: boolean;
- optionMergeStrategies: any;
- devtools: boolean;
- productionTip: boolean;
- performance: boolean;
- errorHandler(err: Error, vm: Vue, info: string): void;
- warnHandler(msg: string, vm: Vue, trace: string): void;
- ignoredElements: (string | RegExp)[];
- keyCodes: { [key: string]: number | number[] };
-}
-
-export interface VueConstructor<V extends Vue = Vue> {
- new <Data = object, Methods = object, Computed = object, PropNames extends string = never>(options?: ThisTypedComponentOptionsWithArrayProps<V, Data, Methods, Computed, PropNames>): CombinedVueInstance<V, Data, Methods, Computed, Record<PropNames, any>>;
- // ideally, the return type should just contains Props, not Record<keyof Props, any>. But TS requires Base constructors must all have the same return type.
- new <Data = object, Methods = object, Computed = object, Props = object>(options?: ThisTypedComponentOptionsWithRecordProps<V, Data, Methods, Computed, Props>): CombinedVueInstance<V, Data, Methods, Computed, Record<keyof Props, any>>;
- new (options?: ComponentOptions<V>): CombinedVueInstance<V, object, object, object, Record<keyof object, any>>;
-
- extend<Data, Methods, Computed, PropNames extends string = never>(options?: ThisTypedComponentOptionsWithArrayProps<V, Data, Methods, Computed, PropNames>): ExtendedVue<V, Data, Methods, Computed, Record<PropNames, any>>;
- extend<Data, Methods, Computed, Props>(options?: ThisTypedComponentOptionsWithRecordProps<V, Data, Methods, Computed, Props>): ExtendedVue<V, Data, Methods, Computed, Props>;
- extend<PropNames extends string = never>(definition: FunctionalComponentOptions<Record<PropNames, any>, PropNames[]>): ExtendedVue<V, {}, {}, {}, Record<PropNames, any>>;
- extend<Props>(definition: FunctionalComponentOptions<Props, RecordPropsDefinition<Props>>): ExtendedVue<V, {}, {}, {}, Props>;
- extend(options?: ComponentOptions<V>): ExtendedVue<V, {}, {}, {}, {}>;
-
- nextTick(callback: () => void, context?: any[]): void;
- nextTick(): Promise<void>
- set<T>(object: object, key: string, value: T): T;
- set<T>(array: T[], key: number, value: T): T;
- delete(object: object, key: string): void;
- delete<T>(array: T[], key: number): void;
-
- directive(
- id: string,
- definition?: DirectiveOptions | DirectiveFunction
- ): DirectiveOptions;
- filter(id: string, definition?: Function): Function;
-
- component(id: string): VueConstructor;
- component<VC extends VueConstructor>(id: string, constructor: VC): VC;
- component<Data, Methods, Computed, Props>(id: string, definition: AsyncComponent<Data, Methods, Computed, Props>): ExtendedVue<V, Data, Methods, Computed, Props>;
- component<Data, Methods, Computed, PropNames extends string = never>(id: string, definition?: ThisTypedComponentOptionsWithArrayProps<V, Data, Methods, Computed, PropNames>): ExtendedVue<V, Data, Methods, Computed, Record<PropNames, any>>;
- component<Data, Methods, Computed, Props>(id: string, definition?: ThisTypedComponentOptionsWithRecordProps<V, Data, Methods, Computed, Props>): ExtendedVue<V, Data, Methods, Computed, Props>;
- component<PropNames extends string>(id: string, definition: FunctionalComponentOptions<Record<PropNames, any>, PropNames[]>): ExtendedVue<V, {}, {}, {}, Record<PropNames, any>>;
- component<Props>(id: string, definition: FunctionalComponentOptions<Props, RecordPropsDefinition<Props>>): ExtendedVue<V, {}, {}, {}, Props>;
- component(id: string, definition?: ComponentOptions<V>): ExtendedVue<V, {}, {}, {}, {}>;
-
- use<T>(plugin: PluginObject<T> | PluginFunction<T>, options?: T): void;
- use(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): void;
- mixin(mixin: VueConstructor | ComponentOptions<Vue>): void;
- compile(template: string): {
- render(createElement: typeof Vue.prototype.$createElement): VNode;
- staticRenderFns: (() => VNode)[];
- };
-
- config: VueConfiguration;
-}
-
-export const Vue: VueConstructor;
+++ /dev/null
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
-"@babel/code-frame@7.0.0-beta.40", "@babel/code-frame@^7.0.0-beta.35", "@babel/code-frame@^7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6"
- dependencies:
- "@babel/highlight" "7.0.0-beta.40"
-
-"@babel/generator@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.40.tgz#ab61f9556f4f71dbd1138949c795bb9a21e302ea"
- dependencies:
- "@babel/types" "7.0.0-beta.40"
- jsesc "^2.5.1"
- lodash "^4.2.0"
- source-map "^0.5.0"
- trim-right "^1.0.1"
-
-"@babel/helper-function-name@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz#9d033341ab16517f40d43a73f2d81fc431ccd7b6"
- dependencies:
- "@babel/helper-get-function-arity" "7.0.0-beta.40"
- "@babel/template" "7.0.0-beta.40"
- "@babel/types" "7.0.0-beta.40"
-
-"@babel/helper-get-function-arity@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz#ac0419cf067b0ec16453e1274f03878195791c6e"
- dependencies:
- "@babel/types" "7.0.0-beta.40"
-
-"@babel/highlight@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255"
- dependencies:
- chalk "^2.0.0"
- esutils "^2.0.2"
- js-tokens "^3.0.0"
-
-"@babel/template@7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.40.tgz#034988c6424eb5c3268fe6a608626de1f4410fc8"
- dependencies:
- "@babel/code-frame" "7.0.0-beta.40"
- "@babel/types" "7.0.0-beta.40"
- babylon "7.0.0-beta.40"
- lodash "^4.2.0"
-
-"@babel/traverse@^7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e"
- dependencies:
- "@babel/code-frame" "7.0.0-beta.40"
- "@babel/generator" "7.0.0-beta.40"
- "@babel/helper-function-name" "7.0.0-beta.40"
- "@babel/types" "7.0.0-beta.40"
- babylon "7.0.0-beta.40"
- debug "^3.0.1"
- globals "^11.1.0"
- invariant "^2.2.0"
- lodash "^4.2.0"
-
-"@babel/types@7.0.0-beta.40", "@babel/types@^7.0.0-beta.40":
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14"
- dependencies:
- esutils "^2.0.2"
- lodash "^4.2.0"
- to-fast-properties "^2.0.0"
-
-"@types/node@*":
- version "9.4.6"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"
-
-"@types/node@^8.0.33":
- version "8.9.4"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.4.tgz#dfd327582a06c114eb6e0441fa3d6fab35edad48"
-
-"@types/tapable@*":
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-0.2.4.tgz#8181a228da46185439300e600c5ae3b3b3982585"
-
-"@types/uglify-js@*":
- version "2.6.30"
- resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-2.6.30.tgz#257d2b6dd86673d60da476680fba90f2e30c6eef"
- dependencies:
- source-map "^0.6.1"
-
-"@types/webpack@^3.0.13":
- version "3.8.9"
- resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.9.tgz#c420c9428ba18e20e4fe8eff7bee4d04bace9182"
- dependencies:
- "@types/node" "*"
- "@types/tapable" "*"
- "@types/uglify-js" "*"
- source-map "^0.6.0"
-
-JSONStream@^1.0.3, JSONStream@^1.0.4:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea"
- dependencies:
- jsonparse "^1.2.0"
- through ">=2.2.7 <3"
-
-abab@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
-
-abbrev@1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
-
-abbrev@1.0.x:
- version "1.0.9"
- resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
-
-accepts@~1.3.4:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2"
- dependencies:
- mime-types "~2.1.18"
- negotiator "0.6.1"
-
-acorn-dynamic-import@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4"
- dependencies:
- acorn "^4.0.3"
-
-acorn-dynamic-import@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278"
- dependencies:
- acorn "^5.0.0"
-
-acorn-globals@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538"
- dependencies:
- acorn "^5.0.0"
-
-acorn-jsx@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
- dependencies:
- acorn "^3.0.4"
-
-acorn-jsx@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e"
- dependencies:
- acorn "^5.0.3"
-
-acorn-node@^1.2.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b"
- dependencies:
- acorn "^5.4.1"
- xtend "^4.0.1"
-
-acorn@^3.0.4:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
-
-acorn@^4.0.3:
- version "4.0.13"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"
-
-acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1, acorn@^5.3.0, acorn@^5.4.1, acorn@^5.5.0:
- version "5.5.1"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.1.tgz#84e05a9ea0acbe131227da50301e62464dc9c1d8"
-
-addressparser@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746"
-
-adm-zip@~0.4.3:
- version "0.4.7"
- resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.7.tgz#8606c2cbf1c426ce8c8ec00174447fd49b6eafc1"
-
-after@0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
-
-agent-base@2:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
- dependencies:
- extend "~3.0.0"
- semver "~5.0.1"
-
-ajv-keywords@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"
-
-ajv-keywords@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be"
-
-ajv@^4.9.1:
- version "4.11.8"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
- dependencies:
- co "^4.6.0"
- json-stable-stringify "^1.0.1"
-
-ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0:
- version "5.5.2"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
- dependencies:
- co "^4.6.0"
- fast-deep-equal "^1.0.0"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.3.0"
-
-ajv@^6.1.0:
- version "6.2.1"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.1.tgz#28a6abc493a2abe0fb4c8507acaedb43fa550671"
- dependencies:
- fast-deep-equal "^1.0.0"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.3.0"
-
-align-text@^0.1.1, align-text@^0.1.3:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
- dependencies:
- kind-of "^3.0.2"
- longest "^1.0.1"
- repeat-string "^1.5.2"
-
-amdefine@>=0.0.4:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
-
-amqplib@^0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63"
- dependencies:
- bitsyntax "~0.0.4"
- bluebird "^3.4.6"
- buffer-more-ints "0.0.2"
- readable-stream "1.x >=1.1.9"
- safe-buffer "^5.0.1"
-
-ansi-escapes@^1.0.0, ansi-escapes@^1.1.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
-
-ansi-escapes@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92"
-
-ansi-regex@^2.0.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
-
-ansi-regex@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
-
-ansi-styles@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
-
-ansi-styles@^3.2.0, ansi-styles@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
- dependencies:
- color-convert "^1.9.0"
-
-any-observable@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242"
-
-anymatch@^1.3.0:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
- dependencies:
- micromatch "^2.1.5"
- normalize-path "^2.0.0"
-
-anymatch@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
- dependencies:
- micromatch "^3.1.4"
- normalize-path "^2.1.1"
-
-app-root-path@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46"
-
-aproba@^1.0.3:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
-
-archiver-utils@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174"
- dependencies:
- glob "^7.0.0"
- graceful-fs "^4.1.0"
- lazystream "^1.0.0"
- lodash "^4.8.0"
- normalize-path "^2.0.0"
- readable-stream "^2.0.0"
-
-archiver@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/archiver/-/archiver-1.3.0.tgz#4f2194d6d8f99df3f531e6881f14f15d55faaf22"
- dependencies:
- archiver-utils "^1.3.0"
- async "^2.0.0"
- buffer-crc32 "^0.2.1"
- glob "^7.0.0"
- lodash "^4.8.0"
- readable-stream "^2.0.0"
- tar-stream "^1.5.0"
- walkdir "^0.0.11"
- zip-stream "^1.1.0"
-
-are-we-there-yet@~1.1.2:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d"
- dependencies:
- delegates "^1.0.0"
- readable-stream "^2.0.6"
-
-argparse@^1.0.7:
- version "1.0.10"
- resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
- dependencies:
- sprintf-js "~1.0.2"
-
-arr-diff@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
- dependencies:
- arr-flatten "^1.0.1"
-
-arr-diff@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
-
-arr-flatten@^1.0.1, arr-flatten@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
-
-arr-union@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
-
-array-equal@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
-
-array-filter@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
-
-array-find-index@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
-
-array-ify@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece"
-
-array-map@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662"
-
-array-reduce@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
-
-array-slice@^0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5"
-
-array-union@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
- dependencies:
- array-uniq "^1.0.1"
-
-array-uniq@^1.0.1:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
-
-array-unique@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
-
-array-unique@^0.3.2:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
-
-arraybuffer.slice@~0.0.7:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675"
-
-arrify@^1.0.0, arrify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
-
-asn1.js@^4.0.0:
- version "4.10.1"
- resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0"
- dependencies:
- bn.js "^4.0.0"
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
-
-asn1@0.1.11:
- version "0.1.11"
- resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.1.11.tgz#559be18376d08a4ec4dbe80877d27818639b2df7"
-
-asn1@~0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
-
-assert-plus@1.0.0, assert-plus@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
-
-assert-plus@^0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.1.5.tgz#ee74009413002d84cec7219c6ac811812e723160"
-
-assert-plus@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
-
-assert@^1.1.1, assert@^1.4.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91"
- dependencies:
- util "0.10.3"
-
-assertion-error@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.0.tgz#c7f85438fdd466bc7ca16ab90c81513797a5d23b"
-
-assign-symbols@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
-
-ast-types@0.x.x:
- version "0.11.2"
- resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.2.tgz#cc4e1d15a36b39979a1986fe1e91321cbfae7783"
-
-astw@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917"
- dependencies:
- acorn "^4.0.3"
-
-async-each@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
-
-async-limiter@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
-
-async@1.x, async@^1.4.0, async@^1.5.2:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
-
-async@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25"
- dependencies:
- lodash "^4.8.0"
-
-async@^2.0.0, async@^2.1.2:
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
- dependencies:
- lodash "^4.14.0"
-
-async@~0.9.0:
- version "0.9.2"
- resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
-
-async@~2.1.2:
- version "2.1.5"
- resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
- dependencies:
- lodash "^4.14.0"
-
-asynckit@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
-
-atob@^2.0.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d"
-
-atob@~1.1.0:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/atob/-/atob-1.1.3.tgz#95f13629b12c3a51a5d215abdce2aa9f32f80773"
-
-aws-sign2@~0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.5.0.tgz#c57103f7a17fc037f02d7c2e64b602ea223f7d63"
-
-aws-sign2@~0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
-
-aws-sign2@~0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
-
-aws4@^1.2.1, aws4@^1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
-
-axios@^0.15.3:
- version "0.15.3"
- resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053"
- dependencies:
- follow-redirects "1.0.0"
-
-babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
- dependencies:
- chalk "^1.1.3"
- esutils "^2.0.2"
- js-tokens "^3.0.2"
-
-babel-core@^6.25.0, babel-core@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8"
- dependencies:
- babel-code-frame "^6.26.0"
- babel-generator "^6.26.0"
- babel-helpers "^6.24.1"
- babel-messages "^6.23.0"
- babel-register "^6.26.0"
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- convert-source-map "^1.5.0"
- debug "^2.6.8"
- json5 "^0.5.1"
- lodash "^4.17.4"
- minimatch "^3.0.4"
- path-is-absolute "^1.0.1"
- private "^0.1.7"
- slash "^1.0.0"
- source-map "^0.5.6"
-
-babel-eslint@^8.0.3:
- version "8.2.2"
- resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b"
- dependencies:
- "@babel/code-frame" "^7.0.0-beta.40"
- "@babel/traverse" "^7.0.0-beta.40"
- "@babel/types" "^7.0.0-beta.40"
- babylon "^7.0.0-beta.40"
- eslint-scope "~3.7.1"
- eslint-visitor-keys "^1.0.0"
-
-babel-generator@^6.18.0, babel-generator@^6.26.0:
- version "6.26.1"
- resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90"
- dependencies:
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- detect-indent "^4.0.0"
- jsesc "^1.3.0"
- lodash "^4.17.4"
- source-map "^0.5.7"
- trim-right "^1.0.1"
-
-babel-helper-call-delegate@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d"
- dependencies:
- babel-helper-hoist-variables "^6.24.1"
- babel-runtime "^6.22.0"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-helper-define-map@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f"
- dependencies:
- babel-helper-function-name "^6.24.1"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
-
-babel-helper-function-name@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
- dependencies:
- babel-helper-get-function-arity "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-helper-get-function-arity@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-helper-hoist-variables@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-helper-optimise-call-expression@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-helper-regex@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72"
- dependencies:
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
-
-babel-helper-replace-supers@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a"
- dependencies:
- babel-helper-optimise-call-expression "^6.24.1"
- babel-messages "^6.23.0"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-helper-vue-jsx-merge-props@^2.0.2:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6"
-
-babel-helpers@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
- dependencies:
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-loader@^7.0.0:
- version "7.1.4"
- resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.4.tgz#e3463938bd4e6d55d1c174c5485d406a188ed015"
- dependencies:
- find-cache-dir "^1.0.0"
- loader-utils "^1.0.2"
- mkdirp "^0.5.1"
-
-babel-messages@^6.23.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-check-es2015-constants@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-istanbul@^4.1.4:
- version "4.1.5"
- resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e"
- dependencies:
- find-up "^2.1.0"
- istanbul-lib-instrument "^1.7.5"
- test-exclude "^4.1.1"
-
-babel-plugin-syntax-class-properties@^6.8.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
-
-babel-plugin-syntax-dynamic-import@^6.18.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
-
-babel-plugin-syntax-flow@^6.18.0, babel-plugin-syntax-flow@^6.8.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d"
-
-babel-plugin-syntax-jsx@^6.18.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
-
-babel-plugin-transform-class-properties@^6.8.0:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac"
- dependencies:
- babel-helper-function-name "^6.24.1"
- babel-plugin-syntax-class-properties "^6.8.0"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-arrow-functions@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-block-scoping@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"
- dependencies:
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
-
-babel-plugin-transform-es2015-classes@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
- dependencies:
- babel-helper-define-map "^6.24.1"
- babel-helper-function-name "^6.24.1"
- babel-helper-optimise-call-expression "^6.24.1"
- babel-helper-replace-supers "^6.24.1"
- babel-messages "^6.23.0"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-computed-properties@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
- dependencies:
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-destructuring@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-for-of@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-function-name@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
- dependencies:
- babel-helper-function-name "^6.24.1"
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-literals@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-modules-amd@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154"
- dependencies:
- babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a"
- dependencies:
- babel-plugin-transform-strict-mode "^6.24.1"
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-types "^6.26.0"
-
-babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
- dependencies:
- babel-helper-hoist-variables "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-modules-umd@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
- dependencies:
- babel-plugin-transform-es2015-modules-amd "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-object-super@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
- dependencies:
- babel-helper-replace-supers "^6.24.1"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-parameters@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
- dependencies:
- babel-helper-call-delegate "^6.24.1"
- babel-helper-get-function-arity "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-spread@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-sticky-regex@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
- dependencies:
- babel-helper-regex "^6.24.1"
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-template-literals@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-unicode-regex@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
- dependencies:
- babel-helper-regex "^6.24.1"
- babel-runtime "^6.22.0"
- regexpu-core "^2.0.0"
-
-babel-plugin-transform-flow-strip-types@^6.8.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf"
- dependencies:
- babel-plugin-syntax-flow "^6.18.0"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-regenerator@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
- dependencies:
- regenerator-transform "^0.10.0"
-
-babel-plugin-transform-strict-mode@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-vue-jsx@^3.4.3:
- version "3.7.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-3.7.0.tgz#d40492e6692a36b594f7e9a1928f43e969740960"
- dependencies:
- esutils "^2.0.2"
-
-babel-preset-es2015@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
- dependencies:
- babel-plugin-check-es2015-constants "^6.22.0"
- babel-plugin-transform-es2015-arrow-functions "^6.22.0"
- babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
- babel-plugin-transform-es2015-block-scoping "^6.24.1"
- babel-plugin-transform-es2015-classes "^6.24.1"
- babel-plugin-transform-es2015-computed-properties "^6.24.1"
- babel-plugin-transform-es2015-destructuring "^6.22.0"
- babel-plugin-transform-es2015-duplicate-keys "^6.24.1"
- babel-plugin-transform-es2015-for-of "^6.22.0"
- babel-plugin-transform-es2015-function-name "^6.24.1"
- babel-plugin-transform-es2015-literals "^6.22.0"
- babel-plugin-transform-es2015-modules-amd "^6.24.1"
- babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
- babel-plugin-transform-es2015-modules-systemjs "^6.24.1"
- babel-plugin-transform-es2015-modules-umd "^6.24.1"
- babel-plugin-transform-es2015-object-super "^6.24.1"
- babel-plugin-transform-es2015-parameters "^6.24.1"
- babel-plugin-transform-es2015-shorthand-properties "^6.24.1"
- babel-plugin-transform-es2015-spread "^6.22.0"
- babel-plugin-transform-es2015-sticky-regex "^6.24.1"
- babel-plugin-transform-es2015-template-literals "^6.22.0"
- babel-plugin-transform-es2015-typeof-symbol "^6.22.0"
- babel-plugin-transform-es2015-unicode-regex "^6.24.1"
- babel-plugin-transform-regenerator "^6.24.1"
-
-babel-preset-flow-vue@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/babel-preset-flow-vue/-/babel-preset-flow-vue-1.0.0.tgz#bd28eb64b53d65f9c47262b32ce6c6033fe70671"
- dependencies:
- babel-plugin-syntax-flow "^6.8.0"
- babel-plugin-transform-class-properties "^6.8.0"
- babel-plugin-transform-flow-strip-types "^6.8.0"
-
-babel-register@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
- dependencies:
- babel-core "^6.26.0"
- babel-runtime "^6.26.0"
- core-js "^2.5.0"
- home-or-tmp "^2.0.0"
- lodash "^4.17.4"
- mkdirp "^0.5.1"
- source-map-support "^0.4.15"
-
-babel-runtime@^6.0.0, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
- dependencies:
- core-js "^2.4.0"
- regenerator-runtime "^0.11.0"
-
-babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
- dependencies:
- babel-runtime "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- lodash "^4.17.4"
-
-babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
- dependencies:
- babel-code-frame "^6.26.0"
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- debug "^2.6.8"
- globals "^9.18.0"
- invariant "^2.2.2"
- lodash "^4.17.4"
-
-babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
- dependencies:
- babel-runtime "^6.26.0"
- esutils "^2.0.2"
- lodash "^4.17.4"
- to-fast-properties "^1.0.3"
-
-babylon@7.0.0-beta.40, babylon@^7.0.0-beta.40:
- version "7.0.0-beta.40"
- resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.40.tgz#91fc8cd56d5eb98b28e6fde41045f2957779940a"
-
-babylon@^6.18.0, babylon@^6.8.4:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
-
-backo2@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947"
-
-balanced-match@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
-
-base64-arraybuffer@0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8"
-
-base64-js@^1.0.2:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.3.tgz#fb13668233d9614cf5fb4bce95a9ba4096cdf801"
-
-base64id@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6"
-
-base@^0.11.1:
- version "0.11.2"
- resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
- dependencies:
- cache-base "^1.0.1"
- class-utils "^0.3.5"
- component-emitter "^1.2.1"
- define-property "^1.0.0"
- isobject "^3.0.1"
- mixin-deep "^1.2.0"
- pascalcase "^0.1.1"
-
-bcrypt-pbkdf@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
- dependencies:
- tweetnacl "^0.14.3"
-
-better-assert@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522"
- dependencies:
- callsite "1.0.0"
-
-big.js@^3.1.3:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
-
-binary-extensions@^1.0.0:
- version "1.11.0"
- resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205"
-
-bitsyntax@~0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82"
- dependencies:
- buffer-more-ints "0.0.2"
-
-bl@^1.0.0:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e"
- dependencies:
- readable-stream "^2.0.5"
-
-bl@~0.9.0:
- version "0.9.5"
- resolved "https://registry.yarnpkg.com/bl/-/bl-0.9.5.tgz#c06b797af085ea00bc527afc8efcf11de2232054"
- dependencies:
- readable-stream "~1.0.26"
-
-bl@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398"
- dependencies:
- readable-stream "~2.0.5"
-
-blob@0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921"
-
-block-stream@*:
- version "0.0.9"
- resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
- dependencies:
- inherits "~2.0.0"
-
-bluebird@^3.3.0, bluebird@^3.4.6:
- version "3.5.1"
- resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
-
-bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
- version "4.11.8"
- resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
-
-body-parser@^1.16.1:
- version "1.18.2"
- resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
- dependencies:
- bytes "3.0.0"
- content-type "~1.0.4"
- debug "2.6.9"
- depd "~1.1.1"
- http-errors "~1.6.2"
- iconv-lite "0.4.19"
- on-finished "~2.3.0"
- qs "6.5.1"
- raw-body "2.3.2"
- type-is "~1.6.15"
-
-boom@0.4.x:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/boom/-/boom-0.4.2.tgz#7a636e9ded4efcefb19cef4947a3c67dfaee911b"
- dependencies:
- hoek "0.9.x"
-
-boom@2.x.x:
- version "2.10.1"
- resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
- dependencies:
- hoek "2.x.x"
-
-boom@4.x.x:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31"
- dependencies:
- hoek "4.x.x"
-
-boom@5.x.x:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02"
- dependencies:
- hoek "4.x.x"
-
-brace-expansion@^1.0.0, brace-expansion@^1.1.7:
- version "1.1.11"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
- dependencies:
- balanced-match "^1.0.0"
- concat-map "0.0.1"
-
-braces@^0.1.2:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6"
- dependencies:
- expand-range "^0.1.0"
-
-braces@^1.8.2:
- version "1.8.5"
- resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"
- dependencies:
- expand-range "^1.8.1"
- preserve "^0.2.0"
- repeat-element "^1.1.2"
-
-braces@^2.3.0, braces@^2.3.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb"
- dependencies:
- arr-flatten "^1.1.0"
- array-unique "^0.3.2"
- define-property "^1.0.0"
- extend-shallow "^2.0.1"
- fill-range "^4.0.0"
- isobject "^3.0.1"
- kind-of "^6.0.2"
- repeat-element "^1.1.2"
- snapdragon "^0.8.1"
- snapdragon-node "^2.0.1"
- split-string "^3.0.2"
- to-regex "^3.0.1"
-
-brorand@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
-
-browser-pack@^6.0.1:
- version "6.0.4"
- resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.4.tgz#9a73beb3b48f9e36868be007b64400102c04a99f"
- dependencies:
- JSONStream "^1.0.3"
- combine-source-map "~0.8.0"
- defined "^1.0.0"
- safe-buffer "^5.1.1"
- through2 "^2.0.0"
- umd "^3.0.0"
-
-browser-process-hrtime@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e"
-
-browser-resolve@^1.11.0, browser-resolve@^1.11.2, browser-resolve@^1.7.0:
- version "1.11.2"
- resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
- dependencies:
- resolve "1.1.7"
-
-browser-stdout@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f"
-
-browserify-aes@^1.0.0, browserify-aes@^1.0.4:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f"
- dependencies:
- buffer-xor "^1.0.3"
- cipher-base "^1.0.0"
- create-hash "^1.1.0"
- evp_bytestokey "^1.0.3"
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-browserify-cipher@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a"
- dependencies:
- browserify-aes "^1.0.4"
- browserify-des "^1.0.0"
- evp_bytestokey "^1.0.0"
-
-browserify-des@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd"
- dependencies:
- cipher-base "^1.0.1"
- des.js "^1.0.0"
- inherits "^2.0.1"
-
-browserify-rsa@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524"
- dependencies:
- bn.js "^4.1.0"
- randombytes "^2.0.1"
-
-browserify-sign@^4.0.0:
- version "4.0.4"
- resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298"
- dependencies:
- bn.js "^4.1.1"
- browserify-rsa "^4.0.0"
- create-hash "^1.1.0"
- create-hmac "^1.1.2"
- elliptic "^6.0.0"
- inherits "^2.0.1"
- parse-asn1 "^5.0.0"
-
-browserify-zlib@^0.2.0, browserify-zlib@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f"
- dependencies:
- pako "~1.0.5"
-
-browserify@^14.5.0:
- version "14.5.0"
- resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5"
- dependencies:
- JSONStream "^1.0.3"
- assert "^1.4.0"
- browser-pack "^6.0.1"
- browser-resolve "^1.11.0"
- browserify-zlib "~0.2.0"
- buffer "^5.0.2"
- cached-path-relative "^1.0.0"
- concat-stream "~1.5.1"
- console-browserify "^1.1.0"
- constants-browserify "~1.0.0"
- crypto-browserify "^3.0.0"
- defined "^1.0.0"
- deps-sort "^2.0.0"
- domain-browser "~1.1.0"
- duplexer2 "~0.1.2"
- events "~1.1.0"
- glob "^7.1.0"
- has "^1.0.0"
- htmlescape "^1.1.0"
- https-browserify "^1.0.0"
- inherits "~2.0.1"
- insert-module-globals "^7.0.0"
- labeled-stream-splicer "^2.0.0"
- module-deps "^4.0.8"
- os-browserify "~0.3.0"
- parents "^1.0.1"
- path-browserify "~0.0.0"
- process "~0.11.0"
- punycode "^1.3.2"
- querystring-es3 "~0.2.0"
- read-only-stream "^2.0.0"
- readable-stream "^2.0.2"
- resolve "^1.1.4"
- shasum "^1.0.0"
- shell-quote "^1.6.1"
- stream-browserify "^2.0.0"
- stream-http "^2.0.0"
- string_decoder "~1.0.0"
- subarg "^1.0.0"
- syntax-error "^1.1.1"
- through2 "^2.0.0"
- timers-browserify "^1.0.1"
- tty-browserify "~0.0.0"
- url "~0.11.0"
- util "~0.10.1"
- vm-browserify "~0.0.1"
- xtend "^4.0.0"
-
-buble@^0.19.2, buble@^0.19.3:
- version "0.19.3"
- resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.3.tgz#01e9412062cff1da6f20342b6ecd72e7bf699d02"
- dependencies:
- acorn "^5.4.1"
- acorn-dynamic-import "^3.0.0"
- acorn-jsx "^4.1.1"
- chalk "^2.3.1"
- magic-string "^0.22.4"
- minimist "^1.2.0"
- os-homedir "^1.0.1"
- vlq "^1.0.0"
-
-buffer-crc32@^0.2.1:
- version "0.2.13"
- resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
-
-buffer-more-ints@0.0.2:
- version "0.0.2"
- resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c"
-
-buffer-xor@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9"
-
-buffer@^4.3.0:
- version "4.9.1"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298"
- dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
- isarray "^1.0.0"
-
-buffer@^5.0.2:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe"
- dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
-
-buildmail@4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72"
- dependencies:
- addressparser "1.0.1"
- libbase64 "0.1.0"
- libmime "3.0.0"
- libqp "1.1.0"
- nodemailer-fetch "1.6.0"
- nodemailer-shared "1.1.0"
- punycode "1.4.1"
-
-builtin-modules@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
-
-builtin-modules@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e"
-
-builtin-status-codes@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
-
-bytes@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
-
-cache-base@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
- dependencies:
- collection-visit "^1.0.0"
- component-emitter "^1.2.1"
- get-value "^2.0.6"
- has-value "^1.0.0"
- isobject "^3.0.1"
- set-value "^2.0.0"
- to-object-path "^0.3.0"
- union-value "^1.0.0"
- unset-value "^1.0.0"
-
-cached-path-relative@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7"
-
-cachedir@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-1.2.0.tgz#e9a0a25bb21a2b7a0f766f07c41eb7a311919b97"
- dependencies:
- os-homedir "^1.0.1"
-
-caller-path@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
- dependencies:
- callsites "^0.2.0"
-
-callsite@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20"
-
-callsites@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
-
-callsites@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
-
-camelcase-keys@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
- dependencies:
- camelcase "^2.0.0"
- map-obj "^1.0.0"
-
-camelcase-keys@^4.0.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77"
- dependencies:
- camelcase "^4.1.0"
- map-obj "^2.0.0"
- quick-lru "^1.0.0"
-
-camelcase@^1.0.2:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
-
-camelcase@^2.0.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
-
-camelcase@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
-
-caseless@~0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
-
-caseless@~0.12.0:
- version "0.12.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
-
-caseless@~0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.6.0.tgz#8167c1ab8397fb5bb95f96d28e5a81c50f247ac4"
-
-center-align@^0.1.1:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
- dependencies:
- align-text "^0.1.3"
- lazy-cache "^1.0.3"
-
-chai-nightwatch@~0.1.x:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/chai-nightwatch/-/chai-nightwatch-0.1.1.tgz#1ca56de768d3c0868fe7fc2f4d32c2fe894e6be9"
- dependencies:
- assertion-error "1.0.0"
- deep-eql "0.1.3"
-
-chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
- dependencies:
- ansi-styles "^2.2.1"
- escape-string-regexp "^1.0.2"
- has-ansi "^2.0.0"
- strip-ansi "^3.0.0"
- supports-color "^2.0.0"
-
-chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65"
- dependencies:
- ansi-styles "^3.2.1"
- escape-string-regexp "^1.0.5"
- supports-color "^5.3.0"
-
-chardet@^0.4.0:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
-
-chokidar@^1.4.1, chokidar@^1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
- dependencies:
- anymatch "^1.3.0"
- async-each "^1.0.0"
- glob-parent "^2.0.0"
- inherits "^2.0.1"
- is-binary-path "^1.0.0"
- is-glob "^2.0.0"
- path-is-absolute "^1.0.0"
- readdirp "^2.0.0"
- optionalDependencies:
- fsevents "^1.0.0"
-
-chokidar@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7"
- dependencies:
- anymatch "^2.0.0"
- async-each "^1.0.0"
- braces "^2.3.0"
- glob-parent "^3.1.0"
- inherits "^2.0.1"
- is-binary-path "^1.0.0"
- is-glob "^4.0.0"
- normalize-path "^2.1.1"
- path-is-absolute "^1.0.0"
- readdirp "^2.0.0"
- upath "^1.0.0"
- optionalDependencies:
- fsevents "^1.0.0"
-
-chromedriver@^2.30.1:
- version "2.36.0"
- resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-2.36.0.tgz#6a9473e11b50e7181ef8cd6476680e7f167374cd"
- dependencies:
- del "^3.0.0"
- extract-zip "^1.6.5"
- kew "^0.7.0"
- mkdirp "^0.5.1"
- request "^2.83.0"
-
-ci-info@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4"
-
-cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-circular-json@^0.3.1:
- version "0.3.3"
- resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
-
-circular-json@^0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.1.tgz#b8942a09e535863dc21b04417a91971e1d9cd91f"
-
-class-utils@^0.3.5:
- version "0.3.6"
- resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
- dependencies:
- arr-union "^3.1.0"
- define-property "^0.2.5"
- isobject "^3.0.0"
- static-extend "^0.1.1"
-
-cli-cursor@^1.0.1, cli-cursor@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"
- dependencies:
- restore-cursor "^1.0.1"
-
-cli-cursor@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
- dependencies:
- restore-cursor "^2.0.0"
-
-cli-spinners@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c"
-
-cli-truncate@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574"
- dependencies:
- slice-ansi "0.0.4"
- string-width "^1.0.1"
-
-cli-width@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
-
-cliui@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
- dependencies:
- center-align "^0.1.1"
- right-align "^0.1.1"
- wordwrap "0.0.2"
-
-cliui@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
- dependencies:
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
- wrap-ansi "^2.0.0"
-
-co@^4.6.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
-
-co@~3.0.6:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/co/-/co-3.0.6.tgz#1445f226c5eb956138e68c9ac30167ea7d2e6bda"
-
-code-point-at@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
-
-codecov.io@^0.1.6:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/codecov.io/-/codecov.io-0.1.6.tgz#59dfd02da1ff31c2fb2b952ad8ad16fd3781b728"
- dependencies:
- request "2.42.0"
- urlgrey "0.4.0"
-
-collection-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
- dependencies:
- map-visit "^1.0.0"
- object-visit "^1.0.0"
-
-color-convert@^1.9.0:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
- dependencies:
- color-name "^1.1.1"
-
-color-name@^1.1.1:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
-
-colors@1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
-
-colors@^1.1.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
-
-combine-lists@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6"
- dependencies:
- lodash "^4.5.0"
-
-combine-source-map@~0.7.1:
- version "0.7.2"
- resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e"
- dependencies:
- convert-source-map "~1.1.0"
- inline-source-map "~0.6.0"
- lodash.memoize "~3.0.3"
- source-map "~0.5.3"
-
-combine-source-map@~0.8.0:
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b"
- dependencies:
- convert-source-map "~1.1.0"
- inline-source-map "~0.6.0"
- lodash.memoize "~3.0.3"
- source-map "~0.5.3"
-
-combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
- dependencies:
- delayed-stream "~1.0.0"
-
-combined-stream@~0.0.4:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-0.0.7.tgz#0137e657baa5a7541c57ac37ac5fc07d73b4dc1f"
- dependencies:
- delayed-stream "0.0.5"
-
-commander@2.9.0:
- version "2.9.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
- dependencies:
- graceful-readlink ">= 1.0.0"
-
-commander@^2.14.1, commander@^2.9.0, commander@~2.14.1:
- version "2.14.1"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa"
-
-commitizen@^2.9.6:
- version "2.9.6"
- resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-2.9.6.tgz#c0d00535ef264da7f63737edfda4228983fa2291"
- dependencies:
- cachedir "^1.1.0"
- chalk "1.1.3"
- cz-conventional-changelog "1.2.0"
- dedent "0.6.0"
- detect-indent "4.0.0"
- find-node-modules "1.0.4"
- find-root "1.0.0"
- fs-extra "^1.0.0"
- glob "7.1.1"
- inquirer "1.2.3"
- lodash "4.17.2"
- minimist "1.2.0"
- path-exists "2.1.0"
- shelljs "0.7.6"
- strip-json-comments "2.0.1"
-
-commondir@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
-
-compare-func@^1.3.1:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648"
- dependencies:
- array-ify "^1.0.0"
- dot-prop "^3.0.0"
-
-component-bind@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1"
-
-component-emitter@1.2.1, component-emitter@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
-
-component-inherit@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143"
-
-compress-commons@^1.2.0:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f"
- dependencies:
- buffer-crc32 "^0.2.1"
- crc32-stream "^2.0.0"
- normalize-path "^2.0.0"
- readable-stream "^2.0.0"
-
-concat-map@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
-
-concat-stream@1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
- dependencies:
- inherits "^2.0.3"
- readable-stream "^2.2.2"
- typedarray "^0.0.6"
-
-concat-stream@^1.4.7, concat-stream@^1.6.0:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26"
- dependencies:
- inherits "^2.0.3"
- readable-stream "^2.2.2"
- typedarray "^0.0.6"
-
-concat-stream@~1.5.0, concat-stream@~1.5.1:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266"
- dependencies:
- inherits "~2.0.1"
- readable-stream "~2.0.0"
- typedarray "~0.0.5"
-
-connect@^3.6.0:
- version "3.6.6"
- resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524"
- dependencies:
- debug "2.6.9"
- finalhandler "1.1.0"
- parseurl "~1.3.2"
- utils-merge "1.0.1"
-
-console-browserify@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
- dependencies:
- date-now "^0.1.4"
-
-console-control-strings@^1.0.0, console-control-strings@~1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
-
-constants-browserify@^1.0.0, constants-browserify@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
-
-content-type-parser@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7"
-
-content-type@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
-
-conventional-changelog-angular@^1.6.6:
- version "1.6.6"
- resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz#b27f2b315c16d0a1f23eb181309d0e6a4698ea0f"
- dependencies:
- compare-func "^1.3.1"
- q "^1.5.1"
-
-conventional-changelog-atom@^0.2.4:
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.2.4.tgz#4917759947f4db86073f9d3838a2d54302d5843d"
- dependencies:
- q "^1.5.1"
-
-conventional-changelog-codemirror@^0.3.4:
- version "0.3.4"
- resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.3.4.tgz#debc43991d487d7964e65087fbbe034044bd51fb"
- dependencies:
- q "^1.5.1"
-
-conventional-changelog-core@^2.0.5:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz#45b6347c4c6512e1f163f7ff55c9f5bcb88fd990"
- dependencies:
- conventional-changelog-writer "^3.0.4"
- conventional-commits-parser "^2.1.5"
- dateformat "^3.0.0"
- get-pkg-repo "^1.0.0"
- git-raw-commits "^1.3.4"
- git-remote-origin-url "^2.0.0"
- git-semver-tags "^1.3.4"
- lodash "^4.2.1"
- normalize-package-data "^2.3.5"
- q "^1.5.1"
- read-pkg "^1.1.0"
- read-pkg-up "^1.0.1"
- through2 "^2.0.0"
-
-conventional-changelog-ember@^0.3.6:
- version "0.3.6"
- resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.3.6.tgz#f3825d7434168f3d9211b5532dc1d5769532b668"
- dependencies:
- q "^1.5.1"
-
-conventional-changelog-eslint@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz#8bae05ebbf574e6506caf7b37dc51ca21b74d220"
- dependencies:
- q "^1.5.1"
-
-conventional-changelog-express@^0.3.4:
- version "0.3.4"
- resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.3.4.tgz#812a9cf778677e12f978ac9c40d85297c0bfcca9"
- dependencies:
- q "^1.5.1"
-
-conventional-changelog-jquery@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz#0208397162e3846986e71273b6c79c5b5f80f510"
- dependencies:
- q "^1.4.1"
-
-conventional-changelog-jscs@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz#0479eb443cc7d72c58bf0bcf0ef1d444a92f0e5c"
- dependencies:
- q "^1.4.1"
-
-conventional-changelog-jshint@^0.3.4:
- version "0.3.4"
- resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.3.4.tgz#b2de33cd0870d9af804ac6a4fded0ee25b69c9bb"
- dependencies:
- compare-func "^1.3.1"
- q "^1.5.1"
-
-conventional-changelog-preset-loader@^1.1.6:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz#b29af6332f9313857be36427623c9016bfeeaf33"
-
-conventional-changelog-writer@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz#705b46a8b8277bd7fd79cad8032095b5d803864c"
- dependencies:
- compare-func "^1.3.1"
- conventional-commits-filter "^1.1.5"
- dateformat "^3.0.0"
- handlebars "^4.0.2"
- json-stringify-safe "^5.0.1"
- lodash "^4.2.1"
- meow "^4.0.0"
- semver "^5.5.0"
- split "^1.0.0"
- through2 "^2.0.0"
-
-conventional-changelog@^1.1.3:
- version "1.1.18"
- resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.18.tgz#ffe28798e4ddef5f6e2f74398e8248bcb233360b"
- dependencies:
- conventional-changelog-angular "^1.6.6"
- conventional-changelog-atom "^0.2.4"
- conventional-changelog-codemirror "^0.3.4"
- conventional-changelog-core "^2.0.5"
- conventional-changelog-ember "^0.3.6"
- conventional-changelog-eslint "^1.0.5"
- conventional-changelog-express "^0.3.4"
- conventional-changelog-jquery "^0.1.0"
- conventional-changelog-jscs "^0.1.0"
- conventional-changelog-jshint "^0.3.4"
- conventional-changelog-preset-loader "^1.1.6"
-
-conventional-commit-types@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946"
-
-conventional-commits-filter@^1.1.5:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz#77aac065e3de9c1a74b801e8e25c9affb3184f65"
- dependencies:
- is-subset "^0.1.1"
- modify-values "^1.0.0"
-
-conventional-commits-parser@^2.1.5:
- version "2.1.5"
- resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz#9ac3a4ab221c0c3c9e9dd2c09ae01e6d1e1dabe0"
- dependencies:
- JSONStream "^1.0.4"
- is-text-path "^1.0.0"
- lodash "^4.2.1"
- meow "^4.0.0"
- split2 "^2.0.0"
- through2 "^2.0.0"
- trim-off-newlines "^1.0.0"
-
-convert-source-map@^1.5.0:
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5"
-
-convert-source-map@~1.1.0:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
-
-cookie@0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
-
-copy-descriptor@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
-
-core-js@^2.2.0, core-js@^2.4.0, core-js@^2.5.0:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
-
-core-util-is@1.0.2, core-util-is@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
-
-corser@~2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87"
-
-cosmiconfig@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc"
- dependencies:
- is-directory "^0.3.1"
- js-yaml "^3.9.0"
- parse-json "^4.0.0"
- require-from-string "^2.0.1"
-
-crc32-stream@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4"
- dependencies:
- crc "^3.4.4"
- readable-stream "^2.0.0"
-
-crc@^3.4.4:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/crc/-/crc-3.5.0.tgz#98b8ba7d489665ba3979f59b21381374101a1964"
-
-create-ecdh@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d"
- dependencies:
- bn.js "^4.1.0"
- elliptic "^6.0.0"
-
-create-hash@^1.1.0, create-hash@^1.1.2:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd"
- dependencies:
- cipher-base "^1.0.1"
- inherits "^2.0.1"
- ripemd160 "^2.0.0"
- sha.js "^2.4.0"
-
-create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06"
- dependencies:
- cipher-base "^1.0.3"
- create-hash "^1.1.0"
- inherits "^2.0.1"
- ripemd160 "^2.0.0"
- safe-buffer "^5.0.1"
- sha.js "^2.4.8"
-
-cross-spawn@^5.0.1, cross-spawn@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
- dependencies:
- lru-cache "^4.0.1"
- shebang-command "^1.2.0"
- which "^1.2.9"
-
-cryptiles@0.2.x:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-0.2.2.tgz#ed91ff1f17ad13d3748288594f8a48a0d26f325c"
- dependencies:
- boom "0.4.x"
-
-cryptiles@2.x.x:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
- dependencies:
- boom "2.x.x"
-
-cryptiles@3.x.x:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
- dependencies:
- boom "5.x.x"
-
-crypto-browserify@^3.0.0, crypto-browserify@^3.11.0:
- version "3.12.0"
- resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
- dependencies:
- browserify-cipher "^1.0.0"
- browserify-sign "^4.0.0"
- create-ecdh "^4.0.0"
- create-hash "^1.1.0"
- create-hmac "^1.1.0"
- diffie-hellman "^5.0.0"
- inherits "^2.0.1"
- pbkdf2 "^3.0.3"
- public-encrypt "^4.0.0"
- randombytes "^2.0.0"
- randomfill "^1.0.3"
-
-css@~2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/css/-/css-2.2.1.tgz#73a4c81de85db664d4ee674f7d47085e3b2d55dc"
- dependencies:
- inherits "^2.0.1"
- source-map "^0.1.38"
- source-map-resolve "^0.3.0"
- urix "^0.1.0"
-
-cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b"
-
-"cssstyle@>= 0.2.37 < 0.3.0":
- version "0.2.37"
- resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54"
- dependencies:
- cssom "0.3.x"
-
-ctype@0.5.3:
- version "0.5.3"
- resolved "https://registry.yarnpkg.com/ctype/-/ctype-0.5.3.tgz#82c18c2461f74114ef16c135224ad0b9144ca12f"
-
-currently-unhandled@^0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
- dependencies:
- array-find-index "^1.0.1"
-
-custom-event@~1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425"
-
-cz-conventional-changelog@1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-1.2.0.tgz#2bca04964c8919b23f3fd6a89ef5e6008b31b3f8"
- dependencies:
- conventional-commit-types "^2.0.0"
- lodash.map "^4.5.1"
- longest "^1.0.1"
- pad-right "^0.2.2"
- right-pad "^1.0.1"
- word-wrap "^1.0.3"
-
-cz-conventional-changelog@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz#2f4bc7390e3244e4df293e6ba351e4c740a7c764"
- dependencies:
- conventional-commit-types "^2.0.0"
- lodash.map "^4.5.1"
- longest "^1.0.1"
- right-pad "^1.0.1"
- word-wrap "^1.0.3"
-
-d@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
- dependencies:
- es5-ext "^0.10.9"
-
-dargs@^4.0.1:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17"
- dependencies:
- number-is-nan "^1.0.0"
-
-dashdash@^1.12.0:
- version "1.14.1"
- resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
- dependencies:
- assert-plus "^1.0.0"
-
-data-uri-to-buffer@1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835"
-
-date-fns@^1.27.2:
- version "1.29.0"
- resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
-
-date-format@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8"
-
-date-now@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
-
-dateformat@^1.0.6:
- version "1.0.12"
- resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9"
- dependencies:
- get-stdin "^4.0.1"
- meow "^3.3.0"
-
-dateformat@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
-
-de-indent@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
-
-debug@2, debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@~2.6.4, debug@~2.6.6:
- version "2.6.9"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
- dependencies:
- ms "2.0.0"
-
-debug@2.2.0, debug@~2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
- dependencies:
- ms "0.7.1"
-
-debug@^3.0.1, debug@^3.1.0, debug@~3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
- dependencies:
- ms "2.0.0"
-
-decamelize-keys@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
- dependencies:
- decamelize "^1.1.0"
- map-obj "^1.0.0"
-
-decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
-
-decode-uri-component@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
-
-dedent@0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.6.0.tgz#0e6da8f0ce52838ef5cec5c8f9396b0c1b64a3cb"
-
-dedent@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
-
-deep-eql@0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
- dependencies:
- type-detect "0.1.1"
-
-deep-equal@~0.1.0:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.1.2.tgz#b246c2b80a570a47c11be1d9bd1070ec878b87ce"
-
-deep-extend@~0.4.0:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f"
-
-deep-is@~0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
-
-define-property@^0.2.5:
- version "0.2.5"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
- dependencies:
- is-descriptor "^0.1.0"
-
-define-property@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
- dependencies:
- is-descriptor "^1.0.0"
-
-define-property@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
- dependencies:
- is-descriptor "^1.0.2"
- isobject "^3.0.1"
-
-defined@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
-
-defined@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e"
-
-degenerator@~1.0.2:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095"
- dependencies:
- ast-types "0.x.x"
- escodegen "1.x.x"
- esprima "3.x.x"
-
-del@^2.0.2:
- version "2.2.2"
- resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
- dependencies:
- globby "^5.0.0"
- is-path-cwd "^1.0.0"
- is-path-in-cwd "^1.0.0"
- object-assign "^4.0.1"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
- rimraf "^2.2.8"
-
-del@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5"
- dependencies:
- globby "^6.1.0"
- is-path-cwd "^1.0.0"
- is-path-in-cwd "^1.0.0"
- p-map "^1.1.1"
- pify "^3.0.0"
- rimraf "^2.2.8"
-
-delayed-stream@0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-0.0.5.tgz#d4b1f43a93e8296dfe02694f4680bc37a313c73f"
-
-delayed-stream@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
-
-delegates@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
-
-depd@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
-
-depd@~1.1.1:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
-
-deps-sort@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5"
- dependencies:
- JSONStream "^1.0.3"
- shasum "^1.0.0"
- subarg "^1.0.0"
- through2 "^2.0.0"
-
-des.js@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc"
- dependencies:
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
-
-detect-file@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63"
- dependencies:
- fs-exists-sync "^0.1.0"
-
-detect-indent@4.0.0, detect-indent@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
- dependencies:
- repeating "^2.0.0"
-
-detect-libc@^1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
-
-detective@^4.0.0:
- version "4.7.1"
- resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e"
- dependencies:
- acorn "^5.2.1"
- defined "^1.0.0"
-
-di@^0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"
-
-diff@1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf"
-
-diff@^3.2.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
-
-diffie-hellman@^5.0.0:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
- dependencies:
- bn.js "^4.1.0"
- miller-rabin "^4.0.0"
- randombytes "^2.0.0"
-
-doctrine@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
- dependencies:
- esutils "^2.0.2"
-
-dom-serialize@^2.2.0:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b"
- dependencies:
- custom-event "~1.0.0"
- ent "~2.2.0"
- extend "^3.0.0"
- void-elements "^2.0.0"
-
-dom-serializer@0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
- dependencies:
- domelementtype "~1.1.1"
- entities "~1.1.1"
-
-domain-browser@^1.1.1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
-
-domain-browser@~1.1.0:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc"
-
-domelementtype@1, domelementtype@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
-
-domelementtype@~1.1.1:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
-
-domexception@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
- dependencies:
- webidl-conversions "^4.0.2"
-
-domhandler@^2.3.0:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259"
- dependencies:
- domelementtype "1"
-
-domutils@^1.5.1:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
- dependencies:
- dom-serializer "0"
- domelementtype "1"
-
-dot-prop@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177"
- dependencies:
- is-obj "^1.0.0"
-
-double-ended-queue@^2.1.0-0:
- version "2.1.0-0"
- resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c"
-
-duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
- dependencies:
- readable-stream "^2.0.2"
-
-duplexer@~0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
-
-ecc-jsbn@~0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
- dependencies:
- jsbn "~0.1.0"
-
-ecstatic@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-3.2.0.tgz#1b1aee1ca7c6b99cfb5cf6c9b26b481b90c4409f"
- dependencies:
- he "^1.1.1"
- mime "^1.4.1"
- minimist "^1.1.0"
- url-join "^2.0.2"
-
-ee-first@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
-
-ejs@2.5.7:
- version "2.5.7"
- resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a"
-
-elegant-spinner@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e"
-
-elliptic@^6.0.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df"
- dependencies:
- bn.js "^4.4.0"
- brorand "^1.0.1"
- hash.js "^1.0.0"
- hmac-drbg "^1.0.0"
- inherits "^2.0.1"
- minimalistic-assert "^1.0.0"
- minimalistic-crypto-utils "^1.0.0"
-
-emojis-list@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
-
-encodeurl@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
-
-end-of-stream@^1.0.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
- dependencies:
- once "^1.4.0"
-
-engine.io-client@~3.1.0:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.5.tgz#85de17666560327ef1817978f6e3f8101ded2c47"
- dependencies:
- component-emitter "1.2.1"
- component-inherit "0.0.3"
- debug "~3.1.0"
- engine.io-parser "~2.1.1"
- has-cors "1.1.0"
- indexof "0.0.1"
- parseqs "0.0.5"
- parseuri "0.0.5"
- ws "~3.3.1"
- xmlhttprequest-ssl "~1.5.4"
- yeast "0.1.2"
-
-engine.io-parser@~2.1.0, engine.io-parser@~2.1.1:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196"
- dependencies:
- after "0.8.2"
- arraybuffer.slice "~0.0.7"
- base64-arraybuffer "0.1.5"
- blob "0.0.4"
- has-binary2 "~1.0.2"
-
-engine.io@~3.1.0:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845"
- dependencies:
- accepts "~1.3.4"
- base64id "1.0.0"
- cookie "0.3.1"
- debug "~3.1.0"
- engine.io-parser "~2.1.0"
- ws "~3.3.1"
- optionalDependencies:
- uws "~9.14.0"
-
-enhanced-resolve@^3.4.0:
- version "3.4.1"
- resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e"
- dependencies:
- graceful-fs "^4.1.2"
- memory-fs "^0.4.0"
- object-assign "^4.0.1"
- tapable "^0.2.7"
-
-ent@~2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
-
-entities@^1.1.1, entities@~1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
-
-errno@^0.1.3:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
- dependencies:
- prr "~1.0.1"
-
-error-ex@^1.2.0, error-ex@^1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc"
- dependencies:
- is-arrayish "^0.2.1"
-
-es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14:
- version "0.10.39"
- resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.39.tgz#fca21b67559277ca4ac1a1ed7048b107b6f76d87"
- dependencies:
- es6-iterator "~2.0.3"
- es6-symbol "~3.1.1"
-
-es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
- dependencies:
- d "1"
- es5-ext "^0.10.35"
- es6-symbol "^3.1.1"
-
-es6-map@^0.1.3:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
- es6-iterator "~2.0.1"
- es6-set "~0.1.5"
- es6-symbol "~3.1.1"
- event-emitter "~0.3.5"
-
-es6-promise@^4.0.3, es6-promise@^4.1.0:
- version "4.2.4"
- resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
-
-es6-set@~0.1.5:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
- es6-iterator "~2.0.1"
- es6-symbol "3.1.1"
- event-emitter "~0.3.5"
-
-es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
-
-es6-weak-map@^2.0.1:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f"
- dependencies:
- d "1"
- es5-ext "^0.10.14"
- es6-iterator "^2.0.1"
- es6-symbol "^3.1.1"
-
-escape-html@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
-
-escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
-
-escodegen@1.8.x:
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018"
- dependencies:
- esprima "^2.7.1"
- estraverse "^1.9.1"
- esutils "^2.0.2"
- optionator "^0.8.1"
- optionalDependencies:
- source-map "~0.2.0"
-
-escodegen@1.x.x, escodegen@^1.8.1, escodegen@^1.9.0:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2"
- dependencies:
- esprima "^3.1.3"
- estraverse "^4.2.0"
- esutils "^2.0.2"
- optionator "^0.8.1"
- optionalDependencies:
- source-map "~0.6.1"
-
-escope@^3.6.0:
- version "3.6.0"
- resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3"
- dependencies:
- es6-map "^0.1.3"
- es6-weak-map "^2.0.1"
- esrecurse "^4.1.0"
- estraverse "^4.1.1"
-
-eslint-loader@^1.7.1:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-1.9.0.tgz#7e1be9feddca328d3dcfaef1ad49d5beffe83a13"
- dependencies:
- loader-fs-cache "^1.0.0"
- loader-utils "^1.0.2"
- object-assign "^4.0.1"
- object-hash "^1.1.4"
- rimraf "^2.6.1"
-
-eslint-plugin-flowtype@^2.34.0:
- version "2.46.1"
- resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.1.tgz#c4f81d580cd89c82bc3a85a1ccf4ae3a915143a4"
- dependencies:
- lodash "^4.15.0"
-
-eslint-plugin-html@^4.0.1:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-4.0.2.tgz#0e56149e42c2ffc3f0df6261a8bb96b1a9f2280d"
- dependencies:
- htmlparser2 "^3.8.2"
-
-eslint-plugin-jasmine@^2.8.4:
- version "2.9.3"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jasmine/-/eslint-plugin-jasmine-2.9.3.tgz#05bf3ab827d791691ceee8c21959b9c0d56a6b0c"
-
-eslint-plugin-vue-libs@^2.0.1:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/eslint-plugin-vue-libs/-/eslint-plugin-vue-libs-2.1.0.tgz#e7faf4ae11dad58553f63f907d6642e2d816dcef"
- dependencies:
- eslint-plugin-html "^4.0.1"
-
-eslint-scope@^3.7.1, eslint-scope@~3.7.1:
- version "3.7.1"
- resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
- dependencies:
- esrecurse "^4.1.0"
- estraverse "^4.1.1"
-
-eslint-visitor-keys@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
-
-eslint@^4.13.1:
- version "4.18.2"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45"
- dependencies:
- ajv "^5.3.0"
- babel-code-frame "^6.22.0"
- chalk "^2.1.0"
- concat-stream "^1.6.0"
- cross-spawn "^5.1.0"
- debug "^3.1.0"
- doctrine "^2.1.0"
- eslint-scope "^3.7.1"
- eslint-visitor-keys "^1.0.0"
- espree "^3.5.2"
- esquery "^1.0.0"
- esutils "^2.0.2"
- file-entry-cache "^2.0.0"
- functional-red-black-tree "^1.0.1"
- glob "^7.1.2"
- globals "^11.0.1"
- ignore "^3.3.3"
- imurmurhash "^0.1.4"
- inquirer "^3.0.6"
- is-resolvable "^1.0.0"
- js-yaml "^3.9.1"
- json-stable-stringify-without-jsonify "^1.0.1"
- levn "^0.3.0"
- lodash "^4.17.4"
- minimatch "^3.0.2"
- mkdirp "^0.5.1"
- natural-compare "^1.4.0"
- optionator "^0.8.2"
- path-is-inside "^1.0.2"
- pluralize "^7.0.0"
- progress "^2.0.0"
- require-uncached "^1.0.3"
- semver "^5.3.0"
- strip-ansi "^4.0.0"
- strip-json-comments "~2.0.1"
- table "4.0.2"
- text-table "~0.2.0"
-
-espree@^3.5.2:
- version "3.5.4"
- resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
- dependencies:
- acorn "^5.5.0"
- acorn-jsx "^3.0.0"
-
-esprima@2.7.x, esprima@^2.7.1:
- version "2.7.3"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
-
-esprima@3.x.x, esprima@^3.1.3:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
-
-esprima@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
-
-esquery@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa"
- dependencies:
- estraverse "^4.0.0"
-
-esrecurse@^4.1.0:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
- dependencies:
- estraverse "^4.1.0"
-
-estraverse@^1.9.1:
- version "1.9.3"
- resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44"
-
-estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
-
-estree-walker@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e"
-
-estree-walker@^0.3.0:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa"
-
-estree-walker@^0.5.0:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.1.tgz#64fc375053abc6f57d73e9bd2f004644ad3c5854"
-
-esutils@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
-
-event-emitter@~0.3.5:
- version "0.3.5"
- resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
- dependencies:
- d "1"
- es5-ext "~0.10.14"
-
-eventemitter3@1.x.x:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
-
-events@^1.0.0, events@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
-
-evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02"
- dependencies:
- md5.js "^1.3.4"
- safe-buffer "^5.1.1"
-
-execa@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
- dependencies:
- cross-spawn "^5.0.1"
- get-stream "^3.0.0"
- is-stream "^1.1.0"
- npm-run-path "^2.0.0"
- p-finally "^1.0.0"
- signal-exit "^3.0.0"
- strip-eof "^1.0.0"
-
-execa@^0.8.0:
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da"
- dependencies:
- cross-spawn "^5.0.1"
- get-stream "^3.0.0"
- is-stream "^1.1.0"
- npm-run-path "^2.0.0"
- p-finally "^1.0.0"
- signal-exit "^3.0.0"
- strip-eof "^1.0.0"
-
-execa@^0.9.0:
- version "0.9.0"
- resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01"
- dependencies:
- cross-spawn "^5.0.1"
- get-stream "^3.0.0"
- is-stream "^1.1.0"
- npm-run-path "^2.0.0"
- p-finally "^1.0.0"
- signal-exit "^3.0.0"
- strip-eof "^1.0.0"
-
-exit-hook@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
-
-exit@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
-
-expand-braces@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea"
- dependencies:
- array-slice "^0.2.3"
- array-unique "^0.2.1"
- braces "^0.1.2"
-
-expand-brackets@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
- dependencies:
- is-posix-bracket "^0.1.0"
-
-expand-brackets@^2.1.4:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
- dependencies:
- debug "^2.3.3"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- posix-character-classes "^0.1.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-expand-range@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044"
- dependencies:
- is-number "^0.1.1"
- repeat-string "^0.2.2"
-
-expand-range@^1.8.1:
- version "1.8.2"
- resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337"
- dependencies:
- fill-range "^2.1.0"
-
-expand-tilde@^1.2.2:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449"
- dependencies:
- os-homedir "^1.0.1"
-
-expect@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/expect/-/expect-22.4.0.tgz#371edf1ae15b83b5bf5ec34b42f1584660a36c16"
- dependencies:
- ansi-styles "^3.2.0"
- jest-diff "^22.4.0"
- jest-get-type "^22.1.0"
- jest-matcher-utils "^22.4.0"
- jest-message-util "^22.4.0"
- jest-regex-util "^22.1.0"
-
-extend-shallow@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
- dependencies:
- is-extendable "^0.1.0"
-
-extend-shallow@^3.0.0, extend-shallow@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
- dependencies:
- assign-symbols "^1.0.0"
- is-extendable "^1.0.1"
-
-extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
-
-external-editor@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-1.1.1.tgz#12d7b0db850f7ff7e7081baf4005700060c4600b"
- dependencies:
- extend "^3.0.0"
- spawn-sync "^1.0.15"
- tmp "^0.0.29"
-
-external-editor@^2.0.4:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48"
- dependencies:
- chardet "^0.4.0"
- iconv-lite "^0.4.17"
- tmp "^0.0.33"
-
-extglob@^0.3.1:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
- dependencies:
- is-extglob "^1.0.0"
-
-extglob@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
- dependencies:
- array-unique "^0.3.2"
- define-property "^1.0.0"
- expand-brackets "^2.1.4"
- extend-shallow "^2.0.1"
- fragment-cache "^0.2.1"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-extract-zip@^1.6.5:
- version "1.6.6"
- resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c"
- dependencies:
- concat-stream "1.6.0"
- debug "2.6.9"
- mkdirp "0.5.0"
- yauzl "2.4.1"
-
-extsprintf@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
-
-extsprintf@^1.2.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
-
-fast-deep-equal@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
-
-fast-json-stable-stringify@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
-
-fast-levenshtein@~2.0.4:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
-
-fd-slicer@~1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
- dependencies:
- pend "~1.2.0"
-
-figures@^1.3.5, figures@^1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
- dependencies:
- escape-string-regexp "^1.0.5"
- object-assign "^4.1.0"
-
-figures@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
- dependencies:
- escape-string-regexp "^1.0.5"
-
-file-entry-cache@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
- dependencies:
- flat-cache "^1.2.1"
- object-assign "^4.0.1"
-
-file-loader@^1.1.5:
- version "1.1.11"
- resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.11.tgz#6fe886449b0f2a936e43cabaac0cdbfb369506f8"
- dependencies:
- loader-utils "^1.0.2"
- schema-utils "^0.4.5"
-
-file-uri-to-path@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
-
-filename-regex@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
-
-fill-range@^2.1.0:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723"
- dependencies:
- is-number "^2.1.0"
- isobject "^2.0.0"
- randomatic "^1.1.3"
- repeat-element "^1.1.2"
- repeat-string "^1.5.2"
-
-fill-range@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
- dependencies:
- extend-shallow "^2.0.1"
- is-number "^3.0.0"
- repeat-string "^1.6.1"
- to-regex-range "^2.1.0"
-
-finalhandler@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5"
- dependencies:
- debug "2.6.9"
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- on-finished "~2.3.0"
- parseurl "~1.3.2"
- statuses "~1.3.1"
- unpipe "~1.0.0"
-
-find-cache-dir@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9"
- dependencies:
- commondir "^1.0.1"
- mkdirp "^0.5.1"
- pkg-dir "^1.0.0"
-
-find-cache-dir@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f"
- dependencies:
- commondir "^1.0.1"
- make-dir "^1.0.0"
- pkg-dir "^2.0.0"
-
-find-node-modules@1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-1.0.4.tgz#b6deb3cccb699c87037677bcede2c5f5862b2550"
- dependencies:
- findup-sync "0.4.2"
- merge "^1.2.0"
-
-find-parent-dir@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54"
-
-find-root@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.0.0.tgz#962ff211aab25c6520feeeb8d6287f8f6e95807a"
-
-find-up@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
- dependencies:
- path-exists "^2.0.0"
- pinkie-promise "^2.0.0"
-
-find-up@^2.0.0, find-up@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
- dependencies:
- locate-path "^2.0.0"
-
-findup-sync@0.4.2:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.2.tgz#a8117d0f73124f5a4546839579fe52d7129fb5e5"
- dependencies:
- detect-file "^0.1.0"
- is-glob "^2.0.1"
- micromatch "^2.3.7"
- resolve-dir "^0.1.0"
-
-flat-cache@^1.2.1:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481"
- dependencies:
- circular-json "^0.3.1"
- del "^2.0.2"
- graceful-fs "^4.1.2"
- write "^0.2.1"
-
-flow-bin@^0.61.0:
- version "0.61.0"
- resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35"
-
-flow-remove-types-no-whitespace@^1.0.3:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/flow-remove-types-no-whitespace/-/flow-remove-types-no-whitespace-1.0.5.tgz#3d297985a0bed5197b8fb0cbe89ec163f8dea9eb"
- dependencies:
- babylon "^6.8.4"
- magic-string "^0.16.0"
-
-follow-redirects@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37"
- dependencies:
- debug "^2.2.0"
-
-for-in@^1.0.1, for-in@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
-
-for-own@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce"
- dependencies:
- for-in "^1.0.1"
-
-forever-agent@~0.5.0:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.5.2.tgz#6d0e09c4921f94a27f63d3b49c5feff1ea4c5130"
-
-forever-agent@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
-
-form-data@~0.1.0:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-0.1.4.tgz#91abd788aba9702b1aabfa8bc01031a2ac9e3b12"
- dependencies:
- async "~0.9.0"
- combined-stream "~0.0.4"
- mime "~1.2.11"
-
-form-data@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "^1.0.5"
- mime-types "^2.1.11"
-
-form-data@~2.1.1:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "^1.0.5"
- mime-types "^2.1.12"
-
-form-data@~2.3.1:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099"
- dependencies:
- asynckit "^0.4.0"
- combined-stream "1.0.6"
- mime-types "^2.1.12"
-
-fragment-cache@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
- dependencies:
- map-cache "^0.2.2"
-
-fs-access@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a"
- dependencies:
- null-check "^1.0.0"
-
-fs-exists-sync@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add"
-
-fs-extra@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950"
- dependencies:
- graceful-fs "^4.1.2"
- jsonfile "^2.1.0"
- klaw "^1.0.0"
-
-fs.realpath@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
-
-fsevents@^1.0.0:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8"
- dependencies:
- nan "^2.3.0"
- node-pre-gyp "^0.6.39"
-
-fstream-ignore@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105"
- dependencies:
- fstream "^1.0.0"
- inherits "2"
- minimatch "^3.0.0"
-
-fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"
- dependencies:
- graceful-fs "^4.1.2"
- inherits "~2.0.0"
- mkdirp ">=0.5 0"
- rimraf "2"
-
-ftp@~0.3.10:
- version "0.3.10"
- resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d"
- dependencies:
- readable-stream "1.1.x"
- xregexp "2.0.0"
-
-function-bind@^1.0.2:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
-
-functional-red-black-tree@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
-
-gauge@~2.7.3:
- version "2.7.4"
- resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
- dependencies:
- aproba "^1.0.3"
- console-control-strings "^1.0.0"
- has-unicode "^2.0.0"
- object-assign "^4.1.0"
- signal-exit "^3.0.0"
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
- wide-align "^1.1.0"
-
-generate-function@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
-
-generate-object-property@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
- dependencies:
- is-property "^1.0.0"
-
-get-caller-file@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"
-
-get-own-enumerable-property-symbols@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b"
-
-get-pkg-repo@^1.0.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d"
- dependencies:
- hosted-git-info "^2.1.4"
- meow "^3.3.0"
- normalize-package-data "^2.3.0"
- parse-github-repo-url "^1.3.0"
- through2 "^2.0.0"
-
-get-stdin@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
-
-get-stream@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
-
-get-uri@2:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.1.tgz#dbdcacacd8c608a38316869368117697a1631c59"
- dependencies:
- data-uri-to-buffer "1"
- debug "2"
- extend "3"
- file-uri-to-path "1"
- ftp "~0.3.10"
- readable-stream "2"
-
-get-value@^2.0.3, get-value@^2.0.6:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
-
-getpass@^0.1.1:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
- dependencies:
- assert-plus "^1.0.0"
-
-git-raw-commits@^1.3.4:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.4.tgz#442c3df5985b4f5689e9e43597f5194736aac001"
- dependencies:
- dargs "^4.0.1"
- lodash.template "^4.0.2"
- meow "^4.0.0"
- split2 "^2.0.0"
- through2 "^2.0.0"
-
-git-remote-origin-url@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f"
- dependencies:
- gitconfiglocal "^1.0.0"
- pify "^2.3.0"
-
-git-semver-tags@^1.3.4:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.3.4.tgz#2ceb2a355c6d7514c123c35e297067d08caf3a92"
- dependencies:
- meow "^4.0.0"
- semver "^5.5.0"
-
-gitconfiglocal@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b"
- dependencies:
- ini "^1.3.2"
-
-glob-base@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
- dependencies:
- glob-parent "^2.0.0"
- is-glob "^2.0.0"
-
-glob-parent@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
- dependencies:
- is-glob "^2.0.0"
-
-glob-parent@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
- dependencies:
- is-glob "^3.1.0"
- path-dirname "^1.0.0"
-
-glob@7.0.5:
- version "7.0.5"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95"
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.2"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-glob@7.1.1:
- version "7.1.1"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.2"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-glob@^5.0.15:
- version "5.0.15"
- resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
- dependencies:
- inflight "^1.0.4"
- inherits "2"
- minimatch "2 || 3"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2:
- version "7.1.2"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-global-modules@^0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d"
- dependencies:
- global-prefix "^0.1.4"
- is-windows "^0.2.0"
-
-global-prefix@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f"
- dependencies:
- homedir-polyfill "^1.0.0"
- ini "^1.3.4"
- is-windows "^0.2.0"
- which "^1.2.12"
-
-globals@^11.0.1, globals@^11.1.0:
- version "11.3.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0"
-
-globals@^9.18.0:
- version "9.18.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
-
-globby@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
- dependencies:
- array-union "^1.0.1"
- arrify "^1.0.0"
- glob "^7.0.3"
- object-assign "^4.0.1"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
-
-globby@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
- dependencies:
- array-union "^1.0.1"
- glob "^7.0.3"
- object-assign "^4.0.1"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
-
-graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
- version "4.1.11"
- resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
-
-"graceful-readlink@>= 1.0.0":
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
-
-growl@1.9.2:
- version "1.9.2"
- resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
-
-handlebars@^4.0.1, handlebars@^4.0.2:
- version "4.0.11"
- resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc"
- dependencies:
- async "^1.4.0"
- optimist "^0.6.1"
- source-map "^0.4.4"
- optionalDependencies:
- uglify-js "^2.6"
-
-har-schema@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
-
-har-schema@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
-
-har-validator@~2.0.6:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
- dependencies:
- chalk "^1.1.1"
- commander "^2.9.0"
- is-my-json-valid "^2.12.4"
- pinkie-promise "^2.0.0"
-
-har-validator@~4.2.1:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
- dependencies:
- ajv "^4.9.1"
- har-schema "^1.0.5"
-
-har-validator@~5.0.3:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
- dependencies:
- ajv "^5.1.0"
- har-schema "^2.0.0"
-
-has-ansi@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
- dependencies:
- ansi-regex "^2.0.0"
-
-has-binary2@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.2.tgz#e83dba49f0b9be4d026d27365350d9f03f54be98"
- dependencies:
- isarray "2.0.1"
-
-has-cors@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39"
-
-has-flag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
-
-has-flag@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
-
-has-flag@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
-
-has-unicode@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
-
-has-value@^0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
- dependencies:
- get-value "^2.0.3"
- has-values "^0.1.4"
- isobject "^2.0.0"
-
-has-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
- dependencies:
- get-value "^2.0.6"
- has-values "^1.0.0"
- isobject "^3.0.0"
-
-has-values@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
-
-has-values@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
- dependencies:
- is-number "^3.0.0"
- kind-of "^4.0.0"
-
-has@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
- dependencies:
- function-bind "^1.0.2"
-
-hash-base@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1"
- dependencies:
- inherits "^2.0.1"
-
-hash-base@^3.0.0:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-hash-sum@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-1.0.2.tgz#33b40777754c6432573c120cc3808bbd10d47f04"
-
-hash.js@^1.0.0, hash.js@^1.0.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846"
- dependencies:
- inherits "^2.0.3"
- minimalistic-assert "^1.0.0"
-
-hasha@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1"
- dependencies:
- is-stream "^1.0.1"
- pinkie-promise "^2.0.0"
-
-hawk@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/hawk/-/hawk-1.1.1.tgz#87cd491f9b46e4e2aeaca335416766885d2d1ed9"
- dependencies:
- boom "0.4.x"
- cryptiles "0.2.x"
- hoek "0.9.x"
- sntp "0.2.x"
-
-hawk@3.1.3, hawk@~3.1.3:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
- dependencies:
- boom "2.x.x"
- cryptiles "2.x.x"
- hoek "2.x.x"
- sntp "1.x.x"
-
-hawk@~6.0.2:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"
- dependencies:
- boom "4.x.x"
- cryptiles "3.x.x"
- hoek "4.x.x"
- sntp "2.x.x"
-
-he@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
-
-hipchat-notifier@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e"
- dependencies:
- lodash "^4.0.0"
- request "^2.0.0"
-
-hmac-drbg@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
- dependencies:
- hash.js "^1.0.3"
- minimalistic-assert "^1.0.0"
- minimalistic-crypto-utils "^1.0.1"
-
-hoek@0.9.x:
- version "0.9.1"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-0.9.1.tgz#3d322462badf07716ea7eb85baf88079cddce505"
-
-hoek@2.x.x:
- version "2.16.3"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
-
-hoek@4.x.x:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
-
-home-or-tmp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
- dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.1"
-
-homedir-polyfill@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc"
- dependencies:
- parse-passwd "^1.0.0"
-
-hosted-git-info@^2.1.4:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
-
-html-encoding-sniffer@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
- dependencies:
- whatwg-encoding "^1.0.1"
-
-htmlescape@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351"
-
-htmlparser2@^3.8.2:
- version "3.9.2"
- resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338"
- dependencies:
- domelementtype "^1.3.0"
- domhandler "^2.3.0"
- domutils "^1.5.1"
- entities "^1.1.1"
- inherits "^2.0.1"
- readable-stream "^2.0.2"
-
-http-errors@1.6.2, http-errors@~1.6.2:
- version "1.6.2"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736"
- dependencies:
- depd "1.1.1"
- inherits "2.0.3"
- setprototypeof "1.0.3"
- statuses ">= 1.3.1 < 2"
-
-http-proxy-agent@1:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz#cc1ce38e453bf984a0f7702d2dd59c73d081284a"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
-
-http-proxy@^1.13.0, http-proxy@^1.8.1:
- version "1.16.2"
- resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
- dependencies:
- eventemitter3 "1.x.x"
- requires-port "1.x.x"
-
-http-server@^0.11.1:
- version "0.11.1"
- resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.11.1.tgz#2302a56a6ffef7f9abea0147d838a5e9b6b6a79b"
- dependencies:
- colors "1.0.3"
- corser "~2.0.0"
- ecstatic "^3.0.0"
- http-proxy "^1.8.1"
- opener "~1.4.0"
- optimist "0.6.x"
- portfinder "^1.0.13"
- union "~0.4.3"
-
-http-signature@~0.10.0:
- version "0.10.1"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-0.10.1.tgz#4fbdac132559aa8323121e540779c0a012b27e66"
- dependencies:
- asn1 "0.1.11"
- assert-plus "^0.1.5"
- ctype "0.5.3"
-
-http-signature@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
- dependencies:
- assert-plus "^0.2.0"
- jsprim "^1.2.2"
- sshpk "^1.7.0"
-
-http-signature@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
- dependencies:
- assert-plus "^1.0.0"
- jsprim "^1.2.2"
- sshpk "^1.7.0"
-
-httpntlm@1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2"
- dependencies:
- httpreq ">=0.4.22"
- underscore "~1.7.0"
-
-httpreq@>=0.4.22:
- version "0.4.24"
- resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f"
-
-https-browserify@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
-
-https-proxy-agent@1, https-proxy-agent@^1.0.0, https-proxy-agent@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
-
-iconv-lite@0.4.15:
- version "0.4.15"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
-
-iconv-lite@0.4.19, iconv-lite@^0.4.17:
- version "0.4.19"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
-
-ieee754@^1.1.4:
- version "1.1.8"
- resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
-
-ignore@^3.3.3:
- version "3.3.7"
- resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
-
-imurmurhash@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
-
-indent-string@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
- dependencies:
- repeating "^2.0.0"
-
-indent-string@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289"
-
-indexof@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
-
-inflection@~1.10.0:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.10.0.tgz#5bffcb1197ad3e81050f8e17e21668087ee9eb2f"
-
-inflection@~1.3.0:
- version "1.3.8"
- resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e"
-
-inflight@^1.0.4:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
- dependencies:
- once "^1.3.0"
- wrappy "1"
-
-inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
-
-inherits@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
-
-ini@^1.3.2, ini@^1.3.4, ini@~1.3.0:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
-
-inline-source-map@~0.6.0:
- version "0.6.2"
- resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5"
- dependencies:
- source-map "~0.5.3"
-
-inquirer@1.2.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918"
- dependencies:
- ansi-escapes "^1.1.0"
- chalk "^1.0.0"
- cli-cursor "^1.0.1"
- cli-width "^2.0.0"
- external-editor "^1.1.0"
- figures "^1.3.5"
- lodash "^4.3.0"
- mute-stream "0.0.6"
- pinkie-promise "^2.0.0"
- run-async "^2.2.0"
- rx "^4.1.0"
- string-width "^1.0.1"
- strip-ansi "^3.0.0"
- through "^2.3.6"
-
-inquirer@^3.0.6:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
- dependencies:
- ansi-escapes "^3.0.0"
- chalk "^2.0.0"
- cli-cursor "^2.1.0"
- cli-width "^2.0.0"
- external-editor "^2.0.4"
- figures "^2.0.0"
- lodash "^4.3.0"
- mute-stream "0.0.7"
- run-async "^2.2.0"
- rx-lite "^4.0.8"
- rx-lite-aggregates "^4.0.8"
- string-width "^2.1.0"
- strip-ansi "^4.0.0"
- through "^2.3.6"
-
-insert-module-globals@^7.0.0:
- version "7.0.2"
- resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.2.tgz#012c56baa7d3307a8b417d4ec5270cf9741c18f4"
- dependencies:
- JSONStream "^1.0.3"
- combine-source-map "~0.7.1"
- concat-stream "~1.5.1"
- is-buffer "^1.1.0"
- lexical-scope "^1.2.0"
- process "~0.11.0"
- through2 "^2.0.0"
- xtend "^4.0.0"
-
-interpret@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
-
-invariant@^2.2.0, invariant@^2.2.2:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.3.tgz#1a827dfde7dcbd7c323f0ca826be8fa7c5e9d688"
- dependencies:
- loose-envify "^1.0.0"
-
-invert-kv@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
-
-ip@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/ip/-/ip-1.0.1.tgz#c7e356cdea225ae71b36d70f2e71a92ba4e42590"
-
-ip@^1.1.2, ip@^1.1.4:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
-
-is-accessor-descriptor@^0.1.6:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
- dependencies:
- kind-of "^3.0.2"
-
-is-accessor-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
- dependencies:
- kind-of "^6.0.0"
-
-is-arrayish@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
-
-is-binary-path@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
- dependencies:
- binary-extensions "^1.0.0"
-
-is-buffer@^1.1.0, is-buffer@^1.1.5:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
-
-is-builtin-module@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
- dependencies:
- builtin-modules "^1.0.0"
-
-is-ci@^1.0.10:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5"
- dependencies:
- ci-info "^1.0.0"
-
-is-data-descriptor@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
- dependencies:
- kind-of "^3.0.2"
-
-is-data-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
- dependencies:
- kind-of "^6.0.0"
-
-is-descriptor@^0.1.0:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
- dependencies:
- is-accessor-descriptor "^0.1.6"
- is-data-descriptor "^0.1.4"
- kind-of "^5.0.0"
-
-is-descriptor@^1.0.0, is-descriptor@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
- dependencies:
- is-accessor-descriptor "^1.0.0"
- is-data-descriptor "^1.0.0"
- kind-of "^6.0.2"
-
-is-directory@^0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1"
-
-is-dotfile@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"
-
-is-equal-shallow@^0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534"
- dependencies:
- is-primitive "^2.0.0"
-
-is-extendable@^0.1.0, is-extendable@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
-
-is-extendable@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
- dependencies:
- is-plain-object "^2.0.4"
-
-is-extglob@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
-
-is-extglob@^2.1.0, is-extglob@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
-
-is-finite@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
- dependencies:
- number-is-nan "^1.0.0"
-
-is-fullwidth-code-point@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
- dependencies:
- number-is-nan "^1.0.0"
-
-is-fullwidth-code-point@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
-
-is-generator-fn@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a"
-
-is-glob@^2.0.0, is-glob@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
- dependencies:
- is-extglob "^1.0.0"
-
-is-glob@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
- dependencies:
- is-extglob "^2.1.0"
-
-is-glob@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0"
- dependencies:
- is-extglob "^2.1.1"
-
-is-module@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
-
-is-my-ip-valid@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824"
-
-is-my-json-valid@^2.12.4:
- version "2.17.2"
- resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c"
- dependencies:
- generate-function "^2.0.0"
- generate-object-property "^1.1.0"
- is-my-ip-valid "^1.0.0"
- jsonpointer "^4.0.0"
- xtend "^4.0.0"
-
-is-number@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806"
-
-is-number@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
- dependencies:
- kind-of "^3.0.2"
-
-is-number@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
- dependencies:
- kind-of "^3.0.2"
-
-is-number@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
-
-is-obj@^1.0.0, is-obj@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
-
-is-observable@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2"
- dependencies:
- symbol-observable "^0.2.2"
-
-is-odd@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24"
- dependencies:
- is-number "^4.0.0"
-
-is-path-cwd@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
-
-is-path-in-cwd@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc"
- dependencies:
- is-path-inside "^1.0.0"
-
-is-path-inside@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
- dependencies:
- path-is-inside "^1.0.1"
-
-is-plain-obj@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
-
-is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
- dependencies:
- isobject "^3.0.1"
-
-is-posix-bracket@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
-
-is-primitive@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
-
-is-promise@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
-
-is-property@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
-
-is-regexp@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
-
-is-resolvable@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
-
-is-stream@^1.0.1, is-stream@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
-
-is-subset@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6"
-
-is-text-path@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e"
- dependencies:
- text-extensions "^1.0.0"
-
-is-typedarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
-
-is-utf8@^0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
-
-is-windows@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c"
-
-is-windows@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
-
-isarray@0.0.1, isarray@~0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
-
-isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
-
-isarray@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e"
-
-isbinaryfile@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621"
-
-isexe@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
-
-isobject@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
- dependencies:
- isarray "1.0.0"
-
-isobject@^3.0.0, isobject@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
-
-isstream@~0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
-
-istanbul-lib-coverage@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz#4113c8ff6b7a40a1ef7350b01016331f63afde14"
-
-istanbul-lib-instrument@^1.7.5:
- version "1.9.2"
- resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz#84905bf47f7e0b401d6b840da7bad67086b4aab6"
- dependencies:
- babel-generator "^6.18.0"
- babel-template "^6.16.0"
- babel-traverse "^6.18.0"
- babel-types "^6.18.0"
- babylon "^6.18.0"
- istanbul-lib-coverage "^1.1.2"
- semver "^5.3.0"
-
-istanbul@^0.4.0:
- version "0.4.5"
- resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b"
- dependencies:
- abbrev "1.0.x"
- async "1.x"
- escodegen "1.8.x"
- esprima "2.7.x"
- glob "^5.0.15"
- handlebars "^4.0.1"
- js-yaml "3.x"
- mkdirp "0.5.x"
- nopt "3.x"
- once "1.x"
- resolve "1.1.x"
- supports-color "^3.1.0"
- which "^1.1.1"
- wordwrap "^1.0.0"
-
-jasmine-core@^2.99.0, jasmine-core@~2.99.0:
- version "2.99.1"
- resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.99.1.tgz#e6400df1e6b56e130b61c4bcd093daa7f6e8ca15"
-
-jasmine@^2.99.0:
- version "2.99.0"
- resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.99.0.tgz#8ca72d102e639b867c6489856e0e18a9c7aa42b7"
- dependencies:
- exit "^0.1.2"
- glob "^7.0.6"
- jasmine-core "~2.99.0"
-
-jest-config@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.4.2.tgz#580ba5819bf81a5e48f4fd470e8b81834f45c855"
- dependencies:
- chalk "^2.0.1"
- glob "^7.1.1"
- jest-environment-jsdom "^22.4.1"
- jest-environment-node "^22.4.1"
- jest-get-type "^22.1.0"
- jest-jasmine2 "^22.4.2"
- jest-regex-util "^22.1.0"
- jest-resolve "^22.4.2"
- jest-util "^22.4.1"
- jest-validate "^22.4.2"
- pretty-format "^22.4.0"
-
-jest-diff@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-22.4.0.tgz#384c2b78519ca44ca126382df53f134289232525"
- dependencies:
- chalk "^2.0.1"
- diff "^3.2.0"
- jest-get-type "^22.1.0"
- pretty-format "^22.4.0"
-
-jest-environment-jsdom@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.4.1.tgz#754f408872441740100d3917e5ec40c74de6447f"
- dependencies:
- jest-mock "^22.2.0"
- jest-util "^22.4.1"
- jsdom "^11.5.1"
-
-jest-environment-node@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.4.1.tgz#418850eb654596b8d6e36c2021cbedbc23df8e16"
- dependencies:
- jest-mock "^22.2.0"
- jest-util "^22.4.1"
-
-jest-get-type@^22.1.0:
- version "22.1.0"
- resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9"
-
-jest-jasmine2@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.4.2.tgz#dfd3d259579ed6f52510d8f1ab692808f0d40691"
- dependencies:
- chalk "^2.0.1"
- co "^4.6.0"
- expect "^22.4.0"
- graceful-fs "^4.1.11"
- is-generator-fn "^1.0.0"
- jest-diff "^22.4.0"
- jest-matcher-utils "^22.4.0"
- jest-message-util "^22.4.0"
- jest-snapshot "^22.4.0"
- jest-util "^22.4.1"
- source-map-support "^0.5.0"
-
-jest-matcher-utils@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.4.0.tgz#d55f5faf2270462736bdf7c7485ee931c9d4b6a1"
- dependencies:
- chalk "^2.0.1"
- jest-get-type "^22.1.0"
- pretty-format "^22.4.0"
-
-jest-message-util@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.4.0.tgz#e3d861df16d2fee60cb2bc8feac2188a42579642"
- dependencies:
- "@babel/code-frame" "^7.0.0-beta.35"
- chalk "^2.0.1"
- micromatch "^2.3.11"
- slash "^1.0.0"
- stack-utils "^1.0.1"
-
-jest-mock@^22.2.0:
- version "22.2.0"
- resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7"
-
-jest-regex-util@^22.1.0:
- version "22.1.0"
- resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-22.1.0.tgz#5daf2fe270074b6da63e5d85f1c9acc866768f53"
-
-jest-resolve@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.4.2.tgz#25d88aa4147462c9c1c6a1ba16250d3794c24d00"
- dependencies:
- browser-resolve "^1.11.2"
- chalk "^2.0.1"
-
-jest-snapshot@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.4.0.tgz#03d3ce63f8fa7352388afc6a3c8b5ccc3a180ed7"
- dependencies:
- chalk "^2.0.1"
- jest-diff "^22.4.0"
- jest-matcher-utils "^22.4.0"
- mkdirp "^0.5.1"
- natural-compare "^1.4.0"
- pretty-format "^22.4.0"
-
-jest-util@^22.4.1:
- version "22.4.1"
- resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.4.1.tgz#dd17c3bdb067f8e90591563ec0c42bf847dc249f"
- dependencies:
- callsites "^2.0.0"
- chalk "^2.0.1"
- graceful-fs "^4.1.11"
- is-ci "^1.0.10"
- jest-message-util "^22.4.0"
- mkdirp "^0.5.1"
- source-map "^0.6.0"
-
-jest-validate@^22.4.0, jest-validate@^22.4.2:
- version "22.4.2"
- resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.4.2.tgz#e789a4e056173bf97fe797a2df2d52105c57d4f4"
- dependencies:
- chalk "^2.0.1"
- jest-config "^22.4.2"
- jest-get-type "^22.1.0"
- leven "^2.1.0"
- pretty-format "^22.4.0"
-
-js-tokens@^3.0.0, js-tokens@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
-
-js-yaml@3.x, js-yaml@^3.9.0, js-yaml@^3.9.1:
- version "3.11.0"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef"
- dependencies:
- argparse "^1.0.7"
- esprima "^4.0.0"
-
-jsbn@~0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
-
-jsdom@^11.5.1:
- version "11.6.2"
- resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb"
- dependencies:
- abab "^1.0.4"
- acorn "^5.3.0"
- acorn-globals "^4.1.0"
- array-equal "^1.0.0"
- browser-process-hrtime "^0.1.2"
- content-type-parser "^1.0.2"
- cssom ">= 0.3.2 < 0.4.0"
- cssstyle ">= 0.2.37 < 0.3.0"
- domexception "^1.0.0"
- escodegen "^1.9.0"
- html-encoding-sniffer "^1.0.2"
- left-pad "^1.2.0"
- nwmatcher "^1.4.3"
- parse5 "4.0.0"
- pn "^1.1.0"
- request "^2.83.0"
- request-promise-native "^1.0.5"
- sax "^1.2.4"
- symbol-tree "^3.2.2"
- tough-cookie "^2.3.3"
- w3c-hr-time "^1.0.1"
- webidl-conversions "^4.0.2"
- whatwg-encoding "^1.0.3"
- whatwg-url "^6.4.0"
- ws "^4.0.0"
- xml-name-validator "^3.0.0"
-
-jsesc@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
-
-jsesc@^2.5.1:
- version "2.5.1"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe"
-
-jsesc@~0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
-
-json-loader@^0.5.4:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
-
-json-parse-better-errors@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a"
-
-json-schema-traverse@^0.3.0:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
-
-json-schema@0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
-
-json-stable-stringify-without-jsonify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
-
-json-stable-stringify@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
- dependencies:
- jsonify "~0.0.0"
-
-json-stable-stringify@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
- dependencies:
- jsonify "~0.0.0"
-
-json-stringify-safe@5.0.x, json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.0, json-stringify-safe@~5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
-
-json3@3.3.2:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
-
-json5@^0.5.0, json5@^0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
-
-jsonfile@^2.1.0:
- version "2.4.0"
- resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
- optionalDependencies:
- graceful-fs "^4.1.6"
-
-jsonify@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
-
-jsonparse@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
-
-jsonpointer@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
-
-jsprim@^1.2.2:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
- dependencies:
- assert-plus "1.0.0"
- extsprintf "1.3.0"
- json-schema "0.2.3"
- verror "1.10.0"
-
-karma-chrome-launcher@^2.1.1:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf"
- dependencies:
- fs-access "^1.0.0"
- which "^1.2.1"
-
-karma-coverage@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-1.1.1.tgz#5aff8b39cf6994dc22de4c84362c76001b637cf6"
- dependencies:
- dateformat "^1.0.6"
- istanbul "^0.4.0"
- lodash "^3.8.0"
- minimatch "^3.0.0"
- source-map "^0.5.1"
-
-karma-firefox-launcher@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339"
-
-karma-jasmine@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529"
-
-karma-mocha-reporter@^2.2.3:
- version "2.2.5"
- resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560"
- dependencies:
- chalk "^2.1.0"
- log-symbols "^2.1.0"
- strip-ansi "^4.0.0"
-
-karma-phantomjs-launcher@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz#d23ca34801bda9863ad318e3bb4bd4062b13acd2"
- dependencies:
- lodash "^4.0.1"
- phantomjs-prebuilt "^2.1.7"
-
-karma-safari-launcher@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz#96982a2cc47d066aae71c553babb28319115a2ce"
-
-karma-sauce-launcher@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca"
- dependencies:
- q "^1.5.0"
- sauce-connect-launcher "^1.2.2"
- saucelabs "^1.4.0"
- wd "^1.4.0"
-
-karma-sourcemap-loader@^0.3.7:
- version "0.3.7"
- resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8"
- dependencies:
- graceful-fs "^4.1.2"
-
-karma-webpack@^2.0.3:
- version "2.0.13"
- resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-2.0.13.tgz#cf56e3056c15b7747a0bb2140fc9a6be41dd9f02"
- dependencies:
- async "^2.0.0"
- babel-runtime "^6.0.0"
- loader-utils "^1.0.0"
- lodash "^4.0.0"
- source-map "^0.5.6"
- webpack-dev-middleware "^1.12.0"
-
-karma@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.0.tgz#a02698dd7f0f05ff5eb66ab8f65582490b512e58"
- dependencies:
- bluebird "^3.3.0"
- body-parser "^1.16.1"
- browserify "^14.5.0"
- chokidar "^1.4.1"
- colors "^1.1.0"
- combine-lists "^1.0.0"
- connect "^3.6.0"
- core-js "^2.2.0"
- di "^0.0.1"
- dom-serialize "^2.2.0"
- expand-braces "^0.1.1"
- glob "^7.1.1"
- graceful-fs "^4.1.2"
- http-proxy "^1.13.0"
- isbinaryfile "^3.0.0"
- lodash "^4.17.4"
- log4js "^2.3.9"
- mime "^1.3.4"
- minimatch "^3.0.2"
- optimist "^0.6.1"
- qjobs "^1.1.4"
- range-parser "^1.2.0"
- rimraf "^2.6.0"
- safe-buffer "^5.0.1"
- socket.io "2.0.4"
- source-map "^0.6.1"
- tmp "0.0.33"
- useragent "^2.1.12"
-
-kew@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b"
-
-kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
- dependencies:
- is-buffer "^1.1.5"
-
-kind-of@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
- dependencies:
- is-buffer "^1.1.5"
-
-kind-of@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
-
-kind-of@^6.0.0, kind-of@^6.0.2:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
-
-klaw@^1.0.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
- optionalDependencies:
- graceful-fs "^4.1.9"
-
-labeled-stream-splicer@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59"
- dependencies:
- inherits "^2.0.1"
- isarray "~0.0.1"
- stream-splicer "^2.0.0"
-
-lazy-cache@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
-
-lazy-cache@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264"
- dependencies:
- set-getter "^0.1.0"
-
-lazystream@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4"
- dependencies:
- readable-stream "^2.0.5"
-
-lcid@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
- dependencies:
- invert-kv "^1.0.0"
-
-left-pad@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
-
-leven@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
-
-levn@^0.3.0, levn@~0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
- dependencies:
- prelude-ls "~1.1.2"
- type-check "~0.3.2"
-
-lexical-scope@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4"
- dependencies:
- astw "^2.0.0"
-
-libbase64@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6"
-
-libmime@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6"
- dependencies:
- iconv-lite "0.4.15"
- libbase64 "0.1.0"
- libqp "1.1.0"
-
-libqp@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8"
-
-lint-staged@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.0.0.tgz#57926c63201e7bd38ca0576d74391efa699b4a9d"
- dependencies:
- app-root-path "^2.0.1"
- chalk "^2.3.1"
- commander "^2.14.1"
- cosmiconfig "^4.0.0"
- debug "^3.1.0"
- dedent "^0.7.0"
- execa "^0.9.0"
- find-parent-dir "^0.3.0"
- is-glob "^4.0.0"
- jest-validate "^22.4.0"
- listr "^0.13.0"
- lodash "^4.17.5"
- log-symbols "^2.2.0"
- micromatch "^3.1.8"
- npm-which "^3.0.1"
- p-map "^1.1.1"
- path-is-inside "^1.0.2"
- pify "^3.0.0"
- please-upgrade-node "^3.0.1"
- staged-git-files "1.1.0"
- stringify-object "^3.2.2"
-
-listr-silent-renderer@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e"
-
-listr-update-renderer@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7"
- dependencies:
- chalk "^1.1.3"
- cli-truncate "^0.2.1"
- elegant-spinner "^1.0.1"
- figures "^1.7.0"
- indent-string "^3.0.0"
- log-symbols "^1.0.2"
- log-update "^1.0.2"
- strip-ansi "^3.0.1"
-
-listr-verbose-renderer@^0.4.0:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35"
- dependencies:
- chalk "^1.1.3"
- cli-cursor "^1.0.2"
- date-fns "^1.27.2"
- figures "^1.7.0"
-
-listr@^0.13.0:
- version "0.13.0"
- resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d"
- dependencies:
- chalk "^1.1.3"
- cli-truncate "^0.2.1"
- figures "^1.7.0"
- indent-string "^2.1.0"
- is-observable "^0.2.0"
- is-promise "^2.1.0"
- is-stream "^1.1.0"
- listr-silent-renderer "^1.1.1"
- listr-update-renderer "^0.4.0"
- listr-verbose-renderer "^0.4.0"
- log-symbols "^1.0.2"
- log-update "^1.0.2"
- ora "^0.2.3"
- p-map "^1.1.1"
- rxjs "^5.4.2"
- stream-to-observable "^0.2.0"
- strip-ansi "^3.0.1"
-
-load-json-file@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
- dependencies:
- graceful-fs "^4.1.2"
- parse-json "^2.2.0"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
- strip-bom "^2.0.0"
-
-load-json-file@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
- dependencies:
- graceful-fs "^4.1.2"
- parse-json "^2.2.0"
- pify "^2.0.0"
- strip-bom "^3.0.0"
-
-load-json-file@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
- dependencies:
- graceful-fs "^4.1.2"
- parse-json "^4.0.0"
- pify "^3.0.0"
- strip-bom "^3.0.0"
-
-loader-fs-cache@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz#56e0bf08bd9708b26a765b68509840c8dec9fdbc"
- dependencies:
- find-cache-dir "^0.1.1"
- mkdirp "0.5.1"
-
-loader-runner@^2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
-
-loader-utils@^1.0.0, loader-utils@^1.0.2, loader-utils@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
- dependencies:
- big.js "^3.1.3"
- emojis-list "^2.0.0"
- json5 "^0.5.0"
-
-locate-path@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
- dependencies:
- p-locate "^2.0.0"
- path-exists "^3.0.0"
-
-lodash._arraycopy@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1"
-
-lodash._arrayeach@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz#bab156b2a90d3f1bbd5c653403349e5e5933ef9e"
-
-lodash._baseassign@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
- dependencies:
- lodash._basecopy "^3.0.0"
- lodash.keys "^3.0.0"
-
-lodash._baseclone@^3.0.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz#303519bf6393fe7e42f34d8b630ef7794e3542b7"
- dependencies:
- lodash._arraycopy "^3.0.0"
- lodash._arrayeach "^3.0.0"
- lodash._baseassign "^3.0.0"
- lodash._basefor "^3.0.0"
- lodash.isarray "^3.0.0"
- lodash.keys "^3.0.0"
-
-lodash._baseclone@^4.0.0:
- version "4.5.7"
- resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434"
-
-lodash._basecopy@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
-
-lodash._basecreate@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821"
-
-lodash._basefor@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/lodash._basefor/-/lodash._basefor-3.0.3.tgz#7550b4e9218ef09fad24343b612021c79b4c20c2"
-
-lodash._bindcallback@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
-
-lodash._getnative@^3.0.0:
- version "3.9.1"
- resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
-
-lodash._isiterateecall@^3.0.0:
- version "3.0.9"
- resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c"
-
-lodash._reinterpolate@~3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
-
-lodash._stack@^4.0.0:
- version "4.1.3"
- resolved "https://registry.yarnpkg.com/lodash._stack/-/lodash._stack-4.1.3.tgz#751aa76c1b964b047e76d14fc72a093fcb5e2dd0"
-
-lodash.clone@3.0.3:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-3.0.3.tgz#84688c73d32b5a90ca25616963f189252a997043"
- dependencies:
- lodash._baseclone "^3.0.0"
- lodash._bindcallback "^3.0.0"
- lodash._isiterateecall "^3.0.0"
-
-lodash.create@3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7"
- dependencies:
- lodash._baseassign "^3.0.0"
- lodash._basecreate "^3.0.0"
- lodash._isiterateecall "^3.0.0"
-
-lodash.defaultsdeep@4.3.2:
- version "4.3.2"
- resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.3.2.tgz#6c1a586e6c5647b0e64e2d798141b8836158be8a"
- dependencies:
- lodash._baseclone "^4.0.0"
- lodash._stack "^4.0.0"
- lodash.isplainobject "^4.0.0"
- lodash.keysin "^4.0.0"
- lodash.mergewith "^4.0.0"
- lodash.rest "^4.0.0"
-
-lodash.isarguments@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
-
-lodash.isarray@^3.0.0:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
-
-lodash.isplainobject@^4.0.0:
- version "4.0.6"
- resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
-
-lodash.keys@^3.0.0:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
- dependencies:
- lodash._getnative "^3.0.0"
- lodash.isarguments "^3.0.0"
- lodash.isarray "^3.0.0"
-
-lodash.keysin@^4.0.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/lodash.keysin/-/lodash.keysin-4.2.0.tgz#8cc3fb35c2d94acc443a1863e02fa40799ea6f28"
-
-lodash.map@^4.5.1:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
-
-lodash.memoize@~3.0.3:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
-
-lodash.mergewith@^4.0.0:
- version "4.6.1"
- resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927"
-
-lodash.rest@^4.0.0:
- version "4.0.5"
- resolved "https://registry.yarnpkg.com/lodash.rest/-/lodash.rest-4.0.5.tgz#954ef75049262038c96d1fc98b28fdaf9f0772aa"
-
-lodash.sortby@^4.7.0:
- version "4.7.0"
- resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
-
-lodash.template@^4.0.2, lodash.template@^4.4.0:
- version "4.4.0"
- resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0"
- dependencies:
- lodash._reinterpolate "~3.0.0"
- lodash.templatesettings "^4.0.0"
-
-lodash.templatesettings@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316"
- dependencies:
- lodash._reinterpolate "~3.0.0"
-
-lodash.uniq@^4.5.0:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
-
-lodash@4.16.2:
- version "4.16.2"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.2.tgz#3e626db827048a699281a8a125226326cfc0e652"
-
-lodash@4.17.2:
- version "4.17.2"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42"
-
-lodash@^3.8.0:
- version "3.10.1"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
-
-lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.8.0:
- version "4.17.5"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
-
-log-symbols@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
- dependencies:
- chalk "^1.0.0"
-
-log-symbols@^2.1.0, log-symbols@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
- dependencies:
- chalk "^2.0.1"
-
-log-update@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1"
- dependencies:
- ansi-escapes "^1.0.0"
- cli-cursor "^1.0.2"
-
-log4js@^2.3.9:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.5.3.tgz#38bb7bde5e9c1c181bd75e8bc128c5cd0409caf1"
- dependencies:
- circular-json "^0.5.1"
- date-format "^1.2.0"
- debug "^3.1.0"
- semver "^5.3.0"
- streamroller "^0.7.0"
- optionalDependencies:
- amqplib "^0.5.2"
- axios "^0.15.3"
- hipchat-notifier "^1.1.0"
- loggly "^1.1.0"
- mailgun-js "^0.7.0"
- nodemailer "^2.5.0"
- redis "^2.7.1"
- slack-node "~0.2.0"
-
-loggly@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee"
- dependencies:
- json-stringify-safe "5.0.x"
- request "2.75.x"
- timespan "2.3.x"
-
-longest@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
-
-loose-envify@^1.0.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
- dependencies:
- js-tokens "^3.0.0"
-
-loud-rejection@^1.0.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
- dependencies:
- currently-unhandled "^0.4.1"
- signal-exit "^3.0.0"
-
-lru-cache@4.1.x, lru-cache@^4.0.1, lru-cache@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
- dependencies:
- pseudomap "^1.0.2"
- yallist "^2.1.2"
-
-lru-cache@~2.6.5:
- version "2.6.5"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.6.5.tgz#e56d6354148ede8d7707b58d143220fd08df0fd5"
-
-magic-string@^0.16.0:
- version "0.16.0"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.16.0.tgz#970ebb0da7193301285fb1aa650f39bdd81eb45a"
- dependencies:
- vlq "^0.2.1"
-
-magic-string@^0.22.4:
- version "0.22.4"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff"
- dependencies:
- vlq "^0.2.1"
-
-mailcomposer@4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4"
- dependencies:
- buildmail "4.0.1"
- libmime "3.0.0"
-
-mailgun-js@^0.7.0:
- version "0.7.15"
- resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.7.15.tgz#ee366a20dac64c3c15c03d6c1b3e0ed795252abb"
- dependencies:
- async "~2.1.2"
- debug "~2.2.0"
- form-data "~2.1.1"
- inflection "~1.10.0"
- is-stream "^1.1.0"
- path-proxy "~1.0.0"
- proxy-agent "~2.0.0"
- q "~1.4.0"
- tsscmp "~1.0.0"
-
-make-dir@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
- dependencies:
- pify "^3.0.0"
-
-map-cache@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
-
-map-obj@^1.0.0, map-obj@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
-
-map-obj@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9"
-
-map-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
- dependencies:
- object-visit "^1.0.0"
-
-md5.js@^1.3.4:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
- dependencies:
- hash-base "^3.0.0"
- inherits "^2.0.1"
-
-media-typer@0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
-
-mem@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76"
- dependencies:
- mimic-fn "^1.0.0"
-
-memory-fs@^0.4.0, memory-fs@~0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
- dependencies:
- errno "^0.1.3"
- readable-stream "^2.0.1"
-
-meow@^3.3.0:
- version "3.7.0"
- resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
- dependencies:
- camelcase-keys "^2.0.0"
- decamelize "^1.1.2"
- loud-rejection "^1.0.0"
- map-obj "^1.0.1"
- minimist "^1.1.3"
- normalize-package-data "^2.3.4"
- object-assign "^4.0.1"
- read-pkg-up "^1.0.1"
- redent "^1.0.0"
- trim-newlines "^1.0.0"
-
-meow@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.0.tgz#fd5855dd008db5b92c552082db1c307cba20b29d"
- dependencies:
- camelcase-keys "^4.0.0"
- decamelize-keys "^1.0.0"
- loud-rejection "^1.0.0"
- minimist "^1.1.3"
- minimist-options "^3.0.1"
- normalize-package-data "^2.3.4"
- read-pkg-up "^3.0.0"
- redent "^2.0.0"
- trim-newlines "^2.0.0"
-
-merge@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da"
-
-micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7:
- version "2.3.11"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
- dependencies:
- arr-diff "^2.0.0"
- array-unique "^0.2.1"
- braces "^1.8.2"
- expand-brackets "^0.1.4"
- extglob "^0.3.1"
- filename-regex "^2.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.1"
- kind-of "^3.0.2"
- normalize-path "^2.0.1"
- object.omit "^2.0.0"
- parse-glob "^3.0.4"
- regex-cache "^0.4.2"
-
-micromatch@^3.1.4, micromatch@^3.1.8:
- version "3.1.9"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89"
- dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- braces "^2.3.1"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- extglob "^2.0.4"
- fragment-cache "^0.2.1"
- kind-of "^6.0.2"
- nanomatch "^1.2.9"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-miller-rabin@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
- dependencies:
- bn.js "^4.0.0"
- brorand "^1.0.1"
-
-mime-db@~1.33.0:
- version "1.33.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
-
-mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7:
- version "2.1.18"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
- dependencies:
- mime-db "~1.33.0"
-
-mime-types@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-1.0.2.tgz#995ae1392ab8affcbfcb2641dd054e943c0d5dce"
-
-mime@^1.3.4, mime@^1.4.1, mime@^1.5.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
-
-mime@~1.2.11:
- version "1.2.11"
- resolved "https://registry.yarnpkg.com/mime/-/mime-1.2.11.tgz#58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10"
-
-mimic-fn@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
-
-minimalistic-assert@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3"
-
-minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
-
-"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
- dependencies:
- brace-expansion "^1.1.7"
-
-minimatch@3.0.3:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
- dependencies:
- brace-expansion "^1.0.0"
-
-minimist-options@^3.0.1:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954"
- dependencies:
- arrify "^1.0.1"
- is-plain-obj "^1.1.0"
-
-minimist@0.0.8:
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
-
-minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
-
-minimist@~0.0.1:
- version "0.0.10"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
-
-mixin-deep@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
- dependencies:
- for-in "^1.0.2"
- is-extendable "^1.0.1"
-
-mkdirp@0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12"
- dependencies:
- minimist "0.0.8"
-
-mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
- dependencies:
- minimist "0.0.8"
-
-mkpath@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/mkpath/-/mkpath-1.0.0.tgz#ebb3a977e7af1c683ae6fda12b545a6ba6c5853d"
-
-mocha-nightwatch@3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/mocha-nightwatch/-/mocha-nightwatch-3.2.2.tgz#91bcb9b3bde057dd7677c78125e491e58d66647c"
- dependencies:
- browser-stdout "1.3.0"
- commander "2.9.0"
- debug "2.2.0"
- diff "1.4.0"
- escape-string-regexp "1.0.5"
- glob "7.0.5"
- growl "1.9.2"
- json3 "3.3.2"
- lodash.create "3.1.1"
- mkdirp "0.5.1"
- supports-color "3.1.2"
-
-modify-values@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2"
-
-module-deps@^4.0.8:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd"
- dependencies:
- JSONStream "^1.0.3"
- browser-resolve "^1.7.0"
- cached-path-relative "^1.0.0"
- concat-stream "~1.5.0"
- defined "^1.0.0"
- detective "^4.0.0"
- duplexer2 "^0.1.2"
- inherits "^2.0.1"
- parents "^1.0.0"
- readable-stream "^2.0.2"
- resolve "^1.1.3"
- stream-combiner2 "^1.1.1"
- subarg "^1.0.0"
- through2 "^2.0.0"
- xtend "^4.0.0"
-
-ms@0.7.1:
- version "0.7.1"
- resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
-
-ms@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
-
-mute-stream@0.0.6:
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db"
-
-mute-stream@0.0.7:
- version "0.0.7"
- resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
-
-nan@^2.3.0:
- version "2.9.2"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
-
-nanomatch@^1.2.9:
- version "1.2.9"
- resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2"
- dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- fragment-cache "^0.2.1"
- is-odd "^2.0.0"
- is-windows "^1.0.2"
- kind-of "^6.0.2"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-natural-compare@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
-
-negotiator@0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
-
-neo-async@^2.5.0:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f"
-
-netmask@~1.0.4:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35"
-
-nightwatch-helpers@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/nightwatch-helpers/-/nightwatch-helpers-1.2.0.tgz#cdefeb7635074a141825a7b6d1b955b6d7810a0f"
-
-nightwatch@^0.9.16:
- version "0.9.20"
- resolved "https://registry.yarnpkg.com/nightwatch/-/nightwatch-0.9.20.tgz#156d17cd058cbc31f43ab18e915f7ec297fb53e0"
- dependencies:
- chai-nightwatch "~0.1.x"
- ejs "2.5.7"
- lodash.clone "3.0.3"
- lodash.defaultsdeep "4.3.2"
- minimatch "3.0.3"
- mkpath "1.0.0"
- mocha-nightwatch "3.2.2"
- optimist "0.6.1"
- proxy-agent "2.0.0"
- q "1.4.1"
-
-node-libs-browser@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df"
- dependencies:
- assert "^1.1.1"
- browserify-zlib "^0.2.0"
- buffer "^4.3.0"
- console-browserify "^1.1.0"
- constants-browserify "^1.0.0"
- crypto-browserify "^3.11.0"
- domain-browser "^1.1.1"
- events "^1.0.0"
- https-browserify "^1.0.0"
- os-browserify "^0.3.0"
- path-browserify "0.0.0"
- process "^0.11.10"
- punycode "^1.2.4"
- querystring-es3 "^0.2.0"
- readable-stream "^2.3.3"
- stream-browserify "^2.0.1"
- stream-http "^2.7.2"
- string_decoder "^1.0.0"
- timers-browserify "^2.0.4"
- tty-browserify "0.0.0"
- url "^0.11.0"
- util "^0.10.3"
- vm-browserify "0.0.4"
-
-node-pre-gyp@^0.6.39:
- version "0.6.39"
- resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649"
- dependencies:
- detect-libc "^1.0.2"
- hawk "3.1.3"
- mkdirp "^0.5.1"
- nopt "^4.0.1"
- npmlog "^4.0.2"
- rc "^1.1.7"
- request "2.81.0"
- rimraf "^2.6.1"
- semver "^5.3.0"
- tar "^2.2.1"
- tar-pack "^3.4.0"
-
-node-uuid@~1.4.0, node-uuid@~1.4.7:
- version "1.4.8"
- resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
-
-nodemailer-direct-transport@3.3.2:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86"
- dependencies:
- nodemailer-shared "1.1.0"
- smtp-connection "2.12.0"
-
-nodemailer-fetch@1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4"
-
-nodemailer-shared@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0"
- dependencies:
- nodemailer-fetch "1.6.0"
-
-nodemailer-smtp-pool@2.8.2:
- version "2.8.2"
- resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72"
- dependencies:
- nodemailer-shared "1.1.0"
- nodemailer-wellknown "0.1.10"
- smtp-connection "2.12.0"
-
-nodemailer-smtp-transport@2.7.2:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77"
- dependencies:
- nodemailer-shared "1.1.0"
- nodemailer-wellknown "0.1.10"
- smtp-connection "2.12.0"
-
-nodemailer-wellknown@0.1.10:
- version "0.1.10"
- resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5"
-
-nodemailer@^2.5.0:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9"
- dependencies:
- libmime "3.0.0"
- mailcomposer "4.0.1"
- nodemailer-direct-transport "3.3.2"
- nodemailer-shared "1.1.0"
- nodemailer-smtp-pool "2.8.2"
- nodemailer-smtp-transport "2.7.2"
- socks "1.1.9"
-
-nopt@3.x:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
- dependencies:
- abbrev "1"
-
-nopt@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
- dependencies:
- abbrev "1"
- osenv "^0.1.4"
-
-normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5:
- version "2.4.0"
- resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
- dependencies:
- hosted-git-info "^2.1.4"
- is-builtin-module "^1.0.0"
- semver "2 || 3 || 4 || 5"
- validate-npm-package-license "^3.0.1"
-
-normalize-path@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
-
-normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
- dependencies:
- remove-trailing-separator "^1.0.1"
-
-npm-path@^2.0.2:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64"
- dependencies:
- which "^1.2.10"
-
-npm-run-path@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
- dependencies:
- path-key "^2.0.0"
-
-npm-which@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa"
- dependencies:
- commander "^2.9.0"
- npm-path "^2.0.2"
- which "^1.2.10"
-
-npmlog@^4.0.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
- dependencies:
- are-we-there-yet "~1.1.2"
- console-control-strings "~1.1.0"
- gauge "~2.7.3"
- set-blocking "~2.0.0"
-
-null-check@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd"
-
-number-is-nan@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
-
-nwmatcher@^1.4.3:
- version "1.4.3"
- resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c"
-
-oauth-sign@~0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.4.0.tgz#f22956f31ea7151a821e5f2fb32c113cad8b9f69"
-
-oauth-sign@~0.8.1, oauth-sign@~0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
-
-object-assign@^4.0.1, object-assign@^4.1.0:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
-
-object-component@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
-
-object-copy@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
- dependencies:
- copy-descriptor "^0.1.0"
- define-property "^0.2.5"
- kind-of "^3.0.3"
-
-object-hash@^1.1.4:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.2.0.tgz#e96af0e96981996a1d47f88ead8f74f1ebc4422b"
-
-object-visit@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
- dependencies:
- isobject "^3.0.0"
-
-object.omit@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
- dependencies:
- for-own "^0.1.4"
- is-extendable "^0.1.1"
-
-object.pick@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
- dependencies:
- isobject "^3.0.1"
-
-on-finished@~2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
- dependencies:
- ee-first "1.1.1"
-
-once@1.x, once@^1.3.0, once@^1.3.3, once@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
- dependencies:
- wrappy "1"
-
-onetime@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789"
-
-onetime@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
- dependencies:
- mimic-fn "^1.0.0"
-
-opener@~1.4.0:
- version "1.4.3"
- resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
-
-optimist@0.6.1, optimist@0.6.x, optimist@^0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
- dependencies:
- minimist "~0.0.1"
- wordwrap "~0.0.2"
-
-optionator@^0.8.1, optionator@^0.8.2:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
- dependencies:
- deep-is "~0.1.3"
- fast-levenshtein "~2.0.4"
- levn "~0.3.0"
- prelude-ls "~1.1.2"
- type-check "~0.3.2"
- wordwrap "~1.0.0"
-
-ora@^0.2.3:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4"
- dependencies:
- chalk "^1.1.1"
- cli-cursor "^1.0.2"
- cli-spinners "^0.1.2"
- object-assign "^4.0.1"
-
-os-browserify@^0.3.0, os-browserify@~0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
-
-os-homedir@^1.0.0, os-homedir@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
-
-os-locale@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2"
- dependencies:
- execa "^0.7.0"
- lcid "^1.0.0"
- mem "^1.1.0"
-
-os-shim@^0.1.2:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917"
-
-os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
-
-osenv@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
- dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.0"
-
-p-finally@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
-
-p-limit@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
- dependencies:
- p-try "^1.0.0"
-
-p-locate@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
- dependencies:
- p-limit "^1.1.0"
-
-p-map@^1.1.1:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b"
-
-p-try@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
-
-pac-proxy-agent@1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-1.1.0.tgz#34a385dfdf61d2f0ecace08858c745d3e791fd4d"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
- get-uri "2"
- http-proxy-agent "1"
- https-proxy-agent "1"
- pac-resolver "~2.0.0"
- raw-body "2"
- socks-proxy-agent "2"
-
-pac-resolver@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-2.0.0.tgz#99b88d2f193fbdeefc1c9a529c1f3260ab5277cd"
- dependencies:
- co "~3.0.6"
- degenerator "~1.0.2"
- ip "1.0.1"
- netmask "~1.0.4"
- thunkify "~2.1.1"
-
-pad-right@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774"
- dependencies:
- repeat-string "^1.5.2"
-
-pako@~1.0.5:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258"
-
-parents@^1.0.0, parents@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751"
- dependencies:
- path-platform "~0.11.15"
-
-parse-asn1@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712"
- dependencies:
- asn1.js "^4.0.0"
- browserify-aes "^1.0.0"
- create-hash "^1.1.0"
- evp_bytestokey "^1.0.0"
- pbkdf2 "^3.0.3"
-
-parse-github-repo-url@^1.3.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50"
-
-parse-glob@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
- dependencies:
- glob-base "^0.3.0"
- is-dotfile "^1.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.0"
-
-parse-json@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
- dependencies:
- error-ex "^1.2.0"
-
-parse-json@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
- dependencies:
- error-ex "^1.3.1"
- json-parse-better-errors "^1.0.1"
-
-parse-passwd@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"
-
-parse5@4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
-
-parseqs@0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d"
- dependencies:
- better-assert "~1.0.0"
-
-parseuri@0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a"
- dependencies:
- better-assert "~1.0.0"
-
-parseurl@~1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
-
-pascalcase@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
-
-path-browserify@0.0.0, path-browserify@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a"
-
-path-dirname@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0"
-
-path-exists@2.1.0, path-exists@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
- dependencies:
- pinkie-promise "^2.0.0"
-
-path-exists@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
-
-path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
-
-path-is-inside@^1.0.1, path-is-inside@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
-
-path-key@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
-
-path-parse@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
-
-path-platform@~0.11.15:
- version "0.11.15"
- resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2"
-
-path-proxy@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e"
- dependencies:
- inflection "~1.3.0"
-
-path-type@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
- dependencies:
- graceful-fs "^4.1.2"
- pify "^2.0.0"
- pinkie-promise "^2.0.0"
-
-path-type@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
- dependencies:
- pify "^2.0.0"
-
-path-type@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
- dependencies:
- pify "^3.0.0"
-
-pbkdf2@^3.0.3:
- version "3.0.14"
- resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade"
- dependencies:
- create-hash "^1.1.2"
- create-hmac "^1.1.4"
- ripemd160 "^2.0.1"
- safe-buffer "^5.0.1"
- sha.js "^2.4.8"
-
-pend@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
-
-performance-now@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
-
-performance-now@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
-
-phantomjs-prebuilt@^2.1.14, phantomjs-prebuilt@^2.1.7:
- version "2.1.16"
- resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef"
- dependencies:
- es6-promise "^4.0.3"
- extract-zip "^1.6.5"
- fs-extra "^1.0.0"
- hasha "^2.2.0"
- kew "^0.7.0"
- progress "^1.1.8"
- request "^2.81.0"
- request-progress "^2.0.1"
- which "^1.2.10"
-
-pify@^2.0.0, pify@^2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
-
-pify@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
-
-pinkie-promise@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
- dependencies:
- pinkie "^2.0.0"
-
-pinkie@^2.0.0:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
-
-pkg-dir@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
- dependencies:
- find-up "^1.0.0"
-
-pkg-dir@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b"
- dependencies:
- find-up "^2.1.0"
-
-please-upgrade-node@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.0.1.tgz#0a681f2c18915e5433a5ca2cd94e0b8206a782db"
-
-pluralize@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
-
-pn@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
-
-portfinder@^1.0.13:
- version "1.0.13"
- resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9"
- dependencies:
- async "^1.5.2"
- debug "^2.2.0"
- mkdirp "0.5.x"
-
-posix-character-classes@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
-
-prelude-ls@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
-
-preserve@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
-
-pretty-format@^22.4.0:
- version "22.4.0"
- resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.0.tgz#237b1f7e1c50ed03bc65c03ccc29d7c8bb7beb94"
- dependencies:
- ansi-regex "^3.0.0"
- ansi-styles "^3.2.0"
-
-private@^0.1.6, private@^0.1.7:
- version "0.1.8"
- resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
-
-process-nextick-args@~1.0.6:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
-
-process-nextick-args@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
-
-process@^0.11.10, process@~0.11.0:
- version "0.11.10"
- resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
-
-progress@^1.1.8:
- version "1.1.8"
- resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
-
-progress@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
-
-proxy-agent@2.0.0, proxy-agent@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-2.0.0.tgz#57eb5347aa805d74ec681cb25649dba39c933499"
- dependencies:
- agent-base "2"
- debug "2"
- extend "3"
- http-proxy-agent "1"
- https-proxy-agent "1"
- lru-cache "~2.6.5"
- pac-proxy-agent "1"
- socks-proxy-agent "2"
-
-prr@~1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
-
-pseudomap@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
-
-public-encrypt@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
- dependencies:
- bn.js "^4.1.0"
- browserify-rsa "^4.0.0"
- create-hash "^1.1.0"
- parse-asn1 "^5.0.0"
- randombytes "^2.0.1"
-
-punycode@1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
-
-punycode@1.4.1, punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
-
-punycode@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
-
-q@1.4.1, q@~1.4.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
-
-q@^1.4.1, q@^1.5.0, q@^1.5.1:
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
-
-qjobs@^1.1.4:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071"
-
-qs@6.5.1, qs@~6.5.1:
- version "6.5.1"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
-
-qs@~1.2.0:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/qs/-/qs-1.2.2.tgz#19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88"
-
-qs@~2.3.3:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/qs/-/qs-2.3.3.tgz#e9e85adbe75da0bbe4c8e0476a086290f863b404"
-
-qs@~6.2.0:
- version "6.2.3"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe"
-
-qs@~6.3.0:
- version "6.3.2"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c"
-
-qs@~6.4.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
-
-querystring-es3@^0.2.0, querystring-es3@~0.2.0:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
-
-querystring@0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
-
-quick-lru@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
-
-randomatic@^1.1.3:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
- dependencies:
- is-number "^3.0.0"
- kind-of "^4.0.0"
-
-randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80"
- dependencies:
- safe-buffer "^5.1.0"
-
-randomfill@^1.0.3:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458"
- dependencies:
- randombytes "^2.0.5"
- safe-buffer "^5.1.0"
-
-range-parser@^1.0.3, range-parser@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
-
-raw-body@2, raw-body@2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89"
- dependencies:
- bytes "3.0.0"
- http-errors "1.6.2"
- iconv-lite "0.4.19"
- unpipe "1.0.0"
-
-rc@^1.1.7:
- version "1.2.5"
- resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.5.tgz#275cd687f6e3b36cc756baa26dfee80a790301fd"
- dependencies:
- deep-extend "~0.4.0"
- ini "~1.3.0"
- minimist "^1.2.0"
- strip-json-comments "~2.0.1"
-
-read-only-stream@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
- dependencies:
- readable-stream "^2.0.2"
-
-read-pkg-up@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
- dependencies:
- find-up "^1.0.0"
- read-pkg "^1.0.0"
-
-read-pkg-up@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
- dependencies:
- find-up "^2.0.0"
- read-pkg "^2.0.0"
-
-read-pkg-up@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07"
- dependencies:
- find-up "^2.0.0"
- read-pkg "^3.0.0"
-
-read-pkg@^1.0.0, read-pkg@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
- dependencies:
- load-json-file "^1.0.0"
- normalize-package-data "^2.3.2"
- path-type "^1.0.0"
-
-read-pkg@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
- dependencies:
- load-json-file "^2.0.0"
- normalize-package-data "^2.3.2"
- path-type "^2.0.0"
-
-read-pkg@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
- dependencies:
- load-json-file "^4.0.0"
- normalize-package-data "^2.3.2"
- path-type "^3.0.0"
-
-readable-stream@1.1.x, "readable-stream@1.x >=1.1.9":
- version "1.1.14"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.1"
- isarray "0.0.1"
- string_decoder "~0.10.x"
-
-readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3:
- version "2.3.5"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.3"
- isarray "~1.0.0"
- process-nextick-args "~2.0.0"
- safe-buffer "~5.1.1"
- string_decoder "~1.0.3"
- util-deprecate "~1.0.1"
-
-readable-stream@~1.0.26:
- version "1.0.34"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.1"
- isarray "0.0.1"
- string_decoder "~0.10.x"
-
-readable-stream@~2.0.0, readable-stream@~2.0.5:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.1"
- isarray "~1.0.0"
- process-nextick-args "~1.0.6"
- string_decoder "~0.10.x"
- util-deprecate "~1.0.1"
-
-readdirp@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78"
- dependencies:
- graceful-fs "^4.1.2"
- minimatch "^3.0.2"
- readable-stream "^2.0.2"
- set-immediate-shim "^1.0.1"
-
-rechoir@^0.6.2:
- version "0.6.2"
- resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
- dependencies:
- resolve "^1.1.6"
-
-redent@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
- dependencies:
- indent-string "^2.1.0"
- strip-indent "^1.0.1"
-
-redent@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa"
- dependencies:
- indent-string "^3.0.0"
- strip-indent "^2.0.0"
-
-redis-commands@^1.2.0:
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2"
-
-redis-parser@^2.6.0:
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b"
-
-redis@^2.7.1:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02"
- dependencies:
- double-ended-queue "^2.1.0-0"
- redis-commands "^1.2.0"
- redis-parser "^2.6.0"
-
-regenerate@^1.2.1:
- version "1.3.3"
- resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"
-
-regenerator-runtime@^0.11.0:
- version "0.11.1"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
-
-regenerator-transform@^0.10.0:
- version "0.10.1"
- resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
- dependencies:
- babel-runtime "^6.18.0"
- babel-types "^6.19.0"
- private "^0.1.6"
-
-regex-cache@^0.4.2:
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd"
- dependencies:
- is-equal-shallow "^0.1.3"
-
-regex-not@^1.0.0, regex-not@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
- dependencies:
- extend-shallow "^3.0.2"
- safe-regex "^1.1.0"
-
-regexpu-core@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"
- dependencies:
- regenerate "^1.2.1"
- regjsgen "^0.2.0"
- regjsparser "^0.1.4"
-
-regjsgen@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7"
-
-regjsparser@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c"
- dependencies:
- jsesc "~0.5.0"
-
-remove-trailing-separator@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
-
-repeat-element@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a"
-
-repeat-string@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae"
-
-repeat-string@^1.5.2, repeat-string@^1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
-
-repeating@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
- dependencies:
- is-finite "^1.0.0"
-
-request-progress@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08"
- dependencies:
- throttleit "^1.0.0"
-
-request-promise-core@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6"
- dependencies:
- lodash "^4.13.1"
-
-request-promise-native@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5"
- dependencies:
- request-promise-core "1.1.1"
- stealthy-require "^1.1.0"
- tough-cookie ">=2.3.3"
-
-request@2.42.0:
- version "2.42.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.42.0.tgz#572bd0148938564040ac7ab148b96423a063304a"
- dependencies:
- bl "~0.9.0"
- caseless "~0.6.0"
- forever-agent "~0.5.0"
- json-stringify-safe "~5.0.0"
- mime-types "~1.0.1"
- node-uuid "~1.4.0"
- qs "~1.2.0"
- tunnel-agent "~0.4.0"
- optionalDependencies:
- aws-sign2 "~0.5.0"
- form-data "~0.1.0"
- hawk "1.1.1"
- http-signature "~0.10.0"
- oauth-sign "~0.4.0"
- stringstream "~0.0.4"
- tough-cookie ">=0.12.0"
-
-request@2.75.x:
- version "2.75.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93"
- dependencies:
- aws-sign2 "~0.6.0"
- aws4 "^1.2.1"
- bl "~1.1.2"
- caseless "~0.11.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.0.0"
- har-validator "~2.0.6"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- node-uuid "~1.4.7"
- oauth-sign "~0.8.1"
- qs "~6.2.0"
- stringstream "~0.0.4"
- tough-cookie "~2.3.0"
- tunnel-agent "~0.4.1"
-
-request@2.79.0:
- version "2.79.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
- dependencies:
- aws-sign2 "~0.6.0"
- aws4 "^1.2.1"
- caseless "~0.11.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.1.1"
- har-validator "~2.0.6"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- oauth-sign "~0.8.1"
- qs "~6.3.0"
- stringstream "~0.0.4"
- tough-cookie "~2.3.0"
- tunnel-agent "~0.4.1"
- uuid "^3.0.0"
-
-request@2.81.0:
- version "2.81.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
- dependencies:
- aws-sign2 "~0.6.0"
- aws4 "^1.2.1"
- caseless "~0.12.0"
- combined-stream "~1.0.5"
- extend "~3.0.0"
- forever-agent "~0.6.1"
- form-data "~2.1.1"
- har-validator "~4.2.1"
- hawk "~3.1.3"
- http-signature "~1.1.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.7"
- oauth-sign "~0.8.1"
- performance-now "^0.2.0"
- qs "~6.4.0"
- safe-buffer "^5.0.1"
- stringstream "~0.0.4"
- tough-cookie "~2.3.0"
- tunnel-agent "^0.6.0"
- uuid "^3.0.0"
-
-request@^2.0.0, request@^2.74.0, request@^2.81.0, request@^2.83.0:
- version "2.83.0"
- resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
- dependencies:
- aws-sign2 "~0.7.0"
- aws4 "^1.6.0"
- caseless "~0.12.0"
- combined-stream "~1.0.5"
- extend "~3.0.1"
- forever-agent "~0.6.1"
- form-data "~2.3.1"
- har-validator "~5.0.3"
- hawk "~6.0.2"
- http-signature "~1.2.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.17"
- oauth-sign "~0.8.2"
- performance-now "^2.1.0"
- qs "~6.5.1"
- safe-buffer "^5.1.1"
- stringstream "~0.0.5"
- tough-cookie "~2.3.3"
- tunnel-agent "^0.6.0"
- uuid "^3.1.0"
-
-requestretry@^1.2.2:
- version "1.13.0"
- resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94"
- dependencies:
- extend "^3.0.0"
- lodash "^4.15.0"
- request "^2.74.0"
- when "^3.7.7"
-
-require-directory@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
-
-require-from-string@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff"
-
-require-main-filename@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
-
-require-relative@0.8.7:
- version "0.8.7"
- resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de"
-
-require-uncached@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
- dependencies:
- caller-path "^0.1.0"
- resolve-from "^1.0.0"
-
-requires-port@1.x.x:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
-
-resolve-dir@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e"
- dependencies:
- expand-tilde "^1.2.2"
- global-modules "^0.2.3"
-
-resolve-from@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
-
-resolve-url@^0.2.1, resolve-url@~0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
-
-resolve@1.1.7, resolve@1.1.x:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
-
-resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.3.3, resolve@^1.4.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
- dependencies:
- path-parse "^1.0.5"
-
-restore-cursor@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
- dependencies:
- exit-hook "^1.0.0"
- onetime "^1.0.0"
-
-restore-cursor@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
- dependencies:
- onetime "^2.0.0"
- signal-exit "^3.0.2"
-
-resumer@~0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759"
- dependencies:
- through "~2.3.4"
-
-ret@~0.1.10:
- version "0.1.15"
- resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
-
-right-align@^0.1.1:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
- dependencies:
- align-text "^0.1.1"
-
-right-pad@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0"
-
-rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1:
- version "2.6.2"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
- dependencies:
- glob "^7.0.5"
-
-ripemd160@^2.0.0, ripemd160@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7"
- dependencies:
- hash-base "^2.0.0"
- inherits "^2.0.1"
-
-rollup-plugin-alias@^1.3.1:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9"
- dependencies:
- slash "^1.0.0"
-
-rollup-plugin-babel@^3.0.2:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.3.tgz#63adedc863130327512a4a9006efc2241c5b7c15"
- dependencies:
- rollup-pluginutils "^1.5.0"
-
-rollup-plugin-buble@^0.19.2:
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.19.2.tgz#c0590c7d3d475b5ed59f129764ec93710cc6e8dd"
- dependencies:
- buble "^0.19.2"
- rollup-pluginutils "^2.0.1"
-
-rollup-plugin-commonjs@^8.0.0:
- version "8.4.1"
- resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz#5c9cea2b2c3de322f5fbccd147e07ed5e502d7a0"
- dependencies:
- acorn "^5.2.1"
- estree-walker "^0.5.0"
- magic-string "^0.22.4"
- resolve "^1.4.0"
- rollup-pluginutils "^2.0.1"
-
-rollup-plugin-flow-no-whitespace@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/rollup-plugin-flow-no-whitespace/-/rollup-plugin-flow-no-whitespace-1.0.0.tgz#bd4ba1bcd99ad5b88234d72e6e2dacea9aa02d16"
- dependencies:
- flow-remove-types-no-whitespace "^1.0.3"
- rollup-pluginutils "^1.5.2"
-
-rollup-plugin-node-resolve@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.2.0.tgz#31534952f3ab21f9473c1d092be7ed43937ea4d4"
- dependencies:
- builtin-modules "^2.0.0"
- is-module "^1.0.0"
- resolve "^1.1.6"
-
-rollup-plugin-replace@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz#19074089c8ed57184b8cc64e967a03d095119277"
- dependencies:
- magic-string "^0.22.4"
- minimatch "^3.0.2"
- rollup-pluginutils "^2.0.1"
-
-rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
- dependencies:
- estree-walker "^0.2.1"
- minimatch "^3.0.2"
-
-rollup-pluginutils@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0"
- dependencies:
- estree-walker "^0.3.0"
- micromatch "^2.3.11"
-
-rollup-watch@^4.0.0:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-4.3.1.tgz#5aa1eaeab787addf368905d102b39d6fc5ce4a8b"
- dependencies:
- chokidar "^1.7.0"
- require-relative "0.8.7"
- rollup-pluginutils "^2.0.1"
-
-rollup@^0.54.1:
- version "0.54.1"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.54.1.tgz#415a5d999421502646cf54b873fc4ce1a7393970"
-
-run-async@^2.2.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
- dependencies:
- is-promise "^2.1.0"
-
-rx-lite-aggregates@^4.0.8:
- version "4.0.8"
- resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be"
- dependencies:
- rx-lite "*"
-
-rx-lite@*, rx-lite@^4.0.8:
- version "4.0.8"
- resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444"
-
-rx@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
-
-rxjs@^5.4.2:
- version "5.5.6"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02"
- dependencies:
- symbol-observable "1.0.1"
-
-safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
-
-safe-regex@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
- dependencies:
- ret "~0.1.10"
-
-sauce-connect-launcher@^1.2.2:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.3.tgz#d2f931ad7ae8fdabf1968a440e7b20417aca7f86"
- dependencies:
- adm-zip "~0.4.3"
- async "^2.1.2"
- https-proxy-agent "~1.0.0"
- lodash "^4.16.6"
- rimraf "^2.5.4"
-
-saucelabs@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.4.0.tgz#b934a9af9da2874b3f40aae1fcde50a4466f5f38"
- dependencies:
- https-proxy-agent "^1.0.0"
-
-sax@^1.2.4:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
-
-schema-utils@^0.4.5:
- version "0.4.5"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e"
- dependencies:
- ajv "^6.1.0"
- ajv-keywords "^3.1.0"
-
-selenium-server@^2.53.1:
- version "2.53.1"
- resolved "https://registry.yarnpkg.com/selenium-server/-/selenium-server-2.53.1.tgz#d681528812f3c2e0531a6b7e613e23bb02cce8a6"
-
-"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
-
-semver@~5.0.1:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a"
-
-serialize-javascript@^1.3.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005"
-
-set-blocking@^2.0.0, set-blocking@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
-
-set-getter@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376"
- dependencies:
- to-object-path "^0.3.0"
-
-set-immediate-shim@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
-
-set-value@^0.4.3:
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1"
- dependencies:
- extend-shallow "^2.0.1"
- is-extendable "^0.1.1"
- is-plain-object "^2.0.1"
- to-object-path "^0.3.0"
-
-set-value@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
- dependencies:
- extend-shallow "^2.0.1"
- is-extendable "^0.1.1"
- is-plain-object "^2.0.3"
- split-string "^3.0.1"
-
-setimmediate@^1.0.4:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
-
-setprototypeof@1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
-
-sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4:
- version "2.4.10"
- resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b"
- dependencies:
- inherits "^2.0.1"
- safe-buffer "^5.0.1"
-
-shasum@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f"
- dependencies:
- json-stable-stringify "~0.0.0"
- sha.js "~2.4.4"
-
-shebang-command@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
- dependencies:
- shebang-regex "^1.0.0"
-
-shebang-regex@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
-
-shell-quote@^1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767"
- dependencies:
- array-filter "~0.0.0"
- array-map "~0.0.0"
- array-reduce "~0.0.0"
- jsonify "~0.0.0"
-
-shelljs@0.7.6:
- version "0.7.6"
- resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
- dependencies:
- glob "^7.0.0"
- interpret "^1.0.0"
- rechoir "^0.6.2"
-
-shelljs@^0.8.1:
- version "0.8.1"
- resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1"
- dependencies:
- glob "^7.0.0"
- interpret "^1.0.0"
- rechoir "^0.6.2"
-
-signal-exit@^3.0.0, signal-exit@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
-
-slack-node@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30"
- dependencies:
- requestretry "^1.2.2"
-
-slash@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
-
-slice-ansi@0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
-
-slice-ansi@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
- dependencies:
- is-fullwidth-code-point "^2.0.0"
-
-smart-buffer@^1.0.13, smart-buffer@^1.0.4:
- version "1.1.15"
- resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16"
-
-smtp-connection@2.12.0:
- version "2.12.0"
- resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1"
- dependencies:
- httpntlm "1.6.1"
- nodemailer-shared "1.1.0"
-
-snapdragon-node@^2.0.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
- dependencies:
- define-property "^1.0.0"
- isobject "^3.0.0"
- snapdragon-util "^3.0.1"
-
-snapdragon-util@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
- dependencies:
- kind-of "^3.2.0"
-
-snapdragon@^0.8.1:
- version "0.8.1"
- resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370"
- dependencies:
- base "^0.11.1"
- debug "^2.2.0"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- map-cache "^0.2.2"
- source-map "^0.5.6"
- source-map-resolve "^0.5.0"
- use "^2.0.0"
-
-sntp@0.2.x:
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/sntp/-/sntp-0.2.4.tgz#fb885f18b0f3aad189f824862536bceeec750900"
- dependencies:
- hoek "0.9.x"
-
-sntp@1.x.x:
- version "1.0.9"
- resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
- dependencies:
- hoek "2.x.x"
-
-sntp@2.x.x:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8"
- dependencies:
- hoek "4.x.x"
-
-socket.io-adapter@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b"
-
-socket.io-client@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e"
- dependencies:
- backo2 "1.0.2"
- base64-arraybuffer "0.1.5"
- component-bind "1.0.0"
- component-emitter "1.2.1"
- debug "~2.6.4"
- engine.io-client "~3.1.0"
- has-cors "1.1.0"
- indexof "0.0.1"
- object-component "0.0.3"
- parseqs "0.0.5"
- parseuri "0.0.5"
- socket.io-parser "~3.1.1"
- to-array "0.1.4"
-
-socket.io-parser@~3.1.1:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e"
- dependencies:
- component-emitter "1.2.1"
- debug "~3.1.0"
- has-binary2 "~1.0.2"
- isarray "2.0.1"
-
-socket.io@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014"
- dependencies:
- debug "~2.6.6"
- engine.io "~3.1.0"
- socket.io-adapter "~1.1.0"
- socket.io-client "2.0.4"
- socket.io-parser "~3.1.1"
-
-socks-proxy-agent@2:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-2.1.1.tgz#86ebb07193258637870e13b7bd99f26c663df3d3"
- dependencies:
- agent-base "2"
- extend "3"
- socks "~1.1.5"
-
-socks@1.1.9:
- version "1.1.9"
- resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691"
- dependencies:
- ip "^1.1.2"
- smart-buffer "^1.0.4"
-
-socks@~1.1.5:
- version "1.1.10"
- resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a"
- dependencies:
- ip "^1.1.4"
- smart-buffer "^1.0.13"
-
-source-list-map@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
-
-source-map-resolve@^0.3.0:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.3.1.tgz#610f6122a445b8dd51535a2a71b783dfc1248761"
- dependencies:
- atob "~1.1.0"
- resolve-url "~0.2.1"
- source-map-url "~0.3.0"
- urix "~0.1.0"
-
-source-map-resolve@^0.5.0:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a"
- dependencies:
- atob "^2.0.0"
- decode-uri-component "^0.2.0"
- resolve-url "^0.2.1"
- source-map-url "^0.4.0"
- urix "^0.1.0"
-
-source-map-support@^0.4.15:
- version "0.4.18"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
- dependencies:
- source-map "^0.5.6"
-
-source-map-support@^0.5.0:
- version "0.5.3"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76"
- dependencies:
- source-map "^0.6.0"
-
-source-map-url@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
-
-source-map-url@~0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.3.0.tgz#7ecaf13b57bcd09da8a40c5d269db33799d4aaf9"
-
-source-map@^0.1.38:
- version "0.1.43"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
- dependencies:
- amdefine ">=0.0.4"
-
-source-map@^0.4.4:
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
- dependencies:
- amdefine ">=0.0.4"
-
-source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.3:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
-
-source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
-
-source-map@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d"
- dependencies:
- amdefine ">=0.0.4"
-
-spawn-sync@^1.0.15:
- version "1.0.15"
- resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476"
- dependencies:
- concat-stream "^1.4.7"
- os-shim "^0.1.2"
-
-spdx-correct@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82"
- dependencies:
- spdx-expression-parse "^3.0.0"
- spdx-license-ids "^3.0.0"
-
-spdx-exceptions@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9"
-
-spdx-expression-parse@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
- dependencies:
- spdx-exceptions "^2.1.0"
- spdx-license-ids "^3.0.0"
-
-spdx-license-ids@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87"
-
-split-string@^3.0.1, split-string@^3.0.2:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
- dependencies:
- extend-shallow "^3.0.0"
-
-split2@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493"
- dependencies:
- through2 "^2.0.2"
-
-split@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9"
- dependencies:
- through "2"
-
-split@~0.2.10:
- version "0.2.10"
- resolved "https://registry.yarnpkg.com/split/-/split-0.2.10.tgz#67097c601d697ce1368f418f06cd201cf0521a57"
- dependencies:
- through "2"
-
-sprintf-js@^1.0.3:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c"
-
-sprintf-js@~1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
-
-sshpk@^1.7.0:
- version "1.13.1"
- resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
- dependencies:
- asn1 "~0.2.3"
- assert-plus "^1.0.0"
- dashdash "^1.12.0"
- getpass "^0.1.1"
- optionalDependencies:
- bcrypt-pbkdf "^1.0.0"
- ecc-jsbn "~0.1.1"
- jsbn "~0.1.0"
- tweetnacl "~0.14.0"
-
-stack-utils@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620"
-
-staged-git-files@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.0.tgz#1a9bb131c1885601023c7aaddd3d54c22142c526"
-
-static-extend@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
- dependencies:
- define-property "^0.2.5"
- object-copy "^0.1.0"
-
-"statuses@>= 1.3.1 < 2":
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
-
-statuses@~1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
-
-stealthy-require@^1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
-
-stream-browserify@^2.0.0, stream-browserify@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"
- dependencies:
- inherits "~2.0.1"
- readable-stream "^2.0.2"
-
-stream-combiner2@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe"
- dependencies:
- duplexer2 "~0.1.0"
- readable-stream "^2.0.2"
-
-stream-combiner@~0.0.2:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14"
- dependencies:
- duplexer "~0.1.1"
-
-stream-http@^2.0.0, stream-http@^2.7.2:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10"
- dependencies:
- builtin-status-codes "^3.0.0"
- inherits "^2.0.1"
- readable-stream "^2.3.3"
- to-arraybuffer "^1.0.0"
- xtend "^4.0.0"
-
-stream-splicer@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83"
- dependencies:
- inherits "^2.0.1"
- readable-stream "^2.0.2"
-
-stream-to-observable@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10"
- dependencies:
- any-observable "^0.2.0"
-
-streamroller@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b"
- dependencies:
- date-format "^1.2.0"
- debug "^3.1.0"
- mkdirp "^0.5.1"
- readable-stream "^2.3.0"
-
-string-width@^1.0.1, string-width@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
- dependencies:
- code-point-at "^1.0.0"
- is-fullwidth-code-point "^1.0.0"
- strip-ansi "^3.0.0"
-
-string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
- dependencies:
- is-fullwidth-code-point "^2.0.0"
- strip-ansi "^4.0.0"
-
-string_decoder@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.0.tgz#384f322ee8a848e500effde99901bba849c5d403"
- dependencies:
- safe-buffer "~5.1.0"
-
-string_decoder@~0.10.x:
- version "0.10.31"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
-
-string_decoder@~1.0.0, string_decoder@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
- dependencies:
- safe-buffer "~5.1.0"
-
-stringify-object@^3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd"
- dependencies:
- get-own-enumerable-property-symbols "^2.0.1"
- is-obj "^1.0.1"
- is-regexp "^1.0.0"
-
-stringstream@~0.0.4, stringstream@~0.0.5:
- version "0.0.5"
- resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
-
-strip-ansi@^3.0.0, strip-ansi@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
- dependencies:
- ansi-regex "^2.0.0"
-
-strip-ansi@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
- dependencies:
- ansi-regex "^3.0.0"
-
-strip-bom@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
- dependencies:
- is-utf8 "^0.2.0"
-
-strip-bom@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
-
-strip-eof@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
-
-strip-indent@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
- dependencies:
- get-stdin "^4.0.1"
-
-strip-indent@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"
-
-strip-json-comments@2.0.1, strip-json-comments@~2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
-
-subarg@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
- dependencies:
- minimist "^1.1.0"
-
-supports-color@3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
- dependencies:
- has-flag "^1.0.0"
-
-supports-color@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
-
-supports-color@^3.1.0:
- version "3.2.3"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
- dependencies:
- has-flag "^1.0.0"
-
-supports-color@^4.2.1:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b"
- dependencies:
- has-flag "^2.0.0"
-
-supports-color@^5.3.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0"
- dependencies:
- has-flag "^3.0.0"
-
-symbol-observable@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4"
-
-symbol-observable@^0.2.2:
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40"
-
-symbol-tree@^3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
-
-syntax-error@^1.1.1:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c"
- dependencies:
- acorn-node "^1.2.0"
-
-table@4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
- dependencies:
- ajv "^5.2.3"
- ajv-keywords "^2.1.0"
- chalk "^2.1.0"
- lodash "^4.17.4"
- slice-ansi "1.0.0"
- string-width "^2.1.1"
-
-tapable@^0.2.7:
- version "0.2.8"
- resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22"
-
-tape@2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/tape/-/tape-2.3.0.tgz#0dfeec709227fbcc9170abe7f046962b271431db"
- dependencies:
- deep-equal "~0.1.0"
- defined "~0.0.0"
- inherits "~2.0.1"
- jsonify "~0.0.0"
- resumer "~0.0.0"
- split "~0.2.10"
- stream-combiner "~0.0.2"
- through "~2.3.4"
-
-tar-pack@^3.4.0:
- version "3.4.1"
- resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f"
- dependencies:
- debug "^2.2.0"
- fstream "^1.0.10"
- fstream-ignore "^1.0.5"
- once "^1.3.3"
- readable-stream "^2.1.4"
- rimraf "^2.5.1"
- tar "^2.2.1"
- uid-number "^0.0.6"
-
-tar-stream@^1.5.0:
- version "1.5.5"
- resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
- dependencies:
- bl "^1.0.0"
- end-of-stream "^1.0.0"
- readable-stream "^2.0.0"
- xtend "^4.0.0"
-
-tar@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"
- dependencies:
- block-stream "*"
- fstream "^1.0.2"
- inherits "2"
-
-test-exclude@^4.1.1:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.0.tgz#07e3613609a362c74516a717515e13322ab45b3c"
- dependencies:
- arrify "^1.0.1"
- micromatch "^2.3.11"
- object-assign "^4.1.0"
- read-pkg-up "^1.0.1"
- require-main-filename "^1.0.1"
-
-text-extensions@^1.0.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39"
-
-text-table@~0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
-
-throttleit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c"
-
-through2@^2.0.0, through2@^2.0.2:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
- dependencies:
- readable-stream "^2.1.5"
- xtend "~4.0.1"
-
-through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4:
- version "2.3.8"
- resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
-
-thunkify@~2.1.1:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d"
-
-time-stamp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357"
-
-timers-browserify@^1.0.1:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d"
- dependencies:
- process "~0.11.0"
-
-timers-browserify@^2.0.4:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae"
- dependencies:
- setimmediate "^1.0.4"
-
-timespan@2.3.x:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929"
-
-tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33:
- version "0.0.33"
- resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
- dependencies:
- os-tmpdir "~1.0.2"
-
-tmp@^0.0.29:
- version "0.0.29"
- resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.29.tgz#f25125ff0dd9da3ccb0c2dd371ee1288bb9128c0"
- dependencies:
- os-tmpdir "~1.0.1"
-
-to-array@0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
-
-to-arraybuffer@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
-
-to-fast-properties@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
-
-to-fast-properties@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
-
-to-object-path@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
- dependencies:
- kind-of "^3.0.2"
-
-to-regex-range@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
- dependencies:
- is-number "^3.0.0"
- repeat-string "^1.6.1"
-
-to-regex@^3.0.1:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
- dependencies:
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- regex-not "^1.0.2"
- safe-regex "^1.1.0"
-
-tough-cookie@>=0.12.0, tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3:
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
- dependencies:
- punycode "^1.4.1"
-
-tr46@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
- dependencies:
- punycode "^2.1.0"
-
-trim-newlines@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
-
-trim-newlines@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20"
-
-trim-off-newlines@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
-
-trim-right@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
-
-tsscmp@~1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97"
-
-tty-browserify@0.0.0:
- version "0.0.0"
- resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
-
-tty-browserify@~0.0.0:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811"
-
-tunnel-agent@^0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
- dependencies:
- safe-buffer "^5.0.1"
-
-tunnel-agent@~0.4.0, tunnel-agent@~0.4.1:
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
-
-tweetnacl@^0.14.3, tweetnacl@~0.14.0:
- version "0.14.5"
- resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
-
-type-check@~0.3.2:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
- dependencies:
- prelude-ls "~1.1.2"
-
-type-detect@0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
-
-type-is@~1.6.15:
- version "1.6.16"
- resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194"
- dependencies:
- media-typer "0.3.0"
- mime-types "~2.1.18"
-
-typedarray@^0.0.6, typedarray@~0.0.5:
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
-
-typescript@^2.7.1:
- version "2.7.2"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
-
-uglify-js@^2.6, uglify-js@^2.8.29:
- version "2.8.29"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
- dependencies:
- source-map "~0.5.1"
- yargs "~3.10.0"
- optionalDependencies:
- uglify-to-browserify "~1.0.0"
-
-uglify-js@^3.0.15:
- version "3.3.13"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.13.tgz#8a1a89eeb16e2d6a66b0db2b04cb871af3c669cf"
- dependencies:
- commander "~2.14.1"
- source-map "~0.6.1"
-
-uglify-to-browserify@~1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
-
-uglifyjs-webpack-plugin@^0.4.6:
- version "0.4.6"
- resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
- dependencies:
- source-map "^0.5.6"
- uglify-js "^2.8.29"
- webpack-sources "^1.0.1"
-
-uid-number@^0.0.6:
- version "0.0.6"
- resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
-
-ultron@~1.1.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c"
-
-umd@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e"
-
-underscore.string@3.3.4:
- version "3.3.4"
- resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-3.3.4.tgz#2c2a3f9f83e64762fdc45e6ceac65142864213db"
- dependencies:
- sprintf-js "^1.0.3"
- util-deprecate "^1.0.2"
-
-underscore@~1.7.0:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209"
-
-union-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
- dependencies:
- arr-union "^3.1.0"
- get-value "^2.0.6"
- is-extendable "^0.1.1"
- set-value "^0.4.3"
-
-union@~0.4.3:
- version "0.4.6"
- resolved "https://registry.yarnpkg.com/union/-/union-0.4.6.tgz#198fbdaeba254e788b0efcb630bc11f24a2959e0"
- dependencies:
- qs "~2.3.3"
-
-unpipe@1.0.0, unpipe@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
-
-unset-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
- dependencies:
- has-value "^0.3.1"
- isobject "^3.0.0"
-
-upath@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d"
-
-urix@^0.1.0, urix@~0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
-
-url-join@^2.0.2:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/url-join/-/url-join-2.0.5.tgz#5af22f18c052a000a48d7b82c5e9c2e2feeda728"
-
-url@^0.11.0, url@~0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
- dependencies:
- punycode "1.3.2"
- querystring "0.2.0"
-
-urlgrey@0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.0.tgz#f065357040fb35c3b311d4e5dc36484d96dbea06"
- dependencies:
- tape "2.3.0"
-
-use@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8"
- dependencies:
- define-property "^0.2.5"
- isobject "^3.0.0"
- lazy-cache "^2.0.2"
-
-useragent@^2.1.12:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972"
- dependencies:
- lru-cache "4.1.x"
- tmp "0.0.x"
-
-util-deprecate@^1.0.2, util-deprecate@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
-
-util@0.10.3, util@^0.10.3, util@~0.10.1:
- version "0.10.3"
- resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
- dependencies:
- inherits "2.0.1"
-
-utils-merge@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
-
-uuid@^3.0.0, uuid@^3.1.0:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14"
-
-uws@~9.14.0:
- version "9.14.0"
- resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95"
-
-validate-npm-package-license@^3.0.1:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338"
- dependencies:
- spdx-correct "^3.0.0"
- spdx-expression-parse "^3.0.0"
-
-vargs@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff"
-
-verror@1.10.0:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
- dependencies:
- assert-plus "^1.0.0"
- core-util-is "1.0.2"
- extsprintf "^1.2.0"
-
-vlq@^0.2.1:
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"
-
-vlq@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.0.tgz#8101be90843422954c2b13eb27f2f3122bdcc806"
-
-vm-browserify@0.0.4, vm-browserify@~0.0.1:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"
- dependencies:
- indexof "0.0.1"
-
-void-elements@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
-
-w3c-hr-time@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
- dependencies:
- browser-process-hrtime "^0.1.2"
-
-walkdir@^0.0.11:
- version "0.0.11"
- resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.0.11.tgz#a16d025eb931bd03b52f308caed0f40fcebe9532"
-
-watchpack@^1.4.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed"
- dependencies:
- chokidar "^2.0.2"
- graceful-fs "^4.1.2"
- neo-async "^2.5.0"
-
-wd@^1.4.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/wd/-/wd-1.6.0.tgz#29f6de1531302a0c553478eeff16ae1e1639b472"
- dependencies:
- archiver "1.3.0"
- async "2.0.1"
- lodash "4.16.2"
- mkdirp "^0.5.1"
- q "1.4.1"
- request "2.79.0"
- underscore.string "3.3.4"
- vargs "0.1.0"
-
-webidl-conversions@^4.0.1, webidl-conversions@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
-
-webpack-dev-middleware@^1.12.0:
- version "1.12.2"
- resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz#f8fc1120ce3b4fc5680ceecb43d777966b21105e"
- dependencies:
- memory-fs "~0.4.1"
- mime "^1.5.0"
- path-is-absolute "^1.0.0"
- range-parser "^1.0.3"
- time-stamp "^2.0.0"
-
-webpack-sources@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54"
- dependencies:
- source-list-map "^2.0.0"
- source-map "~0.6.1"
-
-webpack@^3.11.0:
- version "3.11.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894"
- dependencies:
- acorn "^5.0.0"
- acorn-dynamic-import "^2.0.0"
- ajv "^6.1.0"
- ajv-keywords "^3.1.0"
- async "^2.1.2"
- enhanced-resolve "^3.4.0"
- escope "^3.6.0"
- interpret "^1.0.0"
- json-loader "^0.5.4"
- json5 "^0.5.1"
- loader-runner "^2.3.0"
- loader-utils "^1.1.0"
- memory-fs "~0.4.1"
- mkdirp "~0.5.0"
- node-libs-browser "^2.0.0"
- source-map "^0.5.3"
- supports-color "^4.2.1"
- tapable "^0.2.7"
- uglifyjs-webpack-plugin "^0.4.6"
- watchpack "^1.4.0"
- webpack-sources "^1.0.1"
- yargs "^8.0.2"
-
-weex-js-runtime@^0.23.6:
- version "0.23.7"
- resolved "https://registry.yarnpkg.com/weex-js-runtime/-/weex-js-runtime-0.23.7.tgz#c9d3427f2debf1d638ab4e41bb4f0e539a51915c"
-
-weex-styler@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/weex-styler/-/weex-styler-0.3.0.tgz#5d614c9cf6d8cec0e23231a92955b722556bfe1a"
- dependencies:
- css "~2.2.1"
-
-whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3"
- dependencies:
- iconv-lite "0.4.19"
-
-whatwg-url@^6.4.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08"
- dependencies:
- lodash.sortby "^4.7.0"
- tr46 "^1.0.0"
- webidl-conversions "^4.0.1"
-
-when@^3.7.7:
- version "3.7.8"
- resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
-
-which-module@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
-
-which@^1.1.1, which@^1.2.1, which@^1.2.10, which@^1.2.12, which@^1.2.9:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
- dependencies:
- isexe "^2.0.0"
-
-wide-align@^1.1.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710"
- dependencies:
- string-width "^1.0.2"
-
-window-size@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
-
-word-wrap@^1.0.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
-
-wordwrap@0.0.2:
- version "0.0.2"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
-
-wordwrap@^1.0.0, wordwrap@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
-
-wordwrap@~0.0.2:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
-
-wrap-ansi@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
- dependencies:
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
-
-wrappy@1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
-
-write@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
- dependencies:
- mkdirp "^0.5.1"
-
-ws@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289"
- dependencies:
- async-limiter "~1.0.0"
- safe-buffer "~5.1.0"
-
-ws@~3.3.1:
- version "3.3.3"
- resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2"
- dependencies:
- async-limiter "~1.0.0"
- safe-buffer "~5.1.0"
- ultron "~1.1.0"
-
-xml-name-validator@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
-
-xmlhttprequest-ssl@~1.5.4:
- version "1.5.5"
- resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e"
-
-xregexp@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943"
-
-xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
-
-y18n@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
-
-yallist@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
-
-yargs-parser@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
- dependencies:
- camelcase "^4.1.0"
-
-yargs@^8.0.2:
- version "8.0.2"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360"
- dependencies:
- camelcase "^4.1.0"
- cliui "^3.2.0"
- decamelize "^1.1.1"
- get-caller-file "^1.0.1"
- os-locale "^2.0.0"
- read-pkg-up "^2.0.0"
- require-directory "^2.1.1"
- require-main-filename "^1.0.1"
- set-blocking "^2.0.0"
- string-width "^2.0.0"
- which-module "^2.0.0"
- y18n "^3.2.1"
- yargs-parser "^7.0.0"
-
-yargs@~3.10.0:
- version "3.10.0"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
- dependencies:
- camelcase "^1.0.2"
- cliui "^2.1.0"
- decamelize "^1.0.0"
- window-size "0.1.0"
-
-yauzl@2.4.1:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
- dependencies:
- fd-slicer "~1.0.1"
-
-yeast@0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
-
-yorkie@^1.0.1:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/yorkie/-/yorkie-1.0.3.tgz#5c05db48c012def99c29b79685b6ba2e40c8c671"
- dependencies:
- execa "^0.8.0"
- is-ci "^1.0.10"
- normalize-path "^1.0.0"
- strip-indent "^2.0.0"
-
-zip-stream@^1.1.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04"
- dependencies:
- archiver-utils "^1.3.0"
- compress-commons "^1.2.0"
- lodash "^4.8.0"
- readable-stream "^2.0.0"
'FastRoute\\RouteCollector' => $vendorDir . '/nikic/fast-route/src/RouteCollector.php',
'FastRoute\\RouteParser' => $vendorDir . '/nikic/fast-route/src/RouteParser.php',
'FastRoute\\RouteParser\\Std' => $vendorDir . '/nikic/fast-route/src/RouteParser/Std.php',
- 'Fxp\\Composer\\AssetPlugin\\Assets' => $vendorDir . '/fxp/composer-asset-plugin/Assets.php',
- 'Fxp\\Composer\\AssetPlugin\\Composer\\ScriptHandler' => $vendorDir . '/fxp/composer-asset-plugin/Composer/ScriptHandler.php',
- 'Fxp\\Composer\\AssetPlugin\\Config\\Config' => $vendorDir . '/fxp/composer-asset-plugin/Config/Config.php',
- 'Fxp\\Composer\\AssetPlugin\\Config\\ConfigBuilder' => $vendorDir . '/fxp/composer-asset-plugin/Config/ConfigBuilder.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\AbstractPackageConverter' => $vendorDir . '/fxp/composer-asset-plugin/Converter/AbstractPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\BowerPackageConverter' => $vendorDir . '/fxp/composer-asset-plugin/Converter/BowerPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\NpmPackageConverter' => $vendorDir . '/fxp/composer-asset-plugin/Converter/NpmPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\NpmPackageUtil' => $vendorDir . '/fxp/composer-asset-plugin/Converter/NpmPackageUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\PackageConverterInterface' => $vendorDir . '/fxp/composer-asset-plugin/Converter/PackageConverterInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\PackageUtil' => $vendorDir . '/fxp/composer-asset-plugin/Converter/PackageUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverConverter' => $vendorDir . '/fxp/composer-asset-plugin/Converter/SemverConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverRangeUtil' => $vendorDir . '/fxp/composer-asset-plugin/Converter/SemverRangeUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverUtil' => $vendorDir . '/fxp/composer-asset-plugin/Converter/SemverUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\VersionConverterInterface' => $vendorDir . '/fxp/composer-asset-plugin/Converter/VersionConverterInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\ExceptionInterface' => $vendorDir . '/fxp/composer-asset-plugin/Exception/ExceptionInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\InvalidArgumentException' => $vendorDir . '/fxp/composer-asset-plugin/Exception/InvalidArgumentException.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\InvalidCreateRepositoryException' => $vendorDir . '/fxp/composer-asset-plugin/Exception/InvalidCreateRepositoryException.php',
- 'Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin' => $vendorDir . '/fxp/composer-asset-plugin/FxpAssetPlugin.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\AssetInstaller' => $vendorDir . '/fxp/composer-asset-plugin/Installer/AssetInstaller.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\BowerInstaller' => $vendorDir . '/fxp/composer-asset-plugin/Installer/BowerInstaller.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\IgnoreFactory' => $vendorDir . '/fxp/composer-asset-plugin/Installer/IgnoreFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\IgnoreManager' => $vendorDir . '/fxp/composer-asset-plugin/Installer/IgnoreManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\AbstractLazyCompletePackage' => $vendorDir . '/fxp/composer-asset-plugin/Package/AbstractLazyCompletePackage.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\LazyCompletePackage' => $vendorDir . '/fxp/composer-asset-plugin/Package/LazyCompletePackage.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\LazyPackageInterface' => $vendorDir . '/fxp/composer-asset-plugin/Package/LazyPackageInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Loader\\LazyAssetPackageLoader' => $vendorDir . '/fxp/composer-asset-plugin/Package/Loader/LazyAssetPackageLoader.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Loader\\LazyLoaderInterface' => $vendorDir . '/fxp/composer-asset-plugin/Package/Loader/LazyLoaderInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Version\\VersionParser' => $vendorDir . '/fxp/composer-asset-plugin/Package/Version/VersionParser.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AbstractAssetVcsRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/AbstractAssetVcsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AbstractAssetsRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/AbstractAssetsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AssetRepositoryManager' => $vendorDir . '/fxp/composer-asset-plugin/Repository/AssetRepositoryManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AssetVcsRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerPrivateRegistryFactory' => $vendorDir . '/fxp/composer-asset-plugin/Repository/BowerPrivateRegistryFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerPrivateRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/BowerPrivateRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/BowerRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\DefaultRegistryFactory' => $vendorDir . '/fxp/composer-asset-plugin/Repository/DefaultRegistryFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\FilterUtil' => $vendorDir . '/fxp/composer-asset-plugin/Repository/FilterUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\NpmRepository' => $vendorDir . '/fxp/composer-asset-plugin/Repository/NpmRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\RegistryFactoryInterface' => $vendorDir . '/fxp/composer-asset-plugin/Repository/RegistryFactoryInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\ResolutionManager' => $vendorDir . '/fxp/composer-asset-plugin/Repository/ResolutionManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Util' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Util.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\VcsPackageFilter' => $vendorDir . '/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\AbstractGitHubDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/AbstractGitHubDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\BitbucketUtil' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/BitbucketUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitBitbucketDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/GitBitbucketDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/GitDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitHubDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/GitHubDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\HgBitbucketDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/HgBitbucketDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\HgDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/HgDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\PerforceDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/PerforceDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\ProcessUtil' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/ProcessUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\SvnDriver' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/SvnDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\Util' => $vendorDir . '/fxp/composer-asset-plugin/Repository/Vcs/Util.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\AbstractAssetType' => $vendorDir . '/fxp/composer-asset-plugin/Type/AbstractAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\AssetTypeInterface' => $vendorDir . '/fxp/composer-asset-plugin/Type/AssetTypeInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\BowerAssetType' => $vendorDir . '/fxp/composer-asset-plugin/Type/BowerAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\NpmAssetType' => $vendorDir . '/fxp/composer-asset-plugin/Type/NpmAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\AssetPlugin' => $vendorDir . '/fxp/composer-asset-plugin/Util/AssetPlugin.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\Perforce' => $vendorDir . '/fxp/composer-asset-plugin/Util/Perforce.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\Validator' => $vendorDir . '/fxp/composer-asset-plugin/Util/Validator.php',
'Interop\\Container\\ContainerInterface' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
- 'Fxp\\Composer\\AssetPlugin\\' => array($vendorDir . '/fxp/composer-asset-plugin'),
'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'),
);
),
'F' =>
array (
- 'Fxp\\Composer\\AssetPlugin\\' => 25,
'FastRoute\\' => 10,
),
);
array (
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
),
- 'Fxp\\Composer\\AssetPlugin\\' =>
- array (
- 0 => __DIR__ . '/..' . '/fxp/composer-asset-plugin',
- ),
'FastRoute\\' =>
array (
0 => __DIR__ . '/..' . '/nikic/fast-route/src',
'FastRoute\\RouteCollector' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteCollector.php',
'FastRoute\\RouteParser' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteParser.php',
'FastRoute\\RouteParser\\Std' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteParser/Std.php',
- 'Fxp\\Composer\\AssetPlugin\\Assets' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Assets.php',
- 'Fxp\\Composer\\AssetPlugin\\Composer\\ScriptHandler' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Composer/ScriptHandler.php',
- 'Fxp\\Composer\\AssetPlugin\\Config\\Config' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Config/Config.php',
- 'Fxp\\Composer\\AssetPlugin\\Config\\ConfigBuilder' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Config/ConfigBuilder.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\AbstractPackageConverter' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/AbstractPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\BowerPackageConverter' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/BowerPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\NpmPackageConverter' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/NpmPackageConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\NpmPackageUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/NpmPackageUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\PackageConverterInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/PackageConverterInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\PackageUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/PackageUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverConverter' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/SemverConverter.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverRangeUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/SemverRangeUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\SemverUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/SemverUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Converter\\VersionConverterInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Converter/VersionConverterInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Exception/ExceptionInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Exception/InvalidArgumentException.php',
- 'Fxp\\Composer\\AssetPlugin\\Exception\\InvalidCreateRepositoryException' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Exception/InvalidCreateRepositoryException.php',
- 'Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/FxpAssetPlugin.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\AssetInstaller' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Installer/AssetInstaller.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\BowerInstaller' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Installer/BowerInstaller.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\IgnoreFactory' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Installer/IgnoreFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Installer\\IgnoreManager' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Installer/IgnoreManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\AbstractLazyCompletePackage' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/AbstractLazyCompletePackage.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\LazyCompletePackage' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/LazyCompletePackage.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\LazyPackageInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/LazyPackageInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Loader\\LazyAssetPackageLoader' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/Loader/LazyAssetPackageLoader.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Loader\\LazyLoaderInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/Loader/LazyLoaderInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Package\\Version\\VersionParser' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Package/Version/VersionParser.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AbstractAssetVcsRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/AbstractAssetVcsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AbstractAssetsRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/AbstractAssetsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AssetRepositoryManager' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/AssetRepositoryManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\AssetVcsRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/AssetVcsRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerPrivateRegistryFactory' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/BowerPrivateRegistryFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerPrivateRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/BowerPrivateRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\BowerRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/BowerRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\DefaultRegistryFactory' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/DefaultRegistryFactory.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\FilterUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/FilterUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\NpmRepository' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/NpmRepository.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\RegistryFactoryInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/RegistryFactoryInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\ResolutionManager' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/ResolutionManager.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Util' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Util.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\VcsPackageFilter' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\AbstractGitHubDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/AbstractGitHubDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\BitbucketUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/BitbucketUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitBitbucketDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/GitBitbucketDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/GitDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\GitHubDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/GitHubDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\HgBitbucketDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/HgBitbucketDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\HgDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/HgDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\PerforceDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/PerforceDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\ProcessUtil' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/ProcessUtil.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\SvnDriver' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/SvnDriver.php',
- 'Fxp\\Composer\\AssetPlugin\\Repository\\Vcs\\Util' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Repository/Vcs/Util.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\AbstractAssetType' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Type/AbstractAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\AssetTypeInterface' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Type/AssetTypeInterface.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\BowerAssetType' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Type/BowerAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Type\\NpmAssetType' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Type/NpmAssetType.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\AssetPlugin' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Util/AssetPlugin.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\Perforce' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Util/Perforce.php',
- 'Fxp\\Composer\\AssetPlugin\\Util\\Validator' => __DIR__ . '/..' . '/fxp/composer-asset-plugin/Util/Validator.php',
'Interop\\Container\\ContainerInterface' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
[
- {
- "name": "bower-asset/vue",
- "version": "v2.5.16",
- "version_normalized": "2.5.16.0",
- "source": {
- "type": "git",
- "url": "https://github.com/vuejs/vue.git",
- "reference": "25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/vuejs/vue/zipball/25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6",
- "reference": "25342194016dc3bcc81cb3e8e229b0fb7ba1d1d6",
- "shasum": ""
- },
- "type": "bower-asset-library",
- "installation-source": "dist"
- },
- {
- "name": "bower-asset/vue-resource",
- "version": "1.5.0",
- "version_normalized": "1.5.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/pagekit/vue-resource.git",
- "reference": "9a34f881f56f64b923572541d1753cb6cdd63d40"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/pagekit/vue-resource/zipball/9a34f881f56f64b923572541d1753cb6cdd63d40",
- "reference": "9a34f881f56f64b923572541d1753cb6cdd63d40",
- "shasum": ""
- },
- "time": "2018-03-03T07:42:38+00:00",
- "type": "bower-asset-library",
- "extra": {
- "bower-asset-main": "dist/vue-resource.js",
- "bower-asset-ignore": [
- ".*",
- "build",
- "docs",
- "package.json"
- ]
- },
- "installation-source": "dist",
- "license": [
- "MIT"
- ],
- "description": "The HTTP client for Vue.js",
- "keywords": [
- "ajax",
- "http",
- "vue",
- "xhr"
- ]
- },
{
"name": "container-interop/container-interop",
"version": "1.2.0",
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
"homepage": "https://github.com/container-interop/container-interop"
},
- {
- "name": "fxp/composer-asset-plugin",
- "version": "v1.4.2",
- "version_normalized": "1.4.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fxpio/composer-asset-plugin.git",
- "reference": "61352d99940d2b2392a5d2db83b8c0ef5faf222a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fxpio/composer-asset-plugin/zipball/61352d99940d2b2392a5d2db83b8c0ef5faf222a",
- "reference": "61352d99940d2b2392a5d2db83b8c0ef5faf222a",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^1.0",
- "php": ">=5.3.3"
- },
- "require-dev": {
- "composer/composer": "^1.4.0"
- },
- "time": "2017-10-20T06:53:56+00:00",
- "type": "composer-plugin",
- "extra": {
- "class": "Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin",
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Fxp\\Composer\\AssetPlugin\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "François Pluchino",
- "email": "francois.pluchino@gmail.com"
- }
- ],
- "description": "NPM/Bower Dependency Manager for Composer",
- "homepage": "https://github.com/fxpio/composer-asset-plugin",
- "keywords": [
- "asset",
- "bower",
- "composer",
- "dependency manager",
- "nodejs",
- "npm",
- "package"
- ]
- },
{
"name": "nikic/fast-route",
"version": "v1.3.0",
+++ /dev/null
-vendor/
-phpunit.xml
-.php_cs.cache
+++ /dev/null
-<?php
-
-return PhpCsFixer\Config::create()
- ->setRules(array(
- '@Symfony' => true,
- '@Symfony:risky' => true,
- 'array_syntax' => array('syntax' => 'long'),
- ))
- ->setRiskyAllowed(true)
- ->setFinder(
- PhpCsFixer\Finder::create()
- ->in(__DIR__)
- )
-;
+++ /dev/null
-tools:
- external_code_coverage: false
- php_code_sniffer: true
- php_sim: true
- php_changetracking: true
- php_cs_fixer: true
- php_mess_detector: true
- php_pdepend: true
- php_analyzer: true
- sensiolabs_security_checker: true
-filter:
- excluded_paths:
- - Tests/*
+++ /dev/null
-language: php
-
-sudo: false
-
-cache:
- directories:
- - $HOME/.composer/cache/files
-
-matrix:
- include:
- - php: 5.5
- env: COMPOSER_VERSION=""
- - php: 5.6
- env: COMPOSER_VERSION=""
- - php: 7.0
- env: COMPOSER_VERSION=""
- - php: 7.1
- env: COMPOSER_VERSION=""
- - php: nightly
- env: COMPOSER_VERSION=""
-
- allow_failures:
- - php: nightly
-
- fast_finish: true
-
-before_script:
- - composer self-update
- - composer global require --prefer-source phpunit/phpunit:"^4.8 || ^5.7.0" satooshi/php-coveralls:^1.0.0
- - if [ "$COMPOSER_VERSION" == "" ]; then composer install --prefer-source; fi;
- - if [ "$COMPOSER_VERSION" != "" ]; then composer require "composer/composer:${COMPOSER_VERSION}" --no-update; fi;
- - if [ "$COMPOSER_VERSION" != "" ]; then composer update "composer/composer" --prefer-source; fi;
- - mkdir -p ./build/logs
-
-script:
- - ~/.composer/vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml
-
-after_script:
- - 'echo ''coverage_clover: build/logs/clover.xml'' >> ./.coveralls.yml'
- - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ~/.composer/vendor/bin/coveralls -v; fi;'
-
-notifications:
- email: false
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin;
-
-use Fxp\Composer\AssetPlugin\Exception\InvalidArgumentException;
-use Fxp\Composer\AssetPlugin\Type\AssetTypeInterface;
-
-/**
- * Assets definition.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class Assets
-{
- /**
- * @var array
- */
- protected static $typeClasses = array(
- 'npm' => 'Fxp\Composer\AssetPlugin\Type\NpmAssetType',
- 'bower' => 'Fxp\Composer\AssetPlugin\Type\BowerAssetType',
- );
-
- /**
- * @var array
- */
- protected static $registryFactoryClasses = array(
- 'default' => 'Fxp\Composer\AssetPlugin\Repository\DefaultRegistryFactory',
- 'bower-private' => 'Fxp\Composer\AssetPlugin\Repository\BowerPrivateRegistryFactory',
- );
-
- /**
- * @var array
- */
- protected static $defaultRegistryClasses = array(
- 'npm' => 'Fxp\Composer\AssetPlugin\Repository\NpmRepository',
- 'bower' => 'Fxp\Composer\AssetPlugin\Repository\BowerRepository',
- );
-
- /**
- * @var array
- */
- protected static $vcsRepositoryDrivers = array(
- 'vcs' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'github' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'git-bitbucket' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'git' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'hg-bitbucket' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'hg' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'perforce' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- 'svn' => 'Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository',
- );
-
- /**
- * @var array
- */
- protected static $vcsDrivers = array(
- 'github' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitHubDriver',
- 'git-bitbucket' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitBitbucketDriver',
- 'git' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitDriver',
- 'hg-bitbucket' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\HgBitbucketDriver',
- 'hg' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\HgDriver',
- 'perforce' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\PerforceDriver',
- // svn must be last because identifying a subversion server for sure is practically impossible
- 'svn' => 'Fxp\Composer\AssetPlugin\Repository\Vcs\SvnDriver',
- );
-
- /**
- * Creates asset type.
- *
- * @param string $type
- *
- * @return AssetTypeInterface
- *
- * @throws InvalidArgumentException When the asset type does not exist
- */
- public static function createType($type)
- {
- if (!isset(static::$typeClasses[$type])) {
- throw new InvalidArgumentException('The asset type "'.$type.'" does not exist, only "'.implode('", "', static::getTypes()).'" are accepted');
- }
-
- $class = static::$typeClasses[$type];
-
- return new $class();
- }
-
- /**
- * Gets the asset types.
- *
- * @return array
- */
- public static function getTypes()
- {
- return array_keys(static::$typeClasses);
- }
-
- /**
- * Gets the asset registry repository factories.
- *
- * @return array
- */
- public static function getRegistryFactories()
- {
- return static::$registryFactoryClasses;
- }
-
- /**
- * Gets the asset registry repositories.
- *
- * @return array
- */
- public static function getDefaultRegistries()
- {
- return static::$defaultRegistryClasses;
- }
-
- /**
- * Gets the asset vcs repository drivers.
- *
- * @return array
- */
- public static function getVcsRepositoryDrivers()
- {
- return static::$vcsRepositoryDrivers;
- }
-
- /**
- * Gets the asset vcs drivers.
- *
- * @return array
- */
- public static function getVcsDrivers()
- {
- return static::$vcsDrivers;
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin;
-
-use Composer\Composer;
-use Composer\EventDispatcher\EventSubscriberInterface;
-use Composer\Installer\InstallerEvent;
-use Composer\Installer\InstallerEvents;
-use Composer\IO\IOInterface;
-use Composer\Plugin\CommandEvent;
-use Composer\Plugin\PluginEvents;
-use Composer\Plugin\PluginInterface;
-use Composer\Repository\InstalledFilesystemRepository;
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Config\ConfigBuilder;
-use Fxp\Composer\AssetPlugin\Repository\AssetRepositoryManager;
-use Fxp\Composer\AssetPlugin\Repository\ResolutionManager;
-use Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter;
-use Fxp\Composer\AssetPlugin\Util\AssetPlugin;
-
-/**
- * Composer plugin.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class FxpAssetPlugin implements PluginInterface, EventSubscriberInterface
-{
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var Composer
- */
- protected $composer;
-
- /**
- * @var IOInterface
- */
- protected $io;
-
- /**
- * @var VcsPackageFilter
- */
- protected $packageFilter;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents()
- {
- return array(
- PluginEvents::COMMAND => array(
- array('onPluginCommand', 0),
- ),
- InstallerEvents::PRE_DEPENDENCIES_SOLVING => array(
- array('onPreDependenciesSolving', 0),
- ),
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function activate(Composer $composer, IOInterface $io)
- {
- $this->config = ConfigBuilder::build($composer, $io);
-
- if ($this->config->get('enabled', true)) {
- /* @var InstalledFilesystemRepository $installedRepository */
- $installedRepository = $composer->getRepositoryManager()->getLocalRepository();
- $this->composer = $composer;
- $this->io = $io;
- $this->packageFilter = new VcsPackageFilter($this->config, $composer->getPackage(), $composer->getInstallationManager(), $installedRepository);
- $this->assetRepositoryManager = new AssetRepositoryManager($io, $composer->getRepositoryManager(), $this->config, $this->packageFilter);
- $this->assetRepositoryManager->setResolutionManager(new ResolutionManager($this->config->getArray('resolutions')));
-
- AssetPlugin::addRegistryRepositories($this->assetRepositoryManager, $this->packageFilter, $this->config);
- AssetPlugin::setVcsTypeRepositories($composer->getRepositoryManager());
-
- $this->assetRepositoryManager->addRepositories($this->config->getArray('repositories'));
-
- AssetPlugin::addInstallers($this->config, $composer, $io);
- }
- }
-
- /**
- * Disable the package filter for all command, but for install and update command.
- *
- * @param CommandEvent $event
- */
- public function onPluginCommand(CommandEvent $event)
- {
- if ($this->config->get('enabled', true)) {
- ConfigBuilder::validate($this->io, $this->composer->getPackage(), $event->getCommandName());
-
- if (!in_array($event->getCommandName(), array('install', 'update'))) {
- $this->packageFilter->setEnabled(false);
- }
- }
- }
-
- /**
- * Add pool in asset repository manager.
- *
- * @param InstallerEvent $event
- */
- public function onPreDependenciesSolving(InstallerEvent $event)
- {
- if ($this->config->get('enabled', true)) {
- $this->assetRepositoryManager->setPool($event->getPool());
- }
- }
-
- /**
- * Get the plugin config.
- *
- * @return Config
- */
- public function getConfig()
- {
- return $this->config;
- }
-}
+++ /dev/null
-Copyright (c) 2014-2017 François Pluchino
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Package;
-
-use Composer\Package\CompletePackage;
-use Fxp\Composer\AssetPlugin\Package\Loader\LazyLoaderInterface;
-
-/**
- * Abstract class for the lazy loading complete package.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-abstract class AbstractLazyCompletePackage extends CompletePackage implements LazyPackageInterface
-{
- /**
- * @var LazyLoaderInterface
- */
- protected $lazyLoader;
-
- /**
- * {@inheritdoc}
- */
- public function getAutoload()
- {
- $this->initialize();
-
- return parent::getAutoload();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDevAutoload()
- {
- $this->initialize();
-
- return parent::getDevAutoload();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIncludePaths()
- {
- $this->initialize();
-
- return parent::getIncludePaths();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getNotificationUrl()
- {
- $this->initialize();
-
- return parent::getNotificationUrl();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getArchiveExcludes()
- {
- $this->initialize();
-
- return parent::getArchiveExcludes();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getScripts()
- {
- $this->initialize();
-
- return parent::getScripts();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRepositories()
- {
- $this->initialize();
-
- return parent::getRepositories();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getLicense()
- {
- $this->initialize();
-
- return parent::getLicense();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getKeywords()
- {
- $this->initialize();
-
- return parent::getKeywords();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAuthors()
- {
- $this->initialize();
-
- return parent::getAuthors();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription()
- {
- $this->initialize();
-
- return parent::getDescription();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getHomepage()
- {
- $this->initialize();
-
- return parent::getHomepage();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSupport()
- {
- $this->initialize();
-
- return parent::getSupport();
- }
-
- /**
- * {@inheritdoc}
- */
- public function setLoader(LazyLoaderInterface $lazyLoader)
- {
- $this->lazyLoader = $lazyLoader;
- }
-
- /**
- * Initialize the package.
- */
- protected function initialize()
- {
- if (!$this->lazyLoader) {
- return;
- }
-
- $real = $this->lazyLoader->load($this);
- $this->lazyLoader = null;
-
- if (false === $real) {
- $this->version = '-9999999.9999999.9999999.9999999';
-
- return;
- }
-
- $this->type = $real->getType();
- $this->transportOptions = $real->getTransportOptions();
- $this->targetDir = $real->getTargetDir();
- $this->extra = $real->getExtra();
- $this->binaries = $real->getBinaries();
- $this->installationSource = $real->getInstallationSource();
- $this->sourceType = $real->getSourceType();
- $this->sourceUrl = $real->getSourceUrl();
- $this->sourceReference = $real->getSourceReference();
- $this->sourceMirrors = $real->getSourceMirrors();
- $this->distType = $real->getDistType();
- $this->distUrl = $real->getDistUrl();
- $this->distReference = $real->getDistReference();
- $this->distSha1Checksum = $real->getDistSha1Checksum();
- $this->distMirrors = $real->getDistMirrors();
- $this->releaseDate = $real->getReleaseDate();
- $this->requires = $real->getRequires();
- $this->conflicts = $real->getConflicts();
- $this->provides = $real->getProvides();
- $this->replaces = $real->getReplaces();
- $this->devRequires = $real->getDevRequires();
- $this->suggests = $real->getSuggests();
- $this->autoload = $real->getAutoload();
- $this->devAutoload = $real->getDevAutoload();
- $this->includePaths = $real->getIncludePaths();
- $this->notificationUrl = $real->getNotificationUrl();
- $this->archiveExcludes = $real->getArchiveExcludes();
- $this->scripts = $real->getScripts();
- $this->repositories = $real->getRepositories();
- $this->license = $real->getLicense();
- $this->keywords = $real->getKeywords();
- $this->authors = $real->getAuthors();
- $this->description = $real->getDescription();
- $this->homepage = $real->getHomepage();
- $this->support = $real->getSupport();
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Package;
-
-/**
- * The lazy loading complete package.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class LazyCompletePackage extends AbstractLazyCompletePackage implements LazyPackageInterface
-{
- /**
- * {@inheritdoc}
- */
- public function getTransportOptions()
- {
- $this->initialize();
-
- return parent::getTransportOptions();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTargetDir()
- {
- $this->initialize();
-
- return parent::getTargetDir();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getExtra()
- {
- $this->initialize();
-
- return parent::getExtra();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getBinaries()
- {
- $this->initialize();
-
- return parent::getBinaries();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getInstallationSource()
- {
- $this->initialize();
-
- return parent::getInstallationSource();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceType()
- {
- $this->initialize();
-
- return parent::getSourceType();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceUrl()
- {
- $this->initialize();
-
- return parent::getSourceUrl();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceReference()
- {
- $this->initialize();
-
- return parent::getSourceReference();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceMirrors()
- {
- $this->initialize();
-
- return parent::getSourceMirrors();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceUrls()
- {
- $this->initialize();
-
- return parent::getSourceUrls();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistType()
- {
- $this->initialize();
-
- return parent::getDistType();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistUrl()
- {
- $this->initialize();
-
- return parent::getDistUrl();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistReference()
- {
- $this->initialize();
-
- return parent::getDistReference();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistSha1Checksum()
- {
- $this->initialize();
-
- return parent::getDistSha1Checksum();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistMirrors()
- {
- $this->initialize();
-
- return parent::getDistMirrors();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDistUrls()
- {
- $this->initialize();
-
- return parent::getDistUrls();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getReleaseDate()
- {
- $this->initialize();
-
- return parent::getReleaseDate();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRequires()
- {
- $this->initialize();
-
- return parent::getRequires();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConflicts()
- {
- $this->initialize();
-
- return parent::getConflicts();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDevRequires()
- {
- $this->initialize();
-
- return parent::getDevRequires();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSuggests()
- {
- $this->initialize();
-
- return parent::getSuggests();
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Package;
-
-use Composer\Package\CompletePackageInterface;
-use Fxp\Composer\AssetPlugin\Package\Loader\LazyLoaderInterface;
-
-/**
- * Interface for lazy loading package.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-interface LazyPackageInterface extends CompletePackageInterface
-{
- /**
- * Sets the lazy loader.
- *
- * @param LazyLoaderInterface $lazyLoader
- */
- public function setLoader(LazyLoaderInterface $lazyLoader);
-}
+++ /dev/null
-NPM/Bower Dependency Manager for Composer
-=========================================
-
-[![Latest Version](https://img.shields.io/packagist/v/fxp/composer-asset-plugin.svg)](https://packagist.org/packages/fxp/composer-asset-plugin)
-[![Build Status](https://img.shields.io/travis/fxpio/composer-asset-plugin/master.svg)](https://travis-ci.org/fxpio/composer-asset-plugin)
-[![Coverage Status](https://img.shields.io/coveralls/fxpio/composer-asset-plugin/master.svg)](https://coveralls.io/r/fxpio/composer-asset-plugin?branch=master)
-[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/fxpio/composer-asset-plugin.svg)](https://scrutinizer-ci.com/g/fxpio/composer-asset-plugin?branch=master)
-[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/0d67ca33-5a72-46b8-b109-cfbf95673fce.svg)](https://insight.sensiolabs.com/projects/0d67ca33-5a72-46b8-b109-cfbf95673fce)
-[![Packagist Downloads](https://img.shields.io/packagist/dt/fxp/composer-asset-plugin.svg)](https://packagist.org/packages/fxp/composer-asset-plugin/stats)
-
-The Composer Asset Plugin allows you to manage project assets (css, js, etc.) in your `composer.json`
-without installing NPM or Bower.
-
-This plugin works by transposing package information from NPM or Bower to a compatible version for Composer.
-This allows you to manage asset dependencies in a PHP based project very easily.
-
-
-##### Features include:
-
-- Works with native management system versions of VCS repository of composer
-- Works with public and private VCS repositories
-- Lazy loader of asset package definitions to improve performance
-- Import filter with the dependencies of the root package and the installed packages, for increased dramatically the performance for the update
-- Automatically get and create an Asset VCS repository defined in:
- - [NPM Registry](https://www.npmjs.org)
- - [Bower Registry](http://bower.io/search)
- - [Private Bower Registry](https://github.com/Hacklone/private-bower)
-- Automatically get and create the Asset VCS repositories of dependencies defined
- in each asset package (dev dependencies included)
-- Mapping conversion of asset package to composer package for:
- - [NPM Package](https://www.npmjs.org/doc/package.json.html) - [package.json](Resources/doc/schema.md#npm-mapping)
- - [Bower Package](http://bower.io/docs/creating-packages) - [bower.json](Resources/doc/schema.md#bower-mapping)
-- Conversion of [Semver version](Resources/doc/schema.md#verison-conversion) to the composer version
-- Conversion of [Semver range version](Resources/doc/schema.md#range-verison-conversion) to the composer range version
-- Conversion of [dependencies with URL](Resources/doc/schema.md#url-range-verison-conversion) to the composer dependencies with the creation of VCS repositories
-- Conversion of [multiple versions of the same dependency](Resources/doc/schema.md#multiple-version-of-depdendency-in-the-same-project) to different dependencies of composer
-- Add manually the [multiple versions of a same dependency in the project](Resources/doc/index.md#usage-with-multiple-version-of-a-same-dependency)
-- Add a [custom config of VCS Repository](Resources/doc/index.md#usage-with-vcs-repository)
-- Override the [config of VCS Repository](Resources/doc/index.md#overriding-the-config-of-a-vcs-repository) defined by the asset registry directly in config section of root composer
-- VCS drivers for:
- - [Git](Resources/doc/index.md#usage-with-vcs-repository)
- - [GitHub](Resources/doc/index.md#usage-with-vcs-repository) (compatible with repository redirects)
- - [Git Bitbucket](Resources/doc/index.md#usage-with-vcs-repository)
- - [Mercurial](Resources/doc/index.md#usage-with-vcs-repository)
- - [Mercurial Bitbucket](Resources/doc/index.md#usage-with-vcs-repository)
- - [SVN](Resources/doc/index.md#usage-with-vcs-repository)
- - [Perforce](Resources/doc/index.md#usage-with-vcs-repository)
-- Local cache system for:
- - package versions
- - package contents
- - repository redirects
-- Custom asset installers configurable in the root file `composer.json`
-- For Bower, all files defined in the section `ignore` will not be installed
-- Disable or replace the deleting of the ignore files for Bower
-- Enable manually the deleting of the ignore files for NPM
-- Use the Ignore Files Manager in the Composer scripts
-- Configure the plugin per project, globally or with the environment variables
-- Compatible with all commands, including:
- - `depends`
- - `diagnose`
- - `licenses`
- - `remove`
- - `require`
- - `search` (bower only)
- - `show`
- - `status`
-
-##### Why this plugin?
-
-There already are several possibilities for managing assets in a PHP project:
-
-1. Install Node.js and use NPM or Bower command line in addition to Composer command line
-2. Do #1, but add Composer scripts to automate the process
-3. Include assets directly in the project (not recommended)
-4. Create a repository with all assets and include the `composer.json` file (and use Packagist or an VCS Repository)
-5. Add a package repository in `composer.json` with a direct download link
-6. Create a Satis or Packagist server
-7. Other?
-
-It goes without saying that each javascript, CSS, etc. library should be developed with the usual tools for that
-language, which front-end developers know well. However, in the case of a complete project in PHP, it shouldn't
-be necessary to use several tools (PHP, Nodejs, Composer, NPM, Bower, Grunt, etc.) to simply install
-these assets in your project.
-
-This plugin has been created to address these issues. Additionally, most developers will not add a `composer.json`
-file to their projects just to support php based projects, especially when npm and/or bower already exist and are
-widely used.
-
-Documentation
--------------
-
-The bulk of the documentation is located in `Resources/doc/index.md`:
-
-[Read the Documentation](Resources/doc/index.md)
-
-[Read the FAQs](Resources/doc/faqs.md)
-
-[Read the Release Notes](https://github.com/fxpio/composer-asset-plugin/releases)
-
-Installation
-------------
-
-All the installation instructions are located in [documentation](Resources/doc/index.md).
-
-License
--------
-
-This composer plugin is under the MIT license. See the complete license in:
-
-[LICENSE](LICENSE)
-
-About
------
-
-Fxp Composer Asset Plugin is a [François Pluchino](https://github.com/francoispluchino) initiative.
-See also the list of [contributors](https://github.com/fxpio/composer-asset-plugin/contributors).
-
-Reporting an issue or a feature request
----------------------------------------
-
-Issues and feature requests are tracked in the [Github issue tracker](https://github.com/fxpio/composer-asset-plugin/issues).
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Composer\Package\AliasPackage;
-use Composer\Package\Loader\ArrayLoader;
-use Composer\Package\Loader\LoaderInterface;
-use Composer\Package\Package;
-use Composer\Package\PackageInterface;
-use Composer\Repository\Vcs\VcsDriverInterface;
-use Composer\Repository\VcsRepository;
-use Fxp\Composer\AssetPlugin\Assets;
-use Fxp\Composer\AssetPlugin\Converter\SemverConverter;
-use Fxp\Composer\AssetPlugin\Exception\InvalidArgumentException;
-use Fxp\Composer\AssetPlugin\Package\Loader\LazyAssetPackageLoader;
-use Fxp\Composer\AssetPlugin\Package\Version\VersionParser;
-use Fxp\Composer\AssetPlugin\Type\AssetTypeInterface;
-
-/**
- * Abstract class for Asset VCS repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-abstract class AbstractAssetVcsRepository extends VcsRepository
-{
- /**
- * @var AssetTypeInterface
- */
- protected $assetType;
-
- /**
- * @var VersionParser
- */
- protected $versionParser;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- /**
- * @var LoaderInterface
- */
- protected $loader;
-
- /**
- * @var string
- */
- protected $rootPackageVersion;
-
- /**
- * @var array|null
- */
- protected $rootData;
-
- /**
- * @var VcsPackageFilter|null
- */
- protected $filter;
-
- /**
- * Constructor.
- *
- * @param array $repoConfig
- * @param IOInterface $io
- * @param Config $config
- * @param EventDispatcher $dispatcher
- * @param array $drivers
- */
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
- {
- $drivers = $drivers ?: Assets::getVcsDrivers();
- $assetType = substr($repoConfig['type'], 0, strpos($repoConfig['type'], '-'));
- $assetType = Assets::createType($assetType);
- $repoConfig['asset-type'] = $assetType->getName();
- $repoConfig['package-name'] = $assetType->formatComposerName($repoConfig['name']);
- $repoConfig['filename'] = $assetType->getFilename();
- $this->assetType = $assetType;
- $this->assetRepositoryManager = isset($repoConfig['asset-repository-manager'])
- && $repoConfig['asset-repository-manager'] instanceof AssetRepositoryManager
- ? $repoConfig['asset-repository-manager']
- : null;
- $this->filter = isset($repoConfig['vcs-package-filter'])
- && $repoConfig['vcs-package-filter'] instanceof VcsPackageFilter
- ? $repoConfig['vcs-package-filter']
- : null;
-
- parent::__construct($repoConfig, $io, $config, $dispatcher, $drivers);
- }
-
- /**
- * Gets the package name of this repository.
- *
- * @return string
- */
- public function getComposerPackageName()
- {
- if (null === $this->packages) {
- $this->initialize();
- }
-
- return $this->assetType->formatComposerName($this->packageName);
- }
-
- /**
- * Initializes the driver.
- *
- * @return VcsDriverInterface
- *
- * @throws InvalidArgumentException When not driver found
- */
- protected function initDriver()
- {
- $driver = $this->getDriver();
- if (!$driver) {
- throw new InvalidArgumentException('No driver found to handle Asset VCS repository '.$this->url);
- }
-
- return $driver;
- }
-
- /**
- * Initializes the version parser and loader.
- */
- protected function initLoader()
- {
- $this->versionParser = new VersionParser();
-
- if (!$this->loader) {
- $this->loader = new ArrayLoader($this->versionParser);
- }
- }
-
- /**
- * Initializes the root identifier.
- *
- * @param VcsDriverInterface $driver
- */
- protected function initRootIdentifier(VcsDriverInterface $driver)
- {
- try {
- if ($driver->hasComposerFile($driver->getRootIdentifier())) {
- $data = $driver->getComposerInformation($driver->getRootIdentifier());
- $sc = new SemverConverter();
- $this->rootPackageVersion = !empty($data['version'])
- ? $sc->convertVersion(ltrim($data['version'], '^~')) : null;
- $this->rootData = $data;
-
- if (null === $this->packageName) {
- $this->packageName = !empty($data['name']) ? $data['name'] : null;
- }
- }
- } catch (\Exception $e) {
- if ($this->verbose) {
- $this->io->write('<error>Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage().'</error>');
- }
- }
- }
-
- /**
- * Creates the package name with the composer prefix and the asset package name,
- * or only with the URL.
- *
- * @return string The package name
- */
- protected function createPackageName()
- {
- if (null === $this->packageName) {
- return $this->url;
- }
-
- return sprintf('%s/%s', $this->assetType->getComposerVendorName(), $this->packageName);
- }
-
- /**
- * Creates the mock of package config.
- *
- * @param string $name The package name
- * @param string $version The version
- *
- * @return array The package config
- */
- protected function createMockOfPackageConfig($name, $version)
- {
- return array(
- 'name' => $name,
- 'version' => $version,
- 'type' => $this->assetType->getComposerType(),
- );
- }
-
- /**
- * Creates the lazy loader of package.
- *
- * @param string $type
- * @param string $identifier
- * @param array $packageData
- * @param VcsDriverInterface $driver
- *
- * @return LazyAssetPackageLoader
- */
- protected function createLazyLoader($type, $identifier, array $packageData, VcsDriverInterface $driver)
- {
- $lazyLoader = new LazyAssetPackageLoader($type, $identifier, $packageData);
- $lazyLoader->setAssetType($this->assetType);
- $lazyLoader->setLoader($this->loader);
- $lazyLoader->setDriver(clone $driver);
- $lazyLoader->setIO($this->io);
- $lazyLoader->setAssetRepositoryManager($this->assetRepositoryManager);
-
- return $lazyLoader;
- }
-
- /**
- * Pre process the data of package before the conversion to Package instance.
- *
- * @param array $data
- *
- * @return array
- */
- protected function preProcessAsset(array $data)
- {
- $vcsRepos = array();
-
- // keep the name of the main identifier for all packages
- $data['name'] = $this->packageName ?: $data['name'];
- $data = (array) $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
- $this->assetRepositoryManager->addRepositories($vcsRepos);
-
- return $this->assetRepositoryManager->solveResolutions($data);
- }
-
- /**
- * Override the branch alias extra config of the current package.
- *
- * @param PackageInterface $package The current package
- * @param string $aliasNormalized The alias version normalizes
- * @param string $branch The branch name
- *
- * @return PackageInterface
- */
- protected function overrideBranchAliasConfig(PackageInterface $package, $aliasNormalized, $branch)
- {
- if ($package instanceof Package && false === strpos('dev-', $aliasNormalized)) {
- $extra = $package->getExtra();
- $extra['branch-alias'] = array(
- 'dev-'.$branch => $this->rootPackageVersion.'-dev',
- );
- $this->injectExtraConfig($package, $extra);
- }
-
- return $package;
- }
-
- /**
- * Add the alias packages.
- *
- * @param PackageInterface $package The current package
- * @param string $aliasNormalized The alias version normalizes
- *
- * @return PackageInterface
- */
- protected function addPackageAliases(PackageInterface $package, $aliasNormalized)
- {
- $alias = new AliasPackage($package, $aliasNormalized, $this->rootPackageVersion);
- $this->addPackage($alias);
-
- if (false === strpos('dev-', $aliasNormalized)) {
- $alias = new AliasPackage($package, $aliasNormalized.'-dev', $this->rootPackageVersion);
- $this->addPackage($alias);
- }
-
- return $package;
- }
-
- /**
- * Inject the overriding extra config in the current package.
- *
- * @param PackageInterface $package The package
- * @param array $extra The new extra config
- */
- private function injectExtraConfig(PackageInterface $package, array $extra)
- {
- $ref = new \ReflectionClass($package);
- $met = $ref->getProperty('extra');
- $met->setAccessible(true);
- $met->setValue($package, $extra);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Config;
-use Composer\DependencyResolver\Pool;
-use Composer\Downloader\TransportException;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Composer\Json\JsonFile;
-use Composer\Repository\ComposerRepository;
-use Composer\Repository\RepositoryManager;
-use Fxp\Composer\AssetPlugin\Assets;
-use Fxp\Composer\AssetPlugin\Type\AssetTypeInterface;
-
-/**
- * Abstract assets repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-abstract class AbstractAssetsRepository extends ComposerRepository
-{
- /**
- * @var AssetTypeInterface
- */
- protected $assetType;
-
- /**
- * @var AssetVcsRepository[]
- */
- protected $repos;
-
- /**
- * @var bool
- */
- protected $searchable;
-
- /**
- * @var bool
- */
- protected $fallbackProviders;
-
- /**
- * @var RepositoryManager
- */
- protected $repositoryManager;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- /**
- * @var VcsPackageFilter
- */
- protected $packageFilter;
-
- /**
- * Constructor.
- *
- * @param array $repoConfig
- * @param IOInterface $io
- * @param Config $config
- * @param EventDispatcher $eventDispatcher
- */
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
- {
- $repoConfig = array_merge($repoConfig, array(
- 'url' => $this->getUrl(),
- ));
- $this->assetRepositoryManager = $repoConfig['asset-repository-manager'];
- $this->repositoryManager = $this->assetRepositoryManager->getRepositoryManager();
-
- parent::__construct($repoConfig, $io, $config, $eventDispatcher);
-
- $this->assetType = Assets::createType($this->getType());
- $this->lazyProvidersUrl = $this->getPackageUrl();
- $this->providersUrl = $this->lazyProvidersUrl;
- $this->searchUrl = $this->getSearchUrl();
- $this->hasProviders = true;
- $this->packageFilter = isset($repoConfig['vcs-package-filter'])
- ? $repoConfig['vcs-package-filter']
- : null;
- $this->repos = array();
- $this->searchable = (bool) $this->getOption($repoConfig['asset-options'], 'searchable', true);
- $this->fallbackProviders = false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function search($query, $mode = 0, $type = null)
- {
- if (!$this->searchable) {
- return array();
- }
-
- $url = str_replace('%query%', urlencode(Util::cleanPackageName($query)), $this->searchUrl);
- $hostname = (string) parse_url($url, PHP_URL_HOST) ?: $url;
- $json = (string) $this->rfs->getContents($hostname, $url, false);
- $data = JsonFile::parseJson($json, $url);
- $results = array();
-
- /* @var array $item */
- foreach ($data as $item) {
- $results[] = $this->createSearchItem($item);
- }
-
- return $results;
- }
-
- /**
- * {@inheritdoc}
- */
- public function whatProvides(Pool $pool, $name, $bypassFilters = false)
- {
- if (null !== $provides = $this->findWhatProvides($name)) {
- return $provides;
- }
-
- try {
- $repoName = Util::convertAliasName($name);
- $packageName = Util::cleanPackageName($repoName);
- $packageUrl = $this->buildPackageUrl($packageName);
- $cacheName = $packageName.'-'.sha1($packageName).'-package.json';
- $data = $this->fetchFile($packageUrl, $cacheName);
- $repo = $this->createVcsRepositoryConfig($data, Util::cleanPackageName($name));
- $repo['asset-repository-manager'] = $this->assetRepositoryManager;
- $repo['vcs-package-filter'] = $this->packageFilter;
- $repo['vcs-driver-options'] = Util::getArrayValue($this->repoConfig, 'vcs-driver-options', array());
-
- Util::addRepository($this->io, $this->repositoryManager, $this->repos, $name, $repo, $pool);
-
- $this->providers[$name] = array();
- } catch (\Exception $ex) {
- $this->whatProvidesManageException($pool, $name, $ex);
- }
-
- return $this->providers[$name];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMinimalPackages()
- {
- return array();
- }
-
- /**
- * Build the package url.
- *
- * @param string $packageName The package name
- *
- * @return string
- */
- protected function buildPackageUrl($packageName)
- {
- return str_replace('%package%', $packageName, $this->lazyProvidersUrl);
- }
-
- /**
- * Finds what provides in cache or return empty array if the
- * name is not a asset package.
- *
- * @param string $name
- *
- * @return array|null
- */
- protected function findWhatProvides($name)
- {
- $assetPrefix = $this->assetType->getComposerVendorName().'/';
-
- if (false === strpos($name, $assetPrefix)) {
- return array();
- }
-
- if (isset($this->providers[$name])) {
- return $this->providers[$name];
- }
-
- $data = null;
- if ($this->hasVcsRepository($name)) {
- $this->providers[$name] = array();
- $data = $this->providers[$name];
- }
-
- return $data;
- }
-
- /**
- * Checks if the package vcs repository is already include in repository manager.
- *
- * @param string $name The package name of the vcs repository
- *
- * @return bool
- */
- protected function hasVcsRepository($name)
- {
- foreach ($this->repositoryManager->getRepositories() as $mRepo) {
- if ($mRepo instanceof AssetVcsRepository
- && $name === $mRepo->getComposerPackageName()) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function loadRootServerFile()
- {
- return array(
- 'providers' => array(),
- );
- }
-
- /**
- * Gets the option.
- *
- * @param array $options The options
- * @param string $key The key
- * @param mixed $default The default value
- *
- * @return mixed The option value or default value if key is not found
- */
- protected function getOption(array $options, $key, $default = null)
- {
- if (array_key_exists($key, $options)) {
- return $options[$key];
- }
-
- return $default;
- }
-
- /**
- * Creates the search result item.
- *
- * @param array $item The item
- *
- * @return array An array('name' => '...', 'description' => '...')
- */
- protected function createSearchItem(array $item)
- {
- return array(
- 'name' => $this->assetType->getComposerVendorName().'/'.$item['name'],
- 'description' => null,
- );
- }
-
- /**
- * Manage exception for "whatProvides" method.
- *
- * @param Pool $pool
- * @param string $name
- * @param \Exception $exception
- *
- * @throws \Exception When exception is not a TransportException instance
- */
- protected function whatProvidesManageException(Pool $pool, $name, \Exception $exception)
- {
- if ($exception instanceof TransportException) {
- $this->fallbackWathProvides($pool, $name, $exception);
-
- return;
- }
-
- throw $exception;
- }
-
- /**
- * Searchs if the registry has a package with the same name exists with a
- * different camelcase.
- *
- * @param Pool $pool
- * @param string $name
- * @param TransportException $ex
- */
- protected function fallbackWathProvides(Pool $pool, $name, TransportException $ex)
- {
- $providers = array();
-
- if (404 === $ex->getCode() && !$this->fallbackProviders) {
- $this->fallbackProviders = true;
- $repoName = Util::convertAliasName($name);
- $results = $this->search($repoName);
-
- foreach ($results as $item) {
- if ($name === strtolower($item['name'])) {
- $providers = $this->whatProvides($pool, $item['name']);
- break;
- }
- }
- }
-
- $this->fallbackProviders = false;
- $this->providers[$name] = $providers;
- }
-
- /**
- * Gets the asset type name.
- *
- * @return string
- */
- abstract protected function getType();
-
- /**
- * Gets the URL of repository.
- *
- * @return string
- */
- abstract protected function getUrl();
-
- /**
- * Gets the URL for get the package information.
- *
- * @return string
- */
- abstract protected function getPackageUrl();
-
- /**
- * Gets the URL for get the search result.
- *
- * @return string
- */
- abstract protected function getSearchUrl();
-
- /**
- * Creates a config of vcs repository.
- *
- * @param array $data The repository config
- * @param string $registryName The package name in asset registry
- *
- * @return array An array('type' => '...', 'url' => '...')
- */
- abstract protected function createVcsRepositoryConfig(array $data, $registryName = null);
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\DependencyResolver\Pool;
-use Composer\IO\IOInterface;
-use Composer\Repository\RepositoryInterface;
-use Composer\Repository\RepositoryManager;
-use Fxp\Composer\AssetPlugin\Config\Config;
-
-/**
- * The asset repository manager.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class AssetRepositoryManager
-{
- /**
- * @var IOInterface
- */
- protected $io;
-
- /**
- * @var RepositoryManager
- */
- protected $rm;
-
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var VcsPackageFilter
- */
- protected $packageFilter;
-
- /**
- * @var Pool|null
- */
- protected $pool;
-
- /**
- * @var ResolutionManager
- */
- protected $resolutionManager;
-
- /**
- * @var RepositoryInterface[]
- */
- protected $repositories = array();
-
- /**
- * @var array
- */
- protected $poolRepositories = array();
-
- /**
- * Constructor.
- *
- * @param IOInterface $io The IO
- * @param RepositoryManager $rm The repository manager
- * @param Config $config The asset config
- * @param VcsPackageFilter $packageFilter The package filter
- */
- public function __construct(IOInterface $io, RepositoryManager $rm, Config $config, VcsPackageFilter $packageFilter)
- {
- $this->io = $io;
- $this->rm = $rm;
- $this->config = $config;
- $this->packageFilter = $packageFilter;
- }
-
- /**
- * Get the repository manager.
- *
- * @return RepositoryManager
- */
- public function getRepositoryManager()
- {
- return $this->rm;
- }
-
- /**
- * Get the asset config.
- *
- * @return Config
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Set the pool.
- *
- * @param Pool $pool The pool
- *
- * @return self
- */
- public function setPool(Pool $pool)
- {
- $this->pool = $pool;
-
- foreach ($this->poolRepositories as $repo) {
- $pool->addRepository($repo);
- }
-
- $this->poolRepositories = array();
-
- return $this;
- }
-
- /**
- * Set the dependency resolution manager.
- *
- * @param ResolutionManager $resolutionManager The dependency resolution manager
- */
- public function setResolutionManager(ResolutionManager $resolutionManager)
- {
- $this->resolutionManager = $resolutionManager;
- }
-
- /**
- * Solve the dependency resolutions.
- *
- * @param array $data
- *
- * @return array
- */
- public function solveResolutions(array $data)
- {
- return null !== $this->resolutionManager
- ? $this->resolutionManager->solveResolutions($data)
- : $data;
- }
-
- /**
- * Adds asset vcs repositories.
- *
- * @param array $repositories The repositories
- *
- * @throws \UnexpectedValueException When config of repository is not an array
- * @throws \UnexpectedValueException When the config of repository has not a type defined
- * @throws \UnexpectedValueException When the config of repository has an invalid type
- */
- public function addRepositories(array $repositories)
- {
- foreach ($repositories as $index => $repo) {
- $this->validateRepositories($index, $repo);
-
- if ('package' === $repo['type']) {
- $name = $repo['package']['name'];
- } else {
- $name = is_int($index) ? preg_replace('{^https?://}i', '', $repo['url']) : $index;
- $name = isset($repo['name']) ? $repo['name'] : $name;
- $repo['asset-repository-manager'] = $this;
- $repo['vcs-package-filter'] = $this->packageFilter;
- }
-
- $repoInstance = Util::addRepository($this->io, $this->rm, $this->repositories, $name, $repo, $this->pool);
-
- if (null === $this->pool && $repoInstance instanceof RepositoryInterface) {
- $this->poolRepositories[] = $repoInstance;
- }
- }
- }
-
- /**
- * Validates the config of repositories.
- *
- * @param int|string $index The index
- * @param mixed|array $repo The config repo
- *
- * @throws \UnexpectedValueException
- */
- protected function validateRepositories($index, $repo)
- {
- if (!is_array($repo)) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') should be an array, '.gettype($repo).' given');
- }
- if (!isset($repo['type'])) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined');
- }
-
- $this->validatePackageRepositories($index, $repo);
- $this->validateVcsRepositories($index, $repo);
- }
-
- /**
- * Validates the config of package repositories.
- *
- * @param int|string $index The index
- * @param mixed|array $repo The config repo
- *
- * @throws \UnexpectedValueException
- */
- protected function validatePackageRepositories($index, $repo)
- {
- if ('package' !== $repo['type']) {
- return;
- }
-
- if (!isset($repo['package'])) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
- }
-
- foreach (array('name', 'type', 'version', 'dist') as $key) {
- if (!isset($repo['package'][$key])) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have the "'.$key.'" key in the package definition"');
- }
- }
- }
-
- /**
- * Validates the config of vcs repositories.
- *
- * @param int|string $index The index
- * @param mixed|array $repo The config repo
- *
- * @throws \UnexpectedValueException
- */
- protected function validateVcsRepositories($index, $repo)
- {
- if ('package' === $repo['type']) {
- return;
- }
-
- if (false === strpos($repo['type'], '-')) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined in this way: "%asset-type%-%type%"');
- }
- if (!isset($repo['url'])) {
- throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a url defined');
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Package\AliasPackage;
-use Composer\Package\BasePackage;
-use Composer\Package\CompletePackageInterface;
-use Composer\Package\Loader\ArrayLoader;
-use Composer\Package\PackageInterface;
-use Composer\Repository\InvalidRepositoryException;
-use Composer\Repository\Vcs\VcsDriverInterface;
-use Fxp\Composer\AssetPlugin\Package\LazyCompletePackage;
-use Fxp\Composer\AssetPlugin\Package\Version\VersionParser;
-use Fxp\Composer\AssetPlugin\Util\Validator;
-
-/**
- * Asset VCS repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class AssetVcsRepository extends AbstractAssetVcsRepository
-{
- /**
- * {@inheritdoc}
- */
- protected function initialize()
- {
- $this->packages = array();
- $this->packageName = isset($this->repoConfig['name']) ? Util::cleanPackageName($this->repoConfig['name']) : null;
- $this->initLoader();
- $this->initRegistryVersions();
- $this->initFullDriver();
-
- if (!$this->getPackages()) {
- throw new InvalidRepositoryException('No valid '.$this->assetType->getFilename().' was found in any branch or tag of '.$this->url.', could not load a package from it.');
- }
- }
-
- /**
- * Init the driver with branches and tags.
- */
- protected function initFullDriver()
- {
- try {
- $driver = $this->initDriver();
- $this->initRootIdentifier($driver);
- $this->initTags($driver);
- $this->initBranches($driver);
- $driver->cleanup();
- } catch (\Exception $e) {
- // do nothing
- }
- }
-
- /**
- * Initializes all tags.
- *
- * @param VcsDriverInterface $driver
- */
- protected function initTags(VcsDriverInterface $driver)
- {
- foreach ($driver->getTags() as $tag => $identifier) {
- $packageName = $this->createPackageName();
- // strip the release- prefix from tags if present
- $tag = str_replace(array('release-', 'version/'), '', $tag);
-
- $this->initTag($driver, $packageName, $tag, $identifier);
- }
-
- if (!$this->verbose) {
- $this->io->overwrite('', false);
- }
- }
-
- /**
- * Initializes the tag: check if tag must be skipped and validate the tag.
- *
- * @param VcsDriverInterface $driver
- * @param string $packageName
- * @param string $tag
- * @param string $identifier
- */
- protected function initTag(VcsDriverInterface $driver, $packageName, $tag, $identifier)
- {
- if (null !== $this->filter && $this->filter->skip($this->assetType, $packageName, $tag)) {
- return;
- }
-
- if (!$parsedTag = Validator::validateTag($tag, $this->assetType, $this->versionParser)) {
- if ($this->verbose) {
- $this->io->write('<warning>Skipped tag '.$tag.', invalid tag name</warning>');
- }
-
- return;
- }
-
- $this->initTagAddPackage($driver, $packageName, $tag, $identifier, $parsedTag);
- }
-
- /**
- * Initializes the tag: convert data and create package.
- *
- * @param VcsDriverInterface $driver
- * @param string $packageName
- * @param string $tag
- * @param string $identifier
- * @param string $parsedTag
- */
- protected function initTagAddPackage(VcsDriverInterface $driver, $packageName, $tag, $identifier, $parsedTag)
- {
- $packageClass = 'Fxp\Composer\AssetPlugin\Package\LazyCompletePackage';
- $data = $this->createMockOfPackageConfig($packageName, $tag);
- $data['version'] = $this->assetType->getVersionConverter()->convertVersion($tag);
- $data['version_normalized'] = $parsedTag;
-
- // make sure tag packages have no -dev flag
- $data['version'] = preg_replace('{[.-]?dev$}i', '', (string) $data['version']);
- $data['version_normalized'] = preg_replace('{(^dev-|[.-]?dev$)}i', '', (string) $data['version_normalized']);
-
- $packageData = $this->preProcessAsset($data);
- $package = $this->loader->load($packageData, $packageClass);
- $lazyLoader = $this->createLazyLoader('tag', $identifier, $packageData, $driver);
- /* @var LazyCompletePackage $package */
- $package->setLoader($lazyLoader);
-
- if (!$this->hasPackage($package)) {
- $this->addPackage($package);
- }
- }
-
- /**
- * Initializes all branches.
- *
- * @param VcsDriverInterface $driver
- */
- protected function initBranches(VcsDriverInterface $driver)
- {
- foreach ($driver->getBranches() as $branch => $identifier) {
- if (is_array($this->rootData) && $branch === $driver->getRootIdentifier()) {
- $this->preInitBranchPackage($driver, $this->rootData, $branch, $identifier);
- continue;
- }
-
- $this->preInitBranchLazyPackage($driver, $branch, $identifier);
- }
-
- if (!$this->verbose) {
- $this->io->overwrite('', false);
- }
- }
-
- /**
- * Pre inits the branch of complete package.
- *
- * @param VcsDriverInterface $driver The vcs driver
- * @param array $data The asset package data
- * @param string $branch The branch name
- * @param string $identifier The branch identifier
- */
- protected function preInitBranchPackage(VcsDriverInterface $driver, array $data, $branch, $identifier)
- {
- $packageName = $this->createPackageName();
- $data = array_merge($this->createMockOfPackageConfig($packageName, $branch), $data);
- $data = $this->preProcessAsset($data);
- $data['version'] = $branch;
- $data = $this->configureBranchPackage($branch, $data);
-
- if (!isset($data['dist'])) {
- $data['dist'] = $driver->getDist($identifier);
- }
- if (!isset($data['source'])) {
- $data['source'] = $driver->getSource($identifier);
- }
-
- $loader = new ArrayLoader();
- $package = $loader->load($data);
- $package = $this->includeBranchAlias($driver, $package, $branch);
- $this->addPackage($package);
- }
-
- /**
- * Pre inits the branch of lazy package.
- *
- * @param VcsDriverInterface $driver The vcs driver
- * @param string $branch The branch name
- * @param string $identifier The branch identifier
- */
- protected function preInitBranchLazyPackage(VcsDriverInterface $driver, $branch, $identifier)
- {
- $packageName = $this->createPackageName();
- $data = $this->createMockOfPackageConfig($packageName, $branch);
- $data = $this->configureBranchPackage($branch, $data);
-
- $this->initBranchLazyPackage($driver, $data, $branch, $identifier);
- }
-
- /**
- * Configures the package of branch.
- *
- * @param string $branch The branch name
- * @param array $data The data
- *
- * @return array
- */
- protected function configureBranchPackage($branch, array $data)
- {
- $parsedBranch = $this->versionParser->normalizeBranch($branch);
- $data['version_normalized'] = $parsedBranch;
-
- // make sure branch packages have a dev flag
- if ('dev-' === substr((string) $parsedBranch, 0, 4) || '9999999-dev' === $parsedBranch) {
- $data['version'] = 'dev-'.$data['version'];
- } else {
- $data['version'] = preg_replace('{(\.9{7})+}', '.x', (string) $parsedBranch);
- }
-
- return $data;
- }
-
- /**
- * Inits the branch of lazy package.
- *
- * @param VcsDriverInterface $driver The vcs driver
- * @param array $data The package data
- * @param string $branch The branch name
- * @param string $identifier The branch identifier
- */
- protected function initBranchLazyPackage(VcsDriverInterface $driver, array $data, $branch, $identifier)
- {
- $packageClass = 'Fxp\Composer\AssetPlugin\Package\LazyCompletePackage';
- $packageData = $this->preProcessAsset($data);
- /* @var LazyCompletePackage $package */
- $package = $this->loader->load($packageData, $packageClass);
- $lazyLoader = $this->createLazyLoader('branch', $identifier, $packageData, $driver);
- $package->setLoader($lazyLoader);
- $package = $this->includeBranchAlias($driver, $package, $branch);
-
- $this->addPackage($package);
- }
-
- /**
- * Include the package in the alias package if the branch is a root branch
- * identifier and having a package version.
- *
- * @param VcsDriverInterface $driver The vcs driver
- * @param PackageInterface $package The package instance
- * @param string $branch The branch name
- *
- * @return PackageInterface|AliasPackage
- */
- protected function includeBranchAlias(VcsDriverInterface $driver, PackageInterface $package, $branch)
- {
- if (null !== $this->rootPackageVersion && $branch === $driver->getRootIdentifier()) {
- $aliasNormalized = $this->normalizeBranchAlias($package);
- $package = $package instanceof AliasPackage ? $package->getAliasOf() : $package;
- $package = $this->overrideBranchAliasConfig($package, $aliasNormalized, $branch);
- $package = $this->addPackageAliases($package, $aliasNormalized);
- }
-
- return $package;
- }
-
- /**
- * Normalize the alias of branch.
- *
- * @param PackageInterface $package The package instance
- *
- * @return string The alias branch name
- */
- protected function normalizeBranchAlias(PackageInterface $package)
- {
- $stability = VersionParser::parseStability($this->versionParser->normalize($this->rootPackageVersion));
- $aliasNormalized = 'dev-'.$this->rootPackageVersion;
-
- if (BasePackage::STABILITY_STABLE === BasePackage::$stabilities[$stability]
- && null === $this->findPackage($package->getName(), $this->rootPackageVersion)) {
- $aliasNormalized = $this->versionParser->normalize($this->rootPackageVersion);
- }
-
- return $aliasNormalized;
- }
-
- /**
- * Init the package versions added directly in the Asset Registry.
- */
- protected function initRegistryVersions()
- {
- if (isset($this->repoConfig['registry-versions'])) {
- /* @var CompletePackageInterface $package */
- foreach ($this->repoConfig['registry-versions'] as $package) {
- $this->addPackage($package);
- }
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Util\AssetPlugin;
-
-/**
- * Factory of bower private repository registries.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class BowerPrivateRegistryFactory implements RegistryFactoryInterface
-{
- /**
- * {@inheritdoc}
- */
- public static function create(AssetRepositoryManager $arm, VcsPackageFilter $filter, Config $config)
- {
- $rm = $arm->getRepositoryManager();
- $registries = $config->getArray('private-bower-registries');
-
- foreach ($registries as $registryName => $registryUrl) {
- $repoConfig = AssetPlugin::createRepositoryConfig($arm, $filter, $config, $registryName);
- $repoConfig['private-registry-url'] = $registryUrl;
-
- $rm->setRepositoryClass($registryName, 'Fxp\Composer\AssetPlugin\Repository\BowerPrivateRepository');
- $rm->addRepository($rm->createRepository($registryName, $repoConfig));
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Fxp\Composer\AssetPlugin\Exception\InvalidCreateRepositoryException;
-
-/**
- * Bower repository for Private Instaltions.
- *
- * @author Marcus Stueben <marcus@it-stueben.de>
- */
-class BowerPrivateRepository extends AbstractAssetsRepository
-{
- /**
- * Constructor.
- *
- * @param array $repoConfig
- * @param IOInterface $io
- * @param Config $config
- * @param EventDispatcher $eventDispatcher
- */
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
- {
- $this->url = isset($repoConfig['private-registry-url'])
- ? $repoConfig['private-registry-url']
- : null;
-
- parent::__construct($repoConfig, $io, $config, $eventDispatcher);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'bower';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getUrl()
- {
- return $this->url;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getPackageUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/%package%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getSearchUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/search/%query%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createVcsRepositoryConfig(array $data, $registryName = null)
- {
- $myArray = array();
- $myArray['repository'] = $data;
-
- return array(
- 'type' => $this->assetType->getName().'-vcs',
- 'url' => $this->getVcsRepositoryUrl($myArray, $registryName),
- 'name' => $registryName,
- );
- }
-
- /**
- * Get the URL of VCS repository.
- *
- * @param array $data The repository config
- * @param string $registryName The package name in asset registry
- *
- * @return string
- *
- * @throws InvalidCreateRepositoryException When the repository.url parameter does not exist
- */
- protected function getVcsRepositoryUrl(array $data, $registryName = null)
- {
- if (!isset($data['repository']['url'])) {
- $msg = sprintf('The "repository.url" parameter of "%s" %s asset package must be present for create a VCS Repository', $registryName, $this->assetType->getName());
- $msg .= PHP_EOL.'If the config comes from the Bower Private Registry, override the config with a custom Asset VCS Repository';
- $ex = new InvalidCreateRepositoryException($msg);
- $ex->setData($data);
-
- throw $ex;
- }
-
- return (string) $data['repository']['url'];
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-/**
- * Bower repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class BowerRepository extends AbstractAssetsRepository
-{
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'bower';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getUrl()
- {
- return 'https://registry.bower.io/packages';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getPackageUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/%package%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getSearchUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/search/%query%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createVcsRepositoryConfig(array $data, $registryName = null)
- {
- return array(
- 'type' => $this->assetType->getName().'-vcs',
- 'url' => $data['url'],
- 'name' => $registryName,
- );
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Fxp\Composer\AssetPlugin\Assets;
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Util\AssetPlugin;
-
-/**
- * Factory of default repository registries.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class DefaultRegistryFactory implements RegistryFactoryInterface
-{
- /**
- * {@inheritdoc}
- */
- public static function create(AssetRepositoryManager $arm, VcsPackageFilter $filter, Config $config)
- {
- $rm = $arm->getRepositoryManager();
-
- foreach (Assets::getDefaultRegistries() as $assetType => $registryClass) {
- $repoConfig = AssetPlugin::createRepositoryConfig($arm, $filter, $config, $assetType);
-
- $rm->setRepositoryClass($assetType, $registryClass);
- $rm->addRepository($rm->createRepository($assetType, $repoConfig));
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Package\Link;
-use Composer\Package\Package;
-use Composer\Package\RootPackageInterface;
-use Composer\Semver\Constraint\ConstraintInterface;
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Package\Version\VersionParser;
-
-/**
- * Helper for Filter Package of Repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class FilterUtil
-{
- /**
- * Get the link constraint of normalized version.
- *
- * @param string $normalizedVersion The normalized version
- * @param VersionParser $versionParser The version parser
- *
- * @return ConstraintInterface The constraint
- */
- public static function getVersionConstraint($normalizedVersion, VersionParser $versionParser)
- {
- if (preg_match('/^\d+(\.\d+)(\.\d+)(\.\d+)\-[A-Za-z0-9]+$/', $normalizedVersion)) {
- $normalizedVersion = substr($normalizedVersion, 0, strpos($normalizedVersion, '-'));
- }
-
- return $versionParser->parseConstraints($normalizedVersion);
- }
-
- /**
- * Find the stability name with the stability value.
- *
- * @param int $level The stability level
- *
- * @return string The stability name
- */
- public static function findFlagStabilityName($level)
- {
- $stability = 'dev';
-
- /* @var string $stabilityName */
- /* @var int $stabilityLevel */
- foreach (Package::$stabilities as $stabilityName => $stabilityLevel) {
- if ($stabilityLevel === $level) {
- $stability = $stabilityName;
- break;
- }
- }
-
- return $stability;
- }
-
- /**
- * Find the lowest stability.
- *
- * @param string[] $stabilities The list of stability
- * @param VersionParser $versionParser The version parser
- *
- * @return string The lowest stability
- */
- public static function findInlineStabilities(array $stabilities, VersionParser $versionParser)
- {
- $lowestStability = 'stable';
-
- foreach ($stabilities as $stability) {
- $stability = $versionParser->normalizeStability($stability);
- $stability = $versionParser->parseStability($stability);
-
- if (Package::$stabilities[$stability] > Package::$stabilities[$lowestStability]) {
- $lowestStability = $stability;
- }
- }
-
- return $lowestStability;
- }
-
- /**
- * Get the minimum stability for the require dependency defined in root package.
- *
- * @param RootPackageInterface $package The root package
- * @param Link $require The require link defined in root package
- *
- * @return string The minimum stability defined in root package (in links or global project)
- */
- public static function getMinimumStabilityFlag(RootPackageInterface $package, Link $require)
- {
- $flags = $package->getStabilityFlags();
-
- if (isset($flags[$require->getTarget()])) {
- return static::findFlagStabilityName($flags[$require->getTarget()]);
- }
-
- return $package->getPreferStable()
- ? 'stable'
- : $package->getMinimumStability();
- }
-
- /**
- * Check the config option.
- *
- * @param Config $config The plugin config
- * @param string $name The extra option name
- *
- * @return bool
- */
- public static function checkConfigOption(Config $config, $name)
- {
- return true === $config->get($name, true);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\DependencyResolver\Pool;
-use Composer\IO\IOInterface;
-use Composer\Package\CompletePackageInterface;
-use Composer\Package\Loader\ArrayLoader;
-use Composer\Repository\ArrayRepository;
-use Fxp\Composer\AssetPlugin\Converter\NpmPackageUtil;
-use Fxp\Composer\AssetPlugin\Converter\PackageUtil;
-use Fxp\Composer\AssetPlugin\Exception\InvalidCreateRepositoryException;
-
-/**
- * NPM repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class NpmRepository extends AbstractAssetsRepository
-{
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'npm';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getUrl()
- {
- return 'https://registry.npmjs.org';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getPackageUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/%package%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getSearchUrl()
- {
- return $this->canonicalizeUrl($this->baseUrl.'/-/all');
- }
-
- /**
- * {@inheritdoc}
- */
- public function search($query, $mode = 0, $type = null)
- {
- return array();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function buildPackageUrl($packageName)
- {
- $packageName = urlencode(NpmPackageUtil::revertName($packageName));
- $packageName = str_replace('%40', '@', $packageName);
-
- return parent::buildPackageUrl($packageName);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createVcsRepositoryConfig(array $data, $registryName = null)
- {
- $type = isset($data['repository']['type']) ? $data['repository']['type'] : 'vcs';
-
- // Add release date in $packageConfigs
- if (isset($data['versions']) && isset($data['time'])) {
- $time = $data['time'];
- array_walk($data['versions'], function (&$packageConfigs, $version) use ($time) {
- PackageUtil::convertStringKey($time, $version, $packageConfigs, 'time');
- });
- }
-
- return array(
- 'type' => $this->assetType->getName().'-'.$type,
- 'url' => $this->getVcsRepositoryUrl($data, $registryName),
- 'name' => $registryName,
- 'registry-versions' => isset($data['versions']) ? $this->createArrayRepositoryConfig($data['versions']) : array(),
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function whatProvidesManageException(Pool $pool, $name, \Exception $exception)
- {
- if ($exception instanceof InvalidCreateRepositoryException) {
- $data = $exception->getData();
-
- if (isset($data['versions']) && !empty($data['versions'])) {
- $this->putArrayRepositoryConfig($data['versions'], $name, $pool);
-
- return;
- }
- }
-
- parent::whatProvidesManageException($pool, $name, $exception);
- }
-
- /**
- * Create and put the array repository with the asset configs.
- *
- * @param array $packageConfigs The configs of assets package versions
- * @param string $name The asset package name
- * @param Pool $pool The pool
- */
- protected function putArrayRepositoryConfig(array $packageConfigs, $name, Pool $pool)
- {
- $packages = $this->createArrayRepositoryConfig($packageConfigs);
- $repo = new ArrayRepository($packages);
- Util::addRepositoryInstance($this->io, $this->repositoryManager, $this->repos, $name, $repo, $pool);
-
- $this->providers[$name] = array();
- }
-
- /**
- * Create the array repository with the asset configs.
- *
- * A warning message is displayed if the constraint versions of packages
- * are broken. These versions are skipped and the plugin hope that other
- * versions will be OK.
- *
- * @param array $packageConfigs The configs of assets package versions
- *
- * @return CompletePackageInterface[]
- */
- protected function createArrayRepositoryConfig(array $packageConfigs)
- {
- $packages = array();
- $loader = new ArrayLoader();
-
- foreach ($packageConfigs as $version => $config) {
- try {
- $config['version'] = $version;
- $config = $this->assetType->getPackageConverter()->convert($config);
- $config = $this->assetRepositoryManager->solveResolutions($config);
- $packages[] = $loader->load($config);
- } catch (\UnexpectedValueException $exception) {
- $this->io->write("<warning>Skipped {$config['name']} version {$version}: {$exception->getMessage()}</warning>", IOInterface::VERBOSE);
- }
- }
-
- return $packages;
- }
-
- /**
- * Get the URL of VCS repository.
- *
- * @param array $data The repository config
- * @param string $registryName The package name in asset registry
- *
- * @return string
- *
- * @throws InvalidCreateRepositoryException When the repository.url parameter does not exist
- */
- protected function getVcsRepositoryUrl(array $data, $registryName = null)
- {
- if (!isset($data['repository']['url'])) {
- $msg = sprintf('The "repository.url" parameter of "%s" %s asset package must be present for create a VCS Repository', $registryName, $this->assetType->getName());
- $msg .= PHP_EOL.'If the config comes from the NPM Registry, override the config with a custom Asset VCS Repository';
- $ex = new InvalidCreateRepositoryException($msg);
- $ex->setData($data);
-
- throw $ex;
- }
-
- return $this->convertUrl((string) $data['repository']['url']);
- }
-
- /**
- * Convert the url repository.
- *
- * @param string $url The url
- *
- * @return string The url converted
- */
- private function convertUrl($url)
- {
- if (0 === strpos($url, 'git+http')) {
- return substr($url, 4);
- }
-
- return $url;
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Fxp\Composer\AssetPlugin\Config\Config;
-
-/**
- * Interface of repository registry factory.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-interface RegistryFactoryInterface
-{
- /**
- * Create the repository registries.
- *
- * @param AssetRepositoryManager $arm The asset repository manager
- * @param VcsPackageFilter $filter The vcs package filter
- * @param Config $config The plugin config
- */
- public static function create(AssetRepositoryManager $arm, VcsPackageFilter $filter, Config $config);
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-/**
- * Solve the conflicts of dependencies by the resolutions.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class ResolutionManager
-{
- /**
- * @var array
- */
- protected $resolutions;
-
- /**
- * Constructor.
- *
- * @param array $resolutions The dependency resolutions
- */
- public function __construct(array $resolutions = array())
- {
- $this->resolutions = $resolutions;
- }
-
- /**
- * Solve the dependency resolutions.
- *
- * @param array $data The data of asset composer package
- *
- * @return array
- */
- public function solveResolutions(array $data)
- {
- $data = $this->doSolveResolutions($data, 'require');
- $data = $this->doSolveResolutions($data, 'require-dev');
-
- return $data;
- }
-
- /**
- * Solve the dependency resolutions.
- *
- * @param array $data The data of asset composer package
- * @param string $section The dependency section in package
- *
- * @return array
- */
- protected function doSolveResolutions(array $data, $section)
- {
- if (array_key_exists($section, $data) && is_array($data[$section])) {
- foreach ($data[$section] as $dependency => &$range) {
- foreach ($this->resolutions as $resolutionDependency => $resolutionRange) {
- if ($dependency === $resolutionDependency) {
- $range = $resolutionRange;
- }
- }
- }
- }
-
- return $data;
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\DependencyResolver\Pool;
-use Composer\IO\IOInterface;
-use Composer\Repository\RepositoryInterface;
-use Composer\Repository\RepositoryManager;
-
-/**
- * Helper for Repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class Util
-{
- /**
- * Add repository config.
- * The instance of repository is returned if the repository in't added in the pool.
- *
- * @param IOInterface $io The IO instance
- * @param RepositoryManager $rm The repository manager
- * @param array $repos The list of already repository added (passed by reference)
- * @param string $name The name of the new repository
- * @param array $repoConfig The config of the new repository
- * @param Pool|null $pool The pool
- *
- * @return RepositoryInterface|null
- */
- public static function addRepository(IOInterface $io, RepositoryManager $rm, array &$repos, $name, array $repoConfig, Pool $pool = null)
- {
- $repoConfig['name'] = $name;
- $repo = $rm->createRepository($repoConfig['type'], $repoConfig);
-
- return static::addRepositoryInstance($io, $rm, $repos, $name, $repo, $pool);
- }
-
- /**
- * Add repository instance.
- * The instance of repository is returned if the repository in't added in the pool.
- *
- * @param IOInterface $io The IO instance
- * @param RepositoryManager $rm The repository mamanger
- * @param array $repos The list of already repository added (passed by reference)
- * @param string $name The name of the new repository
- * @param RepositoryInterface $repo The repository instance
- * @param Pool|null $pool The pool
- *
- * @return RepositoryInterface|null
- */
- public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)
- {
- $notAddedRepo = null;
-
- if (!isset($repos[$name])) {
- static::writeAddRepository($io, $name);
- $notAddedRepo = $repo;
- $repos[$name] = $repo;
- $rm->addRepository($repo);
-
- if (null !== $pool) {
- $pool->addRepository($repo);
- $notAddedRepo = null;
- }
- }
-
- return $notAddedRepo;
- }
-
- /**
- * Cleans the package name, removing the Composer prefix if present.
- *
- * @param string $name
- *
- * @return string
- */
- public static function cleanPackageName($name)
- {
- if (preg_match('/^[a-z]+\-asset\//', $name, $matches)) {
- $name = substr($name, strlen($matches[0]));
- }
-
- return $name;
- }
-
- /**
- * Converts the alias of asset package name by the real asset package name.
- *
- * @param string $name
- *
- * @return string
- */
- public static function convertAliasName($name)
- {
- if (preg_match('/([\w0-9\/_-]+)-\d+(.\d+)?.[\dxX]+$/', $name, $matches)) {
- return $matches[1];
- }
-
- return $name;
- }
-
- /**
- * Get the array value.
- *
- * @param array $array The array
- * @param string $name The key name
- * @param mixed $default The default value
- *
- * @return mixed
- */
- public static function getArrayValue(array $array, $name, $default = null)
- {
- return array_key_exists($name, $array)
- ? $array[$name]
- : $default;
- }
-
- /**
- * Write the vcs repository name in output console.
- *
- * @param IOInterface $io The IO instance
- * @param string $name The vcs repository name
- */
- protected static function writeAddRepository(IOInterface $io, $name)
- {
- if ($io->isVerbose()) {
- $io->write('Adding VCS repository <info>'.$name.'</info>');
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Repository;
-
-use Composer\Installer\InstallationManager;
-use Composer\Package\Link;
-use Composer\Package\Loader\ArrayLoader;
-use Composer\Package\Package;
-use Composer\Package\PackageInterface;
-use Composer\Package\RootPackageInterface;
-use Composer\Repository\InstalledFilesystemRepository;
-use Composer\Semver\Constraint\MultiConstraint;
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Package\Version\VersionParser;
-use Fxp\Composer\AssetPlugin\Type\AssetTypeInterface;
-
-/**
- * Filters the asset packages imported into VCS repository to optimize
- * performance when getting the informations of packages.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class VcsPackageFilter
-{
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var RootPackageInterface
- */
- protected $package;
-
- /**
- * @var InstallationManager
- */
- protected $installationManager;
-
- /**
- * @var InstalledFilesystemRepository
- */
- protected $installedRepository;
-
- /**
- * @var VersionParser
- */
- protected $versionParser;
-
- /**
- * @var ArrayLoader
- */
- protected $arrayLoader;
-
- /**
- * @var bool
- */
- protected $enabled;
-
- /**
- * @var array
- */
- protected $requires;
-
- /**
- * Constructor.
- *
- * @param Config $config The plugin config
- * @param RootPackageInterface $package The root package
- * @param InstallationManager $installationManager The installation manager
- * @param InstalledFilesystemRepository|null $installedRepository The installed repository
- */
- public function __construct(Config $config, RootPackageInterface $package, InstallationManager $installationManager, InstalledFilesystemRepository $installedRepository = null)
- {
- $this->config = $config;
- $this->package = $package;
- $this->installationManager = $installationManager;
- $this->installedRepository = $installedRepository;
- $this->versionParser = new VersionParser();
- $this->arrayLoader = new ArrayLoader();
- $this->enabled = true;
-
- $this->initialize();
- }
-
- /**
- * @param bool $enabled
- *
- * @return self
- */
- public function setEnabled($enabled)
- {
- $this->enabled = (bool) $enabled;
-
- return $this;
- }
-
- /**
- * Check if the filter is enabled.
- *
- * @return bool
- */
- public function isEnabled()
- {
- return $this->enabled;
- }
-
- /**
- * Check if the version must be skipped.
- *
- * @param AssetTypeInterface $assetType The asset type
- * @param string $name The composer package name
- * @param string $version The version
- *
- * @return bool
- */
- public function skip(AssetTypeInterface $assetType, $name, $version)
- {
- try {
- $cVersion = $assetType->getVersionConverter()->convertVersion($version);
- $normalizedVersion = $this->versionParser->normalize($cVersion);
- } catch (\Exception $ex) {
- return true;
- }
-
- if (false !== $this->skipByPattern() && $this->forceSkipVersion($normalizedVersion)) {
- return true;
- }
-
- return $this->doSkip($name, $normalizedVersion);
- }
-
- /**
- * Do check if the version must be skipped.
- *
- * @param string $name The composer package name
- * @param string $normalizedVersion The normalized version
- *
- * @return bool
- */
- protected function doSkip($name, $normalizedVersion)
- {
- if (!isset($this->requires[$name]) || false !== strpos($normalizedVersion, '-p')) {
- return false;
- }
-
- /* @var Link $require */
- $require = $this->requires[$name];
-
- return !$this->satisfy($require, $normalizedVersion) && $this->isEnabled();
- }
-
- /**
- * Check if the require dependency has a satisfactory version and stability.
- *
- * @param Link $require The require link defined in root package
- * @param string $normalizedVersion The normalized version
- *
- * @return bool
- */
- protected function satisfy(Link $require, $normalizedVersion)
- {
- return $this->satisfyVersion($require, $normalizedVersion)
- && $this->satisfyStability($require, $normalizedVersion);
- }
-
- /**
- * Check if the filter must be skipped the version by pattern or not.
- *
- * @return string|false Return the pattern or FALSE for disable the feature
- */
- protected function skipByPattern()
- {
- $skip = $this->config->get('pattern-skip-version', false);
-
- return is_string($skip)
- ? trim($skip, '/')
- : false;
- }
-
- /**
- * Check if the require package version must be skipped or not.
- *
- * @param string $normalizedVersion The normalized version
- *
- * @return bool
- */
- protected function forceSkipVersion($normalizedVersion)
- {
- return (bool) preg_match('/'.$this->skipByPattern().'/', $normalizedVersion);
- }
-
- /**
- * Check if the require dependency has a satisfactory version.
- *
- * @param Link $require The require link defined in root package
- * @param string $normalizedVersion The normalized version
- *
- * @return bool
- */
- protected function satisfyVersion(Link $require, $normalizedVersion)
- {
- $constraintSame = $this->versionParser->parseConstraints($normalizedVersion);
- $sameVersion = (bool) $require->getConstraint()->matches($constraintSame);
-
- $consNormalizedVersion = FilterUtil::getVersionConstraint($normalizedVersion, $this->versionParser);
- $constraint = FilterUtil::getVersionConstraint($consNormalizedVersion->getPrettyString(), $this->versionParser);
-
- return (bool) $require->getConstraint()->matches($constraint) || $sameVersion;
- }
-
- /**
- * Check if the require dependency has a satisfactory stability.
- *
- * @param Link $require The require link defined in root package
- * @param string $normalizedVersion The normalized version
- *
- * @return bool
- */
- protected function satisfyStability(Link $require, $normalizedVersion)
- {
- $requireStability = $this->getRequireStability($require);
- $stability = $this->versionParser->parseStability($normalizedVersion);
-
- return Package::$stabilities[$stability] <= Package::$stabilities[$requireStability];
- }
-
- /**
- * Get the minimum stability for the require dependency defined in root package.
- *
- * @param Link $require The require link defined in root package
- *
- * @return string The minimum stability
- */
- protected function getRequireStability(Link $require)
- {
- $prettyConstraint = $require->getPrettyConstraint();
- $stabilities = Package::$stabilities;
-
- if (preg_match_all('/@('.implode('|', array_keys($stabilities)).')/', $prettyConstraint, $matches)) {
- return FilterUtil::findInlineStabilities($matches[1], $this->versionParser);
- }
-
- return FilterUtil::getMinimumStabilityFlag($this->package, $require);
- }
-
- /**
- * Initialize.
- */
- protected function initialize()
- {
- $this->requires = array_merge(
- $this->package->getRequires(),
- $this->package->getDevRequires()
- );
-
- if (null !== $this->installedRepository
- && FilterUtil::checkConfigOption($this->config, 'optimize-with-installed-packages')) {
- $this->initInstalledPackages();
- }
- }
-
- /**
- * Initialize the installed package.
- */
- private function initInstalledPackages()
- {
- /* @var PackageInterface $package */
- foreach ($this->installedRepository->getPackages() as $package) {
- $operator = $this->getFilterOperator($package);
- /* @var Link $link */
- $link = current($this->arrayLoader->parseLinks($this->package->getName(), $this->package->getVersion(), 'installed', array($package->getName() => $operator.$package->getPrettyVersion())));
- $link = $this->includeRootConstraint($package, $link);
-
- $this->requires[$package->getName()] = $link;
- }
- }
-
- /**
- * Include the constraint of root dependency version in the constraint
- * of installed package.
- *
- * @param PackageInterface $package The installed package
- * @param Link $link The link contained installed constraint
- *
- * @return Link The link with root and installed version constraint
- */
- private function includeRootConstraint(PackageInterface $package, Link $link)
- {
- if (isset($this->requires[$package->getName()])) {
- /* @var Link $rLink */
- $rLink = $this->requires[$package->getName()];
- $useConjunctive = FilterUtil::checkConfigOption($this->config, 'optimize-with-conjunctive');
- $constraint = new MultiConstraint(array($rLink->getConstraint(), $link->getConstraint()), $useConjunctive);
- $link = new Link($rLink->getSource(), $rLink->getTarget(), $constraint, 'installed', $constraint->getPrettyString());
- }
-
- return $link;
- }
-
- /**
- * Get the filter root constraint operator.
- *
- * @param PackageInterface $package
- *
- * @return string
- */
- private function getFilterOperator(PackageInterface $package)
- {
- return $this->installationManager->isPackageInstalled($this->installedRepository, $package)
- ? '>'
- : '>=';
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests;
-
-use Fxp\Composer\AssetPlugin\Assets;
-
-/**
- * Tests of assets factory.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class AssetsTest extends \PHPUnit_Framework_TestCase
-{
- public function testGetTypes()
- {
- $this->assertEquals(array(
- 'npm',
- 'bower',
- ), Assets::getTypes());
- }
-
- public function testDefaultGetRegistries()
- {
- $this->assertEquals(array(
- 'npm',
- 'bower',
- ), array_keys(Assets::getDefaultRegistries()));
- }
-
- public function testGetVcsRepositoryDrivers()
- {
- $this->assertEquals(array(
- 'vcs',
- 'github',
- 'git-bitbucket',
- 'git',
- 'hg-bitbucket',
- 'hg',
- 'perforce',
- 'svn',
- ), array_keys(Assets::getVcsRepositoryDrivers()));
- }
-
- public function testGetVcsDrivers()
- {
- $this->assertEquals(array(
- 'github',
- 'git-bitbucket',
- 'git',
- 'hg-bitbucket',
- 'hg',
- 'perforce',
- 'svn',
- ), array_keys(Assets::getVcsDrivers()));
- }
-
- /**
- * @expectedException \Fxp\Composer\AssetPlugin\Exception\InvalidArgumentException
- */
- public function testCreationOfInvalidType()
- {
- Assets::createType(null);
- }
-
- public function testCreationOfNpmAsset()
- {
- $type = Assets::createType('npm');
-
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Type\AssetTypeInterface', $type);
- }
-
- public function testCreationOfBowerAsset()
- {
- $type = Assets::createType('bower');
-
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Type\AssetTypeInterface', $type);
- }
-
- public function testCreationOfPrivateBowerAsset()
- {
- $type = Assets::createType('bower');
-
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Type\AssetTypeInterface', $type);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Composer\Package\PackageInterface;
-use Composer\Repository\RepositoryInterface;
-
-/**
- * Fixture for assets repository tests.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class MockAssetRepository implements RepositoryInterface
-{
- /**
- * Constructor.
- *
- * @param array $repoConfig
- * @param IOInterface $io
- * @param Config $config
- * @param EventDispatcher|null $eventDispatcher
- */
- public function __construct(array $repoConfig, IOInterface $io, Config $config,
- EventDispatcher $eventDispatcher = null)
- {
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasPackage(PackageInterface $package)
- {
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function findPackage($name, $version)
- {
- return;
- }
-
- /**
- * {@inheritdoc}
- */
- public function findPackages($name, $version = null)
- {
- return array();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPackages()
- {
- return array();
- }
-
- /**
- * {@inheritdoc}
- */
- public function search($query, $mode = 0, $type = null)
- {
- return array();
- }
-
- /**
- * {@inheritdoc}
- */
- public function count()
- {
- return 0;
- }
-}
+++ /dev/null
-{
- "name": "test",
- "description": "Test bower",
- "version": "1.0.0-pre",
- "keywords": [
- "foo",
- "bar"
- ],
- "license": "MIT",
- "bin": "bin/foo",
- "main": [
- "dist/js/foo.js"
- ],
- "ignore": [
- ".*"
- ],
- "dependencies": {
- "library1": ">= 1.0.0",
- "library2": ">= 1.0.0",
- "library2-0.9.0": "library2#0.9.0",
- "library3": "git@foobar.tld:user/repository3.git",
- "library4": "git@foobar.tld:user/repository4.git#1.2.3",
- "library5": "git@foobar.tld:user/repository5.git#0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b",
- "library6": "git@foobar.tld:user/repository6.git#branch",
- "library7": "git@foobar.tld:user/repository7.git#1.2.*",
- "library8": "git@foobar.tld:user/repository8.git#1.2.x",
- "library9": "git@foobar.tld:user/repository9.git#master",
- "library10": "user/repository10#1.0.0",
- "library11": "user/repository11",
- "library12": "user/repository11#>=1 <2",
- "library13": ">=1 <2",
- "library14": "*",
- "library15": "library15#*",
- "library16": "library16#>=1 <2",
- "library17": "http://foobar.tld/library17-1.2.3.js",
- "library18": "http://foobar.tld/library18.js#1.2.3",
- "library19": "http://foobar.tld/library19.js",
- "library20": "http://foobar.tld/library20/v1.2.tar.gz"
- },
- "devDependencies": {
- "dev-library1": ">= 1.0.0",
- "dev-library2": ">= 1.0.0",
- "dev-library2-0.9.0": "dev-library2#0.9.0"
- },
- "private": false
-}
+++ /dev/null
-{
- "name": "@scope/test",
- "description": "Test NPM Scope",
- "version": "1.0.0-pre",
- "license": "MIT",
- "dependencies": {
- "@scope/library1": ">= 1.0.0",
- "@scope2/library2": ">= 1.0.0"
- },
- "devDependencies": {
- "@scope3/dev-library1": ">= 1.0.0"
- }
-}
+++ /dev/null
-{
- "name": "test",
- "description": "Test NPM",
- "version": "1.0.0-pre",
- "keywords": [
- "foo",
- "bar"
- ],
- "homepage": "http://test.tld",
- "license": "MIT",
- "author": {
- "name": "Foo Bar",
- "email": "foo@bar.tld",
- "url": "http://foo.bar.tld"
- },
- "contributors": [
- {
- "name": "Bar Foo",
- "email": "bar@foo.tld",
- "url": "http://bar.foo.tld"
- }
- ],
- "dependencies": {
- "library1": ">= 1.0.0",
- "library2": ">= 1.0.0",
- "library2-0.9.0": "library2#0.9.0",
- "library3": "git@foobar.tld:user/repository3.git",
- "library4": "git@foobar.tld:user/repository4.git#1.2.3",
- "library5": "git@foobar.tld:user/repository5.git#0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b",
- "library6": "git@foobar.tld:user/repository6.git#branch",
- "library7": "git@foobar.tld:user/repository7.git#1.2.*",
- "library8": "git@foobar.tld:user/repository8.git#1.2.x",
- "library9": "git@foobar.tld:user/repository9.git#master",
- "library10": "git@foobar.tld:user/repository10#1.0.0",
- "library11": "git@foobar.tld:user/repository11",
- "library12": "git@foobar.tld:user/repository11#>=1 <2",
- "library13": ">=1 <2",
- "library14": "*",
- "library15": "library15#*",
- "library16": "library16#>=1 <2",
- "library17": "http://foobar.tld/library17-1.2.3.js",
- "library18": "http://foobar.tld/library18.js#1.2.3",
- "library19": "http://foobar.tld/library19.js",
- "library20": "http://foobar.tld/library20/v1.2.tar.gz",
- "library21": "1 || 2"
- },
- "devDependencies": {
- "dev-library1": ">= 1.0.0",
- "dev-library2": ">= 1.0.0",
- "dev-library2-0.9.0": "dev-library2#0.9.0",
- "library3": "library3,bar/*.js"
- },
- "bin": "bin/foo",
- "bugs": {
- "url": "http://foo.bar.tld",
- "email": "foo@bar.tld"
- },
- "files": [
- "dist/js/foo.js"
- ],
- "main": [
- "dist/js/bar.js"
- ],
- "man": [],
- "directories": {
- "lib": "lib",
- "bin": "bin",
- "man": "man",
- "doc": "doc",
- "example": "example"
- },
- "repository": {
- "type" : "git",
- "url" : "http://github.com/npm/npm.git"
- },
- "scripts": {
- "build": "npm install && grunt"
- },
- "config": {
- "foo": "bar"
- },
- "bundledDependencies": [],
- "optionalDependencies": [],
- "engines": {
- "node": ">=0.10.3 <0.12"
- },
- "engineStrict": true,
- "os": ["darwin", "linux"],
- "cpu": ["x64", "ia32"],
- "preferGlobal": true,
- "private": false,
- "publishConfig": {
- "foo": "bar"
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests;
-
-use Composer\Composer;
-use Composer\Config;
-use Composer\DependencyResolver\Pool;
-use Composer\Installer\InstallationManager;
-use Composer\Installer\InstallerEvent;
-use Composer\IO\IOInterface;
-use Composer\Plugin\CommandEvent;
-use Composer\Repository\RepositoryManager;
-use Composer\Util\Filesystem;
-use Fxp\Composer\AssetPlugin\FxpAssetPlugin;
-
-/**
- * Tests of asset plugin.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class FxpAssetPluginTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var FxpAssetPlugin
- */
- protected $plugin;
-
- /**
- * @var Composer
- */
- protected $composer;
-
- /**
- * @var IOInterface
- */
- protected $io;
-
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- protected $package;
-
- protected function setUp()
- {
- $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
- $config = $this->getMockBuilder('Composer\Config')->getMock();
- $config->expects($this->any())
- ->method('get')
- ->will($this->returnCallback(function ($key) {
- $value = null;
-
- switch ($key) {
- case 'cache-repo-dir':
- $value = sys_get_temp_dir().'/composer-test-repo-cache';
- break;
- }
-
- return $value;
- }));
- $this->package = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
- $this->package->expects($this->any())
- ->method('getRequires')
- ->will($this->returnValue(array()));
- $this->package->expects($this->any())
- ->method('getDevRequires')
- ->will($this->returnValue(array()));
-
- /* @var IOInterface $io */
- /* @var Config $config */
- $rm = new RepositoryManager($io, $config);
- $im = new InstallationManager();
-
- $composer = $this->getMockBuilder('Composer\Composer')->getMock();
- $composer->expects($this->any())
- ->method('getRepositoryManager')
- ->will($this->returnValue($rm));
- $composer->expects($this->any())
- ->method('getPackage')
- ->will($this->returnValue($this->package));
- $composer->expects($this->any())
- ->method('getConfig')
- ->will($this->returnValue($config));
- $composer->expects($this->any())
- ->method('getInstallationManager')
- ->will($this->returnValue($im));
-
- $this->plugin = new FxpAssetPlugin();
- $this->composer = $composer;
- $this->io = $io;
- }
-
- protected function tearDown()
- {
- $this->plugin = null;
- $this->composer = null;
- $this->io = null;
-
- $fs = new Filesystem();
- $fs->remove(sys_get_temp_dir().'/composer-test-repo-cache');
- }
-
- public function testAssetRepositories()
- {
- $this->package->expects($this->any())
- ->method('getConfig')
- ->will($this->returnValue(array(
- 'fxp-asset' => array(
- 'private-bower-registries' => array(
- 'my-private-bower-server' => 'https://my-private-bower-server.tld/packages',
- ),
- ),
- )));
-
- $this->plugin->activate($this->composer, $this->io);
- $repos = $this->composer->getRepositoryManager()->getRepositories();
-
- $this->assertCount(3, $repos);
- foreach ($repos as $repo) {
- $this->assertInstanceOf('Composer\Repository\ComposerRepository', $repo);
- }
- }
-
- /**
- * @dataProvider getDataForAssetVcsRepositories
- *
- * @param string $type
- */
- public function testAssetVcsRepositories($type)
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array()));
-
- $this->plugin->activate($this->composer, $this->io);
- $rm = $this->composer->getRepositoryManager();
- $repo = $rm->createRepository($type, array(
- 'type' => $type,
- 'url' => 'http://foo.tld',
- 'name' => 'foo',
- ));
-
- $this->assertInstanceOf('Composer\Repository\VcsRepository', $repo);
- }
-
- public function getDataForAssetVcsRepositories()
- {
- return array(
- array('npm-vcs'),
- array('npm-git'),
- array('npm-github'),
-
- array('bower-vcs'),
- array('bower-git'),
- array('bower-github'),
- );
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetRepositoryWithValueIsNotArray()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- 'invalid_repo',
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetRepositoryWithInvalidType()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array(),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetRepositoryWithInvalidTypeFormat()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'invalid_type'),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetRepositoryWithInvalidUrl()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'npm-vcs'),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- public function testAssetRepository()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'npm-vcs', 'url' => 'http://foo.tld', 'name' => 'foo'),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- $repos = $this->composer->getRepositoryManager()->getRepositories();
-
- $this->assertCount(3, $repos);
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository', $repos[2]);
- }
-
- public function testAssetRepositoryWithAlreadyExistRepositoryName()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'npm-vcs', 'url' => 'http://foo.tld', 'name' => 'foo'),
- array('type' => 'npm-vcs', 'url' => 'http://foo.tld', 'name' => 'foo'),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- $repos = $this->composer->getRepositoryManager()->getRepositories();
-
- $this->assertCount(3, $repos);
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository', $repos[2]);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetPackageWithoutPackage()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'package'),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testAssetPackageWithInvalidPackage()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array('type' => 'package', 'package' => array('key' => 'value')),
- ))));
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- public function testAssetPackageRepositories()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array('asset-repositories' => array(
- array(
- 'type' => 'package',
- 'package' => array(
- 'name' => 'foo',
- 'type' => 'ASSET-asset-library',
- 'version' => '0.0.0.0',
- 'dist' => array(
- 'url' => 'foo.tld/bar',
- 'type' => 'file',
- ),
- ),
- ),
- ))));
-
- $rm = $this->composer->getRepositoryManager();
- $rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository');
- $this->plugin->activate($this->composer, $this->io);
- $repos = $this->composer->getRepositoryManager()->getRepositories();
-
- $this->assertCount(3, $repos);
- $this->assertInstanceOf('Composer\Repository\PackageRepository', $repos[2]);
- }
-
- public function testOptionsForAssetRegistryRepositories()
- {
- $this->package->expects($this->any())
- ->method('getConfig')
- ->will($this->returnValue(array(
- 'fxp-asset' => array(
- 'registry-options' => array(
- 'npm-option1' => 'value 1',
- 'bower-option1' => 'value 2',
- ),
- ),
- )));
- $this->assertInstanceOf('Composer\Package\RootPackageInterface', $this->package);
-
- $this->plugin->activate($this->composer, $this->io);
- }
-
- public function testSubscribeEvents()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array()));
-
- $this->assertCount(2, $this->plugin->getSubscribedEvents());
- $this->assertCount(0, $this->composer->getRepositoryManager()->getRepositories());
-
- /* @var InstallerEvent|\PHPUnit_Framework_MockObject_MockObject $eventInstaller */
- $eventInstaller = $this->getMockBuilder('Composer\Installer\InstallerEvent')
- ->disableOriginalConstructor()
- ->getMock();
- $eventInstaller->expects($this->any())
- ->method('getPool')
- ->will($this->returnValue($this->getMockBuilder(Pool::class)
- ->disableOriginalConstructor()
- ->getMock()
- ));
- /* @var CommandEvent|\PHPUnit_Framework_MockObject_MockObject $eventCommand */
- $eventCommand = $this->getMockBuilder('Composer\Plugin\CommandEvent')
- ->disableOriginalConstructor()
- ->getMock();
- $eventCommand->expects($this->any())
- ->method('getCommandName')
- ->will($this->returnValue('show'));
-
- $this->plugin->activate($this->composer, $this->io);
- $this->plugin->onPluginCommand($eventCommand);
- $this->plugin->onPreDependenciesSolving($eventInstaller);
- }
-
- public function testAssetInstallers()
- {
- $this->package->expects($this->any())
- ->method('getExtra')
- ->will($this->returnValue(array()));
-
- $this->plugin->activate($this->composer, $this->io);
- $im = $this->composer->getInstallationManager();
-
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Installer\BowerInstaller', $im->getInstaller('bower-asset-library'));
- $this->assertInstanceOf('Fxp\Composer\AssetPlugin\Installer\AssetInstaller', $im->getInstaller('npm-asset-library'));
- }
-
- public function testGetConfig()
- {
- $this->plugin->activate($this->composer, $this->io);
-
- $config = $this->plugin->getConfig();
- $this->assertInstanceOf(\Fxp\Composer\AssetPlugin\Config\Config::class, $config);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Package;
-
-use Composer\Package\CompletePackage;
-use Fxp\Composer\AssetPlugin\Package\LazyCompletePackage;
-use Fxp\Composer\AssetPlugin\Package\LazyPackageInterface;
-use Fxp\Composer\AssetPlugin\Package\Loader\LazyLoaderInterface;
-
-/**
- * Tests of lazy asset package loader.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class LazyCompletePackageTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var LazyPackageInterface
- */
- protected $package;
-
- protected function setUp()
- {
- $this->package = new LazyCompletePackage('foo', '1.0.0.0', '1.0');
- }
-
- protected function tearDown()
- {
- $this->package = null;
- }
-
- public function getConfigLazyLoader()
- {
- return array(
- array(null),
- array('lazy'),
- array('lazy-exception'),
- );
- }
-
- /**
- * @param string $lazyType
- *
- * @dataProvider getConfigLazyLoader
- */
- public function testMissingAssetType($lazyType)
- {
- if (null !== $lazyType) {
- $lp = 'lazy' === $lazyType
- ? new CompletePackage($this->package->getName(),
- $this->package->getVersion(), $this->package->getPrettyVersion())
- : false;
-
- $loader = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Package\Loader\LazyLoaderInterface')->getMock();
- $loader
- ->expects($this->any())
- ->method('load')
- ->will($this->returnValue($lp));
-
- /* @var LazyLoaderInterface$loader */
- $this->package->setLoader($loader);
- }
-
- $this->assertSame('library', $this->package->getType());
- $this->assertSame(array(), $this->package->getTransportOptions());
- $this->assertNull($this->package->getTargetDir());
- $this->assertSame(array(), $this->package->getExtra());
- $this->assertSame(array(), $this->package->getBinaries());
- $this->assertNull($this->package->getInstallationSource());
- $this->assertNull($this->package->getSourceType());
- $this->assertNull($this->package->getSourceUrl());
- $this->assertNull($this->package->getSourceReference());
- $this->assertNull($this->package->getSourceMirrors());
- $this->assertSame(array(), $this->package->getSourceUrls());
- $this->assertNull($this->package->getDistType());
- $this->assertNull($this->package->getDistUrl());
- $this->assertNull($this->package->getDistReference());
- $this->assertNull($this->package->getDistSha1Checksum());
- $this->assertNull($this->package->getDistMirrors());
- $this->assertSame(array(), $this->package->getDistUrls());
- $this->assertNull($this->package->getReleaseDate());
- $this->assertSame(array(), $this->package->getRequires());
- $this->assertSame(array(), $this->package->getConflicts());
- $this->assertSame(array(), $this->package->getProvides());
- $this->assertSame(array(), $this->package->getReplaces());
- $this->assertSame(array(), $this->package->getDevRequires());
- $this->assertSame(array(), $this->package->getSuggests());
- $this->assertSame(array(), $this->package->getAutoload());
- $this->assertSame(array(), $this->package->getDevAutoload());
- $this->assertSame(array(), $this->package->getIncludePaths());
- $this->assertNull($this->package->getNotificationUrl());
- $this->assertSame(array(), $this->package->getArchiveExcludes());
- $this->assertSame(array(), $this->package->getScripts());
- $this->assertNull($this->package->getRepositories());
- $this->assertSame(array(), $this->package->getLicense());
- $this->assertNull($this->package->getKeywords());
- $this->assertNull($this->package->getAuthors());
- $this->assertNull($this->package->getDescription());
- $this->assertNull($this->package->getHomepage());
- $this->assertSame(array(), $this->package->getSupport());
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Config;
-use Composer\DependencyResolver\Pool;
-use Composer\Downloader\TransportException;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Composer\Repository\RepositoryManager;
-use Fxp\Composer\AssetPlugin\Config\Config as AssetConfig;
-use Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository;
-use Fxp\Composer\AssetPlugin\Repository\AssetRepositoryManager;
-use Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository;
-use Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter;
-
-/**
- * Abstract class for Tests of assets repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-abstract class AbstractAssetsRepositoryTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var IOInterface|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $io;
-
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var RepositoryManager
- */
- protected $rm;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- /**
- * @var AbstractAssetsRepository
- */
- protected $registry;
-
- /**
- * @var Pool
- */
- protected $pool;
-
- protected function setUp()
- {
- $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
- $io->expects($this->any())
- ->method('isVerbose')
- ->will($this->returnValue(true));
- /* @var IOInterface $io */
- $config = new Config();
- $config->merge(array(
- 'config' => array(
- 'home' => sys_get_temp_dir().'/composer-test',
- 'cache-repo-dir' => sys_get_temp_dir().'/composer-test-cache-repo',
- ),
- ));
- /* @var VcsPackageFilter $filter */
- $filter = $this->getMockBuilder(VcsPackageFilter::class)->disableOriginalConstructor()->getMock();
- $rm = new RepositoryManager($io, $config);
- $rm->setRepositoryClass($this->getType().'-vcs', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\MockAssetRepository');
- $this->assetRepositoryManager = new AssetRepositoryManager($io, $rm, new AssetConfig(array()), $filter);
- $repoConfig = array_merge(array(
- 'asset-repository-manager' => $this->assetRepositoryManager,
- 'asset-options' => array(
- 'searchable' => true,
- ),
- ), $this->getCustomRepoConfig());
-
- $this->io = $io;
- $this->config = $config;
- $this->rm = $rm;
- $this->registry = $this->getRegistry($repoConfig, $io, $config);
- $this->pool = $this->getMockBuilder('Composer\DependencyResolver\Pool')->getMock();
- }
-
- protected function tearDown()
- {
- $this->io = null;
- $this->config = null;
- $this->rm = null;
- $this->registry = null;
- $this->pool = null;
- }
-
- protected function getCustomRepoConfig()
- {
- return array();
- }
-
- /**
- * Gets the asset type.
- *
- * @return string
- */
- abstract protected function getType();
-
- /**
- * Gets the asset registry.
- *
- * @param array $repoConfig
- * @param IOInterface $io
- * @param Config $config
- * @param EventDispatcher $eventDispatcher
- *
- * @return AbstractAssetsRepository
- */
- abstract protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null);
-
- /**
- * Gets the mock package of asset for the config of VCS repository.
- *
- * @return array
- */
- abstract protected function getMockPackageForVcsConfig();
-
- /**
- * Gets the mock search result.
- *
- * @param string $name
- *
- * @return array
- */
- abstract protected function getMockSearchResult($name = 'mock-package');
-
- /**
- * Replaces the Remote file system of Registry by a mock.
- *
- * @return \PHPUnit_Framework_MockObject_MockObject
- */
- protected function replaceRegistryRfsByMock()
- {
- $ref = new \ReflectionClass($this->registry);
- $pRef = $ref->getParentClass()->getParentClass();
- $pRfs = $pRef->getProperty('rfs');
- $pRfs->setAccessible(true);
-
- $rfs = $this->getMockBuilder('Composer\Util\RemoteFilesystem')
- ->setConstructorArgs(array($this->io, $this->config))
- ->getMock();
-
- $pRfs->setValue($this->registry, $rfs);
-
- return $rfs;
- }
-
- public function testFindPackageMustBeAlwaysNull()
- {
- $this->assertNull($this->registry->findPackage('foobar', '0'));
- }
-
- public function testFindPackageMustBeAlwaysEmpty()
- {
- $this->assertCount(0, $this->registry->findPackages('foobar', '0'));
- }
-
- /**
- * @expectedException \LogicException
- */
- public function testGetPackagesNotBeUsed()
- {
- $this->registry->getPackages();
- }
-
- public function testGetProviderNamesMustBeEmpty()
- {
- $this->assertCount(0, $this->registry->getProviderNames());
- }
-
- public function testGetMinimalPackagesMustBeAlwaysEmpty()
- {
- $this->assertCount(0, $this->registry->getMinimalPackages());
- }
-
- public function testWhatProvidesWithNotAssetName()
- {
- $this->assertCount(0, $this->registry->whatProvides($this->pool, 'foo/bar'));
- }
-
- public function testWhatProvidesWithNonExistentPackage()
- {
- $name = $this->getType().'-asset/non-existent';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->throwException(new TransportException('Package not found')));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->rm->getRepositories());
- }
-
- public function testWhatProvidesWithExistingPackage()
- {
- $name = $this->getType().'-asset/existing';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockPackageForVcsConfig())));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- }
-
- public function testWhatProvidesWithExistingAliasPackage()
- {
- $name = $this->getType().'-asset/existing-1.0';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockPackageForVcsConfig())));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- }
-
- public function testWhatProvidesWithCamelcasePackageName()
- {
- $assetName = 'CamelCasePackage';
- $name = $this->getType().'-asset/'.strtolower($assetName);
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->at(0))
- ->method('getContents')
- ->will($this->throwException(new TransportException('Package not found', 404)));
- $rfs->expects($this->at(1))
- ->method('getContents')
- ->will($this->throwException(new TransportException('Package not found', 404)));
- $rfs->expects($this->at(2))
- ->method('getContents')
- ->will($this->throwException(new TransportException('Package not found', 404)));
- $rfs->expects($this->at(3))
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockSearchResult($assetName))));
- $rfs->expects($this->at(4))
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockPackageForVcsConfig())));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- }
-
- public function testSearch()
- {
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockSearchResult())));
-
- $result = $this->registry->search('query');
- $this->assertCount(count($this->getMockSearchResult()), $result);
- }
-
- public function testSearchWithAssetComposerPrefix()
- {
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockSearchResult())));
-
- $result = $this->registry->search($this->getType().'-asset/query');
- $this->assertCount(count($this->getMockSearchResult()), $result);
- }
-
- public function testSearchWithSearchDisabled()
- {
- $repoConfig = array(
- 'asset-repository-manager' => $this->assetRepositoryManager,
- 'asset-options' => array(
- 'searchable' => false,
- ),
- );
- $this->registry = $this->getRegistry($repoConfig, $this->io, $this->config);
-
- $this->assertCount(0, $this->registry->search('query'));
- }
-
- public function testOverridingVcsRepositoryConfig()
- {
- $name = $this->getType().'-asset/foobar';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode($this->getMockPackageForVcsConfig())));
-
- $repo = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository')
- ->disableOriginalConstructor()
- ->getMock();
-
- $repo->expects($this->any())
- ->method('getComposerPackageName')
- ->will($this->returnValue($name));
-
- /* @var AssetVcsRepository $repo */
- $this->rm->addRepository($repo);
-
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\DependencyResolver\Pool;
-use Composer\IO\IOInterface;
-use Composer\Repository\RepositoryInterface;
-use Composer\Repository\RepositoryManager;
-use Fxp\Composer\AssetPlugin\Config\Config;
-use Fxp\Composer\AssetPlugin\Repository\AssetRepositoryManager;
-use Fxp\Composer\AssetPlugin\Repository\ResolutionManager;
-use Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter;
-
-/**
- * Tests of Asset Repository Manager.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class AssetRepositoryManagerTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var RepositoryManager|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $rm;
-
- /**
- * @var IOInterface|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $io;
-
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var VcsPackageFilter|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $filter;
-
- /**
- * @var ResolutionManager|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $resolutionManager;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- protected function setUp()
- {
- $this->io = $this->getMockBuilder(IOInterface::class)->getMock();
- $this->rm = $this->getMockBuilder(RepositoryManager::class)->disableOriginalConstructor()->getMock();
- $this->config = new Config(array());
- $this->filter = $this->getMockBuilder(VcsPackageFilter::class)->disableOriginalConstructor()->getMock();
-
- $this->resolutionManager = $this->getMockBuilder(ResolutionManager::class)->getMock();
- $this->assetRepositoryManager = new AssetRepositoryManager($this->io, $this->rm, $this->config, $this->filter);
- }
-
- public function getDataForSolveResolutions()
- {
- return array(
- array(true),
- array(false),
- );
- }
-
- /**
- * @dataProvider getDataForSolveResolutions
- *
- * @param bool $withResolutionManager
- */
- public function testSolveResolutions($withResolutionManager)
- {
- $expected = array(
- 'name' => 'foo/bar',
- );
-
- if ($withResolutionManager) {
- $this->assetRepositoryManager->setResolutionManager($this->resolutionManager);
- $this->resolutionManager->expects($this->once())
- ->method('solveResolutions')
- ->with($expected)
- ->willReturn($expected);
- } else {
- $this->resolutionManager->expects($this->never())
- ->method('solveResolutions');
- }
-
- $data = $this->assetRepositoryManager->solveResolutions($expected);
-
- $this->assertSame($expected, $data);
- }
-
- public function testAddRepositoryInPool()
- {
- $repos = array(
- array(
- 'name' => 'foo/bar',
- 'type' => 'asset-vcs',
- 'url' => 'https://github.com/helloguest/helloguest-ui-app.git',
- ),
- );
-
- $repoConfigExpected = array_merge($repos[0], array(
- 'asset-repository-manager' => $this->assetRepositoryManager,
- 'vcs-package-filter' => $this->filter,
- ));
-
- $repo = $this->getMockBuilder(RepositoryInterface::class)->getMock();
-
- $this->rm->expects($this->once())
- ->method('createRepository')
- ->with('asset-vcs', $repoConfigExpected)
- ->willReturn($repo);
-
- $this->assetRepositoryManager->addRepositories($repos);
-
- /* @var Pool|\PHPUnit_Framework_MockObject_MockObject $pool */
- $pool = $this->getMockBuilder(Pool::class)->disableOriginalConstructor()->getMock();
- $pool->expects($this->once())
- ->method('addRepository')
- ->with($repo);
-
- $this->assetRepositoryManager->setPool($pool);
- }
-
- public function testGetConfig()
- {
- $this->assertSame($this->config, $this->assetRepositoryManager->getConfig());
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\Package\AliasPackage;
-use Composer\Package\CompletePackage;
-use Composer\Package\PackageInterface;
-use Composer\Repository\InvalidRepositoryException;
-use Fxp\Composer\AssetPlugin\Repository\AssetRepositoryManager;
-use Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository;
-use Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter;
-use Fxp\Composer\AssetPlugin\Tests\Fixtures\IO\MockIO;
-use Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriver;
-
-/**
- * Tests of asset vcs repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class AssetVcsRepositoryTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Config
- */
- protected $config;
-
- /**
- * @var EventDispatcher
- */
- protected $dispatcher;
-
- /**
- * @var MockIO
- */
- protected $io;
-
- /**
- * @var AssetRepositoryManager
- */
- protected $assetRepositoryManager;
-
- /**
- * @var AssetVcsRepository
- */
- protected $repository;
-
- protected function setUp()
- {
- $this->config = new Config();
- /* @var EventDispatcher $dispatcher */
- $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
- ->disableOriginalConstructor()
- ->getMock();
- $this->dispatcher = $dispatcher;
- $this->assetRepositoryManager = $this->getMockBuilder(AssetRepositoryManager::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->assetRepositoryManager->expects($this->any())
- ->method('solveResolutions')
- ->willReturnCallback(function ($value) {
- return $value;
- });
- }
-
- protected function tearDown()
- {
- $this->config = null;
- $this->dispatcher = null;
- $this->io = null;
- $this->repository = null;
- }
-
- /**
- * Data provider.
- *
- * @return array
- */
- public function getDefaultDrivers()
- {
- return array(
- array('npm-github', 'http://example.org/foo.git', 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitHubDriver'),
- array('npm-git', 'http://example.org/foo.git', 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitDriver'),
- array('bower-github', 'http://example.org/foo.git', 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitHubDriver'),
- array('bower-git', 'http://example.org/foo.git', 'Fxp\Composer\AssetPlugin\Repository\Vcs\GitDriver'),
- );
- }
-
- /**
- * @dataProvider getDefaultDrivers
- *
- * @param string $type
- * @param string $url
- */
- public function testDefaultConstructor($type, $url)
- {
- $this->init(false, $type, $url, '', false, array());
- $this->assertEquals(0, $this->repository->count());
- }
-
- /**
- * Data provider.
- *
- * @return array
- */
- public function getMockDrivers()
- {
- return array(
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriver'),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriver'),
- );
- }
-
- /**
- * @dataProvider getMockDrivers
- *
- * @param string $type
- * @param string $url
- * @param string $class
- *
- * @expectedException \Composer\Repository\InvalidRepositoryException
- * @expectedExceptionMessageRegExp /No valid (bower|package).json was found in any branch or tag of http:\/\/example.org\/foo, could not load a package from it./
- */
- public function testNotDriverFound($type, $url, $class)
- {
- $this->init(false, $type, $url, $class);
- $this->repository->getPackages();
- }
-
- /**
- * @dataProvider getMockDrivers
- *
- * @param string $type
- * @param string $url
- * @param string $class
- *
- * @expectedException \Composer\Repository\InvalidRepositoryException
- */
- public function testWithoutValidPackage($type, $url, $class)
- {
- $this->init(true, $type, $url, $class);
- $this->repository->getPackages();
- }
-
- /**
- * Data provider.
- *
- * @return array
- */
- public function getMockDriversSkipParsing()
- {
- return array(
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverSkipParsing', false),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverSkipParsing', false),
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverSkipParsing', true),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverSkipParsing', true),
- );
- }
-
- /**
- * @dataProvider getMockDriversSkipParsing
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testSkipParsingFile($type, $url, $class, $verbose)
- {
- $validTraces = array('');
- if ($verbose) {
- $validTraces = array(
- '<error>Skipped parsing ROOT, MESSAGE with ROOT</error>',
- '',
- );
- }
-
- $this->init(true, $type, $url, $class, $verbose);
-
- try {
- $this->repository->getPackages();
- } catch (InvalidRepositoryException $e) {
- // for analysis the IO traces
- }
- $this->assertSame($validTraces, $this->io->getTraces());
- }
-
- /**
- * Data provider.
- *
- * @return array
- */
- public function getMockDriversWithVersions()
- {
- return array(
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithPackages', false),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithPackages', false),
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithPackages', true),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithPackages', true),
- );
- }
-
- /**
- * @dataProvider getMockDriversWithVersions
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testRepositoryPackageName($type, $url, $class, $verbose)
- {
- $packageName = 'asset-package-name';
- $valid = str_replace('-mock', '-asset', $type).'/'.$packageName;
-
- $this->init(true, $type, $url, $class, $verbose, null, $packageName);
-
- $this->assertEquals($valid, $this->repository->getComposerPackageName());
- }
-
- /**
- * @dataProvider getMockDriversWithVersions
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testWithTagsAndBranchs($type, $url, $class, $verbose)
- {
- $validPackageName = substr($type, 0, strpos($type, '-')).'-asset/foobar';
- $validTraces = array('');
- if ($verbose) {
- $validTraces = array(
- '<warning>Skipped tag invalid, invalid tag name</warning>',
- '',
- );
- }
-
- $this->init(true, $type, $url, $class, $verbose);
-
- /* @var PackageInterface[] $packages */
- $packages = $this->repository->getPackages();
- $this->assertCount(7, $packages);
-
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
-
- $this->assertInstanceOf('Composer\Package\CompletePackage', $package);
- $this->assertSame($validPackageName, $package->getName());
- }
-
- $this->assertSame($validTraces, $this->io->getTraces());
- }
-
- /**
- * Data provider.
- *
- * @return array
- */
- public function getMockDriversWithVersionsAndWithoutName()
- {
- return array(
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithUrlPackages', false),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithUrlPackages', false),
- array('npm-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithUrlPackages', true),
- array('bower-mock', 'http://example.org/foo', 'Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs\MockVcsDriverWithUrlPackages', true),
- );
- }
-
- /**
- * @dataProvider getMockDriversWithVersionsAndWithoutName
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testWithTagsAndBranchsWithoutPackageName($type, $url, $class, $verbose)
- {
- $validPackageName = $url;
- $validTraces = array('');
- if ($verbose) {
- $validTraces = array(
- '<warning>Skipped tag invalid, invalid tag name</warning>',
- '',
- );
- }
-
- $this->init(true, $type, $url, $class, $verbose);
-
- /* @var PackageInterface[] $packages */
- $packages = $this->repository->getPackages();
- $this->assertCount(7, $packages);
-
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
-
- $this->assertInstanceOf('Composer\Package\CompletePackage', $package);
- $this->assertSame($validPackageName, $package->getName());
- }
-
- $this->assertSame($validTraces, $this->io->getTraces());
- }
-
- /**
- * @dataProvider getMockDriversWithVersions
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testWithTagsAndBranchsWithRegistryPackageName($type, $url, $class, $verbose)
- {
- $validPackageName = substr($type, 0, strpos($type, '-')).'-asset/registry-foobar';
- $validTraces = array('');
- if ($verbose) {
- $validTraces = array(
- '<warning>Skipped tag invalid, invalid tag name</warning>',
- '',
- );
- }
-
- $this->init(true, $type, $url, $class, $verbose, null, 'registry-foobar');
-
- /* @var PackageInterface[] $packages */
- $packages = $this->repository->getPackages();
- $this->assertCount(7, $packages);
-
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
-
- $this->assertInstanceOf('Composer\Package\CompletePackage', $package);
- $this->assertSame($validPackageName, $package->getName());
- }
-
- $this->assertSame($validTraces, $this->io->getTraces());
- }
-
- /**
- * @dataProvider getMockDriversWithVersions
- *
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- */
- public function testWithFilterTags($type, $url, $class, $verbose)
- {
- $validPackageName = substr($type, 0, strpos($type, '-')).'-asset/registry-foobar';
- $validTraces = array('');
- if ($verbose) {
- $validTraces = array();
- }
-
- $filter = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter')
- ->disableOriginalConstructor()
- ->getMock();
-
- $filter->expects($this->any())
- ->method('skip')
- ->will($this->returnValue(true));
-
- /* @var VcsPackageFilter $filter */
- $this->init(true, $type, $url, $class, $verbose, null, 'registry-foobar', $filter);
-
- /* @var PackageInterface[] $packages */
- $packages = $this->repository->getPackages();
- $this->assertCount(5, $packages);
-
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
-
- $this->assertInstanceOf('Composer\Package\CompletePackage', $package);
- $this->assertSame($validPackageName, $package->getName());
- }
-
- $this->assertSame($validTraces, $this->io->getTraces());
- }
-
- /**
- * @dataProvider getMockDrivers
- *
- * @param string $type
- * @param string $url
- * @param string $class
- */
- public function testPackageWithRegistryVersions($type, $url, $class)
- {
- $registryPackages = array(
- new CompletePackage('package1', '0.1.0.0', '0.1'),
- new CompletePackage('package1', '0.2.0.0', '0.2'),
- new CompletePackage('package1', '0.3.0.0', '0.3'),
- new CompletePackage('package1', '0.4.0.0', '0.4'),
- new CompletePackage('package1', '0.5.0.0', '0.5'),
- new CompletePackage('package1', '0.6.0.0', '0.6'),
- new CompletePackage('package1', '0.7.0.0', '0.7'),
- new CompletePackage('package1', '0.8.0.0', '0.8'),
- new CompletePackage('package1', '0.9.0.0', '0.9'),
- new CompletePackage('package1', '1.0.0.0', '1.0'),
- );
-
- $this->init(true, $type, $url, $class, false, null, 'registry-foobar', null, $registryPackages);
-
- /* @var PackageInterface[] $packages */
- $packages = $this->repository->getPackages();
- $this->assertCount(10, $packages);
- $this->assertSame($registryPackages, $packages);
- }
-
- /**
- * Init the test.
- *
- * @param bool $supported
- * @param string $type
- * @param string $url
- * @param string $class
- * @param bool $verbose
- * @param array|null $drivers
- * @param string|null $registryName
- * @param VcsPackageFilter|null $vcsPackageFilter
- * @param array $registryPackages
- */
- protected function init($supported, $type, $url, $class, $verbose = false, $drivers = null, $registryName = null, VcsPackageFilter $vcsPackageFilter = null, array $registryPackages = array())
- {
- MockVcsDriver::$supported = $supported;
- $driverType = substr($type, strpos($type, '-') + 1);
- $repoConfig = array('type' => $type, 'url' => $url, 'name' => $registryName, 'vcs-package-filter' => $vcsPackageFilter, 'asset-repository-manager' => $this->assetRepositoryManager);
-
- if (null === $drivers) {
- $drivers = array(
- $driverType => $class,
- );
- }
-
- if (count($registryPackages) > 0) {
- $repoConfig['registry-versions'] = $registryPackages;
- }
-
- $this->io = $this->createIO($verbose);
- $this->repository = new AssetVcsRepository($repoConfig, $this->io, $this->config, $this->dispatcher, $drivers);
- }
-
- /**
- * @param bool $verbose
- *
- * @return MockIO
- */
- protected function createIO($verbose = false)
- {
- return new MockIO($verbose);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Fxp\Composer\AssetPlugin\Repository\BowerPrivateRepository;
-
-/**
- * Tests of Private Bower repository.
- *
- * @author Marcus Stüben <marcus@it-stueben.de>
- */
-class BowerPrivateRepositoryTest extends AbstractAssetsRepositoryTest
-{
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'bower';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
- {
- return new BowerPrivateRepository($repoConfig, $io, $config, $eventDispatcher);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockPackageForVcsConfig()
- {
- return array(
- 'url' => 'http://foo.tld',
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockSearchResult($name = 'mock-package')
- {
- return array(
- array(
- 'name' => $name,
- ),
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getCustomRepoConfig()
- {
- return array(
- 'private-registry-url' => 'http://foo.tld',
- );
- }
-
- /**
- * @expectedException \Fxp\Composer\AssetPlugin\Exception\InvalidCreateRepositoryException
- * @expectedExceptionMessage The "repository.url" parameter of "existing" bower asset package must be present for create a VCS Repository
- */
- public function testWhatProvidesWithInvalidPrivateUrl()
- {
- $name = $this->getType().'-asset/existing';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode(array())));
-
- $this->registry->whatProvides($this->pool, $name);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Config;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Fxp\Composer\AssetPlugin\Repository\BowerRepository;
-
-/**
- * Tests of Bower repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class BowerRepositoryTest extends AbstractAssetsRepositoryTest
-{
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'bower';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
- {
- return new BowerRepository($repoConfig, $io, $config, $eventDispatcher);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockPackageForVcsConfig()
- {
- return array(
- 'url' => 'http://foo.tld',
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockSearchResult($name = 'mock-package')
- {
- return array(
- array(
- 'name' => $name,
- ),
- );
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Config;
-use Composer\Downloader\TransportException;
-use Composer\EventDispatcher\EventDispatcher;
-use Composer\IO\IOInterface;
-use Fxp\Composer\AssetPlugin\Repository\NpmRepository;
-
-/**
- * Tests of NPM repository.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class NpmRepositoryTest extends AbstractAssetsRepositoryTest
-{
- /**
- * {@inheritdoc}
- */
- protected function getType()
- {
- return 'npm';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
- {
- return new NpmRepository($repoConfig, $io, $config, $eventDispatcher);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockPackageForVcsConfig()
- {
- return array(
- 'repository' => array(
- 'type' => 'vcs',
- 'url' => 'http://foo.tld',
- ),
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getMockSearchResult($name = 'mock-package')
- {
- return array();
- }
-
- public function testWhatProvidesWithCamelcasePackageName()
- {
- $name = $this->getType().'-asset/CamelCasePackage';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->throwException(new TransportException('Package not found', 404)));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->rm->getRepositories());
- }
-
- public function testWatProvidesWithoutRepositoryUrl()
- {
- $name = $this->getType().'-asset/foobar';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode(array(
- 'repository' => array(
- 'type' => 'vcs',
- ),
- 'versions' => array(
- '1.0.0' => array(
- 'name' => 'foobar',
- 'version' => '0.0.1',
- 'dependencies' => array(),
- 'dist' => array(
- 'shasum' => '1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d',
- 'tarball' => 'http://registry.tld/foobar/-/foobar-1.0.0.tgz',
- ),
- ),
- ),
- 'time' => array(
- '1.0.0' => '2016-09-20T13:48:47.730Z',
- ),
- ))));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- }
-
- public function testWhatProvidesWithBrokenVersionConstraint()
- {
- $name = $this->getType().'-asset/foobar';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode(array(
- 'repository' => array(
- 'type' => 'vcs',
- ),
- 'versions' => array(
- '1.0.0' => array(
- 'name' => 'foobar',
- 'version' => '0.0.1',
- 'dependencies' => array(),
- 'dist' => array(
- 'shasum' => '1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d',
- 'tarball' => 'http://registry.tld/foobar/-/foobar-1.0.0.tgz',
- ),
- ),
- '1.0.1' => array(
- 'name' => 'foobar',
- 'version' => '0.0.1',
- 'dependencies' => array(
- // This constraint is invalid. Whole version package version should be skipped.
- 'library1' => '^1.2,,<2.0',
- ),
- 'dist' => array(
- 'shasum' => '1d408b3fdb76923b9543d96fb4c9acd535d9cb7a',
- 'tarball' => 'http://registry.tld/foobar/-/foobar-1.0.1.tgz',
- ),
- ),
- '1.0.2' => array(
- 'name' => 'foobar',
- 'version' => '0.0.1',
- 'dependencies' => array(
- 'library1' => '^1.2,<2.0',
- ),
- 'dist' => array(
- 'shasum' => '1d408b3fdb76923b9543d96fb4c9acd535d9cb7a',
- 'tarball' => 'http://registry.tld/foobar/-/foobar-1.0.1.tgz',
- ),
- ),
- ),
- 'time' => array(
- '1.0.0' => '2016-09-20T13:48:47.730Z',
- ),
- ))));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- $this->assertCount(2, $this->rm->getRepositories()[0]->getPackages());
- }
-
- /**
- * @expectedException \Fxp\Composer\AssetPlugin\Exception\InvalidCreateRepositoryException
- * @expectedExceptionMessage "repository.url" parameter of "foobar"
- */
- public function testWatProvidesWithoutRepositoryUrlAndWithoutVersions()
- {
- $name = $this->getType().'-asset/foobar';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode(array())));
-
- $this->assertCount(0, $this->rm->getRepositories());
-
- $this->registry->whatProvides($this->pool, $name);
- }
-
- public function testWhatProvidesWithGitPlusHttpsUrl()
- {
- $name = $this->getType().'-asset/existing';
- $rfs = $this->replaceRegistryRfsByMock();
- $rfs->expects($this->any())
- ->method('getContents')
- ->will($this->returnValue(json_encode(array(
- 'repository' => array(
- 'type' => 'vcs',
- 'url' => 'git+https://foo.tld',
- ),
- ))));
-
- $this->assertCount(0, $this->rm->getRepositories());
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(0, $this->registry->whatProvides($this->pool, $name));
- $this->assertCount(1, $this->rm->getRepositories());
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Fxp\Composer\AssetPlugin\Repository\ResolutionManager;
-
-/**
- * Tests of Resolution Manager.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class ResolutionManagerTest extends \PHPUnit_Framework_TestCase
-{
- public function testSolveResolutions()
- {
- $rm = new ResolutionManager(array(
- 'foo/bar' => '^2.2.0',
- 'bar/foo' => '^0.2.0',
- ));
-
- $data = $rm->solveResolutions(array(
- 'require' => array(
- 'foo/bar' => '2.0.*',
- 'foo/baz' => '~1.0',
- ),
- 'require-dev' => array(
- 'bar/foo' => '^0.1.0',
- 'test/dev' => '~1.0@dev',
- ),
- ));
-
- $expected = array(
- 'require' => array(
- 'foo/bar' => '^2.2.0',
- 'foo/baz' => '~1.0',
- ),
- 'require-dev' => array(
- 'bar/foo' => '^0.2.0',
- 'test/dev' => '~1.0@dev',
- ),
- );
-
- $this->assertSame($expected, $data);
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Fxp\Composer\AssetPlugin\Repository\Util;
-
-/**
- * Repository Util Tests.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class UtilTest extends \PHPUnit_Framework_TestCase
-{
- public function getPackageNames()
- {
- return array(
- array('vendor/package', 'vendor/package'),
- array('vendor/package-name', 'vendor/package-name'),
- array('vendor/package_name', 'vendor/package_name'),
- array('vendor/package-1', 'vendor/package-1'),
- array('vendor/package_1', 'vendor/package_1'),
- array('vendor/package-name-1', 'vendor/package-name-1'),
- array('vendor/package_name_1', 'vendor/package_name_1'),
- array('vendor/package-1.0', 'vendor/package'),
- array('vendor/package-1.x', 'vendor/package'),
- array('vendor/package-1.X', 'vendor/package'),
- array('vendor/package-1.0.0', 'vendor/package'),
- array('vendor/package-1.0.x', 'vendor/package'),
- array('vendor/package-1.0.X', 'vendor/package'),
-
- array('vendor-name/package', 'vendor-name/package'),
- array('vendor-name/package-name', 'vendor-name/package-name'),
- array('vendor-name/package-1', 'vendor-name/package-1'),
- array('vendor-name/package-name-1', 'vendor-name/package-name-1'),
- array('vendor-name/package-1.0', 'vendor-name/package'),
- array('vendor-name/package-1.x', 'vendor-name/package'),
- array('vendor-name/package-1.X', 'vendor-name/package'),
- array('vendor-name/package-1.0.0', 'vendor-name/package'),
- array('vendor-name/package-1.0.x', 'vendor-name/package'),
- array('vendor-name/package-1.0.X', 'vendor-name/package'),
-
- array('vendor_name/package', 'vendor_name/package'),
- array('vendor_name/package-name', 'vendor_name/package-name'),
- array('vendor_name/package-1', 'vendor_name/package-1'),
- array('vendor_name/package-name-1', 'vendor_name/package-name-1'),
- array('vendor_name/package-1.0', 'vendor_name/package'),
- array('vendor_name/package-1.x', 'vendor_name/package'),
- array('vendor_name/package-1.X', 'vendor_name/package'),
- array('vendor_name/package-1.0.0', 'vendor_name/package'),
- array('vendor_name/package-1.0.x', 'vendor_name/package'),
- array('vendor_name/package-1.0.X', 'vendor_name/package'),
- );
- }
-
- /**
- * @dataProvider getPackageNames
- *
- * @param string $name
- * @param string $validName
- */
- public function testConvertAliasName($name, $validName)
- {
- $this->assertSame($validName, Util::convertAliasName($name));
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Fxp\Composer\AssetPlugin\Tests\Repository;
-
-use Composer\Composer;
-use Composer\Installer\InstallationManager;
-use Composer\Package\Loader\ArrayLoader;
-use Composer\Package\Package;
-use Composer\Package\RootPackageInterface;
-use Composer\Repository\InstalledFilesystemRepository;
-use Fxp\Composer\AssetPlugin\Config\ConfigBuilder;
-use Fxp\Composer\AssetPlugin\Package\Version\VersionParser;
-use Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter;
-use Fxp\Composer\AssetPlugin\Type\AssetTypeInterface;
-
-/**
- * Tests of VCS Package Filter.
- *
- * @author François Pluchino <francois.pluchino@gmail.com>
- */
-class VcsPackageFilterTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Composer|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $composer;
-
- /**
- * @var RootPackageInterface|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $package;
-
- /**
- * @var InstallationManager|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $installationManager;
-
- /**
- * @var InstalledFilesystemRepository|\PHPUnit_Framework_MockObject_MockObject|null
- */
- protected $installedRepository;
-
- /**
- * @var AssetTypeInterface|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $assetType;
-
- /**
- * @var VcsPackageFilter
- */
- protected $filter;
-
- protected function setUp()
- {
- $this->composer = $this->getMockBuilder('Composer\Composer')->disableOriginalConstructor()->getMock();
- $this->package = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
- $this->assetType = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Type\AssetTypeInterface')->getMock();
-
- $versionConverter = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Converter\VersionConverterInterface')->getMock();
- $versionConverter->expects($this->any())
- ->method('convertVersion')
- ->will($this->returnCallback(function ($value) {
- return $value;
- }));
- $this->assetType->expects($this->any())
- ->method('getVersionConverter')
- ->will($this->returnValue($versionConverter));
-
- $this->installationManager = $this->getMockBuilder('Composer\Installer\InstallationManager')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->installationManager->expects($this->any())
- ->method('isPackageInstalled')
- ->will($this->returnValue(true));
-
- $this->composer->expects($this->any())
- ->method('getPackage')
- ->willReturn($this->package);
- }
-
- protected function tearDown()
- {
- $this->package = null;
- $this->installedRepository = null;
- $this->assetType = null;
- $this->filter = null;
- }
-
- public function getDataProvider()
- {
- $configSkipPattern = array('pattern-skip-version' => false);
- $configSkipPatternPath = array('pattern-skip-version' => '(-patch)');
-
- return array(
- array('acme/foobar', 'v1.0.0', 'stable', array(), false),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'dev', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'dev', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'dev', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'dev', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '>=1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '>=1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '>=1.0@dev'), false),
-
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '>=1.0@dev'), false),
-
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '>=1.0@dev'), false),
-
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0@beta'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0@beta'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0@beta'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0@beta'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '>=1.0@dev'), false),
-
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@stable'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@RC'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@beta'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@alpha'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0@dev'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@stable'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@RC'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@beta'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@alpha'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '>=1.0@dev'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@stable'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@RC'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@beta'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@alpha'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '>=1.0@dev'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@stable'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@RC'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@beta'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@alpha'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '>=1.0@dev'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '~1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '~1.0'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '~1.0'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '~1.0'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '~1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '~1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '~1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '@stable'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '@RC'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '@beta'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '@alpha'), false),
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '@dev'), false),
-
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '@stable'), true),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '@dev'), false),
-
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '@RC'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '@dev'), false),
-
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '@beta'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '@dev'), false),
-
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@stable'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@RC'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@beta'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@alpha'), true, $configSkipPatternPath),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '@dev'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'RC', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'RC', array('acme/foobar' => '1.0-RC1'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'RC', array('acme/foobar' => '1.0-beta1'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'RC', array('acme/foobar' => '1.0-alpha1'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '1.0-patch1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '1.0-patch1'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'RC', array('acme/foobar' => '1.0-patch1'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'beta', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'beta', array('acme/foobar' => '1.0-RC1'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'beta', array('acme/foobar' => '1.0-beta1'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'beta', array('acme/foobar' => '1.0-alpha1'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '1.0-patch1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '1.0-patch1'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'beta', array('acme/foobar' => '1.0-patch1'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'alpha', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'alpha', array('acme/foobar' => '1.0-RC1'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'alpha', array('acme/foobar' => '1.0-beta1'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'alpha', array('acme/foobar' => '1.0-alpha1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '1.0-patch1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '1.0-patch1'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'alpha', array('acme/foobar' => '1.0-patch1'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'dev', array('acme/foobar' => '1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'dev', array('acme/foobar' => '1.0-RC1'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'dev', array('acme/foobar' => '1.0-beta1'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'dev', array('acme/foobar' => '1.0-alpha1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '1.0-patch1'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '1.0-patch1'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'dev', array('acme/foobar' => '1.0-patch1'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@stable'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1@stable'), true),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1@stable'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1@stable'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@stable'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@stable'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@stable'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1@RC'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1@RC'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@RC'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@beta'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1@beta'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1@beta'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1@beta'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@beta'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@beta'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@beta'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@alpha'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1@alpha'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1@alpha'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@alpha'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@alpha'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@alpha'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@dev'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0-RC1@dev'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0-beta1@dev'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0-alpha1@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@dev'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@dev'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0-patch1@dev'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*@RC'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), true),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), true),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0 | 1.0.*@RC'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '1.0@dev|1.0.*@RC'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), false, $configSkipPattern),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '1.0@dev | 1.0.*'), true, $configSkipPatternPath),
-
- array('acme/foobar', 'standard/1.0.0', 'stable', array('acme/foobar' => '>=1.0'), true),
- );
- }
-
- /**
- * @dataProvider getDataProvider
- *
- * @param string $packageName
- * @param string $version
- * @param string $minimumStability
- * @param array $rootRequires
- * @param bool $validSkip
- * @param array $rootConfig
- */
- public function testSkipVersion($packageName, $version, $minimumStability, array $rootRequires, $validSkip, array $rootConfig = array())
- {
- $this->init($rootRequires, $minimumStability, $rootConfig);
-
- $this->assertSame($validSkip, $this->filter->skip($this->assetType, $packageName, $version));
- }
-
- public function getDataProviderForDisableTest()
- {
- return array(
- array('acme/foobar', 'v1.0.0', 'stable', array(), false),
-
- array('acme/foobar', 'v1.0.0', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-RC1', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-beta1', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-alpha1', 'stable', array('acme/foobar' => '>=1.0'), false),
- array('acme/foobar', 'v1.0.0-patch1', 'stable', array('acme/foobar' => '>=1.0'), false),
- );
- }
-
- /**
- * @dataProvider getDataProviderForDisableTest
- *
- * @param $packageName
- * @param $version
- * @param $minimumStability
- * @param array $rootRequires
- * @param $validSkip
- */
- public function testDisabledFilterWithInstalledPackage($packageName, $version, $minimumStability, array $rootRequires, $validSkip)
- {
- $this->init($rootRequires, $minimumStability);
- $this->filter->setEnabled(false);
-
- $this->assertSame($validSkip, $this->filter->skip($this->assetType, $packageName, $version));
- }
-
- public function getDataForInstalledTests()
- {
- $optn = 'optimize-with-installed-packages';
- $optn2 = 'optimize-with-conjunctive';
-
- $opt1 = array();
- $opt2 = array($optn => true, $optn2 => true);
- $opt3 = array($optn => false, $optn2 => true);
- $opt4 = array($optn => true, $optn2 => false);
-
- return array(
- array($opt1, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', '1.0.0', true),
- array($opt2, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', '1.0.0', true),
- array($opt3, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', '1.0.0', false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', '1.0.0', false),
- array($opt1, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', '1.0.0', true),
- array($opt2, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', '1.0.0', true),
- array($opt3, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', '1.0.0', false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', '1.0.0', false),
-
- array($opt1, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', null, false),
- array($opt2, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', null, false),
- array($opt3, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', null, false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'stable', '>=0.9', null, false),
- array($opt1, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', null, false),
- array($opt2, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', null, false),
- array($opt3, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', null, false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'stable', '>=0.9', null, false),
-
- array($opt1, 'acme/foobar', 'v1.0.0', 'stable', null, '1.0.0', true),
- array($opt2, 'acme/foobar', 'v1.0.0', 'stable', null, '1.0.0', true),
- array($opt3, 'acme/foobar', 'v1.0.0', 'stable', null, '1.0.0', false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'stable', null, '1.0.0', true),
- array($opt1, 'acme/foobar', 'v0.9.0', 'stable', null, '1.0.0', true),
- array($opt2, 'acme/foobar', 'v0.9.0', 'stable', null, '1.0.0', true),
- array($opt3, 'acme/foobar', 'v0.9.0', 'stable', null, '1.0.0', false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'stable', null, '1.0.0', true),
-
- array($opt1, 'acme/foobar', 'v1.0.0', 'stable', null, null, false),
- array($opt2, 'acme/foobar', 'v1.0.0', 'stable', null, null, false),
- array($opt3, 'acme/foobar', 'v1.0.0', 'stable', null, null, false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'stable', null, null, false),
- array($opt1, 'acme/foobar', 'v0.9.0', 'stable', null, null, false),
- array($opt2, 'acme/foobar', 'v0.9.0', 'stable', null, null, false),
- array($opt3, 'acme/foobar', 'v0.9.0', 'stable', null, null, false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'stable', null, null, false),
-
- array($opt1, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', '1.0.0', true),
- array($opt2, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', '1.0.0', true),
- array($opt3, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', '1.0.0', false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', '1.0.0', false),
- array($opt1, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', '1.0.0', true),
- array($opt2, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', '1.0.0', true),
- array($opt3, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', '1.0.0', false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', '1.0.0', false),
-
- array($opt1, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', null, false),
- array($opt2, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', null, false),
- array($opt3, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', null, false),
- array($opt4, 'acme/foobar', 'v1.0.0', 'dev', '>=0.9@stable', null, false),
- array($opt1, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', null, false),
- array($opt2, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', null, false),
- array($opt3, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', null, false),
- array($opt4, 'acme/foobar', 'v0.9.0', 'dev', '>=0.9@stable', null, false),
- );
- }
-
- /**
- * @dataProvider getDataForInstalledTests
- *
- * @param array $config
- * @param string $packageName
- * @param string $version
- * @param string $minimumStability
- * @param string|null $rootRequireVersion
- * @param string|null $installedVersion
- * @param bool $validSkip
- */
- public function testFilterWithInstalledPackage(array $config, $packageName, $version, $minimumStability, $rootRequireVersion, $installedVersion, $validSkip)
- {
- $installed = null === $installedVersion
- ? array()
- : array($packageName => $installedVersion);
-
- $require = null === $rootRequireVersion
- ? array()
- : array($packageName => $rootRequireVersion);
-
- $this->installedRepository = $this->getMockBuilder('Composer\Repository\InstalledFilesystemRepository')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->installedRepository->expects($this->any())
- ->method('getPackages')
- ->will($this->returnValue($this->convertInstalled($installed)));
-
- $this->init($require, $minimumStability, $config);
-
- $this->assertSame($validSkip, $this->filter->skip($this->assetType, $packageName, $version));
- }
-
- /**
- * Init test.
- *
- * @param array $requires
- * @param string $minimumStability
- * @param array $config
- */
- protected function init(array $requires = array(), $minimumStability = 'stable', array $config = array())
- {
- $parser = new ArrayLoader();
- $linkRequires = $parser->parseLinks('__ROOT__', '1.0.0', 'requires', $requires);
-
- $stabilityFlags = $this->findStabilityFlags($requires);
-
- $this->package->expects($this->any())
- ->method('getRequires')
- ->will($this->returnValue($linkRequires));
- $this->package->expects($this->any())
- ->method('getDevRequires')
- ->will($this->returnValue(array()));
- $this->package->expects($this->any())
- ->method('getMinimumStability')
- ->will($this->returnValue($minimumStability));
- $this->package->expects($this->any())
- ->method('getStabilityFlags')
- ->will($this->returnValue($stabilityFlags));
- $this->package->expects($this->any())
- ->method('getConfig')
- ->will($this->returnValue(array(
- 'fxp-asset' => $config,
- )));
-
- /* @var RootPackageInterface $package */
- $package = $this->package;
- $config = ConfigBuilder::build($this->composer);
-
- $this->filter = new VcsPackageFilter($config, $package, $this->installationManager, $this->installedRepository);
- }
-
- /**
- * Convert the installed package data tests to mock package instance.
- *
- * @param array $installed The config of installed packages
- *
- * @return array The package instance of installed packages
- */
- protected function convertInstalled(array $installed)
- {
- $packages = array();
- $parser = new VersionParser();
-
- foreach ($installed as $name => $version) {
- $package = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock();
-
- $package->expects($this->any())
- ->method('getName')
- ->will($this->returnValue($name));
-
- $package->expects($this->any())
- ->method('getVersion')
- ->will($this->returnValue($parser->normalize($version)));
-
- $package->expects($this->any())
- ->method('getPrettyVersion')
- ->will($this->returnValue($version));
-
- $packages[] = $package;
- }
-
- return $packages;
- }
-
- /**
- * Find the stability flag of requires.
- *
- * @param array $requires The require dependencies
- *
- * @return array
- */
- protected function findStabilityFlags(array $requires)
- {
- $flags = array();
- $stabilities = Package::$stabilities;
-
- foreach ($requires as $require => $prettyConstraint) {
- if (preg_match_all('/@('.implode('|', array_keys($stabilities)).')/', $prettyConstraint, $matches)) {
- $flags[$require] = $stabilities[$matches[1][0]];
- }
- }
-
- return $flags;
- }
-}
+++ /dev/null
-<?php
-
-/*
- * This file is part of the Fxp Composer Asset Plugin package.
- *
- * (c) François Pluchino <francois.pluchino@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-require __DIR__.'/../vendor/autoload.php';
-
-if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
- class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
-}
-
-require __DIR__.'/../vendor/composer/composer/tests/Composer/TestCase.php';
+++ /dev/null
-{
- "name": "fxp/composer-asset-plugin",
- "description": "NPM/Bower Dependency Manager for Composer",
- "keywords": ["npm", "bower", "dependency manager", "package", "asset", "composer", "nodejs"],
- "homepage": "https://github.com/fxpio/composer-asset-plugin",
- "type": "composer-plugin",
- "license": "MIT",
- "authors": [
- {
- "name": "François Pluchino",
- "email": "francois.pluchino@gmail.com"
- }
- ],
- "require": {
- "php": ">=5.3.3",
- "composer-plugin-api": "^1.0"
- },
- "require-dev": {
- "composer/composer": "^1.4.0"
- },
- "autoload": {
- "psr-4": {
- "Fxp\\Composer\\AssetPlugin\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "autoload-dev": {
- "psr-0": { "Composer\\Test": "vendor/composer/composer/tests/" }
- },
- "extra": {
- "class": "Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin",
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- }
-}
+++ /dev/null
-{
- "_readme": [
- "This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
- "This file is @generated automatically"
- ],
- "content-hash": "11c6ba2583e3e46593055e56ed82b4f6",
- "packages": [],
- "packages-dev": [
- {
- "name": "composer/ca-bundle",
- "version": "1.0.7",
- "source": {
- "type": "git",
- "url": "https://github.com/composer/ca-bundle.git",
- "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b17e6153cb7f33c7e44eb59578dc12eee5dc8e12",
- "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12",
- "shasum": ""
- },
- "require": {
- "ext-openssl": "*",
- "ext-pcre": "*",
- "php": "^5.3.2 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.5",
- "psr/log": "^1.0",
- "symfony/process": "^2.5 || ^3.0"
- },
- "suggest": {
- "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Composer\\CaBundle\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
- "keywords": [
- "cabundle",
- "cacert",
- "certificate",
- "ssl",
- "tls"
- ],
- "time": "2017-03-06T11:59:08+00:00"
- },
- {
- "name": "composer/composer",
- "version": "1.5.1",
- "source": {
- "type": "git",
- "url": "https://github.com/composer/composer.git",
- "reference": "d60a1ff0cb421fcd2811c3f2b57f7e3e2b6c9d0e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/d60a1ff0cb421fcd2811c3f2b57f7e3e2b6c9d0e",
- "reference": "d60a1ff0cb421fcd2811c3f2b57f7e3e2b6c9d0e",
- "shasum": ""
- },
- "require": {
- "composer/ca-bundle": "^1.0",
- "composer/semver": "^1.0",
- "composer/spdx-licenses": "^1.0",
- "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0",
- "php": "^5.3.2 || ^7.0",
- "psr/log": "^1.0",
- "seld/cli-prompt": "^1.0",
- "seld/jsonlint": "^1.4",
- "seld/phar-utils": "^1.0",
- "symfony/console": "^2.7 || ^3.0",
- "symfony/filesystem": "^2.7 || ^3.0",
- "symfony/finder": "^2.7 || ^3.0",
- "symfony/process": "^2.7 || ^3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5",
- "phpunit/phpunit-mock-objects": "^2.3 || ^3.0"
- },
- "suggest": {
- "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
- "ext-zip": "Enabling the zip extension allows you to unzip archives",
- "ext-zlib": "Allow gzip compression of HTTP requests"
- },
- "bin": [
- "bin/composer"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.5-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Composer\\": "src/Composer"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nils Adermann",
- "email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de"
- },
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.",
- "homepage": "https://getcomposer.org/",
- "keywords": [
- "autoload",
- "dependency",
- "package"
- ],
- "time": "2017-08-09T14:07:22+00:00"
- },
- {
- "name": "composer/semver",
- "version": "1.4.2",
- "source": {
- "type": "git",
- "url": "https://github.com/composer/semver.git",
- "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573",
- "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573",
- "shasum": ""
- },
- "require": {
- "php": "^5.3.2 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5",
- "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Composer\\Semver\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nils Adermann",
- "email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de"
- },
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- },
- {
- "name": "Rob Bast",
- "email": "rob.bast@gmail.com",
- "homepage": "http://robbast.nl"
- }
- ],
- "description": "Semver library that offers utilities, version constraint parsing and validation.",
- "keywords": [
- "semantic",
- "semver",
- "validation",
- "versioning"
- ],
- "time": "2016-08-30T16:08:34+00:00"
- },
- {
- "name": "composer/spdx-licenses",
- "version": "1.1.6",
- "source": {
- "type": "git",
- "url": "https://github.com/composer/spdx-licenses.git",
- "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c",
- "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c",
- "shasum": ""
- },
- "require": {
- "php": "^5.3.2 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5",
- "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Composer\\Spdx\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nils Adermann",
- "email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de"
- },
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- },
- {
- "name": "Rob Bast",
- "email": "rob.bast@gmail.com",
- "homepage": "http://robbast.nl"
- }
- ],
- "description": "SPDX licenses list and validation library.",
- "keywords": [
- "license",
- "spdx",
- "validator"
- ],
- "time": "2017-04-03T19:08:52+00:00"
- },
- {
- "name": "justinrainbow/json-schema",
- "version": "5.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/justinrainbow/json-schema.git",
- "reference": "429be236f296ca249d61c65649cdf2652f4a5e80"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80",
- "reference": "429be236f296ca249d61c65649cdf2652f4a5e80",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^2.1",
- "json-schema/json-schema-test-suite": "1.2.0",
- "phpdocumentor/phpdocumentor": "^2.7",
- "phpunit/phpunit": "^4.8.22"
- },
- "bin": [
- "bin/validate-json"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "JsonSchema\\": "src/JsonSchema/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Bruno Prieto Reis",
- "email": "bruno.p.reis@gmail.com"
- },
- {
- "name": "Justin Rainbow",
- "email": "justin.rainbow@gmail.com"
- },
- {
- "name": "Igor Wiedler",
- "email": "igor@wiedler.ch"
- },
- {
- "name": "Robert Schönthal",
- "email": "seroscho@googlemail.com"
- }
- ],
- "description": "A library to validate a json schema.",
- "homepage": "https://github.com/justinrainbow/json-schema",
- "keywords": [
- "json",
- "schema"
- ],
- "time": "2017-05-16T21:06:09+00:00"
- },
- {
- "name": "psr/log",
- "version": "1.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ],
- "time": "2016-10-10T12:19:37+00:00"
- },
- {
- "name": "seld/cli-prompt",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/cli-prompt.git",
- "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
- "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Seld\\CliPrompt\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be"
- }
- ],
- "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type",
- "keywords": [
- "cli",
- "console",
- "hidden",
- "input",
- "prompt"
- ],
- "time": "2017-03-18T11:32:45+00:00"
- },
- {
- "name": "seld/jsonlint",
- "version": "1.6.1",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/jsonlint.git",
- "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77",
- "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77",
- "shasum": ""
- },
- "require": {
- "php": "^5.3 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.5"
- },
- "bin": [
- "bin/jsonlint"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "Seld\\JsonLint\\": "src/Seld/JsonLint/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "JSON Linter",
- "keywords": [
- "json",
- "linter",
- "parser",
- "validator"
- ],
- "time": "2017-06-18T15:11:04+00:00"
- },
- {
- "name": "seld/phar-utils",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/phar-utils.git",
- "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a",
- "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Seld\\PharUtils\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be"
- }
- ],
- "description": "PHAR file format utilities, for when PHP phars you up",
- "keywords": [
- "phra"
- ],
- "time": "2015-10-13T18:44:15+00:00"
- },
- {
- "name": "symfony/console",
- "version": "v3.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/d6596cb5022b6a0bd940eae54a1de78646a5fda6",
- "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/debug": "~2.8|~3.0",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "conflict": {
- "symfony/dependency-injection": "<3.3"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~3.3",
- "symfony/dependency-injection": "~3.3",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/filesystem": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
- },
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/filesystem": "",
- "symfony/process": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com",
- "time": "2017-08-27T14:52:21+00:00"
- },
- {
- "name": "symfony/debug",
- "version": "v3.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/084d804fe35808eb2ef596ec83d85d9768aa6c9d",
- "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/http-kernel": "~2.8|~3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Debug\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Debug Component",
- "homepage": "https://symfony.com",
- "time": "2017-08-27T14:52:21+00:00"
- },
- {
- "name": "symfony/filesystem",
- "version": "v3.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/b32a0e5f928d0fa3d1dd03c78d020777e50c10cb",
- "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Filesystem Component",
- "homepage": "https://symfony.com",
- "time": "2017-07-29T21:54:42+00:00"
- },
- {
- "name": "symfony/finder",
- "version": "v3.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/finder.git",
- "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e",
- "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Finder\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Finder Component",
- "homepage": "https://symfony.com",
- "time": "2017-07-29T21:54:42+00:00"
- },
- {
- "name": "symfony/polyfill-mbstring",
- "version": "v1.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
- "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.5-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- },
- "files": [
- "bootstrap.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for the Mbstring extension",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
- ],
- "time": "2017-06-14T15:44:48+00:00"
- },
- {
- "name": "symfony/process",
- "version": "v3.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/process.git",
- "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0",
- "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Process\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Process Component",
- "homepage": "https://symfony.com",
- "time": "2017-07-29T21:54:42+00:00"
- }
- ],
- "aliases": [],
- "minimum-stability": "stable",
- "stability-flags": [],
- "prefer-stable": false,
- "prefer-lowest": false,
- "platform": {
- "php": ">=5.3.3"
- },
- "platform-dev": []
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit backupGlobals="false"
- backupStaticAttributes="false"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- processIsolation="false"
- stopOnFailure="false"
- syntaxCheck="false"
- bootstrap="Tests/bootstrap.php"
- >
-
- <testsuites>
- <testsuite name="Fxp Composer Asset Plugin Test Suite">
- <directory>./Tests/</directory>
- </testsuite>
- </testsuites>
-
- <filter>
- <whitelist>
- <directory>./</directory>
- <exclude>
- <directory>./Tests</directory>
- <directory>./Resources</directory>
- <directory>./vendor</directory>
- </exclude>
- </whitelist>
- </filter>
-</phpunit>