Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angularjs-color-picker

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angularjs-color-picker - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

bower.json
{
"name": "angular-color-picker",
"description": "Color Picker Directive For AngularJS",
"version": "1.0.6",
"version": "1.0.7",
"homepage": "https://github.com/ruhley/angular-color-picker",

@@ -6,0 +6,0 @@ "repository": {

/*!
* angularjs-color-picker v1.0.6
* angularjs-color-picker v1.0.7
* https://github.com/ruhley/angular-color-picker/

@@ -7,3 +7,3 @@ *

*
* 2016-04-27 13:11:08
* 2016-04-29 08:36:22
*

@@ -31,3 +31,3 @@ */

colorPickerDisabled: '=',
colorPickerAlpha: '=?',
colorPickerAlpha: '=',
colorPickerCase: '=',

@@ -321,15 +321,4 @@ colorPickerFormat: '=',

$scope.$watch('colorPickerFormat', function (newValue, oldValue) {
if (newValue !== undefined && newValue !== oldValue) {
if (newValue === 'hex') {
$scope.colorPickerAlpha = false;
}
$scope.initConfig();
$scope.update();
}
});
$scope.$watchGroup(
['colorPickerAlpha', 'colorPickerCase'],
['colorPickerFormat', 'colorPickerAlpha', 'colorPickerCase'],
function (newValue, oldValue) {

@@ -694,8 +683,2 @@ if (newValue !== undefined) {

' }">\n' +
' <div class="color-picker-hue color-picker-sprite">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-grid color-picker-sprite">\n' +

@@ -707,2 +690,8 @@ ' <div class="color-picker-grid-inner"></div>\n' +

' </div>\n' +
' <div class="color-picker-hue color-picker-sprite">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha && config.format !== \'hex\'">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' </div>\n' +

@@ -709,0 +698,0 @@ '</div>'

/*!
* angularjs-color-picker v1.0.6
* angularjs-color-picker v1.0.7
* https://github.com/ruhley/angular-color-picker/

@@ -7,6 +7,6 @@ *

*
* 2016-04-27 13:11:08
* 2016-04-29 08:36:22
*
*/
"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&&""!==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.$watchGroup(["colorPickerFormat","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()}),
//---------------------------

@@ -65,2 +65,2 @@ // Update Positions And Colors On Elements

// hack for small chrome screens not position the clicks properly when the page is scrolled
return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=null!==e&&e===e.window?e:9===e.nodeType&&e.defaultView,b=e.documentElement,window.chrome&&screen.width<=768?{top:d.top-b.clientTop,left:d.left-b.clientLeft}:{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},c.init(),c.$on("$destroy",function(){a.off("mousedown",c.onMouseDown),a.off("mouseup",c.onMouseUp),a.off("mousemove",c.onMouseMove)})}}};a.$inject=["$document","$timeout"],angular.module("color.picker").directive("colorPicker",a)}(),angular.module("color.picker").run(["$templateCache",function(a){a.put("template/color-picker/directive.html",'<div class="color-picker-wrapper" ng-class="{\'color-picker-swatch-only\': config.swatchOnly}">\n <div class="color-picker-input-wrapper" ng-class="{\'input-group\': config.swatchBootstrap && config.swatch}">\n <span ng-if="config.swatchPos === \'left\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n <input class="color-picker-input form-control" type="text" ng-model="ngModel" ng-disabled="config.disabled" ng-blur="onBlur()" ng-change="onChange($event)" size="7" ng-focus="show()" ng-class="{\'color-picker-input-swatch\': config.swatch && !config.swatchOnly && config.swatchPos === \'left\'}">\n <span ng-if="config.swatchPos === \'right\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n </div>\n <div class="color-picker-panel" ng-show="visible" ng-class="{\n \'color-picker-panel-top color-picker-panel-right\': config.pos === \'top right\',\n \'color-picker-panel-top color-picker-panel-left\': config.pos === \'top left\',\n \'color-picker-panel-bottom color-picker-panel-right\': config.pos === \'bottom right\',\n \'color-picker-panel-bottom color-picker-panel-left\': config.pos === \'bottom left\',\n }">\n <div class="color-picker-hue color-picker-sprite">\n <div class="color-picker-slider"></div>\n </div>\n <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha">\n <div class="color-picker-slider"></div>\n </div>\n <div class="color-picker-grid color-picker-sprite">\n <div class="color-picker-grid-inner"></div>\n <div class="color-picker-picker">\n <div></div>\n </div>\n </div>\n </div>\n</div>')}]);
return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=null!==e&&e===e.window?e:9===e.nodeType&&e.defaultView,b=e.documentElement,window.chrome&&screen.width<=768?{top:d.top-b.clientTop,left:d.left-b.clientLeft}:{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},c.init(),c.$on("$destroy",function(){a.off("mousedown",c.onMouseDown),a.off("mouseup",c.onMouseUp),a.off("mousemove",c.onMouseMove)})}}};a.$inject=["$document","$timeout"],angular.module("color.picker").directive("colorPicker",a)}(),angular.module("color.picker").run(["$templateCache",function(a){a.put("template/color-picker/directive.html",'<div class="color-picker-wrapper" ng-class="{\'color-picker-swatch-only\': config.swatchOnly}">\n <div class="color-picker-input-wrapper" ng-class="{\'input-group\': config.swatchBootstrap && config.swatch}">\n <span ng-if="config.swatchPos === \'left\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n <input class="color-picker-input form-control" type="text" ng-model="ngModel" ng-disabled="config.disabled" ng-blur="onBlur()" ng-change="onChange($event)" size="7" ng-focus="show()" ng-class="{\'color-picker-input-swatch\': config.swatch && !config.swatchOnly && config.swatchPos === \'left\'}">\n <span ng-if="config.swatchPos === \'right\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n </div>\n <div class="color-picker-panel" ng-show="visible" ng-class="{\n \'color-picker-panel-top color-picker-panel-right\': config.pos === \'top right\',\n \'color-picker-panel-top color-picker-panel-left\': config.pos === \'top left\',\n \'color-picker-panel-bottom color-picker-panel-right\': config.pos === \'bottom right\',\n \'color-picker-panel-bottom color-picker-panel-left\': config.pos === \'bottom left\',\n }">\n <div class="color-picker-grid color-picker-sprite">\n <div class="color-picker-grid-inner"></div>\n <div class="color-picker-picker">\n <div></div>\n </div>\n </div>\n <div class="color-picker-hue color-picker-sprite">\n <div class="color-picker-slider"></div>\n </div>\n <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha && config.format !== \'hex\'">\n <div class="color-picker-slider"></div>\n </div>\n </div>\n</div>')}]);

