@skyux/colorpicker 5.6.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@
33
33
  /**
34
34
  * NOTICE: DO NOT MODIFY THIS FILE!
35
35
  * The contents of this file were automatically generated by
36
- * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-colorpicker' schematic.
36
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-colorpicker' schematic.
37
37
  * To update this file, simply rerun the command.
38
38
  */
39
39
  var RESOURCES = {
@@ -66,11 +66,6 @@
66
66
  };
67
67
  return SkyColorpickerResourcesProvider;
68
68
  }());
69
- SkyColorpickerResourcesProvider.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyColorpickerResourcesProvider, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
70
- SkyColorpickerResourcesProvider.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyColorpickerResourcesProvider });
71
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyColorpickerResourcesProvider, decorators: [{
72
- type: i0.Injectable
73
- }] });
74
69
  /**
75
70
  * Import into any component library module that needs to use resource strings.
76
71
  */
@@ -321,7 +316,7 @@
321
316
  var hsva = undefined;
322
317
  for (var key in stringParsers) {
323
318
  /* istanbul ignore else */ /* for in must be filtered by an if */
324
- if (stringParsers.hasOwnProperty(key)) {
319
+ if (Object.prototype.hasOwnProperty.call(stringParsers, key)) {
325
320
  var parser = stringParsers[key];
326
321
  var match = parser.re.exec(colorString);
327
322
  var color = match && parser.parse(match);
@@ -363,7 +358,6 @@
363
358
  return color[outputFormat]();
364
359
  };
365
360
  SkyColorpickerService.prototype.skyColorpickerOut = function (color) {
366
- var formatColor;
367
361
  var cmykText = this.outputFormat(color, 'cmyk', true);
368
362
  var hslaText = this.outputFormat(color, 'hsla', true);
369
363
  var rgbaText = this.outputFormat(color, 'rgba', true);
@@ -371,7 +365,7 @@
371
365
  var hsla = this.hsva2hsla(color);
372
366
  var cmyk = this.rgbaToCmyk(rgba);
373
367
  var hex = this.outputFormat(color, 'hex', false);
374
- formatColor = {
368
+ var formatColor = {
375
369
  cmykText: cmykText,
376
370
  hslaText: hslaText,
377
371
  rgbaText: rgbaText,
@@ -446,7 +440,7 @@
446
440
  SkyColorpickerService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyColorpickerService });
447
441
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyColorpickerService, decorators: [{
448
442
  type: i0.Injectable
449
- }], ctorParameters: function () { return []; } });
443
+ }] });
450
444
 
451
445
  // tslint:disable:no-forward-ref no-use-before-declare
452
446
  var SKY_COLORPICKER_VALUE_ACCESSOR = {
@@ -501,10 +495,11 @@
501
495
  * levels.
502
496
  */
503
497
  this.allowTransparency = true;
504
- /*istanbul ignore next */
498
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
505
499
  this._onChange = function (_) { };
506
- /*istanbul ignore next */
500
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
507
501
  this._onTouched = function () { };
502
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
508
503
  this._validatorChange = function () { };
509
504
  }
510
505
  Object.defineProperty(SkyColorpickerInputDirective.prototype, "initialColor", {
@@ -666,9 +661,8 @@
666
661
  if (color && typeof color !== 'string') {
667
662
  return color;
668
663
  }
669
- var formatColor;
670
664
  var hsva = this.service.stringToHsva(color, this.alphaChannel === 'hex8');
671
- formatColor = this.service.skyColorpickerOut(hsva);
665
+ var formatColor = this.service.skyColorpickerOut(hsva);
672
666
  return formatColor;
673
667
  };
674
668
  SkyColorpickerInputDirective.prototype.getString = function (key) {
@@ -143,29 +143,7 @@
143
143
  }
144
144
  }
145
145
  ],
