diff --git a/dist/vue-color.js b/dist/vue-color.js index 095f349..4218f73 100644 --- a/dist/vue-color.js +++ b/dist/vue-color.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 23); +/******/ return __webpack_require__(__webpack_require__.s = 59); /******/ }) /************************************************************************/ /******/ ([ @@ -175,7 +175,7 @@ if (typeof DEBUG !== 'undefined' && DEBUG) { ) } } -var listToStyles = __webpack_require__(27) +var listToStyles = __webpack_require__(63) /* type StyleObject = { @@ -503,7 +503,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _tinycolor = __webpack_require__(28); +var _tinycolor = __webpack_require__(64); var _tinycolor2 = _interopRequireDefault(_tinycolor); @@ -517,6 +517,12 @@ function _colorChange(data, oldHue) { color = (0, _tinycolor2.default)(data.hsl); } else if (data && data.hex && data.hex.length > 0) { color = (0, _tinycolor2.default)(data.hex); + } else if (data && data.hsv) { + color = (0, _tinycolor2.default)(data.hsv); + } else if (data && data.rgba) { + color = (0, _tinycolor2.default)(data.rgba); + } else if (data && data.rgb) { + color = (0, _tinycolor2.default)(data.rgb); } else { color = (0, _tinycolor2.default)(data); } @@ -608,18 +614,30 @@ exports.default = { /***/ }), /* 4 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), +/* 5 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue__ = __webpack_require__(36); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_EditableInput_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_441174dc_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_EditableInput_vue__ = __webpack_require__(31); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_441174dc_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_EditableInput_vue__ = __webpack_require__(67); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(29) + __webpack_require__(65) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -665,19 +683,104 @@ if (false) {(function () { /***/ }), -/* 5 */ +/* 6 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(8); +var createDesc = __webpack_require__(16); +module.exports = __webpack_require__(9) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(13); +var IE8_DOM_DEFINE = __webpack_require__(42); +var toPrimitive = __webpack_require__(25); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(9) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(15)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(89); +var defined = __webpack_require__(22); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(29)('wks'); +var uid = __webpack_require__(17); +var Symbol = __webpack_require__(4).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), +/* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue__ = __webpack_require__(50); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Hue_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7b9aea78_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Hue_vue__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7b9aea78_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Hue_vue__ = __webpack_require__(113); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(44) + __webpack_require__(111) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -723,19 +826,77 @@ if (false) {(function () { /***/ }), -/* 6 */ +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(14); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 18 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue__ = __webpack_require__(53); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Saturation_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ba139894_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Saturation_vue__ = __webpack_require__(61); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ba139894_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Saturation_vue__ = __webpack_require__(127); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(56) + __webpack_require__(123) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -781,19 +942,19 @@ if (false) {(function () { /***/ }), -/* 7 */ +/* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue__ = __webpack_require__(18); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue__ = __webpack_require__(54); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Alpha_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1af1f1ac_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Alpha_vue__ = __webpack_require__(67); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1af1f1ac_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Alpha_vue__ = __webpack_require__(133); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(62) + __webpack_require__(128) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -839,19 +1000,19 @@ if (false) {(function () { /***/ }), -/* 8 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue__ = __webpack_require__(19); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue__ = __webpack_require__(55); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Checkboard_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5b6dc0c2_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Checkboard_vue__ = __webpack_require__(66); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5b6dc0c2_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Checkboard_vue__ = __webpack_require__(132); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(64) + __webpack_require__(130) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -897,7 +1058,158 @@ if (false) {(function () { /***/ }), -/* 9 */ +/* 21 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.1' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(14); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(46); +var enumBugKeys = __webpack_require__(30); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(29)('keys'); +var uid = __webpack_require__(17); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(4); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); +module.exports = function (key) { + return store[key] || (store[key] = {}); +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(8).f; +var has = __webpack_require__(6); +var TAG = __webpack_require__(11)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(11); + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(4); +var core = __webpack_require__(24); +var LIBRARY = __webpack_require__(23); +var wksExt = __webpack_require__(32); +var defineProperty = __webpack_require__(8).f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -911,7 +1223,7 @@ var _color = __webpack_require__(3); var _color2 = _interopRequireDefault(_color); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); @@ -949,7 +1261,7 @@ exports.default = { }; /***/ }), -/* 10 */ +/* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1029,7 +1341,7 @@ exports.default = { }; /***/ }), -/* 11 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1075,7 +1387,7 @@ exports.default = { }; /***/ }), -/* 12 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1085,7 +1397,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); @@ -1125,7 +1437,7 @@ exports.default = { }; /***/ }), -/* 13 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1135,16 +1447,22 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _typeof2 = __webpack_require__(80); + +var _typeof3 = _interopRequireDefault(_typeof2); + var _color = __webpack_require__(3); var _color2 = _interopRequireDefault(_color); -var _Hue = __webpack_require__(5); +var _Hue = __webpack_require__(12); var _Hue2 = _interopRequireDefault(_Hue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var DEFAULT_SATURATION = 0.1; + exports.default = { name: 'Slider', mixins: [_color2.default], @@ -1152,7 +1470,7 @@ exports.default = { swatches: { type: Array, default: function _default() { - return ['.80', '.65', '.50', '.35', '.20']; + return [{ s: DEFAULT_SATURATION, l: 0.8 }, { s: DEFAULT_SATURATION, l: 0.65 }, { s: DEFAULT_SATURATION, l: 0.5 }, { s: DEFAULT_SATURATION, l: 0.35 }, { s: DEFAULT_SATURATION, l: 0.2 }]; } } }, @@ -1160,30 +1478,38 @@ exports.default = { hue: _Hue2.default }, computed: { - activeOffset: function activeOffset() { - var hasBlack = this.swatches.includes('0'); - var hasWhite = this.swatches.includes('1'); - var hsl = this.colors.hsl; - - if (Math.round(hsl.s * 100) / 100 === 0.50) { - return Math.round(hsl.l * 100) / 100; - } else if (hasBlack && hsl.l === 0) { - return 0; - } else if (hasWhite && hsl.l === 1) { - return 1; - } - return -1; + normalizedSwatches: function normalizedSwatches() { + var swatches = this.swatches; + return swatches.map(function (swatch) { + if ((typeof swatch === 'undefined' ? 'undefined' : (0, _typeof3.default)(swatch)) !== 'object') { + return { + s: DEFAULT_SATURATION, + l: swatch + }; + } + return swatch; + }); } }, methods: { + isActive: function isActive(swatch, index) { + var hsl = this.colors.hsl; + if (hsl.l === 1 && swatch.l === 1) { + return true; + } + if (hsl.l === 0 && swatch.l === 0) { + return true; + } + return Math.abs(hsl.l - swatch.l) < 0.01 && Math.abs(hsl.s - swatch.s) < 0.01; + }, hueChange: function hueChange(data) { this.colorChange(data); }, - handleSwClick: function handleSwClick(index, offset) { + handleSwClick: function handleSwClick(index, swatch) { this.colorChange({ h: this.colors.hsl.h, - s: 0.5, - l: offset, + s: swatch.s, + l: swatch.l, source: 'hsl' }); } @@ -1191,45 +1517,319 @@ exports.default = { }; /***/ }), -/* 14 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - name: 'Hue', - props: { - value: Object, - direction: { - type: String, - - default: 'horizontal' +var LIBRARY = __webpack_require__(23); +var $export = __webpack_require__(41); +var redefine = __webpack_require__(44); +var hide = __webpack_require__(7); +var has = __webpack_require__(6); +var Iterators = __webpack_require__(26); +var $iterCreate = __webpack_require__(87); +var setToStringTag = __webpack_require__(31); +var getPrototypeOf = __webpack_require__(94); +var ITERATOR = __webpack_require__(11)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); } - }, - data: function data() { - return { - oldHue: 0, - pullDirection: '' + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries }; - }, + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; - computed: { - colors: function colors() { - var h = this.value.hsl.h; - if (h !== 0 && h - this.oldHue > 0) this.pullDirection = 'right'; - if (h !== 0 && h - this.oldHue < 0) this.pullDirection = 'left'; - this.oldHue = h; - return this.value; - }, - directionClass: function directionClass() { - return { - 'vc-hue--horizontal': this.direction === 'horizontal', - 'vc-hue--vertical': this.direction === 'vertical' +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(4); +var core = __webpack_require__(24); +var ctx = __webpack_require__(85); +var hide = __webpack_require__(7); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(9) && !__webpack_require__(15)(function () { + return Object.defineProperty(__webpack_require__(43)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(14); +var document = __webpack_require__(4).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(7); + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(13); +var dPs = __webpack_require__(88); +var enumBugKeys = __webpack_require__(30); +var IE_PROTO = __webpack_require__(28)('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(43)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(93).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(6); +var toIObject = __webpack_require__(10); +var arrayIndexOf = __webpack_require__(90)(false); +var IE_PROTO = __webpack_require__(28)('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(46); +var hiddenKeys = __webpack_require__(30).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + name: 'Hue', + props: { + value: Object, + direction: { + type: String, + + default: 'horizontal' + } + }, + data: function data() { + return { + oldHue: 0, + pullDirection: '' + }; + }, + + computed: { + colors: function colors() { + var h = this.value.hsl.h; + if (h !== 0 && h - this.oldHue > 0) this.pullDirection = 'right'; + if (h !== 0 && h - this.oldHue < 0) this.pullDirection = 'left'; + this.oldHue = h; + + return this.value; + }, + directionClass: function directionClass() { + return { + 'vc-hue--horizontal': this.direction === 'horizontal', + 'vc-hue--vertical': this.direction === 'vertical' }; }, pointerTop: function pointerTop() { @@ -1323,7 +1923,7 @@ exports.default = { }; /***/ }), -/* 15 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1333,7 +1933,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _materialColors = __webpack_require__(51); +var _materialColors = __webpack_require__(118); var _materialColors2 = _interopRequireDefault(_materialColors); @@ -1393,7 +1993,7 @@ exports.default = { }; /***/ }), -/* 16 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1407,19 +2007,19 @@ var _color = __webpack_require__(3); var _color2 = _interopRequireDefault(_color); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); -var _Saturation = __webpack_require__(6); +var _Saturation = __webpack_require__(18); var _Saturation2 = _interopRequireDefault(_Saturation); -var _Hue = __webpack_require__(5); +var _Hue = __webpack_require__(12); var _Hue2 = _interopRequireDefault(_Hue); -var _Alpha = __webpack_require__(7); +var _Alpha = __webpack_require__(19); var _Alpha2 = _interopRequireDefault(_Alpha); @@ -1542,7 +2142,7 @@ exports.default = { }; /***/ }), -/* 17 */ +/* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1552,11 +2152,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _clamp = __webpack_require__(58); +var _clamp = __webpack_require__(125); var _clamp2 = _interopRequireDefault(_clamp); -var _lodash = __webpack_require__(59); +var _lodash = __webpack_require__(126); var _lodash2 = _interopRequireDefault(_lodash); @@ -1631,7 +2231,7 @@ exports.default = { }; /***/ }), -/* 18 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1641,7 +2241,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _Checkboard = __webpack_require__(8); +var _Checkboard = __webpack_require__(20); var _Checkboard2 = _interopRequireDefault(_Checkboard); @@ -1711,7 +2311,7 @@ exports.default = { }; /***/ }), -/* 19 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1783,7 +2383,7 @@ function getCheckboard(c1, c2, size) { } /***/ }), -/* 20 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1797,23 +2397,23 @@ var _color = __webpack_require__(3); var _color2 = _interopRequireDefault(_color); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); -var _Saturation = __webpack_require__(6); +var _Saturation = __webpack_require__(18); var _Saturation2 = _interopRequireDefault(_Saturation); -var _Hue = __webpack_require__(5); +var _Hue = __webpack_require__(12); var _Hue2 = _interopRequireDefault(_Hue); -var _Alpha = __webpack_require__(7); +var _Alpha = __webpack_require__(19); var _Alpha2 = _interopRequireDefault(_Alpha); -var _Checkboard = __webpack_require__(8); +var _Checkboard = __webpack_require__(20); var _Checkboard2 = _interopRequireDefault(_Checkboard); @@ -1895,7 +2495,7 @@ exports.default = { }; /***/ }), -/* 21 */ +/* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1909,23 +2509,23 @@ var _color = __webpack_require__(3); var _color2 = _interopRequireDefault(_color); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); -var _Saturation = __webpack_require__(6); +var _Saturation = __webpack_require__(18); var _Saturation2 = _interopRequireDefault(_Saturation); -var _Hue = __webpack_require__(5); +var _Hue = __webpack_require__(12); var _Hue2 = _interopRequireDefault(_Hue); -var _Alpha = __webpack_require__(7); +var _Alpha = __webpack_require__(19); var _Alpha2 = _interopRequireDefault(_Alpha); -var _Checkboard = __webpack_require__(8); +var _Checkboard = __webpack_require__(20); var _Checkboard2 = _interopRequireDefault(_Checkboard); @@ -2029,7 +2629,7 @@ exports.default = { }; /***/ }), -/* 22 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2039,7 +2639,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); @@ -2129,65 +2729,65 @@ exports.default = { }; /***/ }), -/* 23 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _Compact = __webpack_require__(24); +var _Compact = __webpack_require__(60); var _Compact2 = _interopRequireDefault(_Compact); -var _Grayscale = __webpack_require__(33); +var _Grayscale = __webpack_require__(69); var _Grayscale2 = _interopRequireDefault(_Grayscale); -var _Material = __webpack_require__(37); +var _Material = __webpack_require__(73); var _Material2 = _interopRequireDefault(_Material); -var _Slider = __webpack_require__(41); +var _Slider = __webpack_require__(77); var _Slider2 = _interopRequireDefault(_Slider); -var _Swatches = __webpack_require__(48); +var _Swatches = __webpack_require__(115); var _Swatches2 = _interopRequireDefault(_Swatches); -var _Photoshop = __webpack_require__(53); +var _Photoshop = __webpack_require__(120); var _Photoshop2 = _interopRequireDefault(_Photoshop); -var _Sketch = __webpack_require__(69); +var _Sketch = __webpack_require__(135); var _Sketch2 = _interopRequireDefault(_Sketch); -var _Chrome = __webpack_require__(73); +var _Chrome = __webpack_require__(139); var _Chrome2 = _interopRequireDefault(_Chrome); -var _Twitter = __webpack_require__(77); +var _Twitter = __webpack_require__(143); var _Twitter2 = _interopRequireDefault(_Twitter); -var _Alpha = __webpack_require__(7); +var _Alpha = __webpack_require__(19); var _Alpha2 = _interopRequireDefault(_Alpha); -var _Checkboard = __webpack_require__(8); +var _Checkboard = __webpack_require__(20); var _Checkboard2 = _interopRequireDefault(_Checkboard); -var _EditableInput = __webpack_require__(4); +var _EditableInput = __webpack_require__(5); var _EditableInput2 = _interopRequireDefault(_EditableInput); -var _Hue = __webpack_require__(5); +var _Hue = __webpack_require__(12); var _Hue2 = _interopRequireDefault(_Hue); -var _Saturation = __webpack_require__(6); +var _Saturation = __webpack_require__(18); var _Saturation2 = _interopRequireDefault(_Saturation); @@ -2198,7 +2798,7 @@ var _color2 = _interopRequireDefault(_color); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var VueColor = { - version: '2.7.0', + version: '2.8.0', Compact: _Compact2.default, Grayscale: _Grayscale2.default, Twitter: _Twitter2.default, @@ -2219,19 +2819,19 @@ var VueColor = { module.exports = VueColor; /***/ }), -/* 24 */ +/* 60 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue__ = __webpack_require__(35); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue__); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Compact_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_648423a3_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Compact_vue__ = __webpack_require__(32); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_648423a3_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Compact_vue__ = __webpack_require__(68); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(25) + __webpack_require__(61) } var normalizeComponent = __webpack_require__(2) /* script */ @@ -2277,13 +2877,13 @@ if (false) {(function () { /***/ }), -/* 25 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a