@@ -11,3 +11,3 @@ (function() {

colorPickerDisabled: '=',
colorPickerAlpha: '=?',
colorPickerAlpha: '=',
colorPickerCase: '=',

@@ -301,15 +301,4 @@ colorPickerFormat: '=',

$scope.$watch('colorPickerFormat', function (newValue, oldValue) {
if (newValue !== undefined && newValue !== oldValue) {
if (newValue === 'hex') {
$scope.colorPickerAlpha = false;
}
$scope.initConfig();
$scope.update();
}
});
$scope.$watchGroup(
['colorPickerAlpha', 'colorPickerCase'],
['colorPickerFormat', 'colorPickerAlpha', 'colorPickerCase'],
function (newValue, oldValue) {

@@ -316,0 +305,0 @@ if (newValue !== undefined) {

@@ -15,8 +15,2 @@ angular.module('color.picker').run(['$templateCache', function($templateCache) {

' }">\n' +
' <div class="color-picker-hue color-picker-sprite">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-grid color-picker-sprite">\n' +

@@ -28,2 +22,8 @@ ' <div class="color-picker-grid-inner"></div>\n' +

' </div>\n' +
' <div class="color-picker-hue color-picker-sprite">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha && config.format !== \'hex\'">\n' +
' <div class="color-picker-slider"></div>\n' +
' </div>\n' +
' </div>\n' +

@@ -30,0 +30,0 @@ '</div>'

{
"name": "angularjs-color-picker",
"description": "Color Picker Directive For AngularJS",
"version": "1.0.6",
"version": "1.0.7",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/angularjs-color-picker.min.js",

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc