@skyux/colorpicker 5.5.0 → 5.6.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.
Files changed (25) hide show
  1. package/bundles/skyux-colorpicker.umd.js +387 -387
  2. package/documentation.json +87 -87
  3. package/esm2015/lib/modules/colorpicker/colorpicker-input.directive.js +5 -5
  4. package/esm2015/lib/modules/colorpicker/colorpicker-input.directive.js.map +1 -1
  5. package/esm2015/lib/modules/colorpicker/colorpicker-slider.directive.js +5 -5
  6. package/esm2015/lib/modules/colorpicker/colorpicker-slider.directive.js.map +1 -1
  7. package/esm2015/lib/modules/colorpicker/colorpicker-text.directive.js +3 -3
  8. package/esm2015/lib/modules/colorpicker/colorpicker-text.directive.js.map +1 -1
  9. package/esm2015/lib/modules/colorpicker/colorpicker.component.js +13 -13
  10. package/esm2015/lib/modules/colorpicker/colorpicker.component.js.map +1 -1
  11. package/esm2015/lib/modules/colorpicker/colorpicker.module.js +1 -1
  12. package/esm2015/lib/modules/colorpicker/colorpicker.module.js.map +1 -1
  13. package/esm2015/lib/modules/colorpicker/colorpicker.service.js +19 -19
  14. package/esm2015/lib/modules/colorpicker/colorpicker.service.js.map +1 -1
  15. package/esm2015/lib/modules/colorpicker/types/colorpicker-result.js.map +1 -1
  16. package/esm2015/lib/modules/shared/sky-colorpicker-resources.module.js +2 -2
  17. package/esm2015/lib/modules/shared/sky-colorpicker-resources.module.js.map +1 -1
  18. package/esm2015/testing/colorpicker-fixture.js.map +1 -1
  19. package/fesm2015/skyux-colorpicker-testing.js.map +1 -1
  20. package/fesm2015/skyux-colorpicker.js +79 -79
  21. package/fesm2015/skyux-colorpicker.js.map +1 -1
  22. package/lib/modules/colorpicker/colorpicker-input.directive.d.ts +1 -1
  23. package/lib/modules/colorpicker/colorpicker.component.d.ts +4 -4
  24. package/lib/modules/colorpicker/colorpicker.service.d.ts +1 -1
  25. package/package.json +6 -6
@@ -1,8 +1,8 @@
1
- import { Directive, ElementRef, forwardRef, HostListener, Injector, Input, Renderer2, } from '@angular/core';
1
+ import { Directive, ElementRef, HostListener, Injector, Input, Renderer2, forwardRef, } from '@angular/core';
2
2
  import { NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, } from '@angular/forms';
3
3
  import { SkyLibResourcesService } from '@skyux/i18n';
4
- import { SkyColorpickerService } from './colorpicker.service';
5
4
  import { SkyColorpickerComponent } from './colorpicker.component';
5
+ import { SkyColorpickerService } from './colorpicker.service';
6
6
  import * as i0 from "@angular/core";
7
7
  import * as i1 from "./colorpicker.service";
8
8
  import * as i2 from "@skyux/i18n";
@@ -164,7 +164,7 @@ export class SkyColorpickerInputDirective {
164
164
  this.skyColorpickerInput.initialColor = value;
165
165
  }
166
166
  this.skyColorpickerInput.lastAppliedColor = value;
167
- let control = this.injector.get(NgControl)
167
+ const control = this.injector.get(NgControl)
168
168
  .control;
169
169
  if (control) {
170
170
  control.setValue(this.modelValue, { emitEvent: false });
@@ -172,7 +172,7 @@ export class SkyColorpickerInputDirective {
172
172
  }
173
173
  }
174
174
  validate(control) {
175
- let value = control.value;
175
+ const value = control.value;
176
176
  if (!value) {
177
177
  return;
178
178
  }
@@ -220,7 +220,7 @@ export class SkyColorpickerInputDirective {
220
220
  return color;
221
221
  }
222
222
  let formatColor;
223
- let hsva = this.service.stringToHsva(color, this.alphaChannel === 'hex8');
223
+ const hsva = this.service.stringToHsva(color, this.alphaChannel === 'hex8');
224
224
  formatColor = this.service.skyColorpickerOut(hsva);
225
225
  return formatColor;
226
226
  }
