angularjs-color-picker
Advanced tools
Comparing version 1.0.3 to 1.0.6
{ | ||
"name": "angular-color-picker", | ||
"description": "Color Picker Directive For AngularJS", | ||
"version": "1.0.3", | ||
"version": "1.0.6", | ||
"homepage": "https://github.com/ruhley/angular-color-picker", | ||
@@ -6,0 +6,0 @@ "repository": { |
/*! | ||
* angularjs-color-picker v1.0.3 | ||
* angularjs-color-picker v1.0.6 | ||
* https://github.com/ruhley/angular-color-picker/ | ||
@@ -7,3 +7,3 @@ * | ||
* | ||
* 2016-04-08 09:35:35 | ||
* 2016-04-27 13:11:08 | ||
* | ||
@@ -31,3 +31,3 @@ */ | ||
colorPickerDisabled: '=', | ||
colorPickerAlpha: '=', | ||
colorPickerAlpha: '=?', | ||
colorPickerCase: '=', | ||
@@ -310,3 +310,3 @@ colorPickerFormat: '=', | ||
} else { | ||
if (newValue === null) { | ||
if (newValue === null || newValue === '') { | ||
$scope.hue = undefined; | ||
@@ -313,0 +313,0 @@ $scope.saturation = undefined; |
/*! | ||
* angularjs-color-picker v1.0.3 | ||
* angularjs-color-picker v1.0.6 | ||
* https://github.com/ruhley/angular-color-picker/ | ||
@@ -7,6 +7,6 @@ * | ||
* | ||
* 2016-04-08 09:35:35 | ||
* 2016-04-27 13:11:08 | ||
* | ||
*/ | ||
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="color.picker"),function(){"use strict";angular.module("color.picker",[])}(),function(){"use strict";var a=function(a,b){return{restrict:"E",require:["^ngModel"],scope:{ngModel:"=",colorPickerDisabled:"=",colorPickerAlpha:"=",colorPickerCase:"=",colorPickerFormat:"=",colorPickerPos:"=",colorPickerSwatch:"=",colorPickerSwatchOnly:"=",colorPickerSwatchPos:"=",colorPickerSwatchBootstrap:"=",colorPickerOnChange:"&"},templateUrl:"template/color-picker/directive.html",link:function(c,d,e,f){c.onChangeValue=null,c.updateModel=!0,c.init=function(){ | ||
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="color.picker"),function(){"use strict";angular.module("color.picker",[])}(),function(){"use strict";var a=function(a,b){return{restrict:"E",require:["^ngModel"],scope:{ngModel:"=",colorPickerDisabled:"=",colorPickerAlpha:"=?",colorPickerCase:"=",colorPickerFormat:"=",colorPickerPos:"=",colorPickerSwatch:"=",colorPickerSwatchOnly:"=",colorPickerSwatchPos:"=",colorPickerSwatchBootstrap:"=",colorPickerOnChange:"&"},templateUrl:"template/color-picker/directive.html",link:function(c,d,e,f){c.onChangeValue=null,c.updateModel=!0,c.init=function(){ | ||
// if no color provided | ||
@@ -27,3 +27,3 @@ if(void 0===c.ngModel)c.setDefaults();else{var b=tinycolor(c.ngModel);if(b.isValid()){var d=b.toHsv();c.hue=d.h,c.saturation=100*d.s,c.lightness=100*d.v,c.opacity=100*d.a}} | ||
// force the grid selection circle to redraw and fix its position | ||
c.saturationUpdate(),c.lightnessUpdate()},c.hide=function(){(c.visible||null!==d[0].querySelector(".color-picker-panel").offsetParent)&&(c.log("Color Picker: Hide Event"),c.visible=!1,c.$apply())},c.setDefaults=function(){void 0===c.hue&&(c.hue=0),void 0===c.saturation&&(c.saturation=0),void 0===c.lightness&&(c.lightness=100),void 0===c.opacity&&(c.opacity=100)},c.update=function(){if(void 0===c.hue&&void 0===c.saturation&&void 0===c.lightness)return!1;c.setDefaults();var a,b=tinycolor({h:c.hue,s:c.saturation/100,v:c.lightness/100});switch(c.config.alpha&&b.setAlpha(c.opacity/100),c.log("Color Picker: COLOR CHANGED TO ",b,c.hue,c.saturation,c.lightness,c.opacity),c.swatchColor=b.toHslString(),c.config.format){case"rgb":a=b.toRgbString();break;case"hex":a=b.toHexString(),a="lower"===c.config.case?a.toLowerCase():a.toUpperCase();break;case"hex8":a=b.toHex8String(),a="lower"===c.config.case?a.toLowerCase():a.toUpperCase();break;case"hsv":a=b.toHsvString();break;default:a=b.toHslString()}c.updateModel&&(c.ngModel=a)},c.$watch("ngModel",function(a,d){if(void 0!==a&&null!==a&&a!==d&&a.length>4){c.log("Color Picker: MODEL - CHANGED",a);var g=tinycolor(a);if(g.isValid()){var h=g.toHsv();c.updateModel=!1,c.hue=h.h,c.saturation=100*h.s,c.lightness=100*h.v,c.config.alpha&&(c.opacity=100*h.a),b(function(){c.updateModel=!0}),c.isValid=!0}else c.isValid=!1;f[0].$setValidity(e.name,c.isValid),void 0!==d&&"function"==typeof f[0].$setDirty&&f[0].$setDirty()}else null===a&&(c.hue=void 0,c.saturation=void 0,c.lightness=void 0,c.opacity=void 0),c.swatchColor=""}),c.$watch("colorPickerFormat",function(a,b){void 0!==a&&a!==b&&("hex"===a&&(c.colorPickerAlpha=!1),c.initConfig(),c.update())}),c.$watchGroup(["colorPickerAlpha","colorPickerCase"],function(a,b){void 0!==a&&(c.initConfig(),c.update())}),c.$watchGroup(["colorPickerDisabled","colorPickerSwatchPos","colorPickerSwatchBootstrap","colorPickerSwatchOnly","colorPickerSwatch","colorPickerPos"],function(a,b){void 0!==a&&c.initConfig()}), | ||
c.saturationUpdate(),c.lightnessUpdate()},c.hide=function(){(c.visible||null!==d[0].querySelector(".color-picker-panel").offsetParent)&&(c.log("Color Picker: Hide Event"),c.visible=!1,c.$apply())},c.setDefaults=function(){void 0===c.hue&&(c.hue=0),void 0===c.saturation&&(c.saturation=0),void 0===c.lightness&&(c.lightness=100),void 0===c.opacity&&(c.opacity=100)},c.update=function(){if(void 0===c.hue&&void 0===c.saturation&&void 0===c.lightness)return!1;c.setDefaults();var a,b=tinycolor({h:c.hue,s:c.saturation/100,v:c.lightness/100});switch(c.config.alpha&&b.setAlpha(c.opacity/100),c.log("Color Picker: COLOR CHANGED TO ",b,c.hue,c.saturation,c.lightness,c.opacity),c.swatchColor=b.toHslString(),c.config.format){case"rgb":a=b.toRgbString();break;case"hex":a=b.toHexString(),a="lower"===c.config.case?a.toLowerCase():a.toUpperCase();break;case"hex8":a=b.toHex8String(),a="lower"===c.config.case?a.toLowerCase():a.toUpperCase();break;case"hsv":a=b.toHsvString();break;default:a=b.toHslString()}c.updateModel&&(c.ngModel=a)},c.$watch("ngModel",function(a,d){if(void 0!==a&&null!==a&&a!==d&&a.length>4){c.log("Color Picker: MODEL - CHANGED",a);var g=tinycolor(a);if(g.isValid()){var h=g.toHsv();c.updateModel=!1,c.hue=h.h,c.saturation=100*h.s,c.lightness=100*h.v,c.config.alpha&&(c.opacity=100*h.a),b(function(){c.updateModel=!0}),c.isValid=!0}else c.isValid=!1;f[0].$setValidity(e.name,c.isValid),void 0!==d&&"function"==typeof f[0].$setDirty&&f[0].$setDirty()}else null!==a&&""!==a||(c.hue=void 0,c.saturation=void 0,c.lightness=void 0,c.opacity=void 0),c.swatchColor=""}),c.$watch("colorPickerFormat",function(a,b){void 0!==a&&a!==b&&("hex"===a&&(c.colorPickerAlpha=!1),c.initConfig(),c.update())}),c.$watchGroup(["colorPickerAlpha","colorPickerCase"],function(a,b){void 0!==a&&(c.initConfig(),c.update())}),c.$watchGroup(["colorPickerDisabled","colorPickerSwatchPos","colorPickerSwatchBootstrap","colorPickerSwatchOnly","colorPickerSwatch","colorPickerPos"],function(a,b){void 0!==a&&c.initConfig()}), | ||
//--------------------------- | ||
@@ -30,0 +30,0 @@ // Update Positions And Colors On Elements |
@@ -11,3 +11,3 @@ (function() { | ||
colorPickerDisabled: '=', | ||
colorPickerAlpha: '=', | ||
colorPickerAlpha: '=?', | ||
colorPickerCase: '=', | ||
@@ -290,3 +290,3 @@ colorPickerFormat: '=', | ||
} else { | ||
if (newValue === null) { | ||
if (newValue === null || newValue === '') { | ||
$scope.hue = undefined; | ||
@@ -293,0 +293,0 @@ $scope.saturation = undefined; |
{ | ||
"name": "angularjs-color-picker", | ||
"description": "Color Picker Directive For AngularJS", | ||
"version": "1.0.3", | ||
"version": "1.0.6", | ||
"license": "MIT", | ||
@@ -28,7 +28,7 @@ "main": "dist/angularjs-color-picker.min.js", | ||
"grunt-contrib-jshint": "~1.0.0", | ||
"grunt-contrib-less": "~1.2.0", | ||
"grunt-contrib-less": "~1.3.0", | ||
"grunt-contrib-uglify": "~1.0.0", | ||
"grunt-karma": "~0.12.0", | ||
"grunt-notify": "~0.4.1", | ||
"load-grunt-tasks": "~3.4.0", | ||
"load-grunt-tasks": "~3.5.0", | ||
"time-grunt": "~1.3.0" | ||
@@ -35,0 +35,0 @@ }, |
@@ -62,2 +62,3 @@ # angularjs-color-picker | ||
ng-model="" | ||
color-picker-disabled="false, true" | ||
color-picker-format="'hsl', 'hsv', 'rgb', 'hex', 'hex8'" | ||
@@ -64,0 +65,0 @@ color-picker-alpha="true, false" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
446633
39
2152
88