146
- "children": [
147
- {
148
- "id": 235,
149
- "name": "constructor",
150
- "kind": 512,
151
- "kindString": "Constructor",
152
- "flags": {},
153
- "signatures": [
154
- {
155
- "id": 236,
156
- "name": "new SkyColorpickerModule",
157
- "kind": 16384,
158
- "kindString": "Constructor signature",
159
- "flags": {},
160
- "type": {
161
- "type": "reference",
162
- "id": 234,
163
- "name": "SkyColorpickerModule"
164
- }
165
- }
166
- ]
167
- }
168
- ],
146
+ "children": [],
169
147
  "groups": [
170
148
  {
171
149
  "title": "Constructors",
@@ -59,10 +59,11 @@ export class SkyColorpickerInputDirective {
59
59
  * levels.
60
60
  */
61
61
  this.allowTransparency = true;
62
- /*istanbul ignore next */
62
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
63
63
  this._onChange = (_) => { };
64
- /*istanbul ignore next */
64
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
65
65
  this._onTouched = () => { };
66
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
66
67
  this._validatorChange = () => { };
67
68
  }
68
69
  /**
@@ -219,9 +220,8 @@ export class SkyColorpickerInputDirective {
219
220
  if (color && typeof color !== 'string') {
220
221
  return color;
221
222
  }
222
- let formatColor;
223
223
  const hsva = this.service.stringToHsva(color, this.alphaChannel === 'hex8');
224
- formatColor = this.service.skyColorpickerOut(hsva);
224
+ const formatColor = this.service.skyColorpickerOut(hsva);
225
225
  return formatColor;
226
226
  }
227
227
  getString(key) {
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker-input.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-input.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EAIL,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,aAAa,EACb,iBAAiB,E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K;gBAQC,YAAY;sBADlB,KAAK;gBAQC,YAAY;sBADlB,KAAK;gBAQC,iBAAiB;sBADvB,KAAK;gBAgBC,WAAW;sBADjB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;gBAQ1B,QAAQ;sBADd,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBAW3B,MAAM;sBADZ,YAAY;uBAAC,MAAM","sourcesContent":["import {\n Directive,\n ElementRef,\n HostListener,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n NgControl,\n Validator,\n} from '@angular/forms';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subscription } from 'rxjs';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_COLORPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n\nconst SKY_COLORPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n// tslint:enable\nconst SKY_COLORPICKER_DEFAULT_COLOR = '#FFFFFF';\n\n/**\n * Creates the colorpicker element and dropdown.\n */\n@Directive({\n selector: '[skyColorpickerInput]',\n providers: [SKY_COLORPICKER_VALUE_ACCESSOR, SKY_COLORPICKER_VALIDATOR],\n})\nexport class SkyColorpickerInputDirective\n implements OnInit, OnChanges, ControlValueAccessor, Validator, OnDestroy\n{\n public pickerChangedSubscription: Subscription;\n\n /**\n * Creates the colorpicker element and dropdown. Place this attribute on an `input` element\n * or `button` element, wrap the element in a `sky-colorpicker` component, and set the attribute\n * to the instance of the `sky-colorpicker` component.\n * @required\n */\n @Input()\n public skyColorpickerInput: SkyColorpickerComponent;\n\n /**\n * Specifies an initial color to load in the colorpicker. Use a reactive or\n * template-driven form to set this value. This property is deprecated. As an alternative,\n * we recommend the `formControlName` property on reactive forms or `ngModel` on\n * template-driven forms. See the demo for examples.\n * @deprecated\n */\n @Input()\n public set initialColor(value: string) {\n /* istanbul ignore else */\n if (!this._initialColor && !this.modelValue) {\n this.writeValue(value);\n }\n this._initialColor = value;\n }\n\n public get initialColor(): string {\n return this._initialColor || SKY_COLORPICKER_DEFAULT_COLOR;\n }\n\n /**\n * This property is deprecated and does not affect the colorpicker.\n * We recommend against using it.\n * @deprecated\n * @default \"rgba\"\n */\n @Input()\n public returnFormat = 'rgba';\n\n /**\n * Specifies the format to use for the color when the colorpicker uses a native input\n * element such as a standard text input or a button. This property accepts `rgba`, `hex`,\n * or `hsla`, but we do not recommend using it because users never see or use its value.\n * Instead, if you need to access this format value, see the demo for an example.\n *@default \"rgba\"\n */\n @Input()\n public outputFormat = 'rgba';\n\n /**\n * Specifies an array of colors to load as preset choices. The colorpicker displays the\n * colors in a series of 12 boxes for users to select.\n */\n @Input()\n public presetColors = ['#333', '#888', '#EFEFEF', '#FFF'];\n\n /**\n * Specifies the type of transparency to use in the transparency slider.\n *@default \"hex6\"\n */\n @Input()\n public alphaChannel = 'hex6';\n\n /**\n * Indicates whether to display a transparency slider for users to select transparency\n * levels.\n */\n @Input()\n public allowTransparency = true;\n\n private _disabled: boolean;\n private _initialColor: string;\n private modelValue: SkyColorpickerOutput;\n\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private service: SkyColorpickerService,\n private resourcesService: SkyLibResourcesService,\n private injector: Injector\n ) {}\n\n @HostListener('input', ['$event'])\n public changeInput(event: any) {\n const value = event.target.value;\n this.skyColorpickerInput.updatePickerValues(value);\n this.skyColorpickerInput.backgroundColorForDisplay = value;\n }\n\n @HostListener('change', ['$event'])\n public onChange(event: any) {\n const newValue = event.target.value;\n this.modelValue = this.formatter(newValue);\n this._validatorChange();\n this._onChange(this.modelValue);\n this.writeModelValue(this.modelValue);\n }\n\n /* istanbul ignore next */\n @HostListener('blur')\n public onBlur() {\n /*istanbul ignore next */\n this._onTouched();\n }\n\n public ngOnInit() {\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n this.skyColorpickerInput.initialColor = this.initialColor;\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n\n this.pickerChangedSubscription =\n this.skyColorpickerInput.selectedColorChanged.subscribe(\n (newColor: SkyColorpickerOutput) => {\n /* istanbul ignore else */\n if (newColor) {\n this.modelValue = this.formatter(newColor);\n this.writeModelValue(this.modelValue);\n }\n this._onChange(newColor);\n }\n );\n\n this.skyColorpickerInput.updatePickerValues(this.initialColor);\n\n /* Sanity check */\n /* istanbul ignore else */\n if (!this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = this.initialColor;\n }\n\n /// Set aria-label as default, if not set\n if (!element.getAttribute('aria-label')) {\n this.renderer.setAttribute(\n element,\n 'aria-label',\n this.getString('skyux_colorpicker_input_default_label')\n );\n }\n\n const typeAttr = element.getAttribute('type');\n if (typeAttr && typeAttr === 'hidden') {\n this.skyColorpickerInput.isVisible = false;\n } else {\n this.skyColorpickerInput.isVisible = true;\n }\n\n element.setAttribute('readonly', 'true');\n this.renderer.addClass(element, 'sky-colorpicker-input');\n }\n\n public ngOnDestroy() {\n this.pickerChangedSubscription.unsubscribe();\n }\n\n public setColorPickerDefaults() {\n this.skyColorpickerInput.setDialog(\n this,\n this.elementRef,\n this.initialColor,\n this.outputFormat,\n this.presetColors,\n this.alphaChannel,\n this.allowTransparency\n );\n }\n\n public ngOnChanges(): void {\n this._validatorChange();\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n this.setColorPickerDefaults();\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n public registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n public registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n public writeValue(value: any) {\n if (\n this.skyColorpickerInput &&\n value &&\n value !== this.skyColorpickerInput.lastAppliedColor\n ) {\n this.modelValue = this.formatter(value);\n this.writeModelValue(this.modelValue);\n\n if (!this._initialColor) {\n this._initialColor = value;\n this.skyColorpickerInput.initialColor = value;\n }\n this.skyColorpickerInput.lastAppliedColor = value;\n const control: FormControl = this.injector.get<NgControl>(NgControl)\n .control as FormControl;\n if (control) {\n control.setValue(this.modelValue, { emitEvent: false });\n }\n }\n }\n\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n if (!value) {\n return;\n }\n // Validation\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean): void {\n this._disabled = isDisabled;\n this.skyColorpickerInput.disabled = isDisabled;\n if (this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = '#fff';\n } else {\n this.skyColorpickerInput.backgroundColorForDisplay = this.modelValue.hex;\n }\n }\n\n private writeModelValue(model: SkyColorpickerOutput) {\n const setElementValue = model.rgbaText;\n const element = this.elementRef.nativeElement;\n\n let output: string;\n // tslint:disable-next-line:switch-default\n switch (this.outputFormat) {\n case 'rgba':\n output = model.rgbaText;\n break;\n\n case 'hsla':\n output = model.hslaText;\n break;\n\n case 'cmyk':\n output = model.cmykText;\n break;\n\n case 'hex':\n output = model.hex;\n break;\n }\n\n this.skyColorpickerInput.updatePickerValues(output);\n this.skyColorpickerInput.backgroundColorForDisplay = output;\n\n this.renderer.setStyle(element, 'background-color', setElementValue);\n this.renderer.setProperty(element, 'value', output);\n }\n\n private formatter(color: any) {\n if (color && typeof color !== 'string') {\n return color;\n }\n\n let formatColor: SkyColorpickerOutput;\n const hsva: SkyColorpickerHsva = this.service.stringToHsva(\n color,\n this.alphaChannel === 'hex8'\n );\n\n formatColor = this.service.skyColorpickerOut(hsva);\n\n return formatColor;\n }\n\n private getString(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);\n }\n\n /*istanbul ignore next */\n private _onChange = (_: any) => {};\n /*istanbul ignore next */\n private _onTouched = () => {};\n private _validatorChange = () => {};\n}\n"]}
1
+ {"version":3,"file":"colorpicker-input.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-input.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EAIL,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,aAAa,EACb,iBAAiB,EACjB,SAAS,GAEV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;;;;AAI9D,sDAAsD;AACtD,MAAM,8BAA8B,GAAG;IACrC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;IAC3D,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,yBAAyB,GAAG;IAChC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;IAC3D,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAChB,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEhD;;GAEG;AAKH,MAAM,OAAO,4BAA4B;IA8EvC,YACU,UAAsB,EACtB,QAAmB,EACnB,OAA8B,EAC9B,gBAAwC,EACxC,QAAkB;QAJlB,eAAU,GAAV,UAAU,CAAY;QACtB,aAAQ,GAAR,QAAQ,CAAW;QACnB,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O,SAAS,CAAC,GAAW;QAC3B,6EAA6E;QAC7E,OAAO,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5E,CAAC;;0HAxRU,4BAA4B;8GAA5B,4BAA4B,iZAF5B,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;4FAE3D,4BAA4B;kBAJxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,SAAS,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;iBACvE;yNAaQ,mBAAmB;sBADzB,KAAK;gBAWK,YAAY;sBADtB,KAAK;gBAoBC,YAAY;sBADlB,KAAK;gBAWC,YAAY;sBADlB,KAAK;gBAQC,YAAY;sBADlB,KAAK;gBAQC,YAAY;sBADlB,KAAK;gBAQC,iBAAiB;sBADvB,KAAK;gBAgBC,WAAW;sBADjB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;gBAQ1B,QAAQ;sBADd,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBAW3B,MAAM;sBADZ,YAAY;uBAAC,MAAM","sourcesContent":["import {\n Directive,\n ElementRef,\n HostListener,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n NgControl,\n Validator,\n} from '@angular/forms';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subscription } from 'rxjs';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_COLORPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n\nconst SKY_COLORPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n// tslint:enable\nconst SKY_COLORPICKER_DEFAULT_COLOR = '#FFFFFF';\n\n/**\n * Creates the colorpicker element and dropdown.\n */\n@Directive({\n selector: '[skyColorpickerInput]',\n providers: [SKY_COLORPICKER_VALUE_ACCESSOR, SKY_COLORPICKER_VALIDATOR],\n})\nexport class SkyColorpickerInputDirective\n implements OnInit, OnChanges, ControlValueAccessor, Validator, OnDestroy\n{\n public pickerChangedSubscription: Subscription;\n\n /**\n * Creates the colorpicker element and dropdown. Place this attribute on an `input` element\n * or `button` element, wrap the element in a `sky-colorpicker` component, and set the attribute\n * to the instance of the `sky-colorpicker` component.\n * @required\n */\n @Input()\n public skyColorpickerInput: SkyColorpickerComponent;\n\n /**\n * Specifies an initial color to load in the colorpicker. Use a reactive or\n * template-driven form to set this value. This property is deprecated. As an alternative,\n * we recommend the `formControlName` property on reactive forms or `ngModel` on\n * template-driven forms. See the demo for examples.\n * @deprecated\n */\n @Input()\n public set initialColor(value: string) {\n /* istanbul ignore else */\n if (!this._initialColor && !this.modelValue) {\n this.writeValue(value);\n }\n this._initialColor = value;\n }\n\n public get initialColor(): string {\n return this._initialColor || SKY_COLORPICKER_DEFAULT_COLOR;\n }\n\n /**\n * This property is deprecated and does not affect the colorpicker.\n * We recommend against using it.\n * @deprecated\n * @default \"rgba\"\n */\n @Input()\n public returnFormat = 'rgba';\n\n /**\n * Specifies the format to use for the color when the colorpicker uses a native input\n * element such as a standard text input or a button. This property accepts `rgba`, `hex`,\n * or `hsla`, but we do not recommend using it because users never see or use its value.\n * Instead, if you need to access this format value, see the demo for an example.\n *@default \"rgba\"\n */\n @Input()\n public outputFormat = 'rgba';\n\n /**\n * Specifies an array of colors to load as preset choices. The colorpicker displays the\n * colors in a series of 12 boxes for users to select.\n */\n @Input()\n public presetColors = ['#333', '#888', '#EFEFEF', '#FFF'];\n\n /**\n * Specifies the type of transparency to use in the transparency slider.\n *@default \"hex6\"\n */\n @Input()\n public alphaChannel = 'hex6';\n\n /**\n * Indicates whether to display a transparency slider for users to select transparency\n * levels.\n */\n @Input()\n public allowTransparency = true;\n\n private _disabled: boolean;\n private _initialColor: string;\n private modelValue: SkyColorpickerOutput;\n\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private service: SkyColorpickerService,\n private resourcesService: SkyLibResourcesService,\n private injector: Injector\n ) {}\n\n @HostListener('input', ['$event'])\n public changeInput(event: any) {\n const value = event.target.value;\n this.skyColorpickerInput.updatePickerValues(value);\n this.skyColorpickerInput.backgroundColorForDisplay = value;\n }\n\n @HostListener('change', ['$event'])\n public onChange(event: any) {\n const newValue = event.target.value;\n this.modelValue = this.formatter(newValue);\n this._validatorChange();\n this._onChange(this.modelValue);\n this.writeModelValue(this.modelValue);\n }\n\n /* istanbul ignore next */\n @HostListener('blur')\n public onBlur() {\n /*istanbul ignore next */\n this._onTouched();\n }\n\n public ngOnInit() {\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n this.skyColorpickerInput.initialColor = this.initialColor;\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n\n this.pickerChangedSubscription =\n this.skyColorpickerInput.selectedColorChanged.subscribe(\n (newColor: SkyColorpickerOutput) => {\n /* istanbul ignore else */\n if (newColor) {\n this.modelValue = this.formatter(newColor);\n this.writeModelValue(this.modelValue);\n }\n this._onChange(newColor);\n }\n );\n\n this.skyColorpickerInput.updatePickerValues(this.initialColor);\n\n /* Sanity check */\n /* istanbul ignore else */\n if (!this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = this.initialColor;\n }\n\n /// Set aria-label as default, if not set\n if (!element.getAttribute('aria-label')) {\n this.renderer.setAttribute(\n element,\n 'aria-label',\n this.getString('skyux_colorpicker_input_default_label')\n );\n }\n\n const typeAttr = element.getAttribute('type');\n if (typeAttr && typeAttr === 'hidden') {\n this.skyColorpickerInput.isVisible = false;\n } else {\n this.skyColorpickerInput.isVisible = true;\n }\n\n element.setAttribute('readonly', 'true');\n this.renderer.addClass(element, 'sky-colorpicker-input');\n }\n\n public ngOnDestroy() {\n this.pickerChangedSubscription.unsubscribe();\n }\n\n public setColorPickerDefaults() {\n this.skyColorpickerInput.setDialog(\n this,\n this.elementRef,\n this.initialColor,\n this.outputFormat,\n this.presetColors,\n this.alphaChannel,\n this.allowTransparency\n );\n }\n\n public ngOnChanges(): void {\n this._validatorChange();\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n this.setColorPickerDefaults();\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n public registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n public registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n public writeValue(value: any) {\n if (\n this.skyColorpickerInput &&\n value &&\n value !== this.skyColorpickerInput.lastAppliedColor\n ) {\n this.modelValue = this.formatter(value);\n this.writeModelValue(this.modelValue);\n\n if (!this._initialColor) {\n this._initialColor = value;\n this.skyColorpickerInput.initialColor = value;\n }\n this.skyColorpickerInput.lastAppliedColor = value;\n const control: FormControl = this.injector.get<NgControl>(NgControl)\n .control as FormControl;\n if (control) {\n control.setValue(this.modelValue, { emitEvent: false });\n }\n }\n }\n\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n if (!value) {\n return;\n }\n // Validation\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean): void {\n this._disabled = isDisabled;\n this.skyColorpickerInput.disabled = isDisabled;\n if (this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = '#fff';\n } else {\n this.skyColorpickerInput.backgroundColorForDisplay = this.modelValue.hex;\n }\n }\n\n private writeModelValue(model: SkyColorpickerOutput) {\n const setElementValue = model.rgbaText;\n const element = this.elementRef.nativeElement;\n\n let output: string;\n // tslint:disable-next-line:switch-default\n switch (this.outputFormat) {\n case 'rgba':\n output = model.rgbaText;\n break;\n\n case 'hsla':\n output = model.hslaText;\n break;\n\n case 'cmyk':\n output = model.cmykText;\n break;\n\n case 'hex':\n output = model.hex;\n break;\n }\n\n this.skyColorpickerInput.updatePickerValues(output);\n this.skyColorpickerInput.backgroundColorForDisplay = output;\n\n this.renderer.setStyle(element, 'background-color', setElementValue);\n this.renderer.setProperty(element, 'value', output);\n }\n\n private formatter(color: any) {\n if (color && typeof color !== 'string') {\n return color;\n }\n\n const hsva: SkyColorpickerHsva = this.service.stringToHsva(\n color,\n this.alphaChannel === 'hex8'\n );\n\n const formatColor = this.service.skyColorpickerOut(hsva);\n\n return formatColor;\n }\n\n private getString(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onChange = (_: any) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onTouched = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _validatorChange = () => {};\n}\n"]}
@@ -5,7 +5,6 @@ import * as i0 from "@angular/core";
5
5
  * @internal
6
6
  */
7
7
  export class SkyColorpickerService {
8
- constructor() { }
9
8
  hsla2hsva(hsla) {
10
9
  const alpha = Math.min(hsla.alpha, 1);
11
10
  const hue = Math.min(hsla.hue, 1);
@@ -217,7 +216,7 @@ export class SkyColorpickerService {
217
216
  let hsva = undefined;
218
217
  for (const key in stringParsers) {
219
218
  /* istanbul ignore else */ /* for in must be filtered by an if */
220
- if (stringParsers.hasOwnProperty(key)) {
219
+ if (Object.prototype.hasOwnProperty.call(stringParsers, key)) {
221
220
  const parser = stringParsers[key];
222
221
  const match = parser.re.exec(colorString);
223
222
  const color = match && parser.parse(match);
@@ -258,7 +257,6 @@ export class SkyColorpickerService {
258
257
  return color[outputFormat]();
259
258
  }
260
259
  skyColorpickerOut(color) {
261
- let formatColor;
262
260
  const cmykText = this.outputFormat(color, 'cmyk', true);
263
261
  const hslaText = this.outputFormat(color, 'hsla', true);
264
262
  const rgbaText = this.outputFormat(color, 'rgba', true);
@@ -266,7 +264,7 @@ export class SkyColorpickerService {
266
264
  const hsla = this.hsva2hsla(color);
267
265
  const cmyk = this.rgbaToCmyk(rgba);
268
266
  const hex = this.outputFormat(color, 'hex', false);
269
- formatColor = {
267
+ const formatColor = {
270
268
  cmykText: cmykText,
271
269
  hslaText: hslaText,
272
270
  rgbaText: rgbaText,
@@ -340,5 +338,5 @@ SkyColorpickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
340
338
  SkyColorpickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerService });
341
339
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerService, decorators: [{
342
340
  type: Injectable
343
- }], ctorParameters: function () { return []; } });
341
+ }] });
344
342
  //# sourceMappingURL=colorpicker.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.service.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAQ3C;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IAChC,gBAAe,CAAC;IAET,SAAS,CAAC,IAAwB;QACvC,MAAM,KAAK,GAAW,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAW,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAW,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CA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AAC;IAEM,eAAe,CAAC,IAAwB;QAC7C,MAAM,eAAe,GAAuB;YAC1C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;YACjC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YACvC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YACrC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;SAChC,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;;mHA1WU,qBAAqB;uHAArB,qBAAqB;4FAArB,qBAAqB;kBADjC,UAAU","sourcesContent":["// spell-checker:ignore hsva, hsla, cmyk, denormalize, colorpicker,Injectable\nimport { Injectable } from '@angular/core';\n\nimport { SkyColorpickerCmyk } from './types/colorpicker-cmyk';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyColorpickerService {\n constructor() {}\n\n public hsla2hsva(hsla: SkyColorpickerHsla): SkyColorpickerHsva {\n const alpha: number = Math.min(hsla.alpha, 1);\n const hue: number = Math.min(hsla.hue, 1);\n const lightness: number = Math.min(hsla.lightness, 1);\n const saturation: number = Math.min(hsla.saturation, 1);\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: lightness,\n alpha: alpha,\n };\n if (lightness === 0) {\n hsva.saturation = 0;\n hsva.value = 0;\n } else {\n hsva.value =\n lightness + (saturation * (1 - Math.abs(2 * lightness - 1))) / 2;\n hsva.saturation = (2 * (hsva.value - lightness)) / hsva.value;\n }\n return hsva;\n }\n\n public hsva2hsla(hsva: SkyColorpickerHsva): SkyColorpickerHsla {\n const alpha: number = hsva.alpha;\n const hue: number = hsva.hue;\n const saturation: number = hsva.saturation;\n const value: number = hsva.value;\n\n const hsla: SkyColorpickerHsla = {\n hue: hue,\n saturation: saturation,\n lightness: value,\n alpha: alpha,\n };\n if (value === 0) {\n hsla.lightness = 0;\n hsla.saturation = 0;\n } else {\n hsla.lightness = (value * (2 - saturation)) / 2;\n hsla.saturation =\n (value * saturation) / (1 - Math.abs(2 * hsla.lightness - 1));\n }\n return hsla;\n }\n\n public rgbaToHsva(rgba: SkyColorpickerRgba): SkyColorpickerHsva {\n const red: number = Math.min(rgba.red, 1);\n const green: number = Math.min(rgba.green, 1);\n const blue: number = Math.min(rgba.blue, 1);\n const alpha: number = Math.min(rgba.alpha, 1);\n const max: number = Math.max(red, green, blue);\n const min: number = Math.min(red, green, blue);\n const value: number = max;\n const d = max - min;\n const saturation: number = max === 0 ? 0 : d / max;\n let hue = 0;\n let maxValue: { [key: number]: number };\n if (max !== min) {\n maxValue = {\n [red]: (green - blue) / d + (green < blue ? 6 : 0),\n [green]: (blue - red) / d + 2,\n [blue]: (red - green) / d + 4,\n };\n hue = maxValue[max];\n hue /= 6;\n }\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: value,\n alpha: alpha,\n };\n return hsva;\n }\n\n public rgbaToCmyk(rgba: SkyColorpickerRgba): SkyColorpickerCmyk {\n const cmyk: SkyColorpickerCmyk = { cyan: 0, magenta: 0, yellow: 0, key: 0 };\n const key: number = 1 - Math.max(rgba.red, rgba.green, rgba.blue);\n\n if (key === 1) {\n cmyk.key = 1;\n return cmyk;\n }\n cmyk.cyan = (1 - rgba.red - key) / (1 - key);\n cmyk.magenta = (1 - rgba.green - key) / (1 - key);\n cmyk.yellow = (1 - rgba.blue - key) / (1 - key);\n cmyk.key = key;\n return cmyk;\n }\n\n public hsvaToRgba(hsva: SkyColorpickerHsva): SkyColorpickerRgba {\n let red = 0;\n let green = 0;\n let blue = 0;\n const hue = hsva.hue;\n const saturation = hsva.saturation;\n const value = hsva.value;\n const alpha = hsva.alpha || hsva.alpha === 0 ? hsva.alpha : 1;\n const i = Math.floor(hue * 6);\n const f = hue * 6 - i;\n const p = value * (1 - saturation);\n const q = value * (1 - f * saturation);\n const t = value * (1 - (1 - f) * saturation);\n const color: { [key: number]: any } = {\n 0: (): void => {\n red = value;\n green = t;\n blue = p;\n },\n 1: (): void => {\n red = q;\n green = value;\n blue = p;\n },\n 2: (): void => {\n red = p;\n green = value;\n blue = t;\n },\n 3: (): void => {\n red = p;\n green = q;\n blue = value;\n },\n 4: (): void => {\n red = t;\n green = p;\n blue = value;\n },\n 5: (): void => {\n red = value;\n green = p;\n blue = q;\n },\n };\n color[i % 6]();\n\n const rgba: SkyColorpickerRgba = {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n return rgba;\n }\n\n public stringToHsva(colorString: string, hex8: boolean): SkyColorpickerHsva {\n const stringParsers = [\n {\n // tslint:disable max-line-length\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: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[2], 0) / 255,\n green: parseInt(execResult[3], 0) / 255,\n blue: parseInt(execResult[4], 0) / 255,\n alpha: parseFloat(execResult[5]),\n };\n return rgba;\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: (execResult: any) => {\n const hsla: SkyColorpickerHsla = {\n hue: parseInt(execResult[2], 0) / 360,\n saturation: parseInt(execResult[3], 0) / 100,\n lightness: parseInt(execResult[4], 0) / 100,\n alpha: parseFloat(execResult[5]),\n };\n return hsla;\n // tslint:enable max-line-length\n },\n },\n ];\n if (hex8) {\n stringParsers.push({\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: parseInt(execResult[4], 16) / 255,\n };\n return rgba;\n },\n });\n } else {\n stringParsers.push(\n {\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n },\n {\n re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1] + execResult[1], 16) / 255,\n green: parseInt(execResult[2] + execResult[2], 16) / 255,\n blue: parseInt(execResult[3] + execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n }\n );\n }\n\n let hsva: SkyColorpickerHsva = undefined;\n for (const key in stringParsers) {\n /* istanbul ignore else */ /* for in must be filtered by an if */\n if (stringParsers.hasOwnProperty(key)) {\n const parser = stringParsers[key];\n const match = parser.re.exec(colorString);\n const color: any = match && parser.parse(match);\n if (color) {\n if ('red' in color) {\n hsva = this.rgbaToHsva(color);\n }\n if ('hue' in color) {\n hsva = this.hsla2hsva(color);\n }\n\n return hsva;\n }\n }\n }\n return hsva;\n }\n\n public outputFormat(\n hsva: SkyColorpickerHsva,\n outputFormat: string,\n allowHex8: boolean\n ): string {\n if (['hsla', 'hex', 'cmyk'].indexOf(outputFormat) === -1) {\n outputFormat = 'rgba';\n }\n const color: { [key: string]: any } = {\n hsla: () => {\n const hsla = this.denormalizeHSLA(this.hsva2hsla(hsva));\n return `hsla(${hsla.hue},${hsla.saturation}%,${hsla.lightness}%,${hsla.alpha})`;\n },\n hex: () => {\n return this.hexText(\n this.denormalizeRGBA(this.hsvaToRgba(hsva)),\n allowHex8\n );\n },\n cmyk: () => {\n const cmyk = this.denormalizeCMYK(\n this.rgbaToCmyk(this.hsvaToRgba(hsva))\n );\n return `cmyk(${cmyk.cyan}%,${cmyk.magenta}%,${cmyk.yellow}%,${cmyk.key}%)`;\n },\n rgba: () => {\n const rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return `rgba(${rgba.red},${rgba.green},${rgba.blue},${rgba.alpha})`;\n },\n };\n\n return color[outputFormat]();\n }\n\n public skyColorpickerOut(color: SkyColorpickerHsva) {\n let formatColor: SkyColorpickerOutput;\n const cmykText: string = this.outputFormat(color, 'cmyk', true);\n const hslaText: string = this.outputFormat(color, 'hsla', true);\n const rgbaText: string = this.outputFormat(color, 'rgba', true);\n const rgba: SkyColorpickerRgba = this.hsvaToRgba(color);\n const hsla: SkyColorpickerHsla = this.hsva2hsla(color);\n const cmyk: SkyColorpickerCmyk = this.rgbaToCmyk(rgba);\n const hex: string = this.outputFormat(color, 'hex', false);\n\n formatColor = {\n cmykText: cmykText,\n hslaText: hslaText,\n rgbaText: rgbaText,\n hsva: this.denormalizeHSVA(color),\n rgba: this.denormalizeRGBA(rgba),\n hsla: this.denormalizeHSLA(hsla),\n cmyk: this.denormalizeCMYK(cmyk),\n hex: hex,\n };\n return formatColor;\n }\n\n public hexText(rgba: SkyColorpickerRgba, allowHex8: boolean): string {\n // tslint:disable no-bitwise\n let hexText =\n '#' +\n ((1 << 24) | (rgba.red << 16) | (rgba.green << 8) | rgba.blue)\n .toString(16)\n .substr(1);\n if (\n hexText[1] === hexText[2] &&\n hexText[3] === hexText[4] &&\n hexText[5] === hexText[6] &&\n rgba.alpha === 1 &&\n !allowHex8\n ) {\n hexText = '#' + hexText[1] + hexText[3] + hexText[5];\n }\n if (allowHex8) {\n hexText += ((1 << 8) | Math.round(rgba.alpha * 255))\n .toString(16)\n .substr(1);\n }\n return hexText;\n // tslint:enable no-bitwise\n }\n\n public denormalizeRGBA(rgba: SkyColorpickerRgba): SkyColorpickerRgba {\n const denormalizeRgba: SkyColorpickerRgba = {\n red: Math.round(rgba.red * 255),\n green: Math.round(rgba.green * 255),\n blue: Math.round(rgba.blue * 255),\n alpha: Math.round(rgba.alpha * 100) / 100,\n };\n return denormalizeRgba;\n }\n\n public denormalizeHSLA(hsla: SkyColorpickerHsla): SkyColorpickerHsla {\n const denormalizeHsla: SkyColorpickerHsla = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n lightness: Math.round(hsla.lightness * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsla;\n }\n\n public denormalizeHSVA(hsla: SkyColorpickerHsva): SkyColorpickerHsva {\n const denormalizeHsva: SkyColorpickerHsva = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n value: Math.round(hsla.value * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsva;\n }\n\n public denormalizeCMYK(cmyk: SkyColorpickerCmyk): SkyColorpickerCmyk {\n const denormalizeCmyk: SkyColorpickerCmyk = {\n cyan: Math.round(cmyk.cyan * 100),\n magenta: Math.round(cmyk.magenta * 100),\n yellow: Math.round(cmyk.yellow * 100),\n key: Math.round(cmyk.key * 100),\n };\n return denormalizeCmyk;\n }\n}\n"]}
1
+ {"version":3,"file":"colorpicker.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.service.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAQ3C;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IACzB,SAAS,CAAC,IAAwB;QACvC,MAAM,KAAK,GAAW,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAA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;YAC7C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG;SAC1C,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;IAEM,eAAe,CAAC,IAAwB;QAC7C,MAAM,eAAe,GAAuB;YAC1C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;YACjC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YACvC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YACrC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;SAChC,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;;mHAxWU,qBAAqB;uHAArB,qBAAqB;4FAArB,qBAAqB;kBADjC,UAAU","sourcesContent":["// spell-checker:ignore hsva, hsla, cmyk, denormalize, colorpicker,Injectable\nimport { Injectable } from '@angular/core';\n\nimport { SkyColorpickerCmyk } from './types/colorpicker-cmyk';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyColorpickerService {\n public hsla2hsva(hsla: SkyColorpickerHsla): SkyColorpickerHsva {\n const alpha: number = Math.min(hsla.alpha, 1);\n const hue: number = Math.min(hsla.hue, 1);\n const lightness: number = Math.min(hsla.lightness, 1);\n const saturation: number = Math.min(hsla.saturation, 1);\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: lightness,\n alpha: alpha,\n };\n if (lightness === 0) {\n hsva.saturation = 0;\n hsva.value = 0;\n } else {\n hsva.value =\n lightness + (saturation * (1 - Math.abs(2 * lightness - 1))) / 2;\n hsva.saturation = (2 * (hsva.value - lightness)) / hsva.value;\n }\n return hsva;\n }\n\n public hsva2hsla(hsva: SkyColorpickerHsva): SkyColorpickerHsla {\n const alpha: number = hsva.alpha;\n const hue: number = hsva.hue;\n const saturation: number = hsva.saturation;\n const value: number = hsva.value;\n\n const hsla: SkyColorpickerHsla = {\n hue: hue,\n saturation: saturation,\n lightness: value,\n alpha: alpha,\n };\n if (value === 0) {\n hsla.lightness = 0;\n hsla.saturation = 0;\n } else {\n hsla.lightness = (value * (2 - saturation)) / 2;\n hsla.saturation =\n (value * saturation) / (1 - Math.abs(2 * hsla.lightness - 1));\n }\n return hsla;\n }\n\n public rgbaToHsva(rgba: SkyColorpickerRgba): SkyColorpickerHsva {\n const red: number = Math.min(rgba.red, 1);\n const green: number = Math.min(rgba.green, 1);\n const blue: number = Math.min(rgba.blue, 1);\n const alpha: number = Math.min(rgba.alpha, 1);\n const max: number = Math.max(red, green, blue);\n const min: number = Math.min(red, green, blue);\n const value: number = max;\n const d = max - min;\n const saturation: number = max === 0 ? 0 : d / max;\n let hue = 0;\n let maxValue: { [key: number]: number };\n if (max !== min) {\n maxValue = {\n [red]: (green - blue) / d + (green < blue ? 6 : 0),\n [green]: (blue - red) / d + 2,\n [blue]: (red - green) / d + 4,\n };\n hue = maxValue[max];\n hue /= 6;\n }\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: value,\n alpha: alpha,\n };\n return hsva;\n }\n\n public rgbaToCmyk(rgba: SkyColorpickerRgba): SkyColorpickerCmyk {\n const cmyk: SkyColorpickerCmyk = { cyan: 0, magenta: 0, yellow: 0, key: 0 };\n const key: number = 1 - Math.max(rgba.red, rgba.green, rgba.blue);\n\n if (key === 1) {\n cmyk.key = 1;\n return cmyk;\n }\n cmyk.cyan = (1 - rgba.red - key) / (1 - key);\n cmyk.magenta = (1 - rgba.green - key) / (1 - key);\n cmyk.yellow = (1 - rgba.blue - key) / (1 - key);\n cmyk.key = key;\n return cmyk;\n }\n\n public hsvaToRgba(hsva: SkyColorpickerHsva): SkyColorpickerRgba {\n let red = 0;\n let green = 0;\n let blue = 0;\n const hue = hsva.hue;\n const saturation = hsva.saturation;\n const value = hsva.value;\n const alpha = hsva.alpha || hsva.alpha === 0 ? hsva.alpha : 1;\n const i = Math.floor(hue * 6);\n const f = hue * 6 - i;\n const p = value * (1 - saturation);\n const q = value * (1 - f * saturation);\n const t = value * (1 - (1 - f) * saturation);\n const color: { [key: number]: any } = {\n 0: (): void => {\n red = value;\n green = t;\n blue = p;\n },\n 1: (): void => {\n red = q;\n green = value;\n blue = p;\n },\n 2: (): void => {\n red = p;\n green = value;\n blue = t;\n },\n 3: (): void => {\n red = p;\n green = q;\n blue = value;\n },\n 4: (): void => {\n red = t;\n green = p;\n blue = value;\n },\n 5: (): void => {\n red = value;\n green = p;\n blue = q;\n },\n };\n color[i % 6]();\n\n const rgba: SkyColorpickerRgba = {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n return rgba;\n }\n\n public stringToHsva(colorString: string, hex8: boolean): SkyColorpickerHsva {\n const stringParsers = [\n {\n // tslint:disable max-line-length\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: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[2], 0) / 255,\n green: parseInt(execResult[3], 0) / 255,\n blue: parseInt(execResult[4], 0) / 255,\n alpha: parseFloat(execResult[5]),\n };\n return rgba;\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: (execResult: any) => {\n const hsla: SkyColorpickerHsla = {\n hue: parseInt(execResult[2], 0) / 360,\n saturation: parseInt(execResult[3], 0) / 100,\n lightness: parseInt(execResult[4], 0) / 100,\n alpha: parseFloat(execResult[5]),\n };\n return hsla;\n // tslint:enable max-line-length\n },\n },\n ];\n if (hex8) {\n stringParsers.push({\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: parseInt(execResult[4], 16) / 255,\n };\n return rgba;\n },\n });\n } else {\n stringParsers.push(\n {\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n },\n {\n re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1] + execResult[1], 16) / 255,\n green: parseInt(execResult[2] + execResult[2], 16) / 255,\n blue: parseInt(execResult[3] + execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n }\n );\n }\n\n let hsva: SkyColorpickerHsva = undefined;\n for (const key in stringParsers) {\n /* istanbul ignore else */ /* for in must be filtered by an if */\n if (Object.prototype.hasOwnProperty.call(stringParsers, key)) {\n const parser = stringParsers[key];\n const match = parser.re.exec(colorString);\n const color: any = match && parser.parse(match);\n if (color) {\n if ('red' in color) {\n hsva = this.rgbaToHsva(color);\n }\n if ('hue' in color) {\n hsva = this.hsla2hsva(color);\n }\n\n return hsva;\n }\n }\n }\n return hsva;\n }\n\n public outputFormat(\n hsva: SkyColorpickerHsva,\n outputFormat: string,\n allowHex8: boolean\n ): string {\n if (['hsla', 'hex', 'cmyk'].indexOf(outputFormat) === -1) {\n outputFormat = 'rgba';\n }\n const color: { [key: string]: any } = {\n hsla: () => {\n const hsla = this.denormalizeHSLA(this.hsva2hsla(hsva));\n return `hsla(${hsla.hue},${hsla.saturation}%,${hsla.lightness}%,${hsla.alpha})`;\n },\n hex: () => {\n return this.hexText(\n this.denormalizeRGBA(this.hsvaToRgba(hsva)),\n allowHex8\n );\n },\n cmyk: () => {\n const cmyk = this.denormalizeCMYK(\n this.rgbaToCmyk(this.hsvaToRgba(hsva))\n );\n return `cmyk(${cmyk.cyan}%,${cmyk.magenta}%,${cmyk.yellow}%,${cmyk.key}%)`;\n },\n rgba: () => {\n const rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return `rgba(${rgba.red},${rgba.green},${rgba.blue},${rgba.alpha})`;\n },\n };\n\n return color[outputFormat]();\n }\n\n public skyColorpickerOut(color: SkyColorpickerHsva) {\n const cmykText: string = this.outputFormat(color, 'cmyk', true);\n const hslaText: string = this.outputFormat(color, 'hsla', true);\n const rgbaText: string = this.outputFormat(color, 'rgba', true);\n const rgba: SkyColorpickerRgba = this.hsvaToRgba(color);\n const hsla: SkyColorpickerHsla = this.hsva2hsla(color);\n const cmyk: SkyColorpickerCmyk = this.rgbaToCmyk(rgba);\n const hex: string = this.outputFormat(color, 'hex', false);\n\n const formatColor: SkyColorpickerOutput = {\n cmykText: cmykText,\n hslaText: hslaText,\n rgbaText: rgbaText,\n hsva: this.denormalizeHSVA(color),\n rgba: this.denormalizeRGBA(rgba),\n hsla: this.denormalizeHSLA(hsla),\n cmyk: this.denormalizeCMYK(cmyk),\n hex: hex,\n };\n\n return formatColor;\n }\n\n public hexText(rgba: SkyColorpickerRgba, allowHex8: boolean): string {\n // tslint:disable no-bitwise\n let hexText =\n '#' +\n ((1 << 24) | (rgba.red << 16) | (rgba.green << 8) | rgba.blue)\n .toString(16)\n .substr(1);\n if (\n hexText[1] === hexText[2] &&\n hexText[3] === hexText[4] &&\n hexText[5] === hexText[6] &&\n rgba.alpha === 1 &&\n !allowHex8\n ) {\n hexText = '#' + hexText[1] + hexText[3] + hexText[5];\n }\n if (allowHex8) {\n hexText += ((1 << 8) | Math.round(rgba.alpha * 255))\n .toString(16)\n .substr(1);\n }\n return hexText;\n // tslint:enable no-bitwise\n }\n\n public denormalizeRGBA(rgba: SkyColorpickerRgba): SkyColorpickerRgba {\n const denormalizeRgba: SkyColorpickerRgba = {\n red: Math.round(rgba.red * 255),\n green: Math.round(rgba.green * 255),\n blue: Math.round(rgba.blue * 255),\n alpha: Math.round(rgba.alpha * 100) / 100,\n };\n return denormalizeRgba;\n }\n\n public denormalizeHSLA(hsla: SkyColorpickerHsla): SkyColorpickerHsla {\n const denormalizeHsla: SkyColorpickerHsla = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n lightness: Math.round(hsla.lightness * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsla;\n }\n\n public denormalizeHSVA(hsla: SkyColorpickerHsva): SkyColorpickerHsva {\n const denormalizeHsva: SkyColorpickerHsva = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n value: Math.round(hsla.value * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsva;\n }\n\n public denormalizeCMYK(cmyk: SkyColorpickerCmyk): SkyColorpickerCmyk {\n const denormalizeCmyk: SkyColorpickerCmyk = {\n cyan: Math.round(cmyk.cyan * 100),\n magenta: Math.round(cmyk.magenta * 100),\n yellow: Math.round(cmyk.yellow * 100),\n key: Math.round(cmyk.key * 100),\n };\n return denormalizeCmyk;\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * NOTICE: DO NOT MODIFY THIS FILE!
3
3
  * The contents of this file were automatically generated by
4
- * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-colorpicker' schematic.
4
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-colorpicker' schematic.
5
5
  * To update this file, simply rerun the command.
6
6
  */
7
- import { Injectable, NgModule } from '@angular/core';
7
+ import { NgModule } from '@angular/core';
8
8
  import { SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule, getLibStringForLocale, } from '@skyux/i18n';
9
9
  import * as i0 from "@angular/core";
10
10
  const RESOURCES = {
@@ -34,11 +34,6 @@ export class SkyColorpickerResourcesProvider {
34
34
  return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
35
35
  }
36
36
  }
37
- SkyColorpickerResourcesProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
- SkyColorpickerResourcesProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider });
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider, decorators: [{
40
- type: Injectable
41
- }] });
42
37
  /**
43
38
  * Import into any component library module that needs to use resource strings.
44
39
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sky-colorpicker-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/shared/sky-colorpicker-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,uBAAuB,EAAE,EAAE,OA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,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,+BAA+B;4BACzC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-colorpicker' schematic.\n * To update this file, simply rerun the command.\n */\nimport { Injectable, NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_colorpicker_alpha: { message: 'A:' },\n skyux_colorpicker_apply: { message: 'Apply' },\n skyux_colorpicker_aria_alpha: {\n message: 'Alpha channel value between 0 and 1',\n },\n skyux_colorpicker_aria_blue: { message: 'Blue value between 0 and 255' },\n skyux_colorpicker_aria_green: { message: 'Green value between 0 and 255' },\n skyux_colorpicker_aria_hex: { message: 'Hexadecimal color code' },\n skyux_colorpicker_aria_red: { message: 'Red value between 0 and 255' },\n skyux_colorpicker_blue: { message: 'B:' },\n skyux_colorpicker_close: { message: 'Cancel' },\n skyux_colorpicker_dropdown_button: { message: 'Select color value' },\n skyux_colorpicker_green: { message: 'G:' },\n skyux_colorpicker_hex: { message: 'Hex:' },\n skyux_colorpicker_input_default_label: { message: 'Color value' },\n skyux_colorpicker_preset_color: { message: 'Preset Color:' },\n skyux_colorpicker_red: { message: 'R:' },\n skyux_colorpicker_reset: { message: 'Reset color value to white' },\n },\n};\n\n@Injectable()\nexport class SkyColorpickerResourcesProvider\n implements SkyLibResourcesProvider\n{\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyColorpickerResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyColorpickerResourcesModule {}\n"]}
1
+ {"version":3,"file":"sky-colorpicker-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/shared/sky-colorpicker-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,uBAAuB,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC7C,4BAA4B,EAAE;YAC5B,OAAO,EAAE,qCAAqC;SAC/C;QACD,2BAA2B,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;QACxE,4BAA4B,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE;QAC1E,0BAA0B,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;QACjE,0BAA0B,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;QACtE,sBAAsB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACzC,uBAAuB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9C,iCAAiC,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACpE,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,qBAAqB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1C,qCAAqC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QACjE,8BAA8B,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QAC5D,qBAAqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACxC,uBAAuB,EAAE,EAAE,OAAO,EAAE,4BAA4B,EAAE;KACnE;CACF,CAAC;AAEF,MAAM,OAAO,+BAA+B;IAGnC,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,6BAA6B;;2HAA7B,6BAA6B;4HAA7B,6BAA6B,YAT9B,aAAa;4HASZ,6BAA6B,aAR7B;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,+BAA+B;YACzC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,6BAA6B;kBAVzC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,+BAA+B;4BACzC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-colorpicker' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_colorpicker_alpha: { message: 'A:' },\n skyux_colorpicker_apply: { message: 'Apply' },\n skyux_colorpicker_aria_alpha: {\n message: 'Alpha channel value between 0 and 1',\n },\n skyux_colorpicker_aria_blue: { message: 'Blue value between 0 and 255' },\n skyux_colorpicker_aria_green: { message: 'Green value between 0 and 255' },\n skyux_colorpicker_aria_hex: { message: 'Hexadecimal color code' },\n skyux_colorpicker_aria_red: { message: 'Red value between 0 and 255' },\n skyux_colorpicker_blue: { message: 'B:' },\n skyux_colorpicker_close: { message: 'Cancel' },\n skyux_colorpicker_dropdown_button: { message: 'Select color value' },\n skyux_colorpicker_green: { message: 'G:' },\n skyux_colorpicker_hex: { message: 'Hex:' },\n skyux_colorpicker_input_default_label: { message: 'Color value' },\n skyux_colorpicker_preset_color: { message: 'Preset Color:' },\n skyux_colorpicker_red: { message: 'R:' },\n skyux_colorpicker_reset: { message: 'Reset color value to white' },\n },\n};\n\nexport class SkyColorpickerResourcesProvider\n implements SkyLibResourcesProvider\n{\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyColorpickerResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyColorpickerResourcesModule {}\n"]}
@@ -1,7 +1,7 @@
1
1
  import * as i6 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Injectable, NgModule, EventEmitter, Directive, Output, Input, HostListener, TemplateRef, ElementRef, Component, ViewEncapsulation, Optional, ViewChild, forwardRef } from '@angular/core';
4
+ import { NgModule, Injectable, EventEmitter, Directive, Output, Input, HostListener, TemplateRef, ElementRef, Component, ViewEncapsulation, Optional, ViewChild, forwardRef } from '@angular/core';
5
5
  import * as i1 from '@skyux/core';
6
6
  import { SkyAffixAutoFitContext, SkyAffixModule, SkyOverlayModule } from '@skyux/core';
7
7
  import * as i5 from '@skyux/forms';
@@ -19,7 +19,7 @@ import { takeUntil } from 'rxjs/operators';
19
19
  /**
20
20
  * NOTICE: DO NOT MODIFY THIS FILE!
21
21
  * The contents of this file were automatically generated by
22
- * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-colorpicker' schematic.
22
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-colorpicker' schematic.
23
23
  * To update this file, simply rerun the command.
24
24
  */
25
25
  const RESOURCES = {
@@ -49,11 +49,6 @@ class SkyColorpickerResourcesProvider {
49
49
  return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
50
50
  }
51
51
  }
52
- SkyColorpickerResourcesProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
53
- SkyColorpickerResourcesProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerResourcesProvider, decorators: [{
55
- type: Injectable
56
- }] });
57
52
  /**
58
53
  * Import into any component library module that needs to use resource strings.
59
54
  */