@@ -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,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EAIL,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAGL,aAAa,EACb,iBAAiB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B,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 forwardRef,\n HostListener,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n} from '@angular/core';\n\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n Validator,\n NgControl,\n FormControl,\n} from '@angular/forms';\n\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subscription } from 'rxjs';\n\nimport { SkyColorpickerService } from './colorpicker.service';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\n\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\n\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 let 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 let 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 let 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,Q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CAAC;IACrB,CAAC;IAEO,SAAS,CAAC,GAAW;QAC3B,6EAA6E;QAC7E,OAAO,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5E,CAAC;;0HAzRU,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 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,5 +1,5 @@
1
1
  // spell-checker:ignore Colorpicker
2
- import { Directive, Input, Output, ElementRef, EventEmitter, HostListener, } from '@angular/core';
2
+ import { Directive, ElementRef, EventEmitter, HostListener, Input, Output, } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * @internal
@@ -16,10 +16,10 @@ export class SkyColorpickerSliderDirective {
16
16
  };
17
17
  }
18
18
  setCursor(event) {
19
- let height = this.el.nativeElement.offsetHeight;
20
- let width = this.el.nativeElement.offsetWidth;
21
- let xAxis = Math.max(0, Math.min(this.getX(event), width));
22
- let yAxis = Math.max(0, Math.min(this.getY(event), height));
19
+ const height = this.el.nativeElement.offsetHeight;
20
+ const width = this.el.nativeElement.offsetWidth;
21
+ const xAxis = Math.max(0, Math.min(this.getX(event), width));
22
+ const yAxis = Math.max(0, Math.min(this.getY(event), height));
23
23
  if (this.xAxis !== undefined && this.yAxis !== undefined) {
24
24
  this.newColorContrast.emit({
25
25
  xCoordinate: xAxis / width,
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker-slider.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-slider.directive.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;;AAIvB;;GAEG;AAIH,MAAM,OAAO,6BAA6B;IAexC,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAb3B,qBAAgB,GAAG,IAAI,YAAY,EAA4B,CAAC;QAcrE,IAAI,CAAC,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;YACjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,GAAG,EAAE;YACvB,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,KAAU;QACzB,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC;QAChD,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC;QAC9C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QAC3D,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5D,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI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AAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAEM,IAAI,CAAC,KAAU;QACpB,oEAAoE;QACpE,0BAA0B;QAC1B,OAAO,CACL,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAClE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,IAAI;YAClD,MAAM,CAAC,WAAW,CACnB,CAAC;IACJ,CAAC;IACM,IAAI,CAAC,KAAU;QACpB,oEAAoE;QACpE,0BAA0B;QAC1B,OAAO,CACL,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAClE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,GAAG;YACjD,MAAM,CAAC,WAAW,CACnB,CAAC;IACJ,CAAC;;2HAtFU,6BAA6B;+GAA7B,6BAA6B;4FAA7B,6BAA6B;kBAHzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;iBACnC;iGAGQ,gBAAgB;sBADtB,MAAM;gBAGA,oBAAoB;sBAD1B,KAAK;gBAGC,KAAK;sBADX,KAAK;gBAGC,KAAK;sBADX,KAAK;gBAGC,KAAK;sBADX,KAAK;gBA6CC,KAAK;sBAFX,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;;sBACrC,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["// spell-checker:ignore Colorpicker\nimport {\n Directive,\n Input,\n Output,\n ElementRef,\n EventEmitter,\n HostListener,\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 let height = this.el.nativeElement.offsetHeight;\n let width = this.el.nativeElement.offsetWidth;\n let xAxis = Math.max(0, Math.min(this.getX(event), width));\n let 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"]}
1
+ {"version":3,"file":"colorpicker-slider.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-slider.directive.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;;AAIvB;;GAEG;AAIH,MAAM,OAAO,6BAA6B;IAexC,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAb3B,qBAAgB,GAAG,IAAI,YAAY,EAA4B,CAAC;QAcrE,IAAI,CAAC,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;YACjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,GAAG,EAAE;YACvB,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,KAAU;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,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picker\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"]}
@@ -1,5 +1,5 @@
1
1
  // spell-checker:ignore Colorpicker
2
- import { Directive, Input, Output, EventEmitter, HostListener, } from '@angular/core';
2
+ import { Directive, EventEmitter, HostListener, Input, Output, } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * @internal
@@ -9,8 +9,8 @@ export class SkyColorpickerTextDirective {
9
9
  this.newColorContrast = new EventEmitter();
10
10
  }
11
11
  changeInput(event) {
12
- let element = event.target;
13
- let elementValue = parseFloat(element.value);
12
+ const element = event.target;
13
+ const elementValue = parseFloat(element.value);
14
14
  if (this.maxRange === undefined) {
15
15
  this.newColorContrast.emit({
16
16
  color: element.value,
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker-text.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-text.directive.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;;AAIvB;;GAEG;AAIH,MAAM,OAAO,2BAA2B;IAHxC;QAKS,qBAAgB,GAAG,IAAI,YAAY,EAA6B,CAAC;KAgCzE;IAvBQ,WAAW,CAAC,KAAY;QAC7B,IAAI,OAAO,GAAuC,KAAK,CAAC,MAAM,CAAC;QAC/D,IAAI,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,SAAS;aACS,CAAC,CAAC;SACjC;QAED,IACE,CAAC,KAAK,CAAC,YAAY,CAAC;YACpB,YAAY,IAAI,CAAC;YACjB,YAAY,IAAI,IAAI,CAAC,QAAQ,EAC7B;YACA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,UAAU,EAAE,YAAY;gBACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACK,CAAC,CAAC;SACjC;IACH,CAAC;;yHAjCU,2BAA2B;6GAA3B,2BAA2B;4FAA3B,2BAA2B;kBAHvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;iBACjC;8BAGQ,gBAAgB;sBADtB,MAAM;gBAGA,kBAAkB;sBADxB,KAAK;gBAGC,KAAK;sBADX,KAAK;gBAGC,QAAQ;sBADd,KAAK;gBAIC,WAAW;sBADjB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["// spell-checker:ignore Colorpicker\nimport {\n Directive,\n Input,\n Output,\n EventEmitter,\n HostListener,\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 let element: HTMLInputElement = <HTMLInputElement>event.target;\n let 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"]}
1
+ {"version":3,"file":"colorpicker-text.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker-text.directive.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;;AAIvB;;GAEG;AAIH,MAAM,OAAO,2BAA2B;IAHxC;QAKS,qBAAgB,GAAG,IAAI,YAAY,EAA6B,CAAC;KAgCzE;IAvBQ,WAAW,CAAC,KAAY;QAC7B,MAAM,OAAO,GAAqB,KAAK,CAAC,MAA0B,CAAC;QACnE,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,SAAS;aACS,CAAC,CAAC;SACjC;QAED,IACE,CAAC,KAAK,CAAC,YAAY,CAAC;YACpB,YAAY,IAAI,CAAC;YACjB,YAAY,IAAI,IAAI,CAAC,QAAQ,EAC7B;YACA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,UAAU,EAAE,YAAY;gBACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACK,CAAC,CAAC;SACjC;IACH,CAAC;;yHAjCU,2BAA2B;6GAA3B,2BAA2B;4FAA3B,2BAA2B;kBAHvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;iBACjC;8BAGQ,gBAAgB;sBADtB,MAAM;gBAGA,kBAAkB;sBADxB,KAAK;gBAGC,KAAK;sBADX,KAAK;gBAGC,QAAQ;sBADd,KAAK;gBAIC,WAAW;sBADjB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["// 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"]}
@@ -1,11 +1,11 @@
1
1
  import { ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Optional, Output, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core';
2
- import { SkyAffixAutoFitContext, SkyAffixService, SkyOverlayService, SkyCoreAdapterService, } from '@skyux/core';
2
+ import { SkyAffixAutoFitContext, SkyAffixService, SkyCoreAdapterService, SkyOverlayService, } from '@skyux/core';
3
3
  import { SkyThemeService } from '@skyux/theme';
4
- import { fromEvent, Subject } from 'rxjs';
4
+ import { Subject, fromEvent } from 'rxjs';
5
5
  import { takeUntil } from 'rxjs/operators';
6
- import { SkyColorpickerMessageType } from './types/colorpicker-message-type';
6
+ import { SliderDimension, SliderPosition } from './colorpicker-classes';
7
7
  import { SkyColorpickerService } from './colorpicker.service';
8
- import { SliderPosition, SliderDimension } from './colorpicker-classes';
8
+ import { SkyColorpickerMessageType } from './types/colorpicker-message-type';
9
9
  import * as i0 from "@angular/core";
10
10
  import * as i1 from "@skyux/core";
11
11
  import * as i2 from "./colorpicker.service";
@@ -196,19 +196,19 @@ export class SkyColorpickerComponent {
196
196
  this.update();
197
197
  }
198
198
  set red(change) {
199
- let rgba = this.service.hsvaToRgba(this.hsva);
199
+ const rgba = this.service.hsvaToRgba(this.hsva);
200
200
  rgba.red = change.colorValue / change.maxRange;
201
201
  this.hsva = this.service.rgbaToHsva(rgba);
202
202
  this.update();
203
203
  }
204
204
  set green(change) {
205
- let rgba = this.service.hsvaToRgba(this.hsva);
205
+ const rgba = this.service.hsvaToRgba(this.hsva);
206
206
  rgba.green = change.colorValue / change.maxRange;
207
207
  this.hsva = this.service.rgbaToHsva(rgba);
208
208
  this.update();
209
209
  }
210
210
  set blue(change) {
211
- let rgba = this.service.hsvaToRgba(this.hsva);
211
+ const rgba = this.service.hsvaToRgba(this.hsva);
212
212
  rgba.blue = change.colorValue / change.maxRange;
213
213
  this.hsva = this.service.rgbaToHsva(rgba);
214
214
  this.update();
@@ -230,17 +230,17 @@ export class SkyColorpickerComponent {
230
230
  this.update();
231
231
  }
232
232
  update() {
233
- let hsla = this.service.hsva2hsla(this.hsva);
234
- let dHsla = this.service.denormalizeHSLA(hsla);
235
- let rgba = this.service.hsvaToRgba(this.hsva);
236
- let dRgba = this.service.denormalizeRGBA(rgba);
237
- let hsva = {
233
+ const hsla = this.service.hsva2hsla(this.hsva);
234
+ const dHsla = this.service.denormalizeHSLA(hsla);
235
+ const rgba = this.service.hsvaToRgba(this.hsva);
236
+ const dRgba = this.service.denormalizeRGBA(rgba);
237
+ const hsva = {
238
238
  hue: this.hsva.hue,
239
239
  saturation: 1,
240
240
  value: 1,
241
241
  alpha: 1,
242
242
  };
243
- let hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(hsva));
243
+ const hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(hsva));
244
244
  this.hslaText = dHsla;
245
245
  this.rgbaText = dRgba;
246
246
  this.hexText = this.service.hexText(dRgba, this.alphaChannel === 'hex8');
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.ts","../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,sBAAsB,EAEtB,eAAe,EAEf,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAY3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAQ7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;;;;;;;;;;;AAExE,IAAI,gBAAgB,GAAG,CAAC,CAAC;AAEzB;;;;GAIG;AAQH,MAAM,OAAO,uBAAuB;IAyKlC,YACU,YAA6B,EAC7B,cAAiC,EACjC,WAAkC,EAClC,cAAiC,EACjC,OAA8B,EAClB,QAA0B;QAL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AoH1B,WAAW,+GAKX,UAAU,2GAKV,UAAU,6BC7LpB,6pUA8TA;4FD5Pa,uBAAuB;kBAPnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,WAAW,EAAE,8BAA8B;oBAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;oBAC3C,SAAS,EAAE,CAAC,qBAAqB,CAAC;oBAClC,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;;0BAgLI,QAAQ;4CAzKJ,gBAAgB;sBADtB,KAAK;gBAQC,oBAAoB;sBAD1B,KAAK;gBAUC,KAAK;sBADX,KAAK;gBAUC,UAAU;sBADhB,KAAK;gBAOC,oBAAoB;sBAD1B,MAAM;gBAOA,oBAAoB;sBAD1B,MAAM;gBAQA,aAAa;sBADnB,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBA4DE,sBAAsB;sBAH7B,SAAS;uBAAC,wBAAwB,EAAE;wBACnC,IAAI,EAAE,WAAW;qBAClB;gBAMO,gBAAgB;sBAHvB,SAAS;uBAAC,kBAAkB,EAAE;wBAC7B,IAAI,EAAE,UAAU;qBACjB;gBAMW,cAAc;sBAHzB,SAAS;uBAAC,gBAAgB,EAAE;wBAC3B,IAAI,EAAE,UAAU;qBACjB","sourcesContent":["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';\n\nimport {\n SkyAffixAutoFitContext,\n SkyAffixer,\n SkyAffixService,\n SkyOverlayInstance,\n SkyOverlayService,\n SkyCoreAdapterService,\n} from '@skyux/core';\n\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { fromEvent, Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyColorpickerChangeAxis } from './types/colorpicker-axis';\n\nimport { SkyColorpickerChangeColor } from './types/colorpicker-color';\n\nimport { SkyColorpickerHsla } from './types/colorpicker-hsla';\n\nimport { SkyColorpickerHsva } from './types/colorpicker-hsva';\n\nimport { SkyColorpickerMessage } from './types/colorpicker-message';\n\nimport { SkyColorpickerMessageType } from './types/colorpicker-message-type';\n\nimport { SkyColorpickerOutput } from './types/colorpicker-output';\n\nimport { SkyColorpickerRgba } from './types/colorpicker-rgba';\n\nimport { SkyColorpickerResult } from './types/colorpicker-result';\n\nimport { SkyColorpickerService } from './colorpicker.service';\n\nimport { SliderPosition, SliderDimension } from './colorpicker-classes';\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: boolean = false;\n\n public isVisible: boolean = 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: boolean = 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 let 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 let 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 let 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 let hsla: SkyColorpickerHsla = this.service.hsva2hsla(this.hsva);\n let dHsla: SkyColorpickerHsla = this.service.denormalizeHSLA(hsla);\n let rgba: SkyColorpickerRgba = this.service.hsvaToRgba(this.hsva);\n let dRgba: SkyColorpickerRgba = this.service.denormalizeRGBA(rgba);\n\n let hsva: SkyColorpickerHsva = {\n hue: this.hsva.hue,\n saturation: 1,\n value: 1,\n alpha: 1,\n };\n\n let 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"]}
1
+ {"version":3,"file":"colorpicker.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.ts","../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EAEf,qBAAqB,EAErB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;;;AAK7E,IAAI,gBAAgB,GAAG,CAAC,CAAC;AAEzB;;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C,cAAc,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAClE,CAAC;;qHA9gBU,uBAAuB;yGAAvB,uBAAuB,iWAHvB,CAAC,qBAAqB,CAAC,uIAoH1B,WAAW,+GAKX,UAAU,2GAKV,UAAU,6BChLpB,6pUA8TA;4FDzQa,uBAAuB;kBAPnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,WAAW,EAAE,8BAA8B;oBAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;oBAC3C,SAAS,EAAE,CAAC,qBAAqB,CAAC;oBAClC,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;;0BAgLI,QAAQ;4CAzKJ,gBAAgB;sBADtB,KAAK;gBAQC,oBAAoB;sBAD1B,KAAK;gBAUC,KAAK;sBADX,KAAK;gBAUC,UAAU;sBADhB,KAAK;gBAOC,oBAAoB;sBAD1B,MAAM;gBAOA,oBAAoB;sBAD1B,MAAM;gBAQA,aAAa;sBADnB,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBA4DE,sBAAsB;sBAH7B,SAAS;uBAAC,wBAAwB,EAAE;wBACnC,IAAI,EAAE,WAAW;qBAClB;gBAMO,gBAAgB;sBAHvB,SAAS;uBAAC,kBAAkB,EAAE;wBAC7B,IAAI,EAAE,UAAU;qBACjB;gBAMW,cAAc;sBAHzB,SAAS;uBAAC,gBAAgB,EAAE;wBAC3B,IAAI,EAAE,UAAU;qBACjB","sourcesContent":["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"]}
@@ -6,10 +6,10 @@ import { SkyI18nModule } from '@skyux/i18n';
6
6
  import { SkyIconModule } from '@skyux/indicators';
7
7
  import { SkyThemeModule } from '@skyux/theme';
8
8
  import { SkyColorpickerResourcesModule } from '../shared/sky-colorpicker-resources.module';
9
- import { SkyColorpickerComponent } from './colorpicker.component';
10
9
  import { SkyColorpickerInputDirective } from './colorpicker-input.directive';
11
10
  import { SkyColorpickerSliderDirective } from './colorpicker-slider.directive';
12
11
  import { SkyColorpickerTextDirective } from './colorpicker-text.directive';
12
+ import { SkyColorpickerComponent } from './colorpicker.component';
13
13
  import * as i0 from "@angular/core";
14
14
  export class SkyColorpickerModule {
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"colorpicker.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iB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nimport { NgModule } from '@angular/core';\n\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyIconModule } from '@skyux/indicators';\n\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyColorpickerResourcesModule } from '../shared/sky-colorpicker-resources.module';\n\nimport { SkyColorpickerComponent } from './colorpicker.component';\n\nimport { SkyColorpickerInputDirective } from './colorpicker-input.directive';\n\nimport { SkyColorpickerSliderDirective } from './colorpicker-slider.directive';\n\nimport { SkyColorpickerTextDirective } from './colorpicker-text.directive';\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"]}
1
+ {"version":3,"file":"colorpicker.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/colorpicker/src/lib/modules/colorpicker/colorpicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;;AAsBlE,MAAM,OAAO,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","sourcesContent":["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"]}