diff --git a/.gitignore b/.gitignore index baed295..4cb907c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -lib/ -lib/* - examples/app/*.js examples/app/*.d.ts @@ -11,8 +8,6 @@ examples/npm-debug.log node_modules/* typings/* npm-debug.log -index.* -!index.ts .sass-cache nbproject/* \ No newline at end of file diff --git a/bower.json b/bower.json index 59bc1be..cc08a60 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,12 @@ { "name": "angular2-color-picker", - "version": "1.1.0", + "version": "1.1.1", "authors": [ "Alberto Pujante " ], "description": "Color Picker Directive for Angular 2 with no dependencies required", "main": [ - "app/color-picker/color-picker.directive.ts" + "src/color-picker.directive.ts" ], "ignore": [ "node_modules" diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..4682445 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,48 @@ + + + + Angular 2 Color Picker (Demo Page) + + + + + + + + + + + + + + + + + + + + + + + + Loading... + + + \ No newline at end of file diff --git a/examples/package.json b/examples/package.json index da2512b..64db64d 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,7 @@ { "name": "angular2-color-picker-example", - "version": "1.1.0", + "description": "Example for Angular2 Color Picker", + "version": "1.1.1", "scripts": { "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", "lite": "lite-server", diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..11aece6 --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export * from './lib/index'; diff --git a/index.js b/index.js new file mode 100644 index 0000000..4af5dd9 --- /dev/null +++ b/index.js @@ -0,0 +1,7 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require('./lib/index')); + +//# sourceMappingURL=index.js.map diff --git a/index.js.map b/index.js.map new file mode 100644 index 0000000..afa05cf --- /dev/null +++ b/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;AAAA,iBAAc,aAAa,CAAC,EAAA","file":"index.js","sourcesContent":["export * from './lib/index';"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/lib/classes.d.ts b/lib/classes.d.ts new file mode 100644 index 0000000..905da65 --- /dev/null +++ b/lib/classes.d.ts @@ -0,0 +1,35 @@ +export declare class Hsva { + h: number; + s: number; + v: number; + a: number; + constructor(h: number, s: number, v: number, a: number); +} +export declare class Hsla { + h: number; + s: number; + l: number; + a: number; + constructor(h: number, s: number, l: number, a: number); +} +export declare class Rgba { + r: number; + g: number; + b: number; + a: number; + constructor(r: number, g: number, b: number, a: number); +} +export declare class SliderPosition { + h: number; + s: number; + v: number; + a: number; + constructor(h: number, s: number, v: number, a: number); +} +export declare class SliderDimension { + h: number; + s: number; + v: number; + a: number; + constructor(h: number, s: number, v: number, a: number); +} diff --git a/lib/classes.js b/lib/classes.js new file mode 100644 index 0000000..a5fbb94 --- /dev/null +++ b/lib/classes.js @@ -0,0 +1,53 @@ +"use strict"; +var Hsva = (function () { + function Hsva(h, s, v, a) { + this.h = h; + this.s = s; + this.v = v; + this.a = a; + } + return Hsva; +}()); +exports.Hsva = Hsva; +var Hsla = (function () { + function Hsla(h, s, l, a) { + this.h = h; + this.s = s; + this.l = l; + this.a = a; + } + return Hsla; +}()); +exports.Hsla = Hsla; +var Rgba = (function () { + function Rgba(r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + return Rgba; +}()); +exports.Rgba = Rgba; +var SliderPosition = (function () { + function SliderPosition(h, s, v, a) { + this.h = h; + this.s = s; + this.v = v; + this.a = a; + } + return SliderPosition; +}()); +exports.SliderPosition = SliderPosition; +var SliderDimension = (function () { + function SliderDimension(h, s, v, a) { + this.h = h; + this.s = s; + this.v = v; + this.a = a; + } + return SliderDimension; +}()); +exports.SliderDimension = SliderDimension; + +//# sourceMappingURL=classes.js.map diff --git a/lib/classes.js.map b/lib/classes.js.map new file mode 100644 index 0000000..4ec7583 --- /dev/null +++ b/lib/classes.js.map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C,GAAD,CAAC,CAAQ;QAAS,MAAC,GAAD,CAAC,CAAQ;IAAI,CAAC;IAC3F,sBAAC;AAAD,CAFA,AAEC,IAAA;AAFY,uBAAe,kBAE3B,CAAA","file":"classes.js","sourcesContent":["export class Hsva {\n constructor(public h: number, public s: number, public v: number, public a: number) { }\n}\nexport class Hsla {\n constructor(public h: number, public s: number, public l: number, public a: number) { }\n}\nexport class Rgba {\n constructor(public r: number, public g: number, public b: number, public a: number) { }\n}\nexport class SliderPosition {\n constructor(public h: number, public s: number, public v: number, public a: number) { }\n}\nexport class SliderDimension {\n constructor(public h: number, public s: number, public v: number, public a: number) { }\n}"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/lib/color-picker.directive.d.ts b/lib/color-picker.directive.d.ts new file mode 100644 index 0000000..f6a47a1 --- /dev/null +++ b/lib/color-picker.directive.d.ts @@ -0,0 +1,131 @@ +import { DynamicComponentLoader, ViewContainerRef, ElementRef, EventEmitter, OnInit } from '@angular/core'; +import { ColorPickerService } from './color-picker.service'; +export declare class ColorPickerDirective implements OnInit { + private dcl; + private vcRef; + private el; + private service; + colorPicker: string; + colorPickerChange: EventEmitter; + cpPosition: string; + cpPositionOffset: string; + cpPositionRelativeToArrow: boolean; + cpOutputFormat: string; + cpCancelButton: boolean; + cpCancelButtonClass: string; + cpCancelButtonText: string; + cpFallbackColor: string; + cpHeight: string; + private dialog; + private created; + constructor(dcl: DynamicComponentLoader, vcRef: ViewContainerRef, el: ElementRef, service: ColorPickerService); + ngOnInit(): void; + onClick(): void; + colorChanged(value: string): void; + changeInput(value: string): void; +} +export declare class TextDirective { + newValue: EventEmitter; + text: any; + rg: number; + changeInput(value: string): void; +} +export declare class SliderDirective { + private el; + newValue: EventEmitter; + slider: string; + rgX: number; + rgY: number; + private listenerMove; + private listenerStop; + constructor(el: ElementRef); + setCursor(event: any): void; + move(event: any): void; + start(event: any): void; + stop(): void; + getX(event: any): number; + getY(event: any): number; +} +export declare class DialogComponent implements OnInit { + private el; + private service; + private hsva; + private rgbaText; + private hslaText; + private hexText; + private outputColor; + private alphaSliderColor; + private hueSliderColor; + private slider; + private sliderDimMax; + private format; + private show; + private top; + private left; + private position; + private directiveInstance; + private initialColor; + private directiveElementRef; + private listenerMouseDown; + private listenerResize; + private cpPosition; + private cpPositionOffset; + private cpOutputFormat; + private cpCancelButton; + private cpCancelButtonClass; + private cpCancelButtonText; + private cpHeight; + private dialogWidth; + private dialogArrowSize; + private dialogArrowOffset; + private arrowTop; + constructor(el: ElementRef, service: ColorPickerService); + setDialog(instance: any, elementRef: ElementRef, color: any, cpPosition: string, cpPositionOffset: string, cpPositionRelativeToArrow: boolean, cpOutputFormat: string, cpCancelButton: boolean, cpCancelButtonClass: string, cpCancelButtonText: string, cpHeight: string): void; + setInitialColor(color: any): void; + ngOnInit(): void; + openColorPicker(): void; + onMouseDown(event: any): void; + closeColorPicker(): void; + onResize(): void; + setDialogPosition(): void; + setSaturation(val: { + v: number; + rg: number; + }): void; + setLightness(val: { + v: number; + rg: number; + }): void; + setHue(val: { + v: number; + rg: number; + }): void; + setAlpha(val: { + v: number; + rg: number; + }): void; + setR(val: { + v: number; + rg: number; + }): void; + setG(val: { + v: number; + rg: number; + }): void; + setB(val: { + v: number; + rg: number; + }): void; + setSaturationAndBrightness(val: { + s: number; + v: number; + rgX: number; + rgY: number; + }): void; + setColorFromString(value: string): void; + formatPolicy(): number; + update(): void; + cancelColor(): void; + isDescendant(parent: any, child: any): boolean; + createBox(element: any, offset: any): any; +} diff --git a/lib/color-picker.directive.js b/lib/color-picker.directive.js new file mode 100644 index 0000000..7559ce0 --- /dev/null +++ b/lib/color-picker.directive.js @@ -0,0 +1,461 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var core_1 = require('@angular/core'); +var color_picker_service_1 = require('./color-picker.service'); +var classes_1 = require('./classes'); +var ColorPickerDirective = (function () { + function ColorPickerDirective(dcl, vcRef, el, service) { + this.dcl = dcl; + this.vcRef = vcRef; + this.el = el; + this.service = service; + this.colorPickerChange = new core_1.EventEmitter(true); + this.cpPosition = 'right'; + this.cpPositionOffset = '0%'; + this.cpPositionRelativeToArrow = false; + this.cpOutputFormat = 'hex'; + this.cpCancelButton = false; + this.cpCancelButtonClass = 'cp-cancel-button-class'; + this.cpCancelButtonText = 'Cancel'; + this.cpFallbackColor = '#fff'; + this.cpHeight = '290px'; + this.created = false; + } + ColorPickerDirective.prototype.ngOnInit = function () { + var hsva = this.service.stringToHsva(this.colorPicker); + if (hsva == null) { + hsva = this.service.stringToHsva(this.cpFallbackColor); + } + this.colorPickerChange.emit(this.service.outputFormat(hsva, this.cpOutputFormat)); + }; + ColorPickerDirective.prototype.onClick = function () { + var _this = this; + if (!this.created) { + this.created = true; + this.dcl.loadNextToLocation(DialogComponent, this.vcRef) + .then(function (res) { + res.instance.setDialog(_this, _this.el, _this.colorPicker, _this.cpPosition, _this.cpPositionOffset, _this.cpPositionRelativeToArrow, _this.cpOutputFormat, _this.cpCancelButton, _this.cpCancelButtonClass, _this.cpCancelButtonText, _this.cpHeight); + _this.dialog = res.instance; + }); + } + else if (this.dialog) { + this.dialog.setInitialColor(this.colorPicker); + this.dialog.openColorPicker(); + } + }; + ColorPickerDirective.prototype.colorChanged = function (value) { + this.colorPickerChange.emit(value); + }; + ColorPickerDirective.prototype.changeInput = function (value) { + this.dialog.setColorFromString(value); + this.colorPickerChange.emit(value); + }; + __decorate([ + core_1.Input('colorPicker'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "colorPicker", void 0); + __decorate([ + core_1.Output('colorPickerChange'), + __metadata('design:type', Object) + ], ColorPickerDirective.prototype, "colorPickerChange", void 0); + __decorate([ + core_1.Input('cpPosition'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpPosition", void 0); + __decorate([ + core_1.Input('cpPositionOffset'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpPositionOffset", void 0); + __decorate([ + core_1.Input('cpPositionRelativeToArrow'), + __metadata('design:type', Boolean) + ], ColorPickerDirective.prototype, "cpPositionRelativeToArrow", void 0); + __decorate([ + core_1.Input('cpOutputFormat'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpOutputFormat", void 0); + __decorate([ + core_1.Input('cpCancelButton'), + __metadata('design:type', Boolean) + ], ColorPickerDirective.prototype, "cpCancelButton", void 0); + __decorate([ + core_1.Input('cpCancelButtonClass'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpCancelButtonClass", void 0); + __decorate([ + core_1.Input('cpCancelButtonText'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpCancelButtonText", void 0); + __decorate([ + core_1.Input('cpFallbackColor'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpFallbackColor", void 0); + __decorate([ + core_1.Input('cpHeight'), + __metadata('design:type', String) + ], ColorPickerDirective.prototype, "cpHeight", void 0); + ColorPickerDirective = __decorate([ + core_1.Directive({ + selector: '[colorPicker]', + host: { + '(input)': 'changeInput($event.target.value)', + '(click)': 'onClick()' + } + }), + __metadata('design:paramtypes', [core_1.DynamicComponentLoader, core_1.ViewContainerRef, core_1.ElementRef, color_picker_service_1.ColorPickerService]) + ], ColorPickerDirective); + return ColorPickerDirective; +}()); +exports.ColorPickerDirective = ColorPickerDirective; +var TextDirective = (function () { + function TextDirective() { + this.newValue = new core_1.EventEmitter(); + } + TextDirective.prototype.changeInput = function (value) { + if (this.rg === undefined) { + this.newValue.emit(value); + } + else { + var numeric = parseFloat(value); + if (!isNaN(numeric) && numeric >= 0 && numeric <= this.rg) { + this.newValue.emit({ v: numeric, rg: this.rg }); + } + } + }; + __decorate([ + core_1.Output('newValue'), + __metadata('design:type', Object) + ], TextDirective.prototype, "newValue", void 0); + __decorate([ + core_1.Input('text'), + __metadata('design:type', Object) + ], TextDirective.prototype, "text", void 0); + __decorate([ + core_1.Input('rg'), + __metadata('design:type', Number) + ], TextDirective.prototype, "rg", void 0); + TextDirective = __decorate([ + core_1.Directive({ + selector: '[text]', + host: { + '(input)': 'changeInput($event.target.value)' + } + }), + __metadata('design:paramtypes', []) + ], TextDirective); + return TextDirective; +}()); +exports.TextDirective = TextDirective; +var SliderDirective = (function () { + function SliderDirective(el) { + var _this = this; + this.el = el; + this.newValue = new core_1.EventEmitter(); + this.listenerMove = function (event) { _this.move(event); }; + this.listenerStop = function () { _this.stop(); }; + } + SliderDirective.prototype.setCursor = function (event) { + var height = this.el.nativeElement.offsetHeight; + var width = this.el.nativeElement.offsetWidth; + var x = Math.max(0, Math.min(this.getX(event), width)); + var y = Math.max(0, Math.min(this.getY(event), height)); + if (this.rgX !== undefined && this.rgY !== undefined) { + this.newValue.emit({ s: x / width, v: (1 - y / height), rgX: this.rgX, rgY: this.rgY }); + } + else if (this.rgX === undefined && this.rgY !== undefined) { + this.newValue.emit({ v: y / height, rg: this.rgY }); + } + else { + this.newValue.emit({ v: x / width, rg: this.rgX }); + } + }; + SliderDirective.prototype.move = function (event) { + event.preventDefault(); + this.setCursor(event); + }; + SliderDirective.prototype.start = function (event) { + this.setCursor(event); + document.addEventListener('mousemove', this.listenerMove); + document.addEventListener('touchmove', this.listenerMove); + document.addEventListener('mouseup', this.listenerStop); + document.addEventListener('touchend', this.listenerStop); + }; + SliderDirective.prototype.stop = function () { + document.removeEventListener('mousemove', this.listenerMove); + document.removeEventListener('touchmove', this.listenerMove); + document.removeEventListener('mouseup', this.listenerStop); + document.removeEventListener('touchend', this.listenerStop); + }; + SliderDirective.prototype.getX = function (event) { + return (event.pageX !== undefined ? event.pageX : event.touches[0].pageX) - this.el.nativeElement.getBoundingClientRect().left - window.pageXOffset; + }; + SliderDirective.prototype.getY = function (event) { + return (event.pageY !== undefined ? event.pageY : event.touches[0].pageY) - this.el.nativeElement.getBoundingClientRect().top - window.pageYOffset; + }; + __decorate([ + core_1.Output('newValue'), + __metadata('design:type', Object) + ], SliderDirective.prototype, "newValue", void 0); + __decorate([ + core_1.Input('slider'), + __metadata('design:type', String) + ], SliderDirective.prototype, "slider", void 0); + __decorate([ + core_1.Input('rgX'), + __metadata('design:type', Number) + ], SliderDirective.prototype, "rgX", void 0); + __decorate([ + core_1.Input('rgY'), + __metadata('design:type', Number) + ], SliderDirective.prototype, "rgY", void 0); + SliderDirective = __decorate([ + core_1.Directive({ + selector: '[slider]', + host: { + '(mousedown)': 'start($event)', + '(touchstart)': 'start($event)' + } + }), + __metadata('design:paramtypes', [core_1.ElementRef]) + ], SliderDirective); + return SliderDirective; +}()); +exports.SliderDirective = SliderDirective; +var DialogComponent = (function () { + function DialogComponent(el, service) { + this.el = el; + this.service = service; + this.dialogWidth = 232; + this.dialogArrowSize = 10; + this.dialogArrowOffset = 15; + } + DialogComponent.prototype.setDialog = function (instance, elementRef, color, cpPosition, cpPositionOffset, cpPositionRelativeToArrow, cpOutputFormat, cpCancelButton, cpCancelButtonClass, cpCancelButtonText, cpHeight) { + this.directiveInstance = instance; + this.initialColor = color; + this.directiveElementRef = elementRef; + this.cpPosition = cpPosition; + this.cpPositionOffset = parseInt(cpPositionOffset); + if (!cpPositionRelativeToArrow) { + this.dialogArrowOffset = 0; + } + this.cpOutputFormat = cpOutputFormat; + this.cpCancelButton = cpCancelButton; + this.cpCancelButtonClass = cpCancelButtonClass; + this.cpCancelButtonText = cpCancelButtonText; + this.cpHeight = parseInt(cpHeight); + }; + DialogComponent.prototype.setInitialColor = function (color) { + this.initialColor = color; + }; + DialogComponent.prototype.ngOnInit = function () { + var _this = this; + var hsva = this.service.stringToHsva(this.initialColor); + if (hsva !== null) { + this.hsva = hsva; + } + else { + this.hsva = new classes_1.Hsva(0, 1, 1, 1); + } + this.sliderDimMax = new classes_1.SliderDimension(150, 230, 130, 150); + this.slider = new classes_1.SliderPosition(0, 0, 0, 0); + if (this.cpOutputFormat === 'rgba') { + this.format = 1; + } + else if (this.cpOutputFormat === 'hsla') { + this.format = 2; + } + else { + this.format = 0; + } + this.listenerMouseDown = function (event) { _this.onMouseDown(event); }; + this.listenerResize = function () { _this.onResize(); }; + this.update(); + this.openColorPicker(); + }; + DialogComponent.prototype.openColorPicker = function () { + if (!this.show) { + this.setDialogPosition(); + this.show = true; + document.addEventListener('mousedown', this.listenerMouseDown); + window.addEventListener('resize', this.listenerResize); + } + }; + DialogComponent.prototype.onMouseDown = function (event) { + if (!this.isDescendant(this.el.nativeElement, event.target) + && event.target != this.directiveElementRef.nativeElement) { + this.closeColorPicker(); + } + }; + DialogComponent.prototype.closeColorPicker = function () { + this.show = false; + document.removeEventListener('mouseup', this.listenerMouseDown); + window.removeEventListener('resize', this.listenerResize); + }; + DialogComponent.prototype.onResize = function () { + if (this.position === 'fixed') { + this.setDialogPosition(); + } + }; + DialogComponent.prototype.setDialogPosition = function () { + var node = this.directiveElementRef.nativeElement, position = 'static'; + var parentNode = null; + while (node !== null && node.tagName !== 'HTML') { + position = window.getComputedStyle(node).getPropertyValue("position"); + if (position !== 'static' && parentNode === null) { + parentNode = node; + } + if (position === 'fixed') { + break; + } + node = node.parentNode; + } + if (position !== 'fixed') { + var boxDirective = this.createBox(this.directiveElementRef.nativeElement, true); + if (parentNode === null) { + parentNode = node; + } + var boxParent = this.createBox(parentNode, true); + this.top = boxDirective.top - boxParent.top; + this.left = boxDirective.left - boxParent.left; + } + else { + var boxDirective = this.createBox(this.directiveElementRef.nativeElement, false); + this.top = boxDirective.top; + this.left = boxDirective.left; + this.position = 'fixed'; + } + if (this.cpPosition === 'left') { + this.top += boxDirective.height * this.cpPositionOffset / 100 - this.dialogArrowOffset; + this.left -= this.dialogWidth + this.dialogArrowSize; + } + else if (this.cpPosition === 'top') { + this.top -= this.cpHeight + this.dialogArrowSize; + this.left += this.cpPositionOffset / 100 * boxDirective.width - this.dialogArrowOffset; + this.arrowTop = this.cpHeight - 1; + } + else if (this.cpPosition === 'bottom') { + this.top += boxDirective.height + this.dialogArrowSize; + this.left += this.cpPositionOffset / 100 * boxDirective.width - this.dialogArrowOffset; + } + else { + this.top += boxDirective.height * this.cpPositionOffset / 100 - this.dialogArrowOffset; + this.left += boxDirective.width + this.dialogArrowSize; + } + }; + DialogComponent.prototype.setSaturation = function (val) { + var hsla = this.service.hsva2hsla(this.hsva); + hsla.s = val.v / val.rg; + this.hsva = this.service.hsla2hsva(hsla); + this.update(); + }; + DialogComponent.prototype.setLightness = function (val) { + var hsla = this.service.hsva2hsla(this.hsva); + hsla.l = val.v / val.rg; + this.hsva = this.service.hsla2hsva(hsla); + this.update(); + }; + DialogComponent.prototype.setHue = function (val) { + this.hsva.h = val.v / val.rg; + this.update(); + }; + DialogComponent.prototype.setAlpha = function (val) { + this.hsva.a = val.v / val.rg; + this.update(); + }; + DialogComponent.prototype.setR = function (val) { + var rgba = this.service.hsvaToRgba(this.hsva); + rgba.r = val.v / val.rg; + this.hsva = this.service.rgbaToHsva(rgba); + this.update(); + }; + DialogComponent.prototype.setG = function (val) { + var rgba = this.service.hsvaToRgba(this.hsva); + rgba.g = val.v / val.rg; + this.hsva = this.service.rgbaToHsva(rgba); + this.update(); + }; + DialogComponent.prototype.setB = function (val) { + var rgba = this.service.hsvaToRgba(this.hsva); + rgba.b = val.v / val.rg; + this.hsva = this.service.rgbaToHsva(rgba); + this.update(); + }; + DialogComponent.prototype.setSaturationAndBrightness = function (val) { + this.hsva.s = val.s / val.rgX; + this.hsva.v = val.v / val.rgY; + this.update(); + }; + DialogComponent.prototype.setColorFromString = function (value) { + var hsva = this.service.stringToHsva(value); + if (hsva !== null) { + this.hsva = hsva; + } + this.update(); + }; + DialogComponent.prototype.formatPolicy = function () { + this.format = (this.format + 1) % 3; + if (this.format === 0 && this.hsva.a < 1) { + this.format++; + } + return this.format; + }; + DialogComponent.prototype.update = function () { + var hsla = this.service.hsva2hsla(this.hsva); + var rgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva)); + var hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(new classes_1.Hsva(this.hsva.h, 1, 1, 1))); + this.hslaText = new classes_1.Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100); + this.rgbaText = new classes_1.Rgba(rgba.r, rgba.g, rgba.b, Math.round(rgba.a * 100) / 100); + this.hexText = this.service.hexText(rgba); + this.alphaSliderColor = 'rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')'; + this.hueSliderColor = 'rgb(' + hueRgba.r + ',' + hueRgba.g + ',' + hueRgba.b + ')'; + if (this.format === 0 && this.hsva.a < 1) { + this.format++; + } + this.outputColor = this.service.outputFormat(this.hsva, this.cpOutputFormat); + this.slider = new classes_1.SliderPosition((this.hsva.h) * this.sliderDimMax.h - 8, this.hsva.s * this.sliderDimMax.s - 8, (1 - this.hsva.v) * this.sliderDimMax.v - 8, this.hsva.a * this.sliderDimMax.a - 8); + this.directiveInstance.colorChanged(this.outputColor); + }; + DialogComponent.prototype.cancelColor = function () { + this.setColorFromString(this.initialColor); + this.closeColorPicker(); + }; + DialogComponent.prototype.isDescendant = function (parent, child) { + var node = child.parentNode; + while (node !== null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; + }; + DialogComponent.prototype.createBox = function (element, offset) { + return { + top: element.getBoundingClientRect().top + (offset ? window.pageYOffset : 0), + left: element.getBoundingClientRect().left + (offset ? window.pageXOffset : 0), + width: element.offsetWidth, + height: element.offsetHeight + }; + }; + DialogComponent = __decorate([ + core_1.Component({ + selector: 'color-picker', + template: "\n
\n
\n\n
\n
\n
\n\n
\n
\n
\n\n
\n
\n
\n\n
\n
\n\n
\n \n \n \n \n
H
S
L
A
\n
\n\n
\n \n \n \n \n
R
G
B
A
\n
\n\n
\n \n
Hex
\n
\n\n
\n \n \n\n
\n ", + styles: ["\n /*\n * Styles for Color Picker\n * \n * Alberto Pujante\n * \n * @licence: http://opensource.org/licenses/MIT\n */\n .color-picker, .color-picker * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n font-size: 11px; }\n\n .color-picker {\n width: 232px;\n height: 290px;\n border: #777 solid 1px;\n left: 30px;\n top: 250px;\n position: absolute;\n z-index: 1000;\n background-color: #fff;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n .color-picker i {\n cursor: default;\n position: relative; }\n .color-picker input {\n text-align: center;\n font-size: 13px;\n height: 26px;\n -moz-appearance: textfield; }\n .color-picker input:invalid {\n box-shadow: none; }\n .color-picker input:-moz-submit-invalid {\n box-shadow: none; }\n .color-picker input:-moz-ui-invalid {\n box-shadow: none; }\n .color-picker input::-webkit-inner-spin-button, .color-picker input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0; }\n .color-picker .cp-cancel-button-class {\n position: absolute;\n top: 275px;\n left: 161px; }\n .color-picker .arrow {\n height: 0;\n width: 0;\n border-style: solid;\n position: absolute;\n z-index: 999999; }\n .color-picker .arrow-right {\n border-width: 5px 10px;\n border-color: transparent #777 transparent transparent;\n top: 10px;\n left: -20px; }\n .color-picker .arrow-left {\n border-width: 5px 10px;\n border-color: transparent transparent transparent #777;\n top: 10px;\n left: 231px; }\n .color-picker .arrow-bottom {\n border-width: 10px 5px;\n border-color: transparent transparent #777 transparent;\n top: -20px;\n left: 10px; }\n .color-picker .arrow-top {\n border-width: 10px 5px;\n border-color: #777 transparent transparent transparent;\n left: 10px; }\n .color-picker div.cursor-sv {\n cursor: default;\n position: relative;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n width: 15px;\n height: 15px;\n border: #ddd solid 1px; }\n .color-picker div.cursor {\n cursor: default;\n position: relative;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n width: 16px;\n height: 16px;\n border: #222 solid 2px; }\n .color-picker .saturation-lightness {\n width: 230px;\n height: 130px;\n border: none;\n top: 0;\n left: 0;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwksPWR6lgAAIABJREFUeNrtnVuT47gRrAHN+P//Or/61Y5wONZ7mZ1u3XAeLMjJZGZVgdKsfc5xR3S0RIIUW+CHzCpc2McYo7XGv3ex7UiZd57rjyzzv+v+33X/R/+3r/f7vR386Y+TvKNcf/wdhTLPcv9qU2wZd74uth0t1821jkIZLPcsI/6nWa4XvutquU0Z85mnx80S/ZzgpnLnOtHNt7/ofx1TKXcSNzN/7qbMQ3ju7rNQmMYYd/4s2j9aa+P+gGaMcZrb1M/tdrvf7/d2v99P9/t93O/3cbvdxu12G9frdVwul3E+n8c///nP+2+//Xb66aefxl//+tfx5z//2YK5Al2rgvf4UsbpdGrB52bAvArXpuzjmiqAVSGz5eDmGYXzhbAZmCrnmzddpUU+8Y1dAOYeXCtDUwVwV7YCGH6uAmyMcZ9l5vkUaBPGMUZ7/J5w/792/fvv9Xq93263dr/fTxPECeME8nK5jM/Pz/HTTz/dv337dvrll1/GP/7xj/G3v/1t/OUvfwkVswongjdOp9PzH3U3D3zmWGnZVXn4jCqs7wC2BKP4/8tAzkZsoWx6XrqeHZymvp4ABCBJhTQwKfDT8gzrZCIqi5AhiACjBfEB2rP8/X63MM7f6/V6v9/v7Xa7bYC83W7jcrlsVHIq5ffv30+//fbb+OWXX8ZPP/00/v73v4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4CmeUolmeXLN4Aq7C5Sj10Q7yjgl+t6CNxSRHmI5X+CpwreYB3Qfdqna4q21KdBuc4GoZsn49ZOOiVinwHqK9WzjvgeweEh2AU5+vtxZ9Cd9Wqkh49V18E5oj6vVyn0RStAyGIO5edXRKd5B0VGVXq2yr3xYp+5Ut+C4QJ4P1N339pQMjRejj4vb/Dcr6rQc3O/0rjmtZpeYCBiCHfCemRbNhbK/pNUPc3wfKy5f2D7OlL3/uPhve/oU4T0F8f+VNM2vyoiv0jK+KHQfdHq+0bncz4oz73/+Y6LbKw1o/5B7eOf1Rl/0du9B9tn/9bvrf/j+v0h6ttn2tp/r/4819y4/zv5391uvzzfwDifz6phT1MPgAAAABJRU5ErkJggg==\"); }\n .color-picker .hue {\n width: 150px;\n height: 16px;\n border: none;\n top: 145px;\n left: 70px;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC\"); }\n .color-picker .alpha {\n width: 150px;\n height: 16px;\n border: none;\n top: 175px;\n left: 70px;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==\"); }\n .color-picker .selected-color {\n width: 40px;\n height: 40px;\n top: 147px;\n left: 15px;\n position: absolute;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%; }\n .color-picker .selected-color-background {\n width: 40px;\n height: 40px;\n top: 147px;\n left: 15px;\n position: absolute;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC\"); }\n .color-picker .type-policy {\n position: absolute;\n top: 226px;\n left: 206px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 8px 16px;\n -moz-background-size: 8px 16px;\n -webkit-background-size: 8px 16px;\n -o-background-size: 8px 16px;\n width: 16px;\n height: 24px; }\n .color-picker .hsla-text, .color-picker .rgba-text {\n position: absolute;\n top: 220px;\n left: 12px;\n font-size: 11px; }\n .color-picker .hsla-text input, .color-picker .rgba-text input {\n margin: 0;\n float: left;\n width: 40px;\n margin-left: 7px;\n border: #a9a9a9 solid 1px;\n padding: 1px; }\n .color-picker .hsla-text div, .color-picker .rgba-text div {\n float: left;\n width: 40px;\n text-align: center;\n color: #555;\n margin-left: 7px;\n margin-top: 4px; }\n .color-picker .hsla-text div:nth-child(5), .color-picker .rgba-text div:nth-child(5) {\n clear: left; }\n .color-picker .hex-text {\n position: absolute;\n top: 220px;\n left: 30px;\n font-size: 11px; }\n .color-picker .hex-text input {\n float: left;\n width: 160px;\n border: #a9a9a9 solid 1px;\n padding: 1px; }\n .color-picker .hex-text div {\n text-align: center;\n color: #555;\n float: left;\n clear: left;\n width: 160px;\n margin-top: 4px; }\n "], + directives: [SliderDirective, TextDirective] + }), + __metadata('design:paramtypes', [core_1.ElementRef, color_picker_service_1.ColorPickerService]) + ], DialogComponent); + return DialogComponent; +}()); +exports.DialogComponent = DialogComponent; + +//# sourceMappingURL=color-picker.directive.js.map diff --git a/lib/color-picker.directive.js.map b/lib/color-picker.directive.js.map new file mode 100644 index 0000000..9e67194 --- /dev/null +++ b/lib/color-picker.directive.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["color-picker.directive.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAA8H,eAAe,CAAC,CAAA;AAC9I,qCAAiC,wBAAwB,CAAC,CAAA;AAC1D,wBAAgE,WAAW,CAAC,CAAA;AAS5E;IAeI,8BAAoB,GAA2B,EAAU,KAAuB,EAAU,EAAc,EAAU,OAA2B;QAAzH,QAAG,GAAH,GAAG,CAAwB;QAAU,UAAK,GAAL,KAAK,CAAkB;QAAU,OAAE,GAAF,EAAE,CAAY;QAAU,YAAO,GAAP,OAAO,CAAoB;QAbhH,sBAAiB,GAAG,IAAI,mBAAY,CAAS,IAAI,CAAC,CAAC;QAC3D,eAAU,GAAW,OAAO,CAAC;QACvB,qBAAgB,GAAW,IAAI,CAAC;QACvB,8BAAyB,GAAY,KAAK,CAAC;QACtD,mBAAc,GAAW,KAAK,CAAC;QAC/B,mBAAc,GAAY,KAAK,CAAC;QAC3B,wBAAmB,GAAW,wBAAwB,CAAC;QACxD,uBAAkB,GAAW,QAAQ,CAAC;QACzC,oBAAe,GAAW,MAAM,CAAC;QACxC,a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KAAK,EAAE,OAAO,CAAC,WAAW;YAC1B,MAAM,EAAE,OAAO,CAAC,YAAY;SAC/B,CAAC;IACN,CAAC;IAxfL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,cAAc;YACxB,QAAQ,EAAE,mkGA6CT;YACD,MAAM,EAAE,CAAC,sqwBAgMR,CAAC;YACF,UAAU,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC;SAC/C,CAAC;;uBAAA;IAuQF,sBAAC;AAAD,CAtQA,AAsQC,IAAA;AAtQY,uBAAe,kBAsQ3B,CAAA","file":"color-picker.directive.js","sourcesContent":["import {Component, DynamicComponentLoader, Directive, Input, Output, ViewContainerRef, ElementRef, EventEmitter, OnInit} from '@angular/core';\nimport {ColorPickerService} from './color-picker.service';\nimport {Rgba, Hsla, Hsva, SliderPosition, SliderDimension} from './classes';\n\n@Directive({\n selector: '[colorPicker]',\n host: {\n '(input)': 'changeInput($event.target.value)',\n '(click)': 'onClick()'\n }\n})\nexport class ColorPickerDirective implements OnInit {\n @Input('colorPicker') colorPicker: string;\n @Output('colorPickerChange') colorPickerChange = new EventEmitter(true);\n @Input('cpPosition') cpPosition: string = 'right';\n @Input('cpPositionOffset') cpPositionOffset: string = '0%';\n @Input('cpPositionRelativeToArrow') cpPositionRelativeToArrow: boolean = false;\n @Input('cpOutputFormat') cpOutputFormat: string = 'hex';\n @Input('cpCancelButton') cpCancelButton: boolean = false;\n @Input('cpCancelButtonClass') cpCancelButtonClass: string = 'cp-cancel-button-class';\n @Input('cpCancelButtonText') cpCancelButtonText: string = 'Cancel';\n @Input('cpFallbackColor') cpFallbackColor: string = '#fff';\n @Input('cpHeight') cpHeight: string = '290px';\n private dialog: any;\n private created: boolean;\n\n constructor(private dcl: DynamicComponentLoader, private vcRef: ViewContainerRef, private el: ElementRef, private service: ColorPickerService) {\n this.created = false;\n }\n\n ngOnInit() {\n var hsva = this.service.stringToHsva(this.colorPicker);\n if (hsva == null) {\n hsva = this.service.stringToHsva(this.cpFallbackColor);\n }\n this.colorPickerChange.emit(this.service.outputFormat(hsva, this.cpOutputFormat));\n }\n\n onClick() {\n if (!this.created) {\n this.created = true;\n this.dcl.loadNextToLocation(DialogComponent, this.vcRef)\n .then((res) => {\n res.instance.setDialog(this, this.el, this.colorPicker, this.cpPosition, this.cpPositionOffset,\n this.cpPositionRelativeToArrow, this.cpOutputFormat, this.cpCancelButton, this.cpCancelButtonClass, this.cpCancelButtonText, this.cpHeight);\n this.dialog = res.instance;\n });\n } else if (this.dialog) {\n this.dialog.setInitialColor(this.colorPicker);\n this.dialog.openColorPicker();\n }\n }\n\n colorChanged(value: string) {\n this.colorPickerChange.emit(value)\n }\n\n changeInput(value: string) {\n this.dialog.setColorFromString(value)\n this.colorPickerChange.emit(value)\n }\n}\n\n\n@Directive({\n selector: '[text]',\n host: {\n '(input)': 'changeInput($event.target.value)'\n }\n})\nexport class TextDirective {\n @Output('newValue') newValue = new EventEmitter();\n @Input('text') text: any;\n @Input('rg') rg: number;\n\n changeInput(value: string) {\n if (this.rg === undefined) {\n this.newValue.emit(value);\n } else {\n let numeric = parseFloat(value)\n if (!isNaN(numeric) && numeric >= 0 && numeric <= this.rg) {\n this.newValue.emit({ v: numeric, rg: this.rg });\n }\n }\n }\n}\n\n@Directive({\n selector: '[slider]',\n host: {\n '(mousedown)': 'start($event)',\n '(touchstart)': 'start($event)'\n }\n})\nexport class SliderDirective {\n @Output('newValue') newValue = new EventEmitter();\n @Input('slider') slider: string;\n @Input('rgX') rgX: number;\n @Input('rgY') rgY: number;\n private listenerMove: any;\n private listenerStop: any;\n\n constructor(private el: ElementRef) {\n this.listenerMove = (event: any) => { this.move(event) };\n this.listenerStop = () => { this.stop() };\n }\n\n setCursor(event: any) {\n let height = this.el.nativeElement.offsetHeight;\n let width = this.el.nativeElement.offsetWidth;\n let x = Math.max(0, Math.min(this.getX(event), width));\n let y = Math.max(0, Math.min(this.getY(event), height));\n\n if (this.rgX !== undefined && this.rgY !== undefined) {\n this.newValue.emit({ s: x / width, v: (1 - y / height), rgX: this.rgX, rgY: this.rgY });\n } else if (this.rgX === undefined && this.rgY !== undefined) {//ready to use vertical sliders\n this.newValue.emit({ v: y / height, rg: this.rgY });\n } else {\n this.newValue.emit({ v: x / width, rg: this.rgX });\n }\n }\n\n move(event: any) {\n event.preventDefault();\n this.setCursor(event);\n }\n\n start(event: any) {\n this.setCursor(event);\n document.addEventListener('mousemove', this.listenerMove);\n document.addEventListener('touchmove', this.listenerMove);\n document.addEventListener('mouseup', this.listenerStop);\n document.addEventListener('touchend', this.listenerStop);\n }\n\n stop() {\n document.removeEventListener('mousemove', this.listenerMove);\n document.removeEventListener('touchmove', this.listenerMove);\n document.removeEventListener('mouseup', this.listenerStop);\n document.removeEventListener('touchend', this.listenerStop);\n }\n\n getX(event: any): number { \n return (event.pageX !== undefined ? event.pageX : event.touches[0].pageX) - this.el.nativeElement.getBoundingClientRect().left - window.pageXOffset;\n }\n getY(event: any): number {\n return (event.pageY !== undefined ? event.pageY : event.touches[0].pageY) - this.el.nativeElement.getBoundingClientRect().top - window.pageYOffset;\n }\n}\n\n@Component({\n selector: 'color-picker',\n template: `\n
\n
\n\n
\n
\n
\n\n
\n
\n
\n\n
\n
\n
\n\n
\n
\n\n
\n \n \n \n \n
H
S
L
A
\n
\n\n
\n \n \n \n \n
R
G
B
A
\n
\n\n
\n \n
Hex
\n
\n\n
\n \n \n\n
\n `,\n styles: [`\n /*\n * Styles for Color Picker\n * \n * Alberto Pujante\n * \n * @licence: http://opensource.org/licenses/MIT\n */\n .color-picker, .color-picker * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n font-size: 11px; }\n\n .color-picker {\n width: 232px;\n height: 290px;\n border: #777 solid 1px;\n left: 30px;\n top: 250px;\n position: absolute;\n z-index: 1000;\n background-color: #fff;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n .color-picker i {\n cursor: default;\n position: relative; }\n .color-picker input {\n text-align: center;\n font-size: 13px;\n height: 26px;\n -moz-appearance: textfield; }\n .color-picker input:invalid {\n box-shadow: none; }\n .color-picker input:-moz-submit-invalid {\n box-shadow: none; }\n .color-picker input:-moz-ui-invalid {\n box-shadow: none; }\n .color-picker input::-webkit-inner-spin-button, .color-picker input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0; }\n .color-picker .cp-cancel-button-class {\n position: absolute;\n top: 275px;\n left: 161px; }\n .color-picker .arrow {\n height: 0;\n width: 0;\n border-style: solid;\n position: absolute;\n z-index: 999999; }\n .color-picker .arrow-right {\n border-width: 5px 10px;\n border-color: transparent #777 transparent transparent;\n top: 10px;\n left: -20px; }\n .color-picker .arrow-left {\n border-width: 5px 10px;\n border-color: transparent transparent transparent #777;\n top: 10px;\n left: 231px; }\n .color-picker .arrow-bottom {\n border-width: 10px 5px;\n border-color: transparent transparent #777 transparent;\n top: -20px;\n left: 10px; }\n .color-picker .arrow-top {\n border-width: 10px 5px;\n border-color: #777 transparent transparent transparent;\n left: 10px; }\n .color-picker div.cursor-sv {\n cursor: default;\n position: relative;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n width: 15px;\n height: 15px;\n border: #ddd solid 1px; }\n .color-picker div.cursor {\n cursor: default;\n position: relative;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n width: 16px;\n height: 16px;\n border: #222 solid 2px; }\n .color-picker .saturation-lightness {\n width: 230px;\n height: 130px;\n border: none;\n top: 0;\n left: 0;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwksPWR6lgAAIABJREFUeNrtnVuT47gRrAHN+P//Or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: none;\n top: 145px;\n left: 70px;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC\"); }\n .color-picker .alpha {\n width: 150px;\n height: 16px;\n border: none;\n top: 175px;\n left: 70px;\n position: absolute;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==\"); }\n .color-picker .selected-color {\n width: 40px;\n height: 40px;\n top: 147px;\n left: 15px;\n position: absolute;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%; }\n .color-picker .selected-color-background {\n width: 40px;\n height: 40px;\n top: 147px;\n left: 15px;\n position: absolute;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -khtml-border-radius: 50%;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC\"); }\n .color-picker .type-policy {\n position: absolute;\n top: 226px;\n left: 206px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 8px 16px;\n -moz-background-size: 8px 16px;\n -webkit-background-size: 8px 16px;\n -o-background-size: 8px 16px;\n width: 16px;\n height: 24px; }\n .color-picker .hsla-text, .color-picker .rgba-text {\n position: absolute;\n top: 220px;\n left: 12px;\n font-size: 11px; }\n .color-picker .hsla-text input, .color-picker .rgba-text input {\n margin: 0;\n float: left;\n width: 40px;\n margin-left: 7px;\n border: #a9a9a9 solid 1px;\n padding: 1px; }\n .color-picker .hsla-text div, .color-picker .rgba-text div {\n float: left;\n width: 40px;\n text-align: center;\n color: #555;\n margin-left: 7px;\n margin-top: 4px; }\n .color-picker .hsla-text div:nth-child(5), .color-picker .rgba-text div:nth-child(5) {\n clear: left; }\n .color-picker .hex-text {\n position: absolute;\n top: 220px;\n left: 30px;\n font-size: 11px; }\n .color-picker .hex-text input {\n float: left;\n width: 160px;\n border: #a9a9a9 solid 1px;\n padding: 1px; }\n .color-picker .hex-text div {\n text-align: center;\n color: #555;\n float: left;\n clear: left;\n width: 160px;\n margin-top: 4px; }\n `],\n directives: [SliderDirective, TextDirective]\n})\nexport class DialogComponent implements OnInit {\n private hsva: Hsva;\n private rgbaText: Rgba;\n private hslaText: Hsla;\n private hexText: string;\n private outputColor: string;\n private alphaSliderColor: string;\n private hueSliderColor: string;\n private slider: SliderPosition;\n private sliderDimMax: SliderDimension;\n private format: number;\n private show: boolean;\n private top: number;\n private left: number;\n private position: string;\n private directiveInstance: any;\n private initialColor: string;\n private directiveElementRef: ElementRef;\n\n private listenerMouseDown: any;\n private listenerResize: any;\n\n private cpPosition: string;\n private cpPositionOffset: number;\n private cpOutputFormat: string;\n private cpCancelButton: boolean;\n private cpCancelButtonClass: string;\n private cpCancelButtonText: string;\n private cpHeight: number;\n\n private dialogWidth: number = 232;\n private dialogArrowSize: number = 10;\n private dialogArrowOffset: number = 15;\n private arrowTop: number;\n\n constructor(private el: ElementRef, private service: ColorPickerService) { }\n\n setDialog(instance: any, elementRef: ElementRef, color: any, cpPosition: string, cpPositionOffset: string,\n cpPositionRelativeToArrow: boolean, cpOutputFormat: string, cpCancelButton: boolean, cpCancelButtonClass: string, cpCancelButtonText: string, cpHeight: string) {\n this.directiveInstance = instance;\n this.initialColor = color;\n this.directiveElementRef = elementRef;\n this.cpPosition = cpPosition;\n this.cpPositionOffset = parseInt(cpPositionOffset);\n if (!cpPositionRelativeToArrow) {\n this.dialogArrowOffset = 0;\n }\n this.cpOutputFormat = cpOutputFormat;\n this.cpCancelButton = cpCancelButton;\n this.cpCancelButtonClass = cpCancelButtonClass;\n this.cpCancelButtonText = cpCancelButtonText;\n this.cpHeight = parseInt(cpHeight);\n }\n\n setInitialColor(color: any) {\n this.initialColor = color;\n }\n\n ngOnInit() {\n let hsva = this.service.stringToHsva(this.initialColor);\n if (hsva !== null) {\n this.hsva = hsva;\n } else {\n this.hsva = new Hsva(0, 1, 1, 1);\n }\n this.sliderDimMax = new SliderDimension(150, 230, 130, 150);\n this.slider = new SliderPosition(0, 0, 0, 0);\n if (this.cpOutputFormat === 'rgba') {\n this.format = 1;\n } else if (this.cpOutputFormat === 'hsla') {\n this.format = 2;\n } else {\n this.format = 0;\n }\n this.listenerMouseDown = (event: any) => { this.onMouseDown(event) };\n this.listenerResize = () => { this.onResize() };\n this.update();\n this.openColorPicker();\n }\n\n openColorPicker() {\n if (!this.show) {\n this.setDialogPosition();\n this.show = true;\n document.addEventListener('mousedown', this.listenerMouseDown);\n window.addEventListener('resize', this.listenerResize);\n }\n }\n\n onMouseDown(event: any) {\n if (!this.isDescendant(this.el.nativeElement, event.target)\n && event.target != this.directiveElementRef.nativeElement) {\n this.closeColorPicker();\n }\n }\n\n closeColorPicker() {\n this.show = false;\n document.removeEventListener('mouseup', this.listenerMouseDown);\n window.removeEventListener('resize', this.listenerResize);\n }\n\n onResize() {\n if (this.position === 'fixed') {\n this.setDialogPosition();\n }\n }\n\n setDialogPosition() {\n var node = this.directiveElementRef.nativeElement, position = 'static';\n let parentNode = null;\n while (node !== null && node.tagName !== 'HTML') {\n position = window.getComputedStyle(node).getPropertyValue(\"position\");\n if (position !== 'static' && parentNode === null) {\n parentNode = node;\n }\n if (position === 'fixed') {\n break;\n }\n node = node.parentNode;\n }\n if (position !== 'fixed') {\n var boxDirective = this.createBox(this.directiveElementRef.nativeElement, true);\n if (parentNode === null) { parentNode = node }\n let boxParent = this.createBox(parentNode, true);\n this.top = boxDirective.top - boxParent.top;\n this.left = boxDirective.left - boxParent.left;\n } else {\n var boxDirective = this.createBox(this.directiveElementRef.nativeElement, false);\n this.top = boxDirective.top;\n this.left = boxDirective.left;\n this.position = 'fixed';\n }\n if (this.cpPosition === 'left') {\n this.top += boxDirective.height * this.cpPositionOffset / 100 - this.dialogArrowOffset;\n this.left -= this.dialogWidth + this.dialogArrowSize;\n } else if (this.cpPosition === 'top') {\n this.top -= this.cpHeight + this.dialogArrowSize;\n this.left += this.cpPositionOffset / 100 * boxDirective.width - this.dialogArrowOffset;\n this.arrowTop = this.cpHeight - 1;\n } else if (this.cpPosition === 'bottom') {\n this.top += boxDirective.height + this.dialogArrowSize;\n this.left += this.cpPositionOffset / 100 * boxDirective.width - this.dialogArrowOffset;\n } else {\n this.top += boxDirective.height * this.cpPositionOffset / 100 - this.dialogArrowOffset;\n this.left += boxDirective.width + this.dialogArrowSize;\n }\n }\n\n setSaturation(val: { v: number, rg: number }) {\n let hsla = this.service.hsva2hsla(this.hsva);\n hsla.s = val.v / val.rg;\n this.hsva = this.service.hsla2hsva(hsla);\n this.update();\n }\n\n setLightness(val: { v: number, rg: number }) {\n let hsla = this.service.hsva2hsla(this.hsva);\n hsla.l = val.v / val.rg;\n this.hsva = this.service.hsla2hsva(hsla);\n this.update();\n }\n\n setHue(val: { v: number, rg: number }) {\n this.hsva.h = val.v / val.rg;\n this.update();\n }\n\n setAlpha(val: { v: number, rg: number }) {\n this.hsva.a = val.v / val.rg;\n this.update();\n }\n\n setR(val: { v: number, rg: number }) {\n let rgba = this.service.hsvaToRgba(this.hsva);\n rgba.r = val.v / val.rg;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n setG(val: { v: number, rg: number }) {\n let rgba = this.service.hsvaToRgba(this.hsva);\n rgba.g = val.v / val.rg;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n setB(val: { v: number, rg: number }) {\n let rgba = this.service.hsvaToRgba(this.hsva);\n rgba.b = val.v / val.rg;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n setSaturationAndBrightness(val: { s: number, v: number, rgX: number, rgY: number }) {\n this.hsva.s = val.s / val.rgX;\n this.hsva.v = val.v / val.rgY;\n this.update();\n }\n\n setColorFromString(value: string) {\n let hsva = this.service.stringToHsva(value);\n if (hsva !== null) {\n this.hsva = hsva;\n }\n this.update();\n }\n\n formatPolicy(): number {\n this.format = (this.format + 1) % 3;\n if (this.format === 0 && this.hsva.a < 1) {\n this.format++;\n }\n return this.format;\n }\n\n update() {\n let hsla = this.service.hsva2hsla(this.hsva);\n let rgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva));\n let hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(new Hsva(this.hsva.h, 1, 1, 1)));\n\n this.hslaText = new Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100);\n this.rgbaText = new Rgba(rgba.r, rgba.g, rgba.b, Math.round(rgba.a * 100) / 100);\n this.hexText = this.service.hexText(rgba);\n\n this.alphaSliderColor = 'rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')';\n this.hueSliderColor = 'rgb(' + hueRgba.r + ',' + hueRgba.g + ',' + hueRgba.b + ')';\n\n if (this.format === 0 && this.hsva.a < 1) {\n this.format++;\n }\n\n this.outputColor = this.service.outputFormat(this.hsva, this.cpOutputFormat);\n\n this.slider = new SliderPosition((this.hsva.h) * this.sliderDimMax.h - 8, this.hsva.s * this.sliderDimMax.s - 8,\n (1 - this.hsva.v) * this.sliderDimMax.v - 8, this.hsva.a * this.sliderDimMax.a - 8)\n\n this.directiveInstance.colorChanged(this.outputColor);\n }\n\n cancelColor() {\n this.setColorFromString(this.initialColor);\n this.closeColorPicker();\n }\n\n isDescendant(parent, child): boolean {\n var node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n }\n\n createBox(element, offset): any {\n return {\n top: element.getBoundingClientRect().top + (offset ? window.pageYOffset : 0),\n left: element.getBoundingClientRect().left + (offset ? window.pageXOffset : 0),\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n }\n}"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/lib/color-picker.service.d.ts b/lib/color-picker.service.d.ts new file mode 100644 index 0000000..fa3113c --- /dev/null +++ b/lib/color-picker.service.d.ts @@ -0,0 +1,12 @@ +import { Rgba, Hsla, Hsva } from './classes'; +export declare class ColorPickerService { + constructor(); + hsla2hsva(hsla: Hsla): Hsva; + hsva2hsla(hsva: Hsva): Hsla; + rgbaToHsva(rgba: Rgba): Hsva; + hsvaToRgba(hsva: Hsva): Rgba; + stringToHsva(colorString?: string): Hsva; + outputFormat(hsva: Hsva, outputFormat: string): string; + hexText(rgba: Rgba): string; + denormalizeRGBA(rgba: Rgba): Rgba; +} diff --git a/lib/color-picker.service.js b/lib/color-picker.service.js new file mode 100644 index 0000000..517f0e2 --- /dev/null +++ b/lib/color-picker.service.js @@ -0,0 +1,185 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var core_1 = require('@angular/core'); +var classes_1 = require('./classes'); +var ColorPickerService = (function () { + function ColorPickerService() { + } + ColorPickerService.prototype.hsla2hsva = function (hsla) { + var h = Math.min(hsla.h, 1), s = Math.min(hsla.s, 1), l = Math.min(hsla.l, 1), a = Math.min(hsla.a, 1); + if (l === 0) { + return new classes_1.Hsva(h, 0, 0, a); + } + else { + var v = l + s * (1 - Math.abs(2 * l - 1)) / 2; + return new classes_1.Hsva(h, 2 * (v - l) / v, v, a); + } + }; + ColorPickerService.prototype.hsva2hsla = function (hsva) { + var h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a; + if (v === 0) { + return new classes_1.Hsla(h, 0, 0, a); + } + else if (s === 0 && v === 1) { + return new classes_1.Hsla(h, 1, 1, a); + } + else { + var l = v * (2 - s) / 2; + return new classes_1.Hsla(h, v * s / (1 - Math.abs(2 * l - 1)), l, a); + } + }; + ColorPickerService.prototype.rgbaToHsva = function (rgba) { + var r = Math.min(rgba.r, 1), g = Math.min(rgba.g, 1), b = Math.min(rgba.b, 1), a = Math.min(rgba.a, 1); + var max = Math.max(r, g, b), min = Math.min(r, g, b); + var h, s, v = max; + var d = max - min; + s = max === 0 ? 0 : d / max; + if (max === min) { + h = 0; + } + else { + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; + } + h /= 6; + } + return new classes_1.Hsva(h, s, v, a); + }; + ColorPickerService.prototype.hsvaToRgba = function (hsva) { + var h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a; + var r, g, b; + var i = Math.floor(h * 6); + var f = h * 6 - i; + var p = v * (1 - s); + var q = v * (1 - f * s); + var t = v * (1 - (1 - f) * s); + switch (i % 6) { + case 0: + r = v, g = t, b = p; + break; + case 1: + r = q, g = v, b = p; + break; + case 2: + r = p, g = v, b = t; + break; + case 3: + r = p, g = q, b = v; + break; + case 4: + r = t, g = p, b = v; + break; + case 5: + r = v, g = p, b = q; + break; + } + return new classes_1.Rgba(r, g, b, a); + }; + ColorPickerService.prototype.stringToHsva = function (colorString) { + if (colorString === void 0) { colorString = ''; } + var stringParsers = [ + { + re: /(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function (execResult) { + return new classes_1.Rgba(parseInt(execResult[2]) / 255, parseInt(execResult[3]) / 255, parseInt(execResult[4]) / 255, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5])); + } + }, + { + re: /(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function (execResult) { + return new classes_1.Hsla(parseInt(execResult[2]) / 360, parseInt(execResult[3]) / 100, parseInt(execResult[4]) / 100, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5])); + } + }, + { + re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/, + parse: function (execResult) { + return new classes_1.Rgba(parseInt(execResult[1], 16) / 255, parseInt(execResult[2], 16) / 255, parseInt(execResult[3], 16) / 255, 1); + } + }, + { + re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/, + parse: function (execResult) { + return new classes_1.Rgba(parseInt(execResult[1] + execResult[1], 16) / 255, parseInt(execResult[2] + execResult[2], 16) / 255, parseInt(execResult[3] + execResult[3], 16) / 255, 1); + } + } + ]; + colorString = colorString.toLowerCase(); + var hsva = null; + for (var key in stringParsers) { + if (stringParsers.hasOwnProperty(key)) { + var parser = stringParsers[key]; + var match = parser.re.exec(colorString), color = match && parser.parse(match); + if (color) { + if (color instanceof classes_1.Rgba) { + hsva = this.rgbaToHsva(color); + } + else if (color instanceof classes_1.Hsla) { + hsva = this.hsla2hsva(color); + } + return hsva; + } + } + } + return hsva; + }; + ColorPickerService.prototype.outputFormat = function (hsva, outputFormat) { + if (hsva.a < 1) { + switch (outputFormat) { + case 'hsla': + var hsla = this.hsva2hsla(hsva); + var hslaText = new classes_1.Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100); + return 'hsla(' + hslaText.h + ',' + hslaText.s + '%,' + hslaText.l + '%,' + hslaText.a + ')'; + default: + var rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva)); + return 'rgba(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ',' + Math.round(rgba.a * 100) / 100 + ')'; + } + } + else { + switch (outputFormat) { + case 'hsla': + var hsla = this.hsva2hsla(hsva); + var hslaText = new classes_1.Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100); + return 'hsl(' + hslaText.h + ',' + hslaText.s + '%,' + hslaText.l + '%)'; + case 'rgba': + var rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva)); + return 'rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')'; + default: + return this.hexText(this.denormalizeRGBA(this.hsvaToRgba(hsva))); + } + } + }; + ColorPickerService.prototype.hexText = function (rgba) { + var hexText = '#' + ((1 << 24) | (rgba.r << 16) | (rgba.g << 8) | rgba.b).toString(16).substr(1); + if (hexText[1] === hexText[2] && hexText[3] === hexText[4] && hexText[5] === hexText[6]) { + hexText = '#' + hexText[1] + hexText[3] + hexText[5]; + } + return hexText; + }; + ColorPickerService.prototype.denormalizeRGBA = function (rgba) { + return new classes_1.Rgba(Math.round(rgba.r * 255), Math.round(rgba.g * 255), Math.round(rgba.b * 255), rgba.a); + }; + ColorPickerService = __decorate([ + core_1.Injectable(), + __metadata('design:paramtypes', []) + ], ColorPickerService); + return ColorPickerService; +}()); +exports.ColorPickerService = ColorPickerService; + +//# sourceMappingURL=color-picker.service.js.map diff --git a/lib/color-picker.service.js.map b/lib/color-picker.service.js.map new file mode 100644 index 0000000..11850fb --- /dev/null +++ b/lib/color-picker.service.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["color-picker.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAyB,eAAe,CAAC,CAAA;AACzC,wBAA+B,WAAW,CAAC,CAAA;AAG3C;IACI;IAAgB,CAAC;IAEjB,sCAAS,GAAT,UAAU,IAAU;QAChB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACV,MAAM,CAAC,IAAI,cAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,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AAC,CAAC,CAAC,CAAC;IAC1G,CAAC;IAtLL;QAAC,iBAAU,EAAE;;0BAAA;IAwLb,yBAAC;AAAD,CAvLA,AAuLC,IAAA;AAvLY,0BAAkB,qBAuL9B,CAAA","file":"color-picker.service.js","sourcesContent":["import {Injectable} from '@angular/core';\nimport {Rgba, Hsla, Hsva} from './classes';\n\n@Injectable()\nexport class ColorPickerService {\n constructor() { }\n\n hsla2hsva(hsla: Hsla): Hsva {\n var h = Math.min(hsla.h, 1), s = Math.min(hsla.s, 1), l = Math.min(hsla.l, 1), a = Math.min(hsla.a, 1);\n if (l === 0) {\n return new Hsva(h, 0, 0, a);\n } else {\n var v = l + s * (1 - Math.abs(2 * l - 1)) / 2;\n return new Hsva(h, 2 * (v - l) / v, v, a);\n }\n }\n\n hsva2hsla(hsva: Hsva): Hsla {\n var h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a;\n if (v === 0) {\n return new Hsla(h, 0, 0, a)\n } else if (s === 0 && v === 1) {\n return new Hsla(h, 1, 1, a)\n } else {\n var l = v * (2 - s) / 2;\n return new Hsla(h, v * s / (1 - Math.abs(2 * l - 1)), l, a)\n }\n }\n\n rgbaToHsva(rgba: Rgba): Hsva {\n var r = Math.min(rgba.r, 1), g = Math.min(rgba.g, 1), b = Math.min(rgba.b, 1), a = Math.min(rgba.a, 1);\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return new Hsva(h, s, v, a)\n }\n\n hsvaToRgba(hsva: Hsva): Rgba {\n var h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a;\n var r, g, b;\n\n var i = Math.floor(h * 6);\n var f = h * 6 - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v, g = t, b = p;\n break;\n case 1:\n r = q, g = v, b = p;\n break;\n case 2:\n r = p, g = v, b = t;\n break;\n case 3:\n r = p, g = q, b = v;\n break;\n case 4:\n r = t, g = p, b = v;\n break;\n case 5:\n r = v, g = p, b = q;\n break;\n }\n\n return new Rgba(r, g, b, a)\n }\n\n stringToHsva(colorString: string = ''): Hsva {\n var stringParsers = [\n {\n re: /(rgb)a?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*%?,\\s*(\\d{1,3})\\s*%?(?:,\\s*(\\d+(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function(execResult) {\n return new Rgba(parseInt(execResult[2]) / 255,\n parseInt(execResult[3]) / 255,\n parseInt(execResult[4]) / 255,\n isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));\n }\n },\n {\n re: /(hsl)a?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})%\\s*,\\s*(\\d{1,3})%\\s*(?:,\\s*(\\d+(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function(execResult) {\n return new Hsla(parseInt(execResult[2]) / 360,\n parseInt(execResult[3]) / 100,\n parseInt(execResult[4]) / 100,\n isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));\n }\n },\n {\n re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: function(execResult) {\n return new Rgba(parseInt(execResult[1], 16) / 255,\n parseInt(execResult[2], 16) / 255,\n parseInt(execResult[3], 16) / 255,\n 1);\n }\n },\n {\n re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,\n parse: function(execResult) {\n return new Rgba(parseInt(execResult[1] + execResult[1], 16) / 255,\n parseInt(execResult[2] + execResult[2], 16) / 255,\n parseInt(execResult[3] + execResult[3], 16) / 255,\n 1);\n }\n }\n ];\n colorString = colorString.toLowerCase();\n var hsva = null;\n for (var key in stringParsers) {\n if (stringParsers.hasOwnProperty(key)) {\n var parser = stringParsers[key];\n var match = parser.re.exec(colorString), color = match && parser.parse(match);\n if (color) {\n if (color instanceof Rgba) {\n hsva = this.rgbaToHsva(color);\n } else if (color instanceof Hsla) {\n hsva = this.hsla2hsva(color);\n }\n return hsva;\n }\n }\n }\n return hsva;\n }\n\n outputFormat(hsva: Hsva, outputFormat: string): string {\n if (hsva.a < 1) {\n switch (outputFormat) {\n case 'hsla':\n let hsla = this.hsva2hsla(hsva);\n let hslaText = new Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100);\n return 'hsla(' + hslaText.h + ',' + hslaText.s + '%,' + hslaText.l + '%,' + hslaText.a + ')';\n default:\n let rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return 'rgba(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ',' + Math.round(rgba.a * 100) / 100 + ')';\n }\n } else {\n switch (outputFormat) {\n case 'hsla':\n let hsla = this.hsva2hsla(hsva);\n let hslaText = new Hsla(Math.round((hsla.h) * 360), Math.round(hsla.s * 100), Math.round(hsla.l * 100), Math.round(hsla.a * 100) / 100);\n return 'hsl(' + hslaText.h + ',' + hslaText.s + '%,' + hslaText.l + '%)';\n case 'rgba':\n let rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return 'rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')';\n default:\n return this.hexText(this.denormalizeRGBA(this.hsvaToRgba(hsva)));\n }\n }\n }\n\n hexText(rgba: Rgba): string {\n let hexText = '#' + ((1 << 24) | (rgba.r << 16) | (rgba.g << 8) | rgba.b).toString(16).substr(1);\n if (hexText[1] === hexText[2] && hexText[3] === hexText[4] && hexText[5] === hexText[6]) {\n hexText = '#' + hexText[1] + hexText[3] + hexText[5];\n }\n return hexText;\n }\n\n denormalizeRGBA(rgba: Rgba): Rgba {\n return new Rgba(Math.round(rgba.r * 255), Math.round(rgba.g * 255), Math.round(rgba.b * 255), rgba.a);\n }\n\n}"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..99013d0 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,3 @@ +export * from './classes'; +export * from './color-picker.service'; +export * from './color-picker.directive'; diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..314c997 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,9 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require('./classes')); +__export(require('./color-picker.service')); +__export(require('./color-picker.directive')); + +//# sourceMappingURL=index.js.map diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 0000000..1abf4a4 --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;AAAA,iBAAc,WAAW,CAAC,EAAA;AAC1B,iBAAc,wBAAwB,CAAC,EAAA;AACvC,iBAAc,0BAA0B,CAAC,EAAA","file":"index.js","sourcesContent":["export * from './classes';\nexport * from './color-picker.service';\nexport * from './color-picker.directive';"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package.json b/package.json index bb7e3cc..cdfd443 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,16 @@ { "name": "angular2-color-picker", - "version": "1.1.0", - "scripts": { - "postinstall": "gulp" + "description": "Angular 2 Color Picker Directive, no dependences required.", + "version": "1.1.1", + "main": "index.js", + "scripts": { + "build": "gulp" }, "license": "MIT", "dependencies": { - "@angular/common": "2.0.0-rc.5", - "@angular/compiler": "2.0.0-rc.5", "@angular/core": "2.0.0-rc.5", - "@angular/forms": "0.3.0", - "@angular/http": "2.0.0-rc.5", - "@angular/platform-browser": "2.0.0-rc.5", - "@angular/platform-browser-dynamic": "2.0.0-rc.5", - "@angular/router": "3.0.0-rc.1", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.5", - "systemjs": "0.19.27", - "core-js": "^2.4.0", - "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", - "zone.js": "^0.6.12", - "angular2-in-memory-web-api": "0.0.15", - "bootstrap": "^3.3.6" + "zone.js": "^0.6.12" }, "devDependencies": { "concurrently": "^2.0.0", @@ -37,10 +25,5 @@ "run-sequence": "^1.2.2", "typescript": "^1.8.10", "typings": "^1.0.4" - }, - "files": [ - "lib/*", - "index.*" - ] - + } } diff --git a/readme.md b/readme.md index 2784f22..e8c0510 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,7 @@ http://alberplz.github.io/angular2-color-picker/index.html # Installation * Via Git:
git clone https://github.com/Alberplz/angular2-color-picker.git * Via Bower:
bower install angular2-color-picker +* Via Npm:
npm i angular2-color-picker # Usage * Use it in your HTML elements, for example: @@ -16,13 +17,13 @@ http://alberplz.github.io/angular2-color-picker/index.html ``` * Add ColorPickerService in your main.ts: ```javascript -import {ColorPickerService} from './color-picker/color-picker.service' +import {ColorPickerService} from 'angular2-color-picker'; bootstrap(AppComponent, [ColorPickerService]); ``` * Include ColorPickerDirective in your component, and set color the variable: ```javascript import {Component} from '@angular/core'; -import {ColorPickerDirective} from './color-picker/color-picker.directive' +import {ColorPickerDirective} from 'angular2-color-picker'; @Component({ selector: 'my-app', @@ -34,6 +35,21 @@ export class AppComponent { private color: string = "#127bdc"; } ``` +* System.config.js +```javascript +var map = { + ... + 'angular2-color-picker': 'node_modules/angular2-color-picker' //npm installations + }; +var packages = { + ... + 'angular2-color-picker': {main:'index.js', defaultExtension: 'js'} + }; +``` +#Build +git clone https://github.com/Alberplz/angular2-color-picker.git
+npm install
+npm run build #Options Default option is the first item.