@@ -111,7 +106,6 @@ class SliderDimension {
111
106
  * @internal
112
107
  */
113
108
  class SkyColorpickerService {
114
- constructor() { }
115
109
  hsla2hsva(hsla) {
116
110
  const alpha = Math.min(hsla.alpha, 1);
117
111
  const hue = Math.min(hsla.hue, 1);
@@ -323,7 +317,7 @@ class SkyColorpickerService {
323
317
  let hsva = undefined;
324
318
  for (const key in stringParsers) {
325
319
  /* istanbul ignore else */ /* for in must be filtered by an if */
326
- if (stringParsers.hasOwnProperty(key)) {
320
+ if (Object.prototype.hasOwnProperty.call(stringParsers, key)) {
327
321
  const parser = stringParsers[key];
328
322
  const match = parser.re.exec(colorString);
329
323
  const color = match && parser.parse(match);
@@ -364,7 +358,6 @@ class SkyColorpickerService {
364
358
  return color[outputFormat]();
365
359
  }
366
360
  skyColorpickerOut(color) {
367
- let formatColor;
368
361
  const cmykText = this.outputFormat(color, 'cmyk', true);
369
362
  const hslaText = this.outputFormat(color, 'hsla', true);
370
363
  const rgbaText = this.outputFormat(color, 'rgba', true);
@@ -372,7 +365,7 @@ class SkyColorpickerService {
372
365
  const hsla = this.hsva2hsla(color);
373
366
  const cmyk = this.rgbaToCmyk(rgba);
374
367
  const hex = this.outputFormat(color, 'hex', false);
375
- formatColor = {
368
+ const formatColor = {
376
369
  cmykText: cmykText,
377
370
  hslaText: hslaText,
378
371
  rgbaText: rgbaText,
@@ -446,7 +439,7 @@ SkyColorpickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
446
439
  SkyColorpickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerService });
447
440
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColorpickerService, decorators: [{
448
441
  type: Injectable
449
- }], ctorParameters: function () { return []; } });
442
+ }] });
450
443
 
451
444
  /**
452
445
  * Specifies the commands to provide the colorpicker.
@@ -1072,10 +1065,11 @@ class SkyColorpickerInputDirective {
1072
1065
  * levels.
1073
1066
  */
1074
1067
  this.allowTransparency = true;
1075
- /*istanbul ignore next */
1068
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1076
1069
  this._onChange = (_) => { };
1077
- /*istanbul ignore next */
1070
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1078
1071
  this._onTouched = () => { };
1072
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1079
1073
  this._validatorChange = () => { };
1080
1074
  }
1081
1075
  /**
@@ -1232,9 +1226,8 @@ class SkyColorpickerInputDirective {
1232
1226
  if (color && typeof color !== 'string') {
1233
1227
  return color;
1234
1228
  }
1235
- let formatColor;
1236
1229
  const hsva = this.service.stringToHsva(color, this.alphaChannel === 'hex8');
1237
- formatColor = this.service.skyColorpickerOut(hsva);
1230
+ const formatColor = this.service.skyColorpickerOut(hsva);
1238
1231
  return formatColor;
1239
1232
  }
1240
1233
  getString(key) {
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-colorpicker.js","sources":["../../../../../libs/components/colorpicker/src/lib/modules/shared/sky-colorpicker-resources.module.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-classes.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.service.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/types/colorpicker-message-type.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-slider.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-text.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.html","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-input.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.module.ts","../../../../../libs/components/colorpicker/src/skyux-colorpicker.ts"],"sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-colorpicker' schematic.\n * To update this file, simply rerun the command.\n */\nimport { Injectable, NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_colorpicker_alpha: { message: 'A:' },\n skyux_colorpicker_apply: { message: 'Apply' },\n skyux_colorpicker_aria_alpha: {\n message: 'Alpha channel value between 0 and 1',\n },\n skyux_colorpicker_aria_blue: { message: 'Blue value between 0 and 255' },\n skyux_colorpicker_aria_green: { message: 'Green value between 0 and 255' },\n skyux_colorpicker_aria_hex: { message: 'Hexadecimal color code' },\n skyux_colorpicker_aria_red: { message: 'Red value between 0 and 255' },\n skyux_colorpicker_blue: { message: 'B:' },\n skyux_colorpicker_close: { message: 'Cancel' },\n skyux_colorpicker_dropdown_button: { message: 'Select color value' },\n skyux_colorpicker_green: { message: 'G:' },\n skyux_colorpicker_hex: { message: 'Hex:' },\n skyux_colorpicker_input_default_label: { message: 'Color value' },\n skyux_colorpicker_preset_color: { message: 'Preset Color:' },\n skyux_colorpicker_red: { message: 'R:' },\n skyux_colorpicker_reset: { message: 'Reset color value to white' },\n },\n};\n\n@Injectable()\nexport class SkyColorpickerResourcesProvider\n implements SkyLibResourcesProvider\n{\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyColorpickerResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyColorpickerResourcesModule {}\n","// spell-checker:ignore colorpicker\n\n/**\n * @internal\n */\nexport class SliderPosition {\n constructor(\n public hue: number,\n public saturation: number,\n public value: number,\n public alpha: number\n ) {}\n}\n/**\n * @internal\n */\nexport class SliderDimension {\n constructor(\n public hue: number,\n public saturation: number,\n public value: number,\n public alpha: number\n ) {}\n}\n","// spell-checker:ignore hsva, hsla, cmyk, denormalize, colorpicker,Injectable\nimport { Injectable } from '@angular/core';\n\nimport { SkyColorpickerCmyk } from './types/colorpicker-cmyk';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyColorpickerService {\n constructor() {}\n\n public hsla2hsva(hsla: SkyColorpickerHsla): SkyColorpickerHsva {\n const alpha: number = Math.min(hsla.alpha, 1);\n const hue: number = Math.min(hsla.hue, 1);\n const lightness: number = Math.min(hsla.lightness, 1);\n const saturation: number = Math.min(hsla.saturation, 1);\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: lightness,\n alpha: alpha,\n };\n if (lightness === 0) {\n hsva.saturation = 0;\n hsva.value = 0;\n } else {\n hsva.value =\n lightness + (saturation * (1 - Math.abs(2 * lightness - 1))) / 2;\n hsva.saturation = (2 * (hsva.value - lightness)) / hsva.value;\n }\n return hsva;\n }\n\n public hsva2hsla(hsva: SkyColorpickerHsva): SkyColorpickerHsla {\n const alpha: number = hsva.alpha;\n const hue: number = hsva.hue;\n const saturation: number = hsva.saturation;\n const value: number = hsva.value;\n\n const hsla: SkyColorpickerHsla = {\n hue: hue,\n saturation: saturation,\n lightness: value,\n alpha: alpha,\n };\n if (value === 0) {\n hsla.lightness = 0;\n hsla.saturation = 0;\n } else {\n hsla.lightness = (value * (2 - saturation)) / 2;\n hsla.saturation =\n (value * saturation) / (1 - Math.abs(2 * hsla.lightness - 1));\n }\n return hsla;\n }\n\n public rgbaToHsva(rgba: SkyColorpickerRgba): SkyColorpickerHsva {\n const red: number = Math.min(rgba.red, 1);\n const green: number = Math.min(rgba.green, 1);\n const blue: number = Math.min(rgba.blue, 1);\n const alpha: number = Math.min(rgba.alpha, 1);\n const max: number = Math.max(red, green, blue);\n const min: number = Math.min(red, green, blue);\n const value: number = max;\n const d = max - min;\n const saturation: number = max === 0 ? 0 : d / max;\n let hue = 0;\n let maxValue: { [key: number]: number };\n if (max !== min) {\n maxValue = {\n [red]: (green - blue) / d + (green < blue ? 6 : 0),\n [green]: (blue - red) / d + 2,\n [blue]: (red - green) / d + 4,\n };\n hue = maxValue[max];\n hue /= 6;\n }\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: value,\n alpha: alpha,\n };\n return hsva;\n }\n\n public rgbaToCmyk(rgba: SkyColorpickerRgba): SkyColorpickerCmyk {\n const cmyk: SkyColorpickerCmyk = { cyan: 0, magenta: 0, yellow: 0, key: 0 };\n const key: number = 1 - Math.max(rgba.red, rgba.green, rgba.blue);\n\n if (key === 1) {\n cmyk.key = 1;\n return cmyk;\n }\n cmyk.cyan = (1 - rgba.red - key) / (1 - key);\n cmyk.magenta = (1 - rgba.green - key) / (1 - key);\n cmyk.yellow = (1 - rgba.blue - key) / (1 - key);\n cmyk.key = key;\n return cmyk;\n }\n\n public hsvaToRgba(hsva: SkyColorpickerHsva): SkyColorpickerRgba {\n let red = 0;\n let green = 0;\n let blue = 0;\n const hue = hsva.hue;\n const saturation = hsva.saturation;\n const value = hsva.value;\n const alpha = hsva.alpha || hsva.alpha === 0 ? hsva.alpha : 1;\n const i = Math.floor(hue * 6);\n const f = hue * 6 - i;\n const p = value * (1 - saturation);\n const q = value * (1 - f * saturation);\n const t = value * (1 - (1 - f) * saturation);\n const color: { [key: number]: any } = {\n 0: (): void => {\n red = value;\n green = t;\n blue = p;\n },\n 1: (): void => {\n red = q;\n green = value;\n blue = p;\n },\n 2: (): void => {\n red = p;\n green = value;\n blue = t;\n },\n 3: (): void => {\n red = p;\n green = q;\n blue = value;\n },\n 4: (): void => {\n red = t;\n green = p;\n blue = value;\n },\n 5: (): void => {\n red = value;\n green = p;\n blue = q;\n },\n };\n color[i % 6]();\n\n const rgba: SkyColorpickerRgba = {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n return rgba;\n }\n\n public stringToHsva(colorString: string, hex8: boolean): SkyColorpickerHsva {\n const stringParsers = [\n {\n // tslint:disable max-line-length\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: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[2], 0) / 255,\n green: parseInt(execResult[3], 0) / 255,\n blue: parseInt(execResult[4], 0) / 255,\n alpha: parseFloat(execResult[5]),\n };\n return rgba;\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: (execResult: any) => {\n const hsla: SkyColorpickerHsla = {\n hue: parseInt(execResult[2], 0) / 360,\n saturation: parseInt(execResult[3], 0) / 100,\n lightness: parseInt(execResult[4], 0) / 100,\n alpha: parseFloat(execResult[5]),\n };\n return hsla;\n // tslint:enable max-line-length\n },\n },\n ];\n if (hex8) {\n stringParsers.push({\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: parseInt(execResult[4], 16) / 255,\n };\n return rgba;\n },\n });\n } else {\n stringParsers.push(\n {\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n },\n {\n re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1] + execResult[1], 16) / 255,\n green: parseInt(execResult[2] + execResult[2], 16) / 255,\n blue: parseInt(execResult[3] + execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n }\n );\n }\n\n let hsva: SkyColorpickerHsva = undefined;\n for (const key in stringParsers) {\n /* istanbul ignore else */ /* for in must be filtered by an if */\n if (stringParsers.hasOwnProperty(key)) {\n const parser = stringParsers[key];\n const match = parser.re.exec(colorString);\n const color: any = match && parser.parse(match);\n if (color) {\n if ('red' in color) {\n hsva = this.rgbaToHsva(color);\n }\n if ('hue' in color) {\n hsva = this.hsla2hsva(color);\n }\n\n return hsva;\n }\n }\n }\n return hsva;\n }\n\n public outputFormat(\n hsva: SkyColorpickerHsva,\n outputFormat: string,\n allowHex8: boolean\n ): string {\n if (['hsla', 'hex', 'cmyk'].indexOf(outputFormat) === -1) {\n outputFormat = 'rgba';\n }\n const color: { [key: string]: any } = {\n hsla: () => {\n const hsla = this.denormalizeHSLA(this.hsva2hsla(hsva));\n return `hsla(${hsla.hue},${hsla.saturation}%,${hsla.lightness}%,${hsla.alpha})`;\n },\n hex: () => {\n return this.hexText(\n this.denormalizeRGBA(this.hsvaToRgba(hsva)),\n allowHex8\n );\n },\n cmyk: () => {\n const cmyk = this.denormalizeCMYK(\n this.rgbaToCmyk(this.hsvaToRgba(hsva))\n );\n return `cmyk(${cmyk.cyan}%,${cmyk.magenta}%,${cmyk.yellow}%,${cmyk.key}%)`;\n },\n rgba: () => {\n const rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return `rgba(${rgba.red},${rgba.green},${rgba.blue},${rgba.alpha})`;\n },\n };\n\n return color[outputFormat]();\n }\n\n public skyColorpickerOut(color: SkyColorpickerHsva) {\n let formatColor: SkyColorpickerOutput;\n const cmykText: string = this.outputFormat(color, 'cmyk', true);\n const hslaText: string = this.outputFormat(color, 'hsla', true);\n const rgbaText: string = this.outputFormat(color, 'rgba', true);\n const rgba: SkyColorpickerRgba = this.hsvaToRgba(color);\n const hsla: SkyColorpickerHsla = this.hsva2hsla(color);\n const cmyk: SkyColorpickerCmyk = this.rgbaToCmyk(rgba);\n const hex: string = this.outputFormat(color, 'hex', false);\n\n formatColor = {\n cmykText: cmykText,\n hslaText: hslaText,\n rgbaText: rgbaText,\n hsva: this.denormalizeHSVA(color),\n rgba: this.denormalizeRGBA(rgba),\n hsla: this.denormalizeHSLA(hsla),\n cmyk: this.denormalizeCMYK(cmyk),\n hex: hex,\n };\n return formatColor;\n }\n\n public hexText(rgba: SkyColorpickerRgba, allowHex8: boolean): string {\n // tslint:disable no-bitwise\n let hexText =\n '#' +\n ((1 << 24) | (rgba.red << 16) | (rgba.green << 8) | rgba.blue)\n .toString(16)\n .substr(1);\n if (\n hexText[1] === hexText[2] &&\n hexText[3] === hexText[4] &&\n hexText[5] === hexText[6] &&\n rgba.alpha === 1 &&\n !allowHex8\n ) {\n hexText = '#' + hexText[1] + hexText[3] + hexText[5];\n }\n if (allowHex8) {\n hexText += ((1 << 8) | Math.round(rgba.alpha * 255))\n .toString(16)\n .substr(1);\n }\n return hexText;\n // tslint:enable no-bitwise\n }\n\n public denormalizeRGBA(rgba: SkyColorpickerRgba): SkyColorpickerRgba {\n const denormalizeRgba: SkyColorpickerRgba = {\n red: Math.round(rgba.red * 255),\n green: Math.round(rgba.green * 255),\n blue: Math.round(rgba.blue * 255),\n alpha: Math.round(rgba.alpha * 100) / 100,\n };\n return denormalizeRgba;\n }\n\n public denormalizeHSLA(hsla: SkyColorpickerHsla): SkyColorpickerHsla {\n const denormalizeHsla: SkyColorpickerHsla = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n lightness: Math.round(hsla.lightness * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsla;\n }\n\n public denormalizeHSVA(hsla: SkyColorpickerHsva): SkyColorpickerHsva {\n const denormalizeHsva: SkyColorpickerHsva = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n value: Math.round(hsla.value * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsva;\n }\n\n public denormalizeCMYK(cmyk: SkyColorpickerCmyk): SkyColorpickerCmyk {\n const denormalizeCmyk: SkyColorpickerCmyk = {\n cyan: Math.round(cmyk.cyan * 100),\n magenta: Math.round(cmyk.magenta * 100),\n yellow: Math.round(cmyk.yellow * 100),\n key: Math.round(cmyk.key * 100),\n };\n return denormalizeCmyk;\n }\n}\n","/**\n * Specifies the commands to provide the colorpicker.\n */\nexport enum SkyColorpickerMessageType {\n /**\n * Opens the colorpicker.\n */\n Open = 0,\n /**\n * Resets the selection in the colorpicker.\n */\n Reset = 1,\n /**\n * Toggles whether to display a reset button beside the colorpicker.\n */\n ToggleResetButton = 2,\n /**\n * Closes the colorpicker.\n */\n Close = 3,\n}\n","// spell-checker:ignore Colorpicker\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\n\nimport { SkyColorpickerChangeAxis } from './types/colorpicker-axis';\n\n/**\n * @internal\n */\n@Directive({\n selector: '[skyColorpickerSlider]',\n})\nexport class SkyColorpickerSliderDirective {\n @Output()\n public newColorContrast = new EventEmitter<SkyColorpickerChangeAxis>();\n @Input()\n public skyColorpickerSlider: string;\n @Input()\n public color: string;\n @Input()\n public xAxis: number;\n @Input()\n public yAxis: number;\n\n private listenerMove: any;\n private listenerStop: any;\n\n constructor(private el: ElementRef) {\n this.listenerMove = (event: any) => {\n this.move(event);\n };\n this.listenerStop = () => {\n this.stop();\n };\n }\n\n public setCursor(event: any) {\n const height = this.el.nativeElement.offsetHeight;\n const width = this.el.nativeElement.offsetWidth;\n const xAxis = Math.max(0, Math.min(this.getX(event), width));\n const yAxis = Math.max(0, Math.min(this.getY(event), height));\n if (this.xAxis !== undefined && this.yAxis !== undefined) {\n this.newColorContrast.emit({\n xCoordinate: xAxis / width,\n yCoordinate: 1 - yAxis / height,\n xAxis: this.xAxis,\n yAxis: this.yAxis,\n } as SkyColorpickerChangeAxis);\n } else {\n this.newColorContrast.emit({\n xCoordinate: xAxis / width,\n maxRange: this.xAxis,\n } as SkyColorpickerChangeAxis);\n }\n /* // No vertical bars\n if (this.xAxis === undefined && this.yAxis !== undefined) {\n this.newColorContrast.emit({ yCoordinate: yAxis / height, maxRange: this.yAxis });\n } */\n }\n\n public move(event: any) {\n event.preventDefault();\n this.setCursor(event);\n }\n @HostListener('touchstart', ['$event'])\n @HostListener('mousedown', ['$event'])\n public start(event: MouseEvent) {\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 public 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 public getX(event: any): number {\n /* Ignoring event.touches as tests are not run on a touch device. */\n /* istanbul ignore next */\n return (\n (event.pageX !== undefined ? event.pageX : event.touches[0].pageX) -\n this.el.nativeElement.getBoundingClientRect().left -\n window.pageXOffset\n );\n }\n public getY(event: any): number {\n /* Ignoring event.touches as tests are not run on a touch device. */\n /* istanbul ignore next */\n return (\n (event.pageY !== undefined ? event.pageY : event.touches[0].pageY) -\n this.el.nativeElement.getBoundingClientRect().top -\n window.pageYOffset\n );\n }\n}\n","// spell-checker:ignore Colorpicker\nimport {\n Directive,\n EventEmitter,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\n\nimport { SkyColorpickerChangeColor } from './types/colorpicker-color';\n\n/**\n * @internal\n */\n@Directive({\n selector: '[skyColorpickerText]',\n})\nexport class SkyColorpickerTextDirective {\n @Output()\n public newColorContrast = new EventEmitter<SkyColorpickerChangeColor>();\n @Input()\n public skyColorpickerText: any;\n @Input()\n public color: string;\n @Input()\n public maxRange: number;\n\n @HostListener('input', ['$event'])\n public changeInput(event: Event) {\n const element: HTMLInputElement = event.target as HTMLInputElement;\n const elementValue = parseFloat(element.value);\n if (this.maxRange === undefined) {\n this.newColorContrast.emit({\n color: element.value,\n colorValue: undefined,\n maxRange: undefined,\n } as SkyColorpickerChangeColor);\n }\n\n if (\n !isNaN(elementValue) &&\n elementValue >= 0 &&\n elementValue <= this.maxRange\n ) {\n this.newColorContrast.emit({\n color: this.color,\n colorValue: elementValue,\n maxRange: this.maxRange,\n } as SkyColorpickerChangeColor);\n }\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SliderDimension, SliderPosition } from './colorpicker-classes';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerChangeAxis } from './types/colorpicker-axis';\nimport { SkyColorpickerChangeColor } from './types/colorpicker-color';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerMessage } from './types/colorpicker-message';\nimport { SkyColorpickerMessageType } from './types/colorpicker-message-type';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerResult } from './types/colorpicker-result';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\nlet componentIdIndex = 0;\n\n/**\n * Provides a SKY UX-themed replacement for the HTML `input` element with `type=\"color\"`.\n * The value that users select is driven through the `ngModel` attribute specified on\n * the `input` element.\n */\n@Component({\n selector: 'sky-colorpicker',\n templateUrl: './colorpicker.component.html',\n styleUrls: ['./colorpicker.component.scss'],\n providers: [SkyColorpickerService],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyColorpickerComponent implements OnInit, OnDestroy {\n /**\n * Specifies the name of the [Font Awesome 4.7](https://fontawesome.com/v4.7/icons/) icon to overlay on top of the picker. Do not specify the `fa fa-` classes.\n * @internal\n */\n @Input()\n public pickerButtonIcon?: string;\n\n /**\n * Specifies the type of icon to display. Specifying `fa` will display a Font Awesome icon, while specifying `skyux` will display an icon from the custom SKY UX icon font. Note that the custom SKY UX icon font is currently in beta.\n * @internal\n */\n @Input()\n public pickerButtonIconType?: string = 'fa';\n\n /**\n * Specifies an ARIA label for the colorpicker. This sets the colorpicker's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/components/checkbox#accessibility)\n * when the colorpicker does not include a visible label. If the colorpicker includes a visible label, use `labelledBy` instead.\n * @default \"Select color value\"\n */\n @Input()\n public label: string;\n\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels the\n * colorpicker. This sets the colorpicker's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/components/checkbox#accessibility).\n * If the colorpicker does not include a visible label, use `label` instead.\n */\n @Input()\n public labelledBy: string;\n\n /**\n * Fires when users select a color in the colorpicker.\n */\n @Output()\n public selectedColorChanged = new EventEmitter<SkyColorpickerOutput>();\n\n /**\n * Fires when users select **Apply** in the colorpicker to apply a color.\n */\n @Output()\n public selectedColorApplied = new EventEmitter<SkyColorpickerResult>();\n\n /**\n * Provides an observable to send commands to the colorpicker. The commands should\n * respect the `SkyColorPickerMessage` type.\n */\n @Input()\n public messageStream = new Subject<SkyColorpickerMessage>();\n\n /**\n * Indicates whether to display a reset button to let users return to the default color.\n */\n @Input()\n public showResetButton = true;\n\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public idIndex: number;\n public skyColorpickerHexId: string;\n public skyColorpickerRedId: string;\n public skyColorpickerGreenId: string;\n public skyColorpickerBlueId: string;\n public skyColorpickerAlphaId: string;\n public alphaChannel: string;\n public allowTransparency: boolean;\n public alphaSliderColor: string;\n public arrowTop: number;\n public format: number;\n public hexText: string;\n public hslaText: SkyColorpickerHsla;\n public hueSliderColor: string;\n public outputFormat: string;\n public presetColors: Array<string>;\n public returnFormat: string;\n public rgbaText: SkyColorpickerRgba;\n public selectedColor: SkyColorpickerOutput;\n public slider: SliderPosition;\n public iconColor: string;\n public initialColor: string;\n public lastAppliedColor: string;\n public isPickerVisible: boolean;\n\n public set backgroundColorForDisplay(value: string) {\n this._backgroundColorForDisplay = value;\n if (this.pickerButtonIcon) {\n this.iconColor = this.getAccessibleIconColor(this.selectedColor);\n }\n }\n\n public get backgroundColorForDisplay(): string {\n /* istanbul ignore next */\n return this._backgroundColorForDisplay || '#fff';\n }\n\n public colorpickerId: string;\n\n public isOpen = false;\n\n public isVisible = true;\n\n public triggerButtonId: string;\n\n @ViewChild('colorpickerTemplateRef', {\n read: TemplateRef,\n })\n private colorpickerTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonRef', {\n read: ElementRef,\n })\n private triggerButtonRef: ElementRef;\n\n @ViewChild('colorpickerRef', {\n read: ElementRef,\n })\n private set colorpickerRef(value: ElementRef) {\n if (value) {\n this._colorpickerRef = value;\n this.destroyAffixer();\n\n this.removePickerEventListeners();\n this.pickerUnsubscribe = new Subject<void>();\n\n // Ensure the colorpicker has fully rendered before adding the affixer. Added to address a\n // race condition when running under production conditions.\n setTimeout(() => {\n this.createAffixer();\n this.isPickerVisible = true;\n\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n value,\n '.sky-colorpicker',\n false\n );\n this.changeDetector.markForCheck();\n });\n }\n }\n\n private get colorpickerRef(): ElementRef {\n return this._colorpickerRef;\n }\n\n private hsva: SkyColorpickerHsva;\n private sliderDimMax: SliderDimension;\n private ngUnsubscribe = new Subject();\n\n private affixer: SkyAffixer;\n\n private overlay: SkyOverlayInstance;\n\n private pickerUnsubscribe: Subject<void>;\n\n private _backgroundColorForDisplay: string;\n\n private _colorpickerRef: ElementRef;\n\n private _disabled = false;\n\n constructor(\n private affixService: SkyAffixService,\n private changeDetector: ChangeDetectorRef,\n private coreAdapter: SkyCoreAdapterService,\n private overlayService: SkyOverlayService,\n private service: SkyColorpickerService,\n @Optional() private themeSvc?: SkyThemeService\n ) {\n componentIdIndex++;\n\n this.idIndex = componentIdIndex;\n this.skyColorpickerRedId = 'sky-colorpicker-red-' + this.idIndex;\n this.skyColorpickerHexId = 'sky-colorpicker-hex-' + this.idIndex;\n this.skyColorpickerRedId = 'sky-colorpicker-red-' + this.idIndex;\n this.skyColorpickerGreenId = 'sky-colorpicker-green-' + this.idIndex;\n this.skyColorpickerBlueId = 'sky-colorpicker-blue-' + this.idIndex;\n this.skyColorpickerAlphaId = 'sky-colorpicker-alpha-' + this.idIndex;\n this.colorpickerId = `sky-colorpicker-${this.idIndex}`;\n this.triggerButtonId = `sky-colorpicker-button-${this.idIndex}`;\n }\n\n public setDialog(\n instance: any,\n elementRef: ElementRef,\n color: any,\n outputFormat: string,\n presetColors: Array<string>,\n alphaChannel: string,\n allowTransparency: boolean\n ): void {\n this.initialColor = color;\n this.outputFormat = outputFormat;\n this.presetColors = presetColors;\n this.alphaChannel = alphaChannel;\n this.allowTransparency = allowTransparency;\n\n if (this.outputFormat === 'rgba') {\n this.format = 1;\n } else if (this.outputFormat === 'hsla') {\n this.format = 2;\n } else {\n this.format = 0;\n }\n }\n\n public ngOnInit(): void {\n this.sliderDimMax = new SliderDimension(182, 270, 170, 182);\n this.slider = new SliderPosition(0, 0, 0, 0);\n this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyColorpickerMessage) => {\n this.handleIncomingMessages(message);\n });\n\n this.addTriggerButtonEventListeners();\n\n /* istanbul ignore else */\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((themeSettings) => {\n /* istanbul ignore next */\n const themeName = themeSettings.currentSettings?.theme?.name;\n\n // Hue/alpha slider bars have different widths in Modern theme.\n /* istanbul ignore if */\n if (themeName === 'modern') {\n this.sliderDimMax = new SliderDimension(174, 270, 170, 174);\n } else {\n this.sliderDimMax = new SliderDimension(182, 270, 170, 182);\n }\n this.updateSlider();\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.removePickerEventListeners();\n this.destroyAffixer();\n this.destroyOverlay();\n }\n\n public onTriggerButtonClick(): void {\n this.sendMessage(SkyColorpickerMessageType.Open);\n }\n\n public closePicker(): void {\n this.destroyAffixer();\n this.destroyOverlay();\n this.removePickerEventListeners();\n this.triggerButtonRef.nativeElement.focus();\n this.isOpen = false;\n }\n\n public onApplyColorClick(): void {\n this.selectedColorChanged.emit(this.selectedColor);\n this.selectedColorApplied.emit({ color: this.selectedColor });\n this.lastAppliedColor = this.selectedColor.rgbaText;\n this.updatePickerValues(this.lastAppliedColor);\n this.backgroundColorForDisplay = this.selectedColor.rgbaText;\n this.closePicker();\n }\n\n public onCancelClick(): void {\n // Revert picker values back to previous color.\n this.updatePickerValues(this.backgroundColorForDisplay);\n this.closePicker();\n }\n\n public onPresetClick(value: string): void {\n this.updatePickerValues(value);\n }\n\n public onResetClick(): void {\n this.sendMessage(SkyColorpickerMessageType.Reset);\n }\n\n public updatePickerValues(value: string): void {\n const hsva = this.getHsvaValue(value);\n if (hsva) {\n this.hsva = hsva;\n this.update();\n }\n }\n\n public set hue(change: SkyColorpickerChangeAxis) {\n this.hsva.hue = change.xCoordinate / change.maxRange;\n this.update();\n }\n\n public set red(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.red = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set green(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.green = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set blue(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.blue = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set alphaAxis(change: SkyColorpickerChangeAxis) {\n this.hsva.alpha = change.xCoordinate / change.maxRange;\n this.update();\n }\n\n public set alphaColor(change: SkyColorpickerChangeColor) {\n this.hsva.alpha = change.colorValue / change.maxRange;\n this.update();\n }\n\n public set hex(change: SkyColorpickerChangeColor) {\n this.updatePickerValues(change.color);\n }\n\n public set saturationAndLightness(value: SkyColorpickerChangeAxis) {\n this.hsva.saturation = value.xCoordinate / value.xAxis;\n this.hsva.value = value.yCoordinate / value.yAxis;\n this.update();\n }\n\n public update(): void {\n const hsla: SkyColorpickerHsla = this.service.hsva2hsla(this.hsva);\n const dHsla: SkyColorpickerHsla = this.service.denormalizeHSLA(hsla);\n const rgba: SkyColorpickerRgba = this.service.hsvaToRgba(this.hsva);\n const dRgba: SkyColorpickerRgba = this.service.denormalizeRGBA(rgba);\n\n const hsva: SkyColorpickerHsva = {\n hue: this.hsva.hue,\n saturation: 1,\n value: 1,\n alpha: 1,\n };\n\n const hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(hsva));\n\n this.hslaText = dHsla;\n this.rgbaText = dRgba;\n this.hexText = this.service.hexText(dRgba, this.alphaChannel === 'hex8');\n\n this.alphaSliderColor = `rgba(${dRgba.red},${dRgba.green},${dRgba.blue},${dRgba.alpha})`;\n this.hueSliderColor = `rgba(${hueRgba.red},${hueRgba.green},${hueRgba.blue},${rgba.alpha})`;\n\n if (\n this.format === 0 &&\n this.hsva.alpha < 1 &&\n this.alphaChannel === 'hex6'\n ) {\n this.format++;\n }\n\n this.service.outputFormat(\n this.hsva,\n this.outputFormat,\n this.alphaChannel === 'hex8'\n );\n this.selectedColor = this.service.skyColorpickerOut(this.hsva);\n\n this.updateSlider();\n }\n\n private updateSlider(): void {\n if (this.hsva && this.sliderDimMax) {\n this.slider = new SliderPosition(\n this.hsva.hue * this.sliderDimMax.hue - 8,\n this.hsva.saturation * this.sliderDimMax.saturation - 8,\n (1 - this.hsva.value) * this.sliderDimMax.value - 8,\n this.hsva.alpha * this.sliderDimMax.alpha - 8\n );\n }\n }\n\n private openPicker(): void {\n this.isPickerVisible = false;\n this.removePickerEventListeners();\n this.destroyOverlay();\n this.createOverlay();\n this.isOpen = true;\n }\n\n private sendMessage(type: SkyColorpickerMessageType) {\n this.messageStream.next({ type });\n }\n\n private handleIncomingMessages(message: SkyColorpickerMessage) {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyColorpickerMessageType.Open:\n if (!this.isOpen) {\n this.openPicker();\n }\n break;\n\n case SkyColorpickerMessageType.Close:\n if (this.isOpen) {\n this.closePicker();\n }\n break;\n\n case SkyColorpickerMessageType.Reset:\n this.updatePickerValues(this.initialColor);\n this.backgroundColorForDisplay = this.initialColor;\n this.selectedColorChanged.emit(this.selectedColor);\n this.selectedColorApplied.emit({ color: this.selectedColor });\n break;\n\n case SkyColorpickerMessageType.ToggleResetButton:\n this.showResetButton = !this.showResetButton;\n break;\n }\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(this.colorpickerRef);\n\n affixer.placementChange\n .pipe(takeUntil(this.pickerUnsubscribe))\n .subscribe((change) => {\n this.isPickerVisible = change.placement !== null;\n });\n\n affixer.affixTo(this.triggerButtonRef.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: 'left',\n isSticky: true,\n placement: 'below',\n });\n\n this.affixer = affixer;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private createOverlay(): void {\n const overlay = this.overlayService.create({\n enableClose: false,\n enablePointerEvents: false,\n enableScroll: true,\n });\n\n overlay.attachTemplate(this.colorpickerTemplateRef);\n\n this.overlay = overlay;\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private addTriggerButtonEventListeners(): void {\n fromEvent(window.document, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key?.toLowerCase();\n /* istanbul ignore else */\n if (key === 'escape') {\n this.sendMessage(SkyColorpickerMessageType.Close);\n }\n });\n }\n\n private removePickerEventListeners(): void {\n /* istanbul ignore else */\n if (this.pickerUnsubscribe) {\n this.pickerUnsubscribe.next();\n this.pickerUnsubscribe.complete();\n this.pickerUnsubscribe = undefined;\n }\n }\n\n private getHsvaValue(value: string): SkyColorpickerHsva {\n let hsva: SkyColorpickerHsva;\n\n if (this.alphaChannel === 'hex8') {\n hsva = this.service.stringToHsva(value, true);\n if (!hsva && !this.hsva) {\n hsva = this.service.stringToHsva(value, false);\n }\n } else {\n hsva = this.service.stringToHsva(value, false);\n }\n\n return hsva;\n }\n\n // http://www.w3.org/TR/AERT#color-contrast\n private getAccessibleIconColor(\n backgroundColor: SkyColorpickerOutput\n ): string {\n const rgb = backgroundColor.rgba;\n const brightness = Math.round(\n (rgb.red * 299 + rgb.green * 587 + rgb.blue * 114) / 1000\n );\n return brightness > 125 ? 'rgb(0, 0, 0)' : 'rgb(255, 255, 255)';\n }\n}\n","<div\n class=\"sky-input-group\"\n [ngClass]=\"{\n 'sky-colorpicker-hidden': !isVisible,\n 'sky-colorpicker-disabled': disabled\n }\"\n>\n <div [hidden]=\"true\">\n <ng-content></ng-content>\n </div>\n\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-colorpicker-button\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? colorpickerId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n label ||\n (labelledBy\n ? null\n : ('skyux_colorpicker_dropdown_button' | skyLibResources))\n \"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"\n label ||\n (labelledBy\n ? null\n : ('skyux_colorpicker_dropdown_button' | skyLibResources))\n \"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-colorpicker-button-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n [style.background-color]=\"backgroundColorForDisplay\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon\n *ngIf=\"pickerButtonIcon\"\n class=\"sky-colorpicker-button-icon\"\n [icon]=\"pickerButtonIcon\"\n [iconType]=\"pickerButtonIconType\"\n [size]=\"'1x'\"\n [style.color]=\"iconColor\"\n >\n </sky-icon>\n <ng-container *skyThemeIf=\"'modern'\">\n <sky-icon\n class=\"sky-colorpicker-button-modern-chevron\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n size=\"xs\"\n [ngClass]=\"{\n 'sky-colorpicker-button-modern-chevron-disabled': disabled\n }\"\n >\n </sky-icon>\n </ng-container>\n </button>\n\n <ng-template #colorpickerTemplateRef>\n <div\n class=\"sky-colorpicker-container\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"colorpickerId\"\n [hidden]=\"!isPickerVisible\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n #colorpickerRef\n >\n <div class=\"sky-colorpicker\">\n <div\n class=\"saturation-lightness\"\n [color]=\"slider.saturation - slider.value\"\n [skyColorpickerSlider]\n [style.background-color]=\"hueSliderColor\"\n [xAxis]=\"1\"\n [yAxis]=\"1\"\n (newColorContrast)=\"saturationAndLightness = $event\"\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.saturation\"\n [style.top.px]=\"slider.value\"\n ></div>\n </div>\n\n <div class=\"box\">\n <div class=\"left\">\n <div class=\"selected-color-background sky-rounded-circle\"></div>\n <div\n class=\"selected-color sky-rounded-circle\"\n [style.background-color]=\"selectedColor?.rgbaText\"\n ></div>\n </div>\n <div class=\"right\">\n <div\n class=\"hue\"\n [skyColorpickerSlider]\n [xAxis]=\"1\"\n (newColorContrast)=\"hue = $event\"\n #hueSlider\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.hue\"\n ></div>\n </div>\n <div\n *ngIf=\"this.allowTransparency\"\n class=\"alpha\"\n [skyColorpickerSlider]\n [style.background-color]=\"alphaSliderColor\"\n [xAxis]=\"1\"\n (newColorContrast)=\"alphaAxis = $event\"\n #alphaSlider\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.alpha\"\n ></div>\n </div>\n </div>\n </div>\n\n <div class=\"rgba-text\">\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"'skyux_colorpicker_aria_hex' | skyLibResources\"\n [attr.for]=\"skyColorpickerHexId\"\n >\n {{ 'skyux_colorpicker_hex' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n pattern=\"^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$\"\n [attr.id]=\"skyColorpickerHexId\"\n [skyColorpickerText]\n [value]=\"hexText\"\n (newColorContrast)=\"hex = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"'skyux_colorpicker_aria_red' | skyLibResources\"\n [attr.for]=\"skyColorpickerRedId\"\n >\n {{ 'skyux_colorpicker_red' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerRedId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.red\"\n (newColorContrast)=\"red = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_green' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerGreenId\"\n >\n {{ 'skyux_colorpicker_green' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerGreenId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.green\"\n (newColorContrast)=\"green = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_blue' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerBlueId\"\n >\n {{ 'skyux_colorpicker_blue' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerBlueId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.blue\"\n (newColorContrast)=\"blue = $event\"\n />\n </sky-input-box>\n <sky-input-box *ngIf=\"this.allowTransparency\">\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_alpha' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerAlphaId\"\n >\n {{ 'skyux_colorpicker_alpha' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"1\"\n min=\"0\"\n pattern=\"[0-9]+([\\.,][0-9]{1,2})?\"\n step=\"0.1\"\n type=\"number\"\n [attr.id]=\"skyColorpickerAlphaId\"\n [maxRange]=\"1\"\n [skyColorpickerText]\n [value]=\"rgbaText?.alpha\"\n (newColorContrast)=\"alphaColor = $event\"\n />\n </sky-input-box>\n </div>\n <div\n *ngIf=\"presetColors && presetColors.length\"\n class=\"sky-colorpicker-preset-color-area\"\n >\n <button\n *ngFor=\"let color of presetColors | slice: 0:12; let i = index\"\n type=\"button\"\n [attr.aria-label]=\"\n ('skyux_colorpicker_preset_color' | skyLibResources) + ' ' + color\n \"\n [skyThemeClass]=\"{\n 'sky-preset-color': 'default',\n 'sky-btn sky-btn-link': 'modern'\n }\"\n [style.backgroundColor]=\"color\"\n (click)=\"onPresetClick(color)\"\n ></button>\n </div>\n </div>\n\n <div\n class=\"sky-colorpicker-footer\"\n [skyThemeClass]=\"{\n 'sky-padding-even-large': 'default'\n }\"\n >\n <section class=\"sky-colorpicker-column\">\n <button\n class=\"sky-btn sky-btn-primary sky-btn-colorpicker-apply\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_apply' | skyLibResources\"\n [skyThemeClass]=\"{ 'sky-margin-inline-sm': 'modern' }\"\n (click)=\"onApplyColorClick()\"\n >\n {{ 'skyux_colorpicker_apply' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-btn-colorpicker-close\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_close' | skyLibResources\"\n (click)=\"onCancelClick()\"\n >\n {{ 'skyux_colorpicker_close' | skyLibResources }}\n </button>\n </section>\n </div>\n </div>\n </ng-template>\n <span\n *ngIf=\"allowTransparency\"\n aria-hidden=\"true\"\n class=\"sky-colorpicker-checkered-background\"\n >\n </span>\n\n <button\n *ngIf=\"showResetButton\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_reset' | skyLibResources\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-colorpicker-reset-button-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-colorpicker-reset-button': 'default',\n 'sky-btn sky-btn-icon-borderless sky-colorpicker-reset-button-modern':\n 'modern'\n }\"\n (click)=\"onResetClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"times\" size=\"sm\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"trash\" iconType=\"skyux\" size=\"lg\">\n </sky-icon>\n </button>\n</div>\n","import {\n Directive,\n ElementRef,\n HostListener,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n NgControl,\n Validator,\n} from '@angular/forms';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subscription } from 'rxjs';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_COLORPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n\nconst SKY_COLORPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n// tslint:enable\nconst SKY_COLORPICKER_DEFAULT_COLOR = '#FFFFFF';\n\n/**\n * Creates the colorpicker element and dropdown.\n */\n@Directive({\n selector: '[skyColorpickerInput]',\n providers: [SKY_COLORPICKER_VALUE_ACCESSOR, SKY_COLORPICKER_VALIDATOR],\n})\nexport class SkyColorpickerInputDirective\n implements OnInit, OnChanges, ControlValueAccessor, Validator, OnDestroy\n{\n public pickerChangedSubscription: Subscription;\n\n /**\n * Creates the colorpicker element and dropdown. Place this attribute on an `input` element\n * or `button` element, wrap the element in a `sky-colorpicker` component, and set the attribute\n * to the instance of the `sky-colorpicker` component.\n * @required\n */\n @Input()\n public skyColorpickerInput: SkyColorpickerComponent;\n\n /**\n * Specifies an initial color to load in the colorpicker. Use a reactive or\n * template-driven form to set this value. This property is deprecated. As an alternative,\n * we recommend the `formControlName` property on reactive forms or `ngModel` on\n * template-driven forms. See the demo for examples.\n * @deprecated\n */\n @Input()\n public set initialColor(value: string) {\n /* istanbul ignore else */\n if (!this._initialColor && !this.modelValue) {\n this.writeValue(value);\n }\n this._initialColor = value;\n }\n\n public get initialColor(): string {\n return this._initialColor || SKY_COLORPICKER_DEFAULT_COLOR;\n }\n\n /**\n * This property is deprecated and does not affect the colorpicker.\n * We recommend against using it.\n * @deprecated\n * @default \"rgba\"\n */\n @Input()\n public returnFormat = 'rgba';\n\n /**\n * Specifies the format to use for the color when the colorpicker uses a native input\n * element such as a standard text input or a button. This property accepts `rgba`, `hex`,\n * or `hsla`, but we do not recommend using it because users never see or use its value.\n * Instead, if you need to access this format value, see the demo for an example.\n *@default \"rgba\"\n */\n @Input()\n public outputFormat = 'rgba';\n\n /**\n * Specifies an array of colors to load as preset choices. The colorpicker displays the\n * colors in a series of 12 boxes for users to select.\n */\n @Input()\n public presetColors = ['#333', '#888', '#EFEFEF', '#FFF'];\n\n /**\n * Specifies the type of transparency to use in the transparency slider.\n *@default \"hex6\"\n */\n @Input()\n public alphaChannel = 'hex6';\n\n /**\n * Indicates whether to display a transparency slider for users to select transparency\n * levels.\n */\n @Input()\n public allowTransparency = true;\n\n private _disabled: boolean;\n private _initialColor: string;\n private modelValue: SkyColorpickerOutput;\n\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private service: SkyColorpickerService,\n private resourcesService: SkyLibResourcesService,\n private injector: Injector\n ) {}\n\n @HostListener('input', ['$event'])\n public changeInput(event: any) {\n const value = event.target.value;\n this.skyColorpickerInput.updatePickerValues(value);\n this.skyColorpickerInput.backgroundColorForDisplay = value;\n }\n\n @HostListener('change', ['$event'])\n public onChange(event: any) {\n const newValue = event.target.value;\n this.modelValue = this.formatter(newValue);\n this._validatorChange();\n this._onChange(this.modelValue);\n this.writeModelValue(this.modelValue);\n }\n\n /* istanbul ignore next */\n @HostListener('blur')\n public onBlur() {\n /*istanbul ignore next */\n this._onTouched();\n }\n\n public ngOnInit() {\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n this.skyColorpickerInput.initialColor = this.initialColor;\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n\n this.pickerChangedSubscription =\n this.skyColorpickerInput.selectedColorChanged.subscribe(\n (newColor: SkyColorpickerOutput) => {\n /* istanbul ignore else */\n if (newColor) {\n this.modelValue = this.formatter(newColor);\n this.writeModelValue(this.modelValue);\n }\n this._onChange(newColor);\n }\n );\n\n this.skyColorpickerInput.updatePickerValues(this.initialColor);\n\n /* Sanity check */\n /* istanbul ignore else */\n if (!this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = this.initialColor;\n }\n\n /// Set aria-label as default, if not set\n if (!element.getAttribute('aria-label')) {\n this.renderer.setAttribute(\n element,\n 'aria-label',\n this.getString('skyux_colorpicker_input_default_label')\n );\n }\n\n const typeAttr = element.getAttribute('type');\n if (typeAttr && typeAttr === 'hidden') {\n this.skyColorpickerInput.isVisible = false;\n } else {\n this.skyColorpickerInput.isVisible = true;\n }\n\n element.setAttribute('readonly', 'true');\n this.renderer.addClass(element, 'sky-colorpicker-input');\n }\n\n public ngOnDestroy() {\n this.pickerChangedSubscription.unsubscribe();\n }\n\n public setColorPickerDefaults() {\n this.skyColorpickerInput.setDialog(\n this,\n this.elementRef,\n this.initialColor,\n this.outputFormat,\n this.presetColors,\n this.alphaChannel,\n this.allowTransparency\n );\n }\n\n public ngOnChanges(): void {\n this._validatorChange();\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n this.setColorPickerDefaults();\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n public registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n public registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n public writeValue(value: any) {\n if (\n this.skyColorpickerInput &&\n value &&\n value !== this.skyColorpickerInput.lastAppliedColor\n ) {\n this.modelValue = this.formatter(value);\n this.writeModelValue(this.modelValue);\n\n if (!this._initialColor) {\n this._initialColor = value;\n this.skyColorpickerInput.initialColor = value;\n }\n this.skyColorpickerInput.lastAppliedColor = value;\n const control: FormControl = this.injector.get<NgControl>(NgControl)\n .control as FormControl;\n if (control) {\n control.setValue(this.modelValue, { emitEvent: false });\n }\n }\n }\n\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n if (!value) {\n return;\n }\n // Validation\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean): void {\n this._disabled = isDisabled;\n this.skyColorpickerInput.disabled = isDisabled;\n if (this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = '#fff';\n } else {\n this.skyColorpickerInput.backgroundColorForDisplay = this.modelValue.hex;\n }\n }\n\n private writeModelValue(model: SkyColorpickerOutput) {\n const setElementValue = model.rgbaText;\n const element = this.elementRef.nativeElement;\n\n let output: string;\n // tslint:disable-next-line:switch-default\n switch (this.outputFormat) {\n case 'rgba':\n output = model.rgbaText;\n break;\n\n case 'hsla':\n output = model.hslaText;\n break;\n\n case 'cmyk':\n output = model.cmykText;\n break;\n\n case 'hex':\n output = model.hex;\n break;\n }\n\n this.skyColorpickerInput.updatePickerValues(output);\n this.skyColorpickerInput.backgroundColorForDisplay = output;\n\n this.renderer.setStyle(element, 'background-color', setElementValue);\n this.renderer.setProperty(element, 'value', output);\n }\n\n private formatter(color: any) {\n if (color && typeof color !== 'string') {\n return color;\n }\n\n let formatColor: SkyColorpickerOutput;\n const hsva: SkyColorpickerHsva = this.service.stringToHsva(\n color,\n this.alphaChannel === 'hex8'\n );\n\n formatColor = this.service.skyColorpickerOut(hsva);\n\n return formatColor;\n }\n\n private getString(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);\n }\n\n /*istanbul ignore next */\n private _onChange = (_: any) => {};\n /*istanbul ignore next */\n private _onTouched = () => {};\n private _validatorChange = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyColorpickerResourcesModule } from '../shared/sky-colorpicker-resources.module';\n\nimport { SkyColorpickerInputDirective } from './colorpicker-input.directive';\nimport { SkyColorpickerSliderDirective } from './colorpicker-slider.directive';\nimport { SkyColorpickerTextDirective } from './colorpicker-text.directive';\nimport { SkyColorpickerComponent } from './colorpicker.component';\n\n@NgModule({\n declarations: [\n SkyColorpickerComponent,\n SkyColorpickerInputDirective,\n SkyColorpickerTextDirective,\n SkyColorpickerSliderDirective,\n ],\n imports: [\n CommonModule,\n SkyAffixModule,\n SkyColorpickerResourcesModule,\n SkyI18nModule,\n SkyIconModule,\n SkyInputBoxModule,\n SkyOverlayModule,\n SkyThemeModule,\n ],\n exports: [SkyColorpickerComponent, SkyColorpickerInputDirective],\n entryComponents: [SkyColorpickerComponent],\n})\nexport class SkyColorpickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;AAgBA,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,uBAAuB,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC7C,4BAA4B,EAAE;YAC5B,OAAO,EAAE,qCAAqC;SAC/C;QACD,2BAA2B,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;QACxE,4BAA4B,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE;QAC1E,0BAA0B,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;QACjE,0BAA0B,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;QACtE,sBAAsB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACzC,uBAAuB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9C,iCAAiC,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACpE,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,qBAAqB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1C,qCAAqC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QACjE,8BAA8B,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QAC5D,qBAAqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACxC,uBAAuB,EAA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;sBADtB,KAAK;gBAoBC,YAAY;sBADlB,KAAK;gBAWC,YAAY;sBADlB,KAAK;gBAQC,YAAY;sBADlB,KAAK;gBAQC,YAAY;sBADlB,KAAK;gBAQC,iBAAiB;sBADvB,KAAK;gBAgBC,WAAW;sBADjB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;gBAQ1B,QAAQ;sBADd,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBAW3B,MAAM;sBADZ,YAAY;uBAAC,MAAM;;;MCxHT,oBAAoB;;kHAApB,oBAAoB;mHAApB,oBAAoB,iBAlB7B,uBAAuB;QACvB,4BAA4B;QAC5B,2BAA2B;QAC3B,6BAA6B,aAG7B,YAAY;QACZ,cAAc;QACd,6BAA6B;QAC7B,aAAa;QACb,aAAa;QACb,iBAAiB;QACjB,gBAAgB;QAChB,cAAc,aAEN,uBAAuB,EAAE,4BAA4B;mHAGpD,oBAAoB,YAbtB;YACP,YAAY;YACZ,cAAc;YACd,6BAA6B;YAC7B,aAAa;YACb,aAAa;YACb,iBAAiB;YACjB,gBAAgB;YAChB,cAAc;SACf;4FAIU,oBAAoB;kBApBhC,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,uBAAuB;wBACvB,4BAA4B;wBAC5B,2BAA2B;wBAC3B,6BAA6B;qBAC9B;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,6BAA6B;wBAC7B,aAAa;wBACb,aAAa;wBACb,iBAAiB;wBACjB,gBAAgB;wBAChB,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;oBAChE,eAAe,EAAE,CAAC,uBAAuB,CAAC;iBAC3C;;;AClCD;;;;;;"}
1
+ {"version":3,"file":"skyux-colorpicker.js","sources":["../../../../../libs/components/colorpicker/src/lib/modules/shared/sky-colorpicker-resources.module.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-classes.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.service.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/types/colorpicker-message-type.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-slider.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-text.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.html","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-input.directive.ts","../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.module.ts","../../../../../libs/components/colorpicker/src/skyux-colorpicker.ts"],"sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-colorpicker' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_colorpicker_alpha: { message: 'A:' },\n skyux_colorpicker_apply: { message: 'Apply' },\n skyux_colorpicker_aria_alpha: {\n message: 'Alpha channel value between 0 and 1',\n },\n skyux_colorpicker_aria_blue: { message: 'Blue value between 0 and 255' },\n skyux_colorpicker_aria_green: { message: 'Green value between 0 and 255' },\n skyux_colorpicker_aria_hex: { message: 'Hexadecimal color code' },\n skyux_colorpicker_aria_red: { message: 'Red value between 0 and 255' },\n skyux_colorpicker_blue: { message: 'B:' },\n skyux_colorpicker_close: { message: 'Cancel' },\n skyux_colorpicker_dropdown_button: { message: 'Select color value' },\n skyux_colorpicker_green: { message: 'G:' },\n skyux_colorpicker_hex: { message: 'Hex:' },\n skyux_colorpicker_input_default_label: { message: 'Color value' },\n skyux_colorpicker_preset_color: { message: 'Preset Color:' },\n skyux_colorpicker_red: { message: 'R:' },\n skyux_colorpicker_reset: { message: 'Reset color value to white' },\n },\n};\n\nexport class SkyColorpickerResourcesProvider\n implements SkyLibResourcesProvider\n{\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyColorpickerResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyColorpickerResourcesModule {}\n","// spell-checker:ignore colorpicker\n\n/**\n * @internal\n */\nexport class SliderPosition {\n constructor(\n public hue: number,\n public saturation: number,\n public value: number,\n public alpha: number\n ) {}\n}\n/**\n * @internal\n */\nexport class SliderDimension {\n constructor(\n public hue: number,\n public saturation: number,\n public value: number,\n public alpha: number\n ) {}\n}\n","// spell-checker:ignore hsva, hsla, cmyk, denormalize, colorpicker,Injectable\nimport { Injectable } from '@angular/core';\n\nimport { SkyColorpickerCmyk } from './types/colorpicker-cmyk';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyColorpickerService {\n public hsla2hsva(hsla: SkyColorpickerHsla): SkyColorpickerHsva {\n const alpha: number = Math.min(hsla.alpha, 1);\n const hue: number = Math.min(hsla.hue, 1);\n const lightness: number = Math.min(hsla.lightness, 1);\n const saturation: number = Math.min(hsla.saturation, 1);\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: lightness,\n alpha: alpha,\n };\n if (lightness === 0) {\n hsva.saturation = 0;\n hsva.value = 0;\n } else {\n hsva.value =\n lightness + (saturation * (1 - Math.abs(2 * lightness - 1))) / 2;\n hsva.saturation = (2 * (hsva.value - lightness)) / hsva.value;\n }\n return hsva;\n }\n\n public hsva2hsla(hsva: SkyColorpickerHsva): SkyColorpickerHsla {\n const alpha: number = hsva.alpha;\n const hue: number = hsva.hue;\n const saturation: number = hsva.saturation;\n const value: number = hsva.value;\n\n const hsla: SkyColorpickerHsla = {\n hue: hue,\n saturation: saturation,\n lightness: value,\n alpha: alpha,\n };\n if (value === 0) {\n hsla.lightness = 0;\n hsla.saturation = 0;\n } else {\n hsla.lightness = (value * (2 - saturation)) / 2;\n hsla.saturation =\n (value * saturation) / (1 - Math.abs(2 * hsla.lightness - 1));\n }\n return hsla;\n }\n\n public rgbaToHsva(rgba: SkyColorpickerRgba): SkyColorpickerHsva {\n const red: number = Math.min(rgba.red, 1);\n const green: number = Math.min(rgba.green, 1);\n const blue: number = Math.min(rgba.blue, 1);\n const alpha: number = Math.min(rgba.alpha, 1);\n const max: number = Math.max(red, green, blue);\n const min: number = Math.min(red, green, blue);\n const value: number = max;\n const d = max - min;\n const saturation: number = max === 0 ? 0 : d / max;\n let hue = 0;\n let maxValue: { [key: number]: number };\n if (max !== min) {\n maxValue = {\n [red]: (green - blue) / d + (green < blue ? 6 : 0),\n [green]: (blue - red) / d + 2,\n [blue]: (red - green) / d + 4,\n };\n hue = maxValue[max];\n hue /= 6;\n }\n const hsva: SkyColorpickerHsva = {\n hue: hue,\n saturation: saturation,\n value: value,\n alpha: alpha,\n };\n return hsva;\n }\n\n public rgbaToCmyk(rgba: SkyColorpickerRgba): SkyColorpickerCmyk {\n const cmyk: SkyColorpickerCmyk = { cyan: 0, magenta: 0, yellow: 0, key: 0 };\n const key: number = 1 - Math.max(rgba.red, rgba.green, rgba.blue);\n\n if (key === 1) {\n cmyk.key = 1;\n return cmyk;\n }\n cmyk.cyan = (1 - rgba.red - key) / (1 - key);\n cmyk.magenta = (1 - rgba.green - key) / (1 - key);\n cmyk.yellow = (1 - rgba.blue - key) / (1 - key);\n cmyk.key = key;\n return cmyk;\n }\n\n public hsvaToRgba(hsva: SkyColorpickerHsva): SkyColorpickerRgba {\n let red = 0;\n let green = 0;\n let blue = 0;\n const hue = hsva.hue;\n const saturation = hsva.saturation;\n const value = hsva.value;\n const alpha = hsva.alpha || hsva.alpha === 0 ? hsva.alpha : 1;\n const i = Math.floor(hue * 6);\n const f = hue * 6 - i;\n const p = value * (1 - saturation);\n const q = value * (1 - f * saturation);\n const t = value * (1 - (1 - f) * saturation);\n const color: { [key: number]: any } = {\n 0: (): void => {\n red = value;\n green = t;\n blue = p;\n },\n 1: (): void => {\n red = q;\n green = value;\n blue = p;\n },\n 2: (): void => {\n red = p;\n green = value;\n blue = t;\n },\n 3: (): void => {\n red = p;\n green = q;\n blue = value;\n },\n 4: (): void => {\n red = t;\n green = p;\n blue = value;\n },\n 5: (): void => {\n red = value;\n green = p;\n blue = q;\n },\n };\n color[i % 6]();\n\n const rgba: SkyColorpickerRgba = {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n return rgba;\n }\n\n public stringToHsva(colorString: string, hex8: boolean): SkyColorpickerHsva {\n const stringParsers = [\n {\n // tslint:disable max-line-length\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: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[2], 0) / 255,\n green: parseInt(execResult[3], 0) / 255,\n blue: parseInt(execResult[4], 0) / 255,\n alpha: parseFloat(execResult[5]),\n };\n return rgba;\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: (execResult: any) => {\n const hsla: SkyColorpickerHsla = {\n hue: parseInt(execResult[2], 0) / 360,\n saturation: parseInt(execResult[3], 0) / 100,\n lightness: parseInt(execResult[4], 0) / 100,\n alpha: parseFloat(execResult[5]),\n };\n return hsla;\n // tslint:enable max-line-length\n },\n },\n ];\n if (hex8) {\n stringParsers.push({\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: parseInt(execResult[4], 16) / 255,\n };\n return rgba;\n },\n });\n } else {\n stringParsers.push(\n {\n re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1], 16) / 255,\n green: parseInt(execResult[2], 16) / 255,\n blue: parseInt(execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n },\n {\n re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,\n parse: (execResult: any) => {\n const rgba: SkyColorpickerRgba = {\n red: parseInt(execResult[1] + execResult[1], 16) / 255,\n green: parseInt(execResult[2] + execResult[2], 16) / 255,\n blue: parseInt(execResult[3] + execResult[3], 16) / 255,\n alpha: 1,\n };\n return rgba;\n },\n }\n );\n }\n\n let hsva: SkyColorpickerHsva = undefined;\n for (const key in stringParsers) {\n /* istanbul ignore else */ /* for in must be filtered by an if */\n if (Object.prototype.hasOwnProperty.call(stringParsers, key)) {\n const parser = stringParsers[key];\n const match = parser.re.exec(colorString);\n const color: any = match && parser.parse(match);\n if (color) {\n if ('red' in color) {\n hsva = this.rgbaToHsva(color);\n }\n if ('hue' in color) {\n hsva = this.hsla2hsva(color);\n }\n\n return hsva;\n }\n }\n }\n return hsva;\n }\n\n public outputFormat(\n hsva: SkyColorpickerHsva,\n outputFormat: string,\n allowHex8: boolean\n ): string {\n if (['hsla', 'hex', 'cmyk'].indexOf(outputFormat) === -1) {\n outputFormat = 'rgba';\n }\n const color: { [key: string]: any } = {\n hsla: () => {\n const hsla = this.denormalizeHSLA(this.hsva2hsla(hsva));\n return `hsla(${hsla.hue},${hsla.saturation}%,${hsla.lightness}%,${hsla.alpha})`;\n },\n hex: () => {\n return this.hexText(\n this.denormalizeRGBA(this.hsvaToRgba(hsva)),\n allowHex8\n );\n },\n cmyk: () => {\n const cmyk = this.denormalizeCMYK(\n this.rgbaToCmyk(this.hsvaToRgba(hsva))\n );\n return `cmyk(${cmyk.cyan}%,${cmyk.magenta}%,${cmyk.yellow}%,${cmyk.key}%)`;\n },\n rgba: () => {\n const rgba = this.denormalizeRGBA(this.hsvaToRgba(hsva));\n return `rgba(${rgba.red},${rgba.green},${rgba.blue},${rgba.alpha})`;\n },\n };\n\n return color[outputFormat]();\n }\n\n public skyColorpickerOut(color: SkyColorpickerHsva) {\n const cmykText: string = this.outputFormat(color, 'cmyk', true);\n const hslaText: string = this.outputFormat(color, 'hsla', true);\n const rgbaText: string = this.outputFormat(color, 'rgba', true);\n const rgba: SkyColorpickerRgba = this.hsvaToRgba(color);\n const hsla: SkyColorpickerHsla = this.hsva2hsla(color);\n const cmyk: SkyColorpickerCmyk = this.rgbaToCmyk(rgba);\n const hex: string = this.outputFormat(color, 'hex', false);\n\n const formatColor: SkyColorpickerOutput = {\n cmykText: cmykText,\n hslaText: hslaText,\n rgbaText: rgbaText,\n hsva: this.denormalizeHSVA(color),\n rgba: this.denormalizeRGBA(rgba),\n hsla: this.denormalizeHSLA(hsla),\n cmyk: this.denormalizeCMYK(cmyk),\n hex: hex,\n };\n\n return formatColor;\n }\n\n public hexText(rgba: SkyColorpickerRgba, allowHex8: boolean): string {\n // tslint:disable no-bitwise\n let hexText =\n '#' +\n ((1 << 24) | (rgba.red << 16) | (rgba.green << 8) | rgba.blue)\n .toString(16)\n .substr(1);\n if (\n hexText[1] === hexText[2] &&\n hexText[3] === hexText[4] &&\n hexText[5] === hexText[6] &&\n rgba.alpha === 1 &&\n !allowHex8\n ) {\n hexText = '#' + hexText[1] + hexText[3] + hexText[5];\n }\n if (allowHex8) {\n hexText += ((1 << 8) | Math.round(rgba.alpha * 255))\n .toString(16)\n .substr(1);\n }\n return hexText;\n // tslint:enable no-bitwise\n }\n\n public denormalizeRGBA(rgba: SkyColorpickerRgba): SkyColorpickerRgba {\n const denormalizeRgba: SkyColorpickerRgba = {\n red: Math.round(rgba.red * 255),\n green: Math.round(rgba.green * 255),\n blue: Math.round(rgba.blue * 255),\n alpha: Math.round(rgba.alpha * 100) / 100,\n };\n return denormalizeRgba;\n }\n\n public denormalizeHSLA(hsla: SkyColorpickerHsla): SkyColorpickerHsla {\n const denormalizeHsla: SkyColorpickerHsla = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n lightness: Math.round(hsla.lightness * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsla;\n }\n\n public denormalizeHSVA(hsla: SkyColorpickerHsva): SkyColorpickerHsva {\n const denormalizeHsva: SkyColorpickerHsva = {\n hue: Math.round(hsla.hue * 360),\n saturation: Math.round(hsla.saturation * 100),\n value: Math.round(hsla.value * 100),\n alpha: Math.round(hsla.alpha * 100) / 100,\n };\n return denormalizeHsva;\n }\n\n public denormalizeCMYK(cmyk: SkyColorpickerCmyk): SkyColorpickerCmyk {\n const denormalizeCmyk: SkyColorpickerCmyk = {\n cyan: Math.round(cmyk.cyan * 100),\n magenta: Math.round(cmyk.magenta * 100),\n yellow: Math.round(cmyk.yellow * 100),\n key: Math.round(cmyk.key * 100),\n };\n return denormalizeCmyk;\n }\n}\n","/**\n * Specifies the commands to provide the colorpicker.\n */\nexport enum SkyColorpickerMessageType {\n /**\n * Opens the colorpicker.\n */\n Open = 0,\n /**\n * Resets the selection in the colorpicker.\n */\n Reset = 1,\n /**\n * Toggles whether to display a reset button beside the colorpicker.\n */\n ToggleResetButton = 2,\n /**\n * Closes the colorpicker.\n */\n Close = 3,\n}\n","// spell-checker:ignore Colorpicker\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\n\nimport { SkyColorpickerChangeAxis } from './types/colorpicker-axis';\n\n/**\n * @internal\n */\n@Directive({\n selector: '[skyColorpickerSlider]',\n})\nexport class SkyColorpickerSliderDirective {\n @Output()\n public newColorContrast = new EventEmitter<SkyColorpickerChangeAxis>();\n @Input()\n public skyColorpickerSlider: string;\n @Input()\n public color: string;\n @Input()\n public xAxis: number;\n @Input()\n public yAxis: number;\n\n private listenerMove: any;\n private listenerStop: any;\n\n constructor(private el: ElementRef) {\n this.listenerMove = (event: any) => {\n this.move(event);\n };\n this.listenerStop = () => {\n this.stop();\n };\n }\n\n public setCursor(event: any) {\n const height = this.el.nativeElement.offsetHeight;\n const width = this.el.nativeElement.offsetWidth;\n const xAxis = Math.max(0, Math.min(this.getX(event), width));\n const yAxis = Math.max(0, Math.min(this.getY(event), height));\n if (this.xAxis !== undefined && this.yAxis !== undefined) {\n this.newColorContrast.emit({\n xCoordinate: xAxis / width,\n yCoordinate: 1 - yAxis / height,\n xAxis: this.xAxis,\n yAxis: this.yAxis,\n } as SkyColorpickerChangeAxis);\n } else {\n this.newColorContrast.emit({\n xCoordinate: xAxis / width,\n maxRange: this.xAxis,\n } as SkyColorpickerChangeAxis);\n }\n /* // No vertical bars\n if (this.xAxis === undefined && this.yAxis !== undefined) {\n this.newColorContrast.emit({ yCoordinate: yAxis / height, maxRange: this.yAxis });\n } */\n }\n\n public move(event: any) {\n event.preventDefault();\n this.setCursor(event);\n }\n @HostListener('touchstart', ['$event'])\n @HostListener('mousedown', ['$event'])\n public start(event: MouseEvent) {\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 public 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 public getX(event: any): number {\n /* Ignoring event.touches as tests are not run on a touch device. */\n /* istanbul ignore next */\n return (\n (event.pageX !== undefined ? event.pageX : event.touches[0].pageX) -\n this.el.nativeElement.getBoundingClientRect().left -\n window.pageXOffset\n );\n }\n public getY(event: any): number {\n /* Ignoring event.touches as tests are not run on a touch device. */\n /* istanbul ignore next */\n return (\n (event.pageY !== undefined ? event.pageY : event.touches[0].pageY) -\n this.el.nativeElement.getBoundingClientRect().top -\n window.pageYOffset\n );\n }\n}\n","// spell-checker:ignore Colorpicker\nimport {\n Directive,\n EventEmitter,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\n\nimport { SkyColorpickerChangeColor } from './types/colorpicker-color';\n\n/**\n * @internal\n */\n@Directive({\n selector: '[skyColorpickerText]',\n})\nexport class SkyColorpickerTextDirective {\n @Output()\n public newColorContrast = new EventEmitter<SkyColorpickerChangeColor>();\n @Input()\n public skyColorpickerText: any;\n @Input()\n public color: string;\n @Input()\n public maxRange: number;\n\n @HostListener('input', ['$event'])\n public changeInput(event: Event) {\n const element: HTMLInputElement = event.target as HTMLInputElement;\n const elementValue = parseFloat(element.value);\n if (this.maxRange === undefined) {\n this.newColorContrast.emit({\n color: element.value,\n colorValue: undefined,\n maxRange: undefined,\n } as SkyColorpickerChangeColor);\n }\n\n if (\n !isNaN(elementValue) &&\n elementValue >= 0 &&\n elementValue <= this.maxRange\n ) {\n this.newColorContrast.emit({\n color: this.color,\n colorValue: elementValue,\n maxRange: this.maxRange,\n } as SkyColorpickerChangeColor);\n }\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SliderDimension, SliderPosition } from './colorpicker-classes';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerChangeAxis } from './types/colorpicker-axis';\nimport { SkyColorpickerChangeColor } from './types/colorpicker-color';\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerMessage } from './types/colorpicker-message';\nimport { SkyColorpickerMessageType } from './types/colorpicker-message-type';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\nimport { SkyColorpickerResult } from './types/colorpicker-result';\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\nlet componentIdIndex = 0;\n\n/**\n * Provides a SKY UX-themed replacement for the HTML `input` element with `type=\"color\"`.\n * The value that users select is driven through the `ngModel` attribute specified on\n * the `input` element.\n */\n@Component({\n selector: 'sky-colorpicker',\n templateUrl: './colorpicker.component.html',\n styleUrls: ['./colorpicker.component.scss'],\n providers: [SkyColorpickerService],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyColorpickerComponent implements OnInit, OnDestroy {\n /**\n * Specifies the name of the [Font Awesome 4.7](https://fontawesome.com/v4.7/icons/) icon to overlay on top of the picker. Do not specify the `fa fa-` classes.\n * @internal\n */\n @Input()\n public pickerButtonIcon?: string;\n\n /**\n * Specifies the type of icon to display. Specifying `fa` will display a Font Awesome icon, while specifying `skyux` will display an icon from the custom SKY UX icon font. Note that the custom SKY UX icon font is currently in beta.\n * @internal\n */\n @Input()\n public pickerButtonIconType?: string = 'fa';\n\n /**\n * Specifies an ARIA label for the colorpicker. This sets the colorpicker's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/components/checkbox#accessibility)\n * when the colorpicker does not include a visible label. If the colorpicker includes a visible label, use `labelledBy` instead.\n * @default \"Select color value\"\n */\n @Input()\n public label: string;\n\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels the\n * colorpicker. This sets the colorpicker's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/components/checkbox#accessibility).\n * If the colorpicker does not include a visible label, use `label` instead.\n */\n @Input()\n public labelledBy: string;\n\n /**\n * Fires when users select a color in the colorpicker.\n */\n @Output()\n public selectedColorChanged = new EventEmitter<SkyColorpickerOutput>();\n\n /**\n * Fires when users select **Apply** in the colorpicker to apply a color.\n */\n @Output()\n public selectedColorApplied = new EventEmitter<SkyColorpickerResult>();\n\n /**\n * Provides an observable to send commands to the colorpicker. The commands should\n * respect the `SkyColorPickerMessage` type.\n */\n @Input()\n public messageStream = new Subject<SkyColorpickerMessage>();\n\n /**\n * Indicates whether to display a reset button to let users return to the default color.\n */\n @Input()\n public showResetButton = true;\n\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public idIndex: number;\n public skyColorpickerHexId: string;\n public skyColorpickerRedId: string;\n public skyColorpickerGreenId: string;\n public skyColorpickerBlueId: string;\n public skyColorpickerAlphaId: string;\n public alphaChannel: string;\n public allowTransparency: boolean;\n public alphaSliderColor: string;\n public arrowTop: number;\n public format: number;\n public hexText: string;\n public hslaText: SkyColorpickerHsla;\n public hueSliderColor: string;\n public outputFormat: string;\n public presetColors: Array<string>;\n public returnFormat: string;\n public rgbaText: SkyColorpickerRgba;\n public selectedColor: SkyColorpickerOutput;\n public slider: SliderPosition;\n public iconColor: string;\n public initialColor: string;\n public lastAppliedColor: string;\n public isPickerVisible: boolean;\n\n public set backgroundColorForDisplay(value: string) {\n this._backgroundColorForDisplay = value;\n if (this.pickerButtonIcon) {\n this.iconColor = this.getAccessibleIconColor(this.selectedColor);\n }\n }\n\n public get backgroundColorForDisplay(): string {\n /* istanbul ignore next */\n return this._backgroundColorForDisplay || '#fff';\n }\n\n public colorpickerId: string;\n\n public isOpen = false;\n\n public isVisible = true;\n\n public triggerButtonId: string;\n\n @ViewChild('colorpickerTemplateRef', {\n read: TemplateRef,\n })\n private colorpickerTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonRef', {\n read: ElementRef,\n })\n private triggerButtonRef: ElementRef;\n\n @ViewChild('colorpickerRef', {\n read: ElementRef,\n })\n private set colorpickerRef(value: ElementRef) {\n if (value) {\n this._colorpickerRef = value;\n this.destroyAffixer();\n\n this.removePickerEventListeners();\n this.pickerUnsubscribe = new Subject<void>();\n\n // Ensure the colorpicker has fully rendered before adding the affixer. Added to address a\n // race condition when running under production conditions.\n setTimeout(() => {\n this.createAffixer();\n this.isPickerVisible = true;\n\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n value,\n '.sky-colorpicker',\n false\n );\n this.changeDetector.markForCheck();\n });\n }\n }\n\n private get colorpickerRef(): ElementRef {\n return this._colorpickerRef;\n }\n\n private hsva: SkyColorpickerHsva;\n private sliderDimMax: SliderDimension;\n private ngUnsubscribe = new Subject();\n\n private affixer: SkyAffixer;\n\n private overlay: SkyOverlayInstance;\n\n private pickerUnsubscribe: Subject<void>;\n\n private _backgroundColorForDisplay: string;\n\n private _colorpickerRef: ElementRef;\n\n private _disabled = false;\n\n constructor(\n private affixService: SkyAffixService,\n private changeDetector: ChangeDetectorRef,\n private coreAdapter: SkyCoreAdapterService,\n private overlayService: SkyOverlayService,\n private service: SkyColorpickerService,\n @Optional() private themeSvc?: SkyThemeService\n ) {\n componentIdIndex++;\n\n this.idIndex = componentIdIndex;\n this.skyColorpickerRedId = 'sky-colorpicker-red-' + this.idIndex;\n this.skyColorpickerHexId = 'sky-colorpicker-hex-' + this.idIndex;\n this.skyColorpickerRedId = 'sky-colorpicker-red-' + this.idIndex;\n this.skyColorpickerGreenId = 'sky-colorpicker-green-' + this.idIndex;\n this.skyColorpickerBlueId = 'sky-colorpicker-blue-' + this.idIndex;\n this.skyColorpickerAlphaId = 'sky-colorpicker-alpha-' + this.idIndex;\n this.colorpickerId = `sky-colorpicker-${this.idIndex}`;\n this.triggerButtonId = `sky-colorpicker-button-${this.idIndex}`;\n }\n\n public setDialog(\n instance: any,\n elementRef: ElementRef,\n color: any,\n outputFormat: string,\n presetColors: Array<string>,\n alphaChannel: string,\n allowTransparency: boolean\n ): void {\n this.initialColor = color;\n this.outputFormat = outputFormat;\n this.presetColors = presetColors;\n this.alphaChannel = alphaChannel;\n this.allowTransparency = allowTransparency;\n\n if (this.outputFormat === 'rgba') {\n this.format = 1;\n } else if (this.outputFormat === 'hsla') {\n this.format = 2;\n } else {\n this.format = 0;\n }\n }\n\n public ngOnInit(): void {\n this.sliderDimMax = new SliderDimension(182, 270, 170, 182);\n this.slider = new SliderPosition(0, 0, 0, 0);\n this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyColorpickerMessage) => {\n this.handleIncomingMessages(message);\n });\n\n this.addTriggerButtonEventListeners();\n\n /* istanbul ignore else */\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((themeSettings) => {\n /* istanbul ignore next */\n const themeName = themeSettings.currentSettings?.theme?.name;\n\n // Hue/alpha slider bars have different widths in Modern theme.\n /* istanbul ignore if */\n if (themeName === 'modern') {\n this.sliderDimMax = new SliderDimension(174, 270, 170, 174);\n } else {\n this.sliderDimMax = new SliderDimension(182, 270, 170, 182);\n }\n this.updateSlider();\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.removePickerEventListeners();\n this.destroyAffixer();\n this.destroyOverlay();\n }\n\n public onTriggerButtonClick(): void {\n this.sendMessage(SkyColorpickerMessageType.Open);\n }\n\n public closePicker(): void {\n this.destroyAffixer();\n this.destroyOverlay();\n this.removePickerEventListeners();\n this.triggerButtonRef.nativeElement.focus();\n this.isOpen = false;\n }\n\n public onApplyColorClick(): void {\n this.selectedColorChanged.emit(this.selectedColor);\n this.selectedColorApplied.emit({ color: this.selectedColor });\n this.lastAppliedColor = this.selectedColor.rgbaText;\n this.updatePickerValues(this.lastAppliedColor);\n this.backgroundColorForDisplay = this.selectedColor.rgbaText;\n this.closePicker();\n }\n\n public onCancelClick(): void {\n // Revert picker values back to previous color.\n this.updatePickerValues(this.backgroundColorForDisplay);\n this.closePicker();\n }\n\n public onPresetClick(value: string): void {\n this.updatePickerValues(value);\n }\n\n public onResetClick(): void {\n this.sendMessage(SkyColorpickerMessageType.Reset);\n }\n\n public updatePickerValues(value: string): void {\n const hsva = this.getHsvaValue(value);\n if (hsva) {\n this.hsva = hsva;\n this.update();\n }\n }\n\n public set hue(change: SkyColorpickerChangeAxis) {\n this.hsva.hue = change.xCoordinate / change.maxRange;\n this.update();\n }\n\n public set red(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.red = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set green(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.green = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set blue(change: SkyColorpickerChangeColor) {\n const rgba = this.service.hsvaToRgba(this.hsva);\n rgba.blue = change.colorValue / change.maxRange;\n this.hsva = this.service.rgbaToHsva(rgba);\n this.update();\n }\n\n public set alphaAxis(change: SkyColorpickerChangeAxis) {\n this.hsva.alpha = change.xCoordinate / change.maxRange;\n this.update();\n }\n\n public set alphaColor(change: SkyColorpickerChangeColor) {\n this.hsva.alpha = change.colorValue / change.maxRange;\n this.update();\n }\n\n public set hex(change: SkyColorpickerChangeColor) {\n this.updatePickerValues(change.color);\n }\n\n public set saturationAndLightness(value: SkyColorpickerChangeAxis) {\n this.hsva.saturation = value.xCoordinate / value.xAxis;\n this.hsva.value = value.yCoordinate / value.yAxis;\n this.update();\n }\n\n public update(): void {\n const hsla: SkyColorpickerHsla = this.service.hsva2hsla(this.hsva);\n const dHsla: SkyColorpickerHsla = this.service.denormalizeHSLA(hsla);\n const rgba: SkyColorpickerRgba = this.service.hsvaToRgba(this.hsva);\n const dRgba: SkyColorpickerRgba = this.service.denormalizeRGBA(rgba);\n\n const hsva: SkyColorpickerHsva = {\n hue: this.hsva.hue,\n saturation: 1,\n value: 1,\n alpha: 1,\n };\n\n const hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(hsva));\n\n this.hslaText = dHsla;\n this.rgbaText = dRgba;\n this.hexText = this.service.hexText(dRgba, this.alphaChannel === 'hex8');\n\n this.alphaSliderColor = `rgba(${dRgba.red},${dRgba.green},${dRgba.blue},${dRgba.alpha})`;\n this.hueSliderColor = `rgba(${hueRgba.red},${hueRgba.green},${hueRgba.blue},${rgba.alpha})`;\n\n if (\n this.format === 0 &&\n this.hsva.alpha < 1 &&\n this.alphaChannel === 'hex6'\n ) {\n this.format++;\n }\n\n this.service.outputFormat(\n this.hsva,\n this.outputFormat,\n this.alphaChannel === 'hex8'\n );\n this.selectedColor = this.service.skyColorpickerOut(this.hsva);\n\n this.updateSlider();\n }\n\n private updateSlider(): void {\n if (this.hsva && this.sliderDimMax) {\n this.slider = new SliderPosition(\n this.hsva.hue * this.sliderDimMax.hue - 8,\n this.hsva.saturation * this.sliderDimMax.saturation - 8,\n (1 - this.hsva.value) * this.sliderDimMax.value - 8,\n this.hsva.alpha * this.sliderDimMax.alpha - 8\n );\n }\n }\n\n private openPicker(): void {\n this.isPickerVisible = false;\n this.removePickerEventListeners();\n this.destroyOverlay();\n this.createOverlay();\n this.isOpen = true;\n }\n\n private sendMessage(type: SkyColorpickerMessageType) {\n this.messageStream.next({ type });\n }\n\n private handleIncomingMessages(message: SkyColorpickerMessage) {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyColorpickerMessageType.Open:\n if (!this.isOpen) {\n this.openPicker();\n }\n break;\n\n case SkyColorpickerMessageType.Close:\n if (this.isOpen) {\n this.closePicker();\n }\n break;\n\n case SkyColorpickerMessageType.Reset:\n this.updatePickerValues(this.initialColor);\n this.backgroundColorForDisplay = this.initialColor;\n this.selectedColorChanged.emit(this.selectedColor);\n this.selectedColorApplied.emit({ color: this.selectedColor });\n break;\n\n case SkyColorpickerMessageType.ToggleResetButton:\n this.showResetButton = !this.showResetButton;\n break;\n }\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(this.colorpickerRef);\n\n affixer.placementChange\n .pipe(takeUntil(this.pickerUnsubscribe))\n .subscribe((change) => {\n this.isPickerVisible = change.placement !== null;\n });\n\n affixer.affixTo(this.triggerButtonRef.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: 'left',\n isSticky: true,\n placement: 'below',\n });\n\n this.affixer = affixer;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private createOverlay(): void {\n const overlay = this.overlayService.create({\n enableClose: false,\n enablePointerEvents: false,\n enableScroll: true,\n });\n\n overlay.attachTemplate(this.colorpickerTemplateRef);\n\n this.overlay = overlay;\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private addTriggerButtonEventListeners(): void {\n fromEvent(window.document, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key?.toLowerCase();\n /* istanbul ignore else */\n if (key === 'escape') {\n this.sendMessage(SkyColorpickerMessageType.Close);\n }\n });\n }\n\n private removePickerEventListeners(): void {\n /* istanbul ignore else */\n if (this.pickerUnsubscribe) {\n this.pickerUnsubscribe.next();\n this.pickerUnsubscribe.complete();\n this.pickerUnsubscribe = undefined;\n }\n }\n\n private getHsvaValue(value: string): SkyColorpickerHsva {\n let hsva: SkyColorpickerHsva;\n\n if (this.alphaChannel === 'hex8') {\n hsva = this.service.stringToHsva(value, true);\n if (!hsva && !this.hsva) {\n hsva = this.service.stringToHsva(value, false);\n }\n } else {\n hsva = this.service.stringToHsva(value, false);\n }\n\n return hsva;\n }\n\n // http://www.w3.org/TR/AERT#color-contrast\n private getAccessibleIconColor(\n backgroundColor: SkyColorpickerOutput\n ): string {\n const rgb = backgroundColor.rgba;\n const brightness = Math.round(\n (rgb.red * 299 + rgb.green * 587 + rgb.blue * 114) / 1000\n );\n return brightness > 125 ? 'rgb(0, 0, 0)' : 'rgb(255, 255, 255)';\n }\n}\n","<div\n class=\"sky-input-group\"\n [ngClass]=\"{\n 'sky-colorpicker-hidden': !isVisible,\n 'sky-colorpicker-disabled': disabled\n }\"\n>\n <div [hidden]=\"true\">\n <ng-content></ng-content>\n </div>\n\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-colorpicker-button\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? colorpickerId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n label ||\n (labelledBy\n ? null\n : ('skyux_colorpicker_dropdown_button' | skyLibResources))\n \"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"\n label ||\n (labelledBy\n ? null\n : ('skyux_colorpicker_dropdown_button' | skyLibResources))\n \"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-colorpicker-button-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n [style.background-color]=\"backgroundColorForDisplay\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon\n *ngIf=\"pickerButtonIcon\"\n class=\"sky-colorpicker-button-icon\"\n [icon]=\"pickerButtonIcon\"\n [iconType]=\"pickerButtonIconType\"\n [size]=\"'1x'\"\n [style.color]=\"iconColor\"\n >\n </sky-icon>\n <ng-container *skyThemeIf=\"'modern'\">\n <sky-icon\n class=\"sky-colorpicker-button-modern-chevron\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n size=\"xs\"\n [ngClass]=\"{\n 'sky-colorpicker-button-modern-chevron-disabled': disabled\n }\"\n >\n </sky-icon>\n </ng-container>\n </button>\n\n <ng-template #colorpickerTemplateRef>\n <div\n class=\"sky-colorpicker-container\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"colorpickerId\"\n [hidden]=\"!isPickerVisible\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n #colorpickerRef\n >\n <div class=\"sky-colorpicker\">\n <div\n class=\"saturation-lightness\"\n [color]=\"slider.saturation - slider.value\"\n [skyColorpickerSlider]\n [style.background-color]=\"hueSliderColor\"\n [xAxis]=\"1\"\n [yAxis]=\"1\"\n (newColorContrast)=\"saturationAndLightness = $event\"\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.saturation\"\n [style.top.px]=\"slider.value\"\n ></div>\n </div>\n\n <div class=\"box\">\n <div class=\"left\">\n <div class=\"selected-color-background sky-rounded-circle\"></div>\n <div\n class=\"selected-color sky-rounded-circle\"\n [style.background-color]=\"selectedColor?.rgbaText\"\n ></div>\n </div>\n <div class=\"right\">\n <div\n class=\"hue\"\n [skyColorpickerSlider]\n [xAxis]=\"1\"\n (newColorContrast)=\"hue = $event\"\n #hueSlider\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.hue\"\n ></div>\n </div>\n <div\n *ngIf=\"this.allowTransparency\"\n class=\"alpha\"\n [skyColorpickerSlider]\n [style.background-color]=\"alphaSliderColor\"\n [xAxis]=\"1\"\n (newColorContrast)=\"alphaAxis = $event\"\n #alphaSlider\n >\n <div\n class=\"cursor sky-rounded-circle\"\n [style.left.px]=\"slider.alpha\"\n ></div>\n </div>\n </div>\n </div>\n\n <div class=\"rgba-text\">\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"'skyux_colorpicker_aria_hex' | skyLibResources\"\n [attr.for]=\"skyColorpickerHexId\"\n >\n {{ 'skyux_colorpicker_hex' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n pattern=\"^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$\"\n [attr.id]=\"skyColorpickerHexId\"\n [skyColorpickerText]\n [value]=\"hexText\"\n (newColorContrast)=\"hex = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"'skyux_colorpicker_aria_red' | skyLibResources\"\n [attr.for]=\"skyColorpickerRedId\"\n >\n {{ 'skyux_colorpicker_red' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerRedId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.red\"\n (newColorContrast)=\"red = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_green' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerGreenId\"\n >\n {{ 'skyux_colorpicker_green' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerGreenId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.green\"\n (newColorContrast)=\"green = $event\"\n />\n </sky-input-box>\n <sky-input-box>\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_blue' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerBlueId\"\n >\n {{ 'skyux_colorpicker_blue' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"255\"\n min=\"0\"\n pattern=\"[0-9]*\"\n type=\"number\"\n [attr.id]=\"skyColorpickerBlueId\"\n [maxRange]=\"255\"\n [skyColorpickerText]\n [value]=\"rgbaText?.blue\"\n (newColorContrast)=\"blue = $event\"\n />\n </sky-input-box>\n <sky-input-box *ngIf=\"this.allowTransparency\">\n <label\n class=\"sky-control-label\"\n [attr.aria-label]=\"\n 'skyux_colorpicker_aria_alpha' | skyLibResources\n \"\n [attr.for]=\"skyColorpickerAlphaId\"\n >\n {{ 'skyux_colorpicker_alpha' | skyLibResources }}\n </label>\n <input\n class=\"sky-form-control\"\n max=\"1\"\n min=\"0\"\n pattern=\"[0-9]+([\\.,][0-9]{1,2})?\"\n step=\"0.1\"\n type=\"number\"\n [attr.id]=\"skyColorpickerAlphaId\"\n [maxRange]=\"1\"\n [skyColorpickerText]\n [value]=\"rgbaText?.alpha\"\n (newColorContrast)=\"alphaColor = $event\"\n />\n </sky-input-box>\n </div>\n <div\n *ngIf=\"presetColors && presetColors.length\"\n class=\"sky-colorpicker-preset-color-area\"\n >\n <button\n *ngFor=\"let color of presetColors | slice: 0:12; let i = index\"\n type=\"button\"\n [attr.aria-label]=\"\n ('skyux_colorpicker_preset_color' | skyLibResources) + ' ' + color\n \"\n [skyThemeClass]=\"{\n 'sky-preset-color': 'default',\n 'sky-btn sky-btn-link': 'modern'\n }\"\n [style.backgroundColor]=\"color\"\n (click)=\"onPresetClick(color)\"\n ></button>\n </div>\n </div>\n\n <div\n class=\"sky-colorpicker-footer\"\n [skyThemeClass]=\"{\n 'sky-padding-even-large': 'default'\n }\"\n >\n <section class=\"sky-colorpicker-column\">\n <button\n class=\"sky-btn sky-btn-primary sky-btn-colorpicker-apply\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_apply' | skyLibResources\"\n [skyThemeClass]=\"{ 'sky-margin-inline-sm': 'modern' }\"\n (click)=\"onApplyColorClick()\"\n >\n {{ 'skyux_colorpicker_apply' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-btn-colorpicker-close\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_close' | skyLibResources\"\n (click)=\"onCancelClick()\"\n >\n {{ 'skyux_colorpicker_close' | skyLibResources }}\n </button>\n </section>\n </div>\n </div>\n </ng-template>\n <span\n *ngIf=\"allowTransparency\"\n aria-hidden=\"true\"\n class=\"sky-colorpicker-checkered-background\"\n >\n </span>\n\n <button\n *ngIf=\"showResetButton\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_colorpicker_reset' | skyLibResources\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-colorpicker-reset-button-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-colorpicker-reset-button': 'default',\n 'sky-btn sky-btn-icon-borderless sky-colorpicker-reset-button-modern':\n 'modern'\n }\"\n (click)=\"onResetClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"times\" size=\"sm\"> </sky-icon>\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"trash\" iconType=\"skyux\" size=\"lg\">\n </sky-icon>\n </button>\n</div>\n","import {\n Directive,\n ElementRef,\n HostListener,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n NgControl,\n Validator,\n} from '@angular/forms';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subscription } from 'rxjs';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\nimport { SkyColorpickerService } from './colorpicker.service';\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_COLORPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n\nconst SKY_COLORPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyColorpickerInputDirective),\n multi: true,\n};\n// tslint:enable\nconst SKY_COLORPICKER_DEFAULT_COLOR = '#FFFFFF';\n\n/**\n * Creates the colorpicker element and dropdown.\n */\n@Directive({\n selector: '[skyColorpickerInput]',\n providers: [SKY_COLORPICKER_VALUE_ACCESSOR, SKY_COLORPICKER_VALIDATOR],\n})\nexport class SkyColorpickerInputDirective\n implements OnInit, OnChanges, ControlValueAccessor, Validator, OnDestroy\n{\n public pickerChangedSubscription: Subscription;\n\n /**\n * Creates the colorpicker element and dropdown. Place this attribute on an `input` element\n * or `button` element, wrap the element in a `sky-colorpicker` component, and set the attribute\n * to the instance of the `sky-colorpicker` component.\n * @required\n */\n @Input()\n public skyColorpickerInput: SkyColorpickerComponent;\n\n /**\n * Specifies an initial color to load in the colorpicker. Use a reactive or\n * template-driven form to set this value. This property is deprecated. As an alternative,\n * we recommend the `formControlName` property on reactive forms or `ngModel` on\n * template-driven forms. See the demo for examples.\n * @deprecated\n */\n @Input()\n public set initialColor(value: string) {\n /* istanbul ignore else */\n if (!this._initialColor && !this.modelValue) {\n this.writeValue(value);\n }\n this._initialColor = value;\n }\n\n public get initialColor(): string {\n return this._initialColor || SKY_COLORPICKER_DEFAULT_COLOR;\n }\n\n /**\n * This property is deprecated and does not affect the colorpicker.\n * We recommend against using it.\n * @deprecated\n * @default \"rgba\"\n */\n @Input()\n public returnFormat = 'rgba';\n\n /**\n * Specifies the format to use for the color when the colorpicker uses a native input\n * element such as a standard text input or a button. This property accepts `rgba`, `hex`,\n * or `hsla`, but we do not recommend using it because users never see or use its value.\n * Instead, if you need to access this format value, see the demo for an example.\n *@default \"rgba\"\n */\n @Input()\n public outputFormat = 'rgba';\n\n /**\n * Specifies an array of colors to load as preset choices. The colorpicker displays the\n * colors in a series of 12 boxes for users to select.\n */\n @Input()\n public presetColors = ['#333', '#888', '#EFEFEF', '#FFF'];\n\n /**\n * Specifies the type of transparency to use in the transparency slider.\n *@default \"hex6\"\n */\n @Input()\n public alphaChannel = 'hex6';\n\n /**\n * Indicates whether to display a transparency slider for users to select transparency\n * levels.\n */\n @Input()\n public allowTransparency = true;\n\n private _disabled: boolean;\n private _initialColor: string;\n private modelValue: SkyColorpickerOutput;\n\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private service: SkyColorpickerService,\n private resourcesService: SkyLibResourcesService,\n private injector: Injector\n ) {}\n\n @HostListener('input', ['$event'])\n public changeInput(event: any) {\n const value = event.target.value;\n this.skyColorpickerInput.updatePickerValues(value);\n this.skyColorpickerInput.backgroundColorForDisplay = value;\n }\n\n @HostListener('change', ['$event'])\n public onChange(event: any) {\n const newValue = event.target.value;\n this.modelValue = this.formatter(newValue);\n this._validatorChange();\n this._onChange(this.modelValue);\n this.writeModelValue(this.modelValue);\n }\n\n /* istanbul ignore next */\n @HostListener('blur')\n public onBlur() {\n /*istanbul ignore next */\n this._onTouched();\n }\n\n public ngOnInit() {\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n this.skyColorpickerInput.initialColor = this.initialColor;\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n\n this.pickerChangedSubscription =\n this.skyColorpickerInput.selectedColorChanged.subscribe(\n (newColor: SkyColorpickerOutput) => {\n /* istanbul ignore else */\n if (newColor) {\n this.modelValue = this.formatter(newColor);\n this.writeModelValue(this.modelValue);\n }\n this._onChange(newColor);\n }\n );\n\n this.skyColorpickerInput.updatePickerValues(this.initialColor);\n\n /* Sanity check */\n /* istanbul ignore else */\n if (!this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = this.initialColor;\n }\n\n /// Set aria-label as default, if not set\n if (!element.getAttribute('aria-label')) {\n this.renderer.setAttribute(\n element,\n 'aria-label',\n this.getString('skyux_colorpicker_input_default_label')\n );\n }\n\n const typeAttr = element.getAttribute('type');\n if (typeAttr && typeAttr === 'hidden') {\n this.skyColorpickerInput.isVisible = false;\n } else {\n this.skyColorpickerInput.isVisible = true;\n }\n\n element.setAttribute('readonly', 'true');\n this.renderer.addClass(element, 'sky-colorpicker-input');\n }\n\n public ngOnDestroy() {\n this.pickerChangedSubscription.unsubscribe();\n }\n\n public setColorPickerDefaults() {\n this.skyColorpickerInput.setDialog(\n this,\n this.elementRef,\n this.initialColor,\n this.outputFormat,\n this.presetColors,\n this.alphaChannel,\n this.allowTransparency\n );\n }\n\n public ngOnChanges(): void {\n this._validatorChange();\n this.skyColorpickerInput.returnFormat = this.returnFormat;\n this.setColorPickerDefaults();\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this._onChange = fn;\n }\n public registerOnTouched(fn: () => any): void {\n this._onTouched = fn;\n }\n public registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n public writeValue(value: any) {\n if (\n this.skyColorpickerInput &&\n value &&\n value !== this.skyColorpickerInput.lastAppliedColor\n ) {\n this.modelValue = this.formatter(value);\n this.writeModelValue(this.modelValue);\n\n if (!this._initialColor) {\n this._initialColor = value;\n this.skyColorpickerInput.initialColor = value;\n }\n this.skyColorpickerInput.lastAppliedColor = value;\n const control: FormControl = this.injector.get<NgControl>(NgControl)\n .control as FormControl;\n if (control) {\n control.setValue(this.modelValue, { emitEvent: false });\n }\n }\n }\n\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n if (!value) {\n return;\n }\n // Validation\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean): void {\n this._disabled = isDisabled;\n this.skyColorpickerInput.disabled = isDisabled;\n if (this._disabled) {\n this.skyColorpickerInput.backgroundColorForDisplay = '#fff';\n } else {\n this.skyColorpickerInput.backgroundColorForDisplay = this.modelValue.hex;\n }\n }\n\n private writeModelValue(model: SkyColorpickerOutput) {\n const setElementValue = model.rgbaText;\n const element = this.elementRef.nativeElement;\n\n let output: string;\n // tslint:disable-next-line:switch-default\n switch (this.outputFormat) {\n case 'rgba':\n output = model.rgbaText;\n break;\n\n case 'hsla':\n output = model.hslaText;\n break;\n\n case 'cmyk':\n output = model.cmykText;\n break;\n\n case 'hex':\n output = model.hex;\n break;\n }\n\n this.skyColorpickerInput.updatePickerValues(output);\n this.skyColorpickerInput.backgroundColorForDisplay = output;\n\n this.renderer.setStyle(element, 'background-color', setElementValue);\n this.renderer.setProperty(element, 'value', output);\n }\n\n private formatter(color: any) {\n if (color && typeof color !== 'string') {\n return color;\n }\n\n const hsva: SkyColorpickerHsva = this.service.stringToHsva(\n color,\n this.alphaChannel === 'hex8'\n );\n\n const formatColor = this.service.skyColorpickerOut(hsva);\n\n return formatColor;\n }\n\n private getString(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onChange = (_: any) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onTouched = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _validatorChange = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyColorpickerResourcesModule } from '../shared/sky-colorpicker-resources.module';\n\nimport { SkyColorpickerInputDirective } from './colorpicker-input.directive';\nimport { SkyColorpickerSliderDirective } from './colorpicker-slider.directive';\nimport { SkyColorpickerTextDirective } from './colorpicker-text.directive';\nimport { SkyColorpickerComponent } from './colorpicker.component';\n\n@NgModule({\n declarations: [\n SkyColorpickerComponent,\n SkyColorpickerInputDirective,\n SkyColorpickerTextDirective,\n SkyColorpickerSliderDirective,\n ],\n imports: [\n CommonModule,\n SkyAffixModule,\n SkyColorpickerResourcesModule,\n SkyI18nModule,\n SkyIconModule,\n SkyInputBoxModule,\n SkyOverlayModule,\n SkyThemeModule,\n ],\n exports: [SkyColorpickerComponent, SkyColorpickerInputDirective],\n entryComponents: [SkyColorpickerComponent],\n})\nexport class SkyColorpickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;AAgBA,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,uBAAuB,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC7C,4BAA4B,EAAE;YAC5B,OAAO,EAAE,qCAAqC;SAC/C;QACD,2BAA2B,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;QACxE,4BAA4B,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE;QAC1E,0BAA0B,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;QACjE,0BAA0B,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;QACtE,sBAAsB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACzC,uBAAuB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9C,iCAAiC,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACpE,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC1C,qBAAqB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1C,qCAAqC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QACjE,8BAA8B,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QAC5D,qBAAqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACxC,uBAAuB,EAAE,EAAE,OAAO,EAAE,4BAA4B,EAAE;KACnE;CACF,CAAC;MAEW,+BAA+B;IAGnC,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM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Q;sBADd,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBAW3B,MAAM;sBADZ,YAAY;uBAAC,MAAM;;;MCxHT,oBAAoB;;kHAApB,oBAAoB;mHAApB,oBAAoB,iBAlB7B,uBAAuB;QACvB,4BAA4B;QAC5B,2BAA2B;QAC3B,6BAA6B,aAG7B,YAAY;QACZ,cAAc;QACd,6BAA6B;QAC7B,aAAa;QACb,aAAa;QACb,iBAAiB;QACjB,gBAAgB;QAChB,cAAc,aAEN,uBAAuB,EAAE,4BAA4B;mHAGpD,oBAAoB,YAbtB;YACP,YAAY;YACZ,cAAc;YACd,6BAA6B;YAC7B,aAAa;YACb,aAAa;YACb,iBAAiB;YACjB,gBAAgB;YAChB,cAAc;SACf;4FAIU,oBAAoB;kBApBhC,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,uBAAuB;wBACvB,4BAA4B;wBAC5B,2BAA2B;wBAC3B,6BAA6B;qBAC9B;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,6BAA6B;wBAC7B,aAAa;wBACb,aAAa;wBACb,iBAAiB;wBACjB,gBAAgB;wBAChB,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;oBAChE,eAAe,EAAE,CAAC,uBAAuB,CAAC;iBAC3C;;;AClCD;;;;;;"}
@@ -8,7 +8,6 @@ import * as i0 from "@angular/core";
8
8
  * @internal
9
9
  */
10
10
  export declare class SkyColorpickerService {
11
- constructor();
12
11
  hsla2hsva(hsla: SkyColorpickerHsla): SkyColorpickerHsva;
13
12
  hsva2hsla(hsva: SkyColorpickerHsva): SkyColorpickerHsla;
14
13
  rgbaToHsva(rgba: SkyColorpickerRgba): SkyColorpickerHsva;
@@ -2,9 +2,7 @@ import { SkyAppLocaleInfo, SkyLibResourcesProvider } from '@skyux/i18n';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@skyux/i18n";
4
4
  export declare class SkyColorpickerResourcesProvider implements SkyLibResourcesProvider {
5
- getString(localeInfo: SkyAppLocaleInfo, name: string): string;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<SkyColorpickerResourcesProvider, never>;
7
- static ɵprov: i0.ɵɵInjectableDeclaration<SkyColorpickerResourcesProvider>;
5
+ getString(localeInfo: SkyAppLocaleInfo, name: string): string | undefined;
8
6
  }
9
7
  /**
10
8
  * Import into any component library module that needs to use resource strings.
package/package.json CHANGED
@@ -1,19 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/colorpicker",
3
- "version": "5.6.0",
4
- "peerDependencies": {
5
- "@angular/common": "^12.2.16",
6
- "@angular/core": "^12.2.16",
7
- "@angular/forms": "^12.2.16",
8
- "@skyux/core": "5.6.0",
9
- "@skyux/forms": "5.6.0",
10
- "@skyux/i18n": "5.6.0",
11
- "@skyux/indicators": "5.6.0",
12
- "@skyux/theme": "5.6.0"
13
- },
14
- "dependencies": {
15
- "tslib": "^2.3.1"
16
- },
3
+ "version": "5.7.0",
17
4
  "author": "Blackbaud, Inc.",
18
5
  "keywords": [
19
6
  "blackbaud",
@@ -28,6 +15,21 @@
28
15
  "url": "https://github.com/blackbaud/skyux/issues"
29
16
  },
30
17
  "homepage": "https://github.com/blackbaud/skyux#readme",
18
+ "peerDependencies": {
19
+ "@angular/common": "^12.2.16",
20
+ "@angular/core": "^12.2.16",
21
+ "@angular/forms": "^12.2.16",
22
+ "@angular/platform-browser": "^12.2.16",
23
+ "@skyux-sdk/testing": "5.7.0",
24
+ "@skyux/core": "5.7.0",
25
+ "@skyux/forms": "5.7.0",
26
+ "@skyux/i18n": "5.7.0",
27
+ "@skyux/indicators": "5.7.0",
28
+ "@skyux/theme": "5.7.0"
29
+ },
30
+ "dependencies": {
31
+ "tslib": "^2.3.1"
32
+ },
31
33
  "main": "bundles/skyux-colorpicker.umd.js",
32
34
  "module": "fesm2015/skyux-colorpicker.js",
33
35
  "es2015": "fesm2015/skyux-colorpicker.js",