diff --git a/dist/vue-chartjs.js b/dist/vue-chartjs.js index 6639350..add0f16 100644 --- a/dist/vue-chartjs.js +++ b/dist/vue-chartjs.js @@ -212,7 +212,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global) {/*! - * Vue.js v2.1.10 + * Vue.js v2.2.1 * (c) 2014-2017 Evan You * Released under the MIT License. */ @@ -266,7 +266,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Remove an item from an array */ - function remove$1 (arr, item) { + function remove (arr, item) { if (arr.length) { var index = arr.indexOf(item); if (index > -1) { @@ -330,7 +330,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Simple bind, faster than native */ - function bind$1 (fn, ctx) { + function bind (fn, ctx) { function boundFn (a) { var l = arguments.length; return l @@ -417,11 +417,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * 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, @@ -446,6 +442,19 @@ return /******/ (function(modules) { // webpackBootstrap return -1 } + /** + * Ensure a function is called only once. + */ + function once (fn) { + var called = false; + return function () { + if (!called) { + called = true; + fn(); + } + } + } + /* */ var config = { @@ -459,11 +468,21 @@ return /******/ (function(modules) { // webpackBootstrap */ 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: process.env.NODE_ENV !== 'production', + /** * Error handler for watcher errors */ @@ -538,47 +557,6 @@ return /******/ (function(modules) { // webpackBootstrap _maxUpdateCount: 100 }; - /* */ - - /** - * 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 - } else { - var segments = path.split('.'); - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) { return } - obj = obj[segments[i]]; - } - return obj - } - } - } - /* */ /* globals MutationObserver */ @@ -593,6 +571,7 @@ return /******/ (function(modules) { // webpackBootstrap var isEdge = UA && UA.indexOf('edge/') > 0; var isAndroid = UA && UA.indexOf('android') > 0; var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA); + var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; // this needs to be lazy-evaled because vue may be required before // vue-server-renderer can set VUE_ENV @@ -619,6 +598,10 @@ return /******/ (function(modules) { // webpackBootstrap return /native code/.test(Ctor.toString()) } + var hasSymbol = + typeof Symbol !== 'undefined' && isNative(Symbol) && + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + /** * Defer a task to execute it asynchronously. */ @@ -723,11 +706,68 @@ return /******/ (function(modules) { // webpackBootstrap }()); } + var perf; + + if (process.env.NODE_ENV !== 'production') { + perf = inBrowser && window.performance; + if (perf && (!perf.mark || !perf.measure)) { + perf = undefined; + } + } + + /* */ + + var emptyObject = Object.freeze({}); + + /** + * 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 + } else { + var segments = path.split('.'); + return function (obj) { + for (var i = 0; i < segments.length; i++) { + if (!obj) { return } + obj = obj[segments[i]]; + } + return obj + } + } + } + var warn = noop; + var tip = noop; var formatComponentName; 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) { if (hasConsole && (!config.silent)) { @@ -737,21 +777,36 @@ return /******/ (function(modules) { // webpackBootstrap } }; - formatComponentName = function (vm) { + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + " " + ( + vm ? formatLocation(formatComponentName(vm)) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { if (vm.$root === vm) { - return 'root instance' + return '' } var name = vm._isVue ? vm.$options.name || vm.$options._componentTag : vm.name; + + var file = vm._isVue && vm.$options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + return ( - (name ? ("component <" + name + ">") : "anonymous component") + - (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '') + (name ? ("<" + (classify(name)) + ">") : "") + + (file && includeFile !== false ? (" at " + file) : '') ) }; var formatLocation = function (str) { - if (str === 'anonymous component') { + if (str === "") { str += " - use the \"name\" option for better debugging messages."; } return ("\n(found in " + str + ")") @@ -777,7 +832,7 @@ return /******/ (function(modules) { // webpackBootstrap }; Dep.prototype.removeSub = function removeSub (sub) { - remove$1(this.subs, sub); + remove(this.subs, sub); }; Dep.prototype.depend = function depend () { @@ -1030,7 +1085,7 @@ return /******/ (function(modules) { // webpackBootstrap * triggers change notification if the property doesn't * already exist. */ - function set$1 (obj, key, val) { + function set (obj, key, val) { if (Array.isArray(obj)) { obj.length = Math.max(obj.length, key); obj.splice(key, 1, val); @@ -1061,6 +1116,10 @@ return /******/ (function(modules) { // webpackBootstrap * Delete a property and trigger change if necessary. */ function del (obj, key) { + if (Array.isArray(obj)) { + obj.splice(key, 1); + return + } var ob = obj.__ob__; if (obj._isVue || (ob && ob.vmCount)) { process.env.NODE_ENV !== 'production' && warn( @@ -1129,7 +1188,7 @@ return /******/ (function(modules) { // webpackBootstrap toVal = to[key]; fromVal = from[key]; if (!hasOwn(to, key)) { - set$1(to, key, fromVal); + set(to, key, fromVal); } else if (isPlainObject(toVal) && isPlainObject(fromVal)) { mergeData(toVal, fromVal); } @@ -1192,7 +1251,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /** - * Hooks and param attributes are merged as arrays. + * Hooks and props are merged as arrays. */ function mergeHook ( parentVal, @@ -1237,7 +1296,7 @@ return /******/ (function(modules) { // webpackBootstrap */ strats.watch = function (parentVal, childVal) { /* istanbul ignore if */ - if (!childVal) { return parentVal } + if (!childVal) { return Object.create(parentVal || null) } if (!parentVal) { return childVal } var ret = {}; extend(ret, parentVal); @@ -1260,7 +1319,7 @@ return /******/ (function(modules) { // webpackBootstrap strats.props = strats.methods = strats.computed = function (parentVal, childVal) { - if (!childVal) { return parentVal } + if (!childVal) { return Object.create(parentVal || null) } if (!parentVal) { return childVal } var ret = Object.create(null); extend(ret, parentVal); @@ -1463,8 +1522,8 @@ return /******/ (function(modules) { // webpackBootstrap } var def = prop.default; // warn against non-factory defaults for Object & Array - if (isObject(def)) { - process.env.NODE_ENV !== 'production' && warn( + 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.', @@ -1475,11 +1534,12 @@ return /******/ (function(modules) { // webpackBootstrap // return previous default value to avoid unnecessary watcher trigger if (vm && vm.$options.propsData && vm.$options.propsData[key] === undefined && - vm[key] !== undefined) { - return vm[key] + vm._props[key] !== undefined) { + return vm._props[key] } // call factory function for non-Function types - return typeof def === 'function' && prop.type !== Function + // 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 } @@ -1587,54 +1647,21 @@ return /******/ (function(modules) { // webpackBootstrap return false } - - - var util = Object.freeze({ - defineReactive: defineReactive$$1, - _toString: _toString, - toNumber: toNumber, - makeMap: makeMap, - isBuiltInTag: isBuiltInTag, - remove: remove$1, - hasOwn: hasOwn, - isPrimitive: isPrimitive, - cached: cached, - camelize: camelize, - capitalize: capitalize, - hyphenate: hyphenate, - bind: bind$1, - toArray: toArray, - extend: extend, - isObject: isObject, - isPlainObject: isPlainObject, - toObject: toObject, - noop: noop, - no: no, - identity: identity, - genStaticKeys: genStaticKeys, - looseEqual: looseEqual, - looseIndexOf: looseIndexOf, - isReserved: isReserved, - def: def, - parsePath: parsePath, - hasProto: hasProto, - inBrowser: inBrowser, - UA: UA, - isIE: isIE, - isIE9: isIE9, - isEdge: isEdge, - isAndroid: isAndroid, - isIOS: isIOS, - isServerRendering: isServerRendering, - devtools: devtools, - nextTick: nextTick, - get _Set () { return _Set; }, - mergeOptions: mergeOptions, - resolveAsset: resolveAsset, - get warn () { return warn; }, - get formatComponentName () { return formatComponentName; }, - validateProp: validateProp - }); + function handleError (err, vm, type) { + if (config.errorHandler) { + config.errorHandler.call(null, err, vm, type); + } else { + if (process.env.NODE_ENV !== 'production') { + warn(("Error in " + type + ":"), vm); + } + /* istanbul ignore else */ + if (inBrowser && typeof console !== 'undefined') { + console.error(err); + } else { + throw err + } + } + } /* not type checking this file because flow doesn't play well with Proxy */ @@ -1793,7 +1820,1237 @@ return /******/ (function(modules) { // webpackBootstrap /* */ - var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 }; + var normalizeEvent = cached(function (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 + } + }); + + function createFnInvoker (fns) { + function invoker () { + var arguments$1 = arguments; + + var fns = invoker.fns; + if (Array.isArray(fns)) { + for (var i = 0; i < fns.length; i++) { + fns[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, cur, old, event; + for (name in on) { + cur = on[name]; + old = oldOn[name]; + event = normalizeEvent(name); + if (!cur) { + process.env.NODE_ENV !== 'production' && warn( + "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), + vm + ); + } else if (!old) { + if (!cur.fns) { + cur = on[name] = createFnInvoker(cur); + } + add(event.name, cur, event.once, event.capture); + } else if (cur !== old) { + old.fns = cur; + on[name] = old; + } + } + for (name in oldOn) { + if (!on[name]) { + event = normalizeEvent(name); + remove$$1(event.name, oldOn[name], event.capture); + } + } + } + + /* */ + + function mergeVNodeHook (def, hookKey, 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 (!oldHook) { + // no existing hook + invoker = createFnInvoker([wrappedHook]); + } else { + /* istanbul ignore if */ + if (oldHook.fns && 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; + } + + /* */ + + // 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. 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 constrcuts that always generated nested Arrays, + // e.g.