{"version":3,"file":"usitsdasdesign-dds-ng-colorpicker.mjs","sources":["../../src/app/dds/colorpicker/colorpicker/constants.ts","../../src/app/dds/colorpicker/utils.ts","../../src/app/dds/colorpicker/colorpicker/colorpicker.component.ts","../../src/app/dds/colorpicker/colorpicker/colorpicker.component.html","../../src/app/dds/colorpicker/colorpicker.module.ts","../../src/app/dds/colorpicker/usitsdasdesign-dds-ng-colorpicker.ts"],"sourcesContent":["import { ThemeClassesMap, ThemeMapEnum } from '@usitsdasdesign/dds-ng/core/theme';\nimport { Size } from '@usitsdasdesign/dds-ng/shared';\n\nexport const DEFAULT_PALETTE = [\n  '#FFFFFF',\n  '#D0D0CE',\n  '#BBBCBC',\n  '#A7A8AA',\n  '#97999B',\n  '#75787B',\n  '#63666A',\n  '#53565A',\n  '#000000',\n  '#26890D',\n  '#E3E48D',\n  '#C4D600',\n  '#86BC25',\n  '#43B02A',\n  '#009A44',\n  '#046A38',\n  '#2C5234',\n  '#007CB0',\n  '#A0DCFF',\n  '#62B5E5',\n  '#00A3E0',\n  '#0076A8',\n  '#005587',\n  '#012169',\n  '#041E42',\n  '#0D8390',\n  '#DDEFE8',\n  '#9DD4CF',\n  '#6FC2B4',\n  '#00ABAB',\n  '#0097A9',\n  '#007680',\n  '#004F59',\n  '#0DF200',\n  '#3EFAC5',\n  '#33F0FF',\n  '#DA291C',\n  '#ED8B00',\n  '#FFCD00',\n];\nexport const DEFAULT_AUTOMATIC_COLOR = '#26890D';\nexport const RECENT_COLORS_STORAGE_KEY = 'dds-recent-colors';\nexport const ACTIVE_COLOR_CLASS_NAME = 'dds-colorpicker__color-view_active';\nexport const DARK_THRESHOLD = 25;\nexport const LIGHT_THRESHOLD = 240;\n\nexport const themeClassesMap: ThemeClassesMap = {\n  [ThemeMapEnum.Size]: {\n    [Size.lg]: 'dds-colorpicker_lg',\n    [Size.sm]: 'dds-colorpicker_sm',\n  },\n};\n","import { DARK_THRESHOLD, LIGHT_THRESHOLD } from \"./colorpicker/constants\";\n\n\nexport function isLightColor(hexColor: string): boolean {\n  if (!hexColor) return;\n\n  const brightness = getBrightnessColor(hexColor);\n  const threshold = LIGHT_THRESHOLD;\n\n  return brightness > threshold;\n}\n\nexport function isDarkColor(hexColor: string): boolean {\n  if (!hexColor) return;\n\n  const brightness = getBrightnessColor(hexColor);\n  const threshold = DARK_THRESHOLD;\n\n  return brightness < threshold;\n}\n\n// Calculates the brightness of a color given its hexadecimal representation.\nexport function getBrightnessColor(hexColor: string): number {\n  const r = parseInt(hexColor.substring(1, 3), 16);\n  const g = parseInt(hexColor.substring(3, 5), 16);\n  const b = parseInt(hexColor.substring(5, 7), 16);\n  const brightness = r * 0.299 + g * 0.587 + b * 0.114;\n\n  return brightness;\n}\n\n// Checks if the provided string is a valid hexadecimal color code.\nexport function isValidHexCode(color: string): boolean {\n  const regexHexCode = new RegExp(/^[0-9A-F]{6}$/i);\n\n  return regexHexCode.test(color);\n}\n\n// Removes duplicate values from the second array based on the values in the first array,\n// and then concatenates the unique values from the second array to the first array.\nexport function removeDuplicatesFromArray(arr1: string[], arr2: string[]): string[] {\n  const uniqueValues = new Set(arr1);\n  const resultArray = arr2.filter((item) => !uniqueValues.has(item));\n\n  return arr1.concat(resultArray);\n}\n","import { CommonModule } from '@angular/common';\nimport {\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  ElementRef,\n  EventEmitter,\n  Input,\n  OnChanges,\n  Output,\n  QueryList,\n  Renderer2,\n  SimpleChanges,\n  ViewChild,\n  ViewChildren,\n} from '@angular/core';\nimport { ButtonModule } from '@usitsdasdesign/dds-ng/button';\nimport { DestroyCtor, DestroyMixin, I18nCtor, I18nMixin } from '@usitsdasdesign/dds-ng/core/common-behaviors';\nimport { FocusHandlerModule } from '@usitsdasdesign/dds-ng/core/focus-handler';\nimport { ThemeClassesMap, ThemeModule } from '@usitsdasdesign/dds-ng/core/theme';\nimport { InputComponent, InputModule } from '@usitsdasdesign/dds-ng/input';\nimport { Size, Themes } from '@usitsdasdesign/dds-ng/shared';\nimport { DdsConfigService } from '@usitsdasdesign/dds-ng/shared/dds-config';\nimport { I18nModule, I18nService, ITranslation } from '@usitsdasdesign/dds-ng/shared/i18n';\nimport { TooltipModule } from '@usitsdasdesign/dds-ng/tooltip';\nimport { isDarkColor, isLightColor, isValidHexCode, removeDuplicatesFromArray } from '../utils';\nimport {\n  ACTIVE_COLOR_CLASS_NAME,\n  DEFAULT_AUTOMATIC_COLOR,\n  DEFAULT_PALETTE,\n  RECENT_COLORS_STORAGE_KEY,\n  themeClassesMap\n} from './constants';\n\nconst ColorpickerBase: DestroyCtor & I18nCtor = DestroyMixin(I18nMixin());\n\n@Component({\n  selector: 'dds-colorpicker',\n  templateUrl: './colorpicker.component.html',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  standalone: true,\n  imports: [CommonModule, ButtonModule, InputModule, FocusHandlerModule, ThemeModule, I18nModule, TooltipModule],\n})\nexport class ColorpickerComponent extends ColorpickerBase implements OnChanges, AfterViewInit {\n  // Input properties for the color picker component\n  @Input() presetColors: string[] | undefined = DEFAULT_PALETTE;\n  @Input() automaticColor: string | undefined = DEFAULT_AUTOMATIC_COLOR;\n  @Input() activeColor: string | undefined;\n  @Input() size: Size | string | undefined = this.ddsConfig.getConfig().size;\n  @Input() theme: Themes | string | undefined = this.ddsConfig.getConfig().theme;\n  @Input() enableEmptyColor: boolean | undefined = true;\n  @Input() enableCustomColor: boolean | undefined = true;\n  @Input() enableRecentColors: boolean | undefined = true;\n  @Input() enableAutomaticColor: boolean | undefined = true;\n  @Input() isInverse: boolean | undefined;\n\n  // Getter and setter for recent colors with session storage handling\n  @Input() get recentColors(): string[] | undefined {\n    return this.getRecentColors();\n  }\n  set recentColors(colors: string[] | undefined) {\n    this.setRecentColors(colors);\n  }\n\n  // Output event emitter for color change\n  @Output() changeColor = new EventEmitter<string>();\n\n  // ViewChild and ViewChildren decorators to access DOM elements\n  @ViewChild('colorpickerWrap') colorpickerWrap: ElementRef<HTMLElement>;\n  @ViewChild('customColorField') customColorField: InputComponent;\n  @ViewChildren('colorItem') colorItems: QueryList<ElementRef<HTMLElement>>;\n\n  // Theme configuration for the color picker component\n  public themeConfig: ThemeClassesMap = themeClassesMap;\n\n  // Custom color selected by the user\n  public customColor: string;\n\n  // Accessibility texts for various elements in the color picker\n  public invalidColorText: string;\n  public ariaLabelCustomColorField: string;\n  public ariaLabelColorBtn: string;\n  public ariaLabelEnterColor: string;\n  public ariaLabelNoColor: string;\n  public ariaLabelApplyBtn: string;\n  public validColorText: string;\n  public customColorLabelText: string;\n  public customColorDescriptionText: string;\n  public noColorText: string;\n  public automaticText: string;\n  public recentColorsText: string;\n  public applyBtnText: string;\n\n  // Flag to check if no color is selected\n  public isNoColorSelected: boolean;\n\n  // Timer for updating aria-describedby attribute\n  private updAriaDescribedTimer: ReturnType<typeof setTimeout>;\n\n  constructor(public cdr: ChangeDetectorRef, public i18n: I18nService, private renderer: Renderer2, private ddsConfig: DdsConfigService) {\n    super();\n  }\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes.activeColor) {\n      this.setActiveColor();\n    }\n  }\n\n  ngAfterViewInit(): void {\n    if (this.activeColor) {\n      this.setActiveColor();\n    }\n  }\n\n  // Selects a color and updates the active color state.\n  selectColor(hexColor: string, colorEl: HTMLElement): void {\n    this.resetAllActiveColors();\n    this.activeColor = hexColor;\n    this.isNoColorSelected = !hexColor;\n\n    this.renderer.addClass(colorEl, ACTIVE_COLOR_CLASS_NAME);\n    this.renderer.setAttribute(colorEl, 'aria-current', 'true');\n  }\n\n  // Sets a custom color for the color picker.\n  setCustomColor(color: string): void {\n    const isHexCode = isValidHexCode(color);\n\n    this.customColor = isHexCode ? '#' + color : '';\n    this.customColorField.isError = color && !isHexCode;\n    this.activeColor = this.customColor;\n\n    this.updAriaDescribedBy(isHexCode);\n  }\n\n  // Applies the selected color and updates recent colors if necessary.\n  applyColor(): void {\n    const checkIncludePresetColors = this.presetColors.find(\n      (presetColor) => presetColor?.toLowerCase() === this.customColor?.toLowerCase()\n    );\n\n    if (!checkIncludePresetColors && this.customColor) {\n      this.recentColors = [this.customColor];\n    }\n\n    this.changeColor.emit(this.activeColor);\n  }\n\n  // Checks if the given color is a light color based on its brightness.\n  isLightColor(hexColor: string): boolean {\n    return isLightColor(hexColor);\n  }\n\n  // Checks if the given color is a dark color based on its brightness.\n  isDarkColor(hexColor: string): boolean {\n    return isDarkColor(hexColor);\n  }\n\n  // Sets the active color in the color picker component.\n  private setActiveColor(): void {\n    if (!this.colorpickerWrap) return;\n\n    const colorpickerWrapEl = this.colorpickerWrap.nativeElement;\n    const colorEl = colorpickerWrapEl.querySelector(`[data-color=\"${this.activeColor?.toLowerCase()}\"]`);\n\n    if (colorEl) {\n      this.resetAllActiveColors();\n      this.renderer.addClass(colorEl, ACTIVE_COLOR_CLASS_NAME);\n      this.renderer.setAttribute(colorEl, 'aria-current', 'true');\n    }\n  }\n\n  // Updates the `aria-describedby` attribute of the input element based on the validity of the hex code.\n  private updAriaDescribedBy(isHexCode: boolean): void {\n    const inputElement = this.customColorField.inputField.nativeElement;\n\n    inputElement.setAttribute('aria-describedby', '');\n\n    if (inputElement.value === '') return;\n\n    clearTimeout(this.updAriaDescribedTimer);\n\n    this.updAriaDescribedTimer = setTimeout(() => {\n      if (isHexCode) {\n        this.resetAllActiveColors();\n        this.activeColor = this.customColor;\n        inputElement.setAttribute('aria-describedby', 'successDescription');\n      } else {\n        inputElement.setAttribute('aria-describedby', 'errorDescription');\n      }\n    }, 100);\n  }\n\n  // Resets all active colors by removing the active class and\n  // 'aria-current' attribute from each color item.\n  private resetAllActiveColors(): void {\n    this.colorItems?.forEach((item) => {\n      this.renderer.removeClass(item.nativeElement, ACTIVE_COLOR_CLASS_NAME);\n      this.renderer.setAttribute(item.nativeElement, 'aria-current', undefined);\n    });\n  }\n\n  // Updates the recent colors in the session storage by merging the provided colors\n  // with the existing recent colors, removing any duplicates.\n  private setRecentColors(colors: string[]): void {\n    const storageRecentColors = this.getRecentColors() || [];\n    const recentColors = removeDuplicatesFromArray(storageRecentColors, colors);\n\n    sessionStorage.setItem(RECENT_COLORS_STORAGE_KEY, JSON.stringify(recentColors));\n  }\n\n  // Retrieves the recent colors stored in the session storage.\n  private getRecentColors(): string[] {\n    const recentColors = sessionStorage.getItem(RECENT_COLORS_STORAGE_KEY);\n\n    return recentColors ? JSON.parse(recentColors) : [recentColors];\n  }\n\n  // Sets the internationalization (i18n) texts for the color picker component.\n  protected setI18nTexts(translation: ITranslation): void {\n    this.invalidColorText = translation.COLORPICKER.A11Y.INVALID_COLOR_TEXT;\n    this.validColorText = translation.COLORPICKER.A11Y.VALID_COLOR_TEXT;\n    this.ariaLabelCustomColorField = translation.COLORPICKER.A11Y.ARIA_LABEL_CUSTOM_COLOR_FIELD;\n    this.ariaLabelColorBtn = translation.COLORPICKER.A11Y.ARIA_LABEL_COLOR_BTN;\n    this.ariaLabelEnterColor = translation.COLORPICKER.A11Y.ARIA_LABEL_ENTER_COLOR;\n    this.ariaLabelNoColor = translation.COLORPICKER.A11Y.ARIA_LABEL_NO_COLOR;\n    this.ariaLabelApplyBtn = translation.COLORPICKER.A11Y.ARIA_LABEL_APPLY_BTN;\n    this.customColorLabelText = translation.COLORPICKER.CUSTOM_COLOR_LABEL_TEXT;\n    this.customColorDescriptionText = translation.COLORPICKER.CUSTOM_COLOR_DESCRIPTION_TEXT;\n    this.noColorText = translation.COLORPICKER.NO_COLOR_TEXT;\n    this.automaticText = translation.COLORPICKER.AUTOMATIC_TEXT;\n    this.recentColorsText = translation.COLORPICKER.RECENT_COLOR_TEXT;\n    this.applyBtnText = translation.COLORPICKER.APPLE_BTN_TEXT;\n    this.cdr.detectChanges();\n  }\n}\n","<div class=\"dds-colorpicker\"\n     [ngClass]=\"{'dds-colorpicker_inverse': isInverse}\"\n     [size]=\"size\"\n     [ddsTheme]=\"themeConfig\"\n     data-qa=\"colorpicker\"\n     #colorpickerWrap>\n  @if (enableCustomColor) {\n    <div class=\"dds-colorpicker__section dds-colorpicker-custom\">\n      <div class=\"dds-colorpicker-custom__field-wrap\">\n        <dds-input class=\"dds-colorpicker-custom__field\"\n                   [value]=\"activeColor\"\n                   [ariaLabel]=\"customColorDescriptionText + ' ' + ariaLabelCustomColorField\"\n                   [label]=\"customColorLabelText\"\n                   [description]=\"customColorDescriptionText\"\n                   [size]=\"size\"\n                   [isInverse]=\"isInverse\"\n                   mask=\"AAAAAA\"\n                   (valueChanged)=\"setCustomColor($event)\"\n                   #customColorField></dds-input>\n        <ng-container *ngTemplateOutlet=\"colorView; context: {color: activeColor, ariaLabel: ariaLabelEnterColor, disabled: true}\"></ng-container>\n      </div>\n      <div id=\"errorDescription\"\n           class=\"dds-d-none\">{{invalidColorText}}</div>\n      <div id=\"successDescription\"\n           class=\"dds-d-none\">{{validColorText}} {{activeColor}}</div>\n    </div>\n  }\n\n  <div class=\"dds-colorpicker__section dds-colorpicker__palette\">\n    <div class=\"dds-colorpicker__colors-wrap\">\n      @for (color of presetColors; track color) {\n        <ng-container *ngTemplateOutlet=\"colorView; context: {color, ariaLabel: ariaLabelColorBtn}\"></ng-container>\n      }\n    </div>\n  </div>\n\n  @if (enableEmptyColor) {\n    <div class=\"dds-colorpicker__section\">\n      <label class=\"dds-colorpicker__button\">\n        <ng-container *ngTemplateOutlet=\"colorView; context: {ariaLabel: ariaLabelNoColor}\"></ng-container>\n        <span class=\"dds-colorpicker__color-title\">{{noColorText}}</span>\n      </label>\n    </div>\n  }\n\n  @if (enableAutomaticColor && automaticColor) {\n    <div class=\"dds-colorpicker__section\">\n      <label class=\"dds-colorpicker__button\">\n        <ng-container *ngTemplateOutlet=\"colorView; context: {color: automaticColor}\"></ng-container>\n        <span class=\"dds-colorpicker__color-title\">{{automaticText}}</span>\n      </label>\n    </div>\n  }\n\n  @if (enableRecentColors && recentColors) {\n    <div class=\"dds-colorpicker__section dds-colorpicker__recent-colors\">\n      <span class=\"dds-colorpicker__section-title\">{{recentColorsText}}</span>\n      <div class=\"dds-colorpicker__colors-wrap\">\n        @for (color of recentColors; track color) {\n          <ng-container *ngTemplateOutlet=\"colorView; context: {color, ariaLabel: ariaLabelColorBtn}\"></ng-container>\n        }\n      </div>\n    </div>\n  }\n\n  <div class=\"dds-colorpicker__footer\">\n    <dds-button ariaLabel=\"{{ariaLabelApplyBtn}} {{activeColor}}\"\n                [theme]=\"theme\"\n                [size]=\"size\"\n                [isInverse]=\"isInverse\"\n                [disabled]=\"!activeColor && !isNoColorSelected\"\n                (clicked)=\"applyColor()\">{{applyBtnText}}</dds-button>\n  </div>\n</div>\n\n<ng-template #colorView\n             let-color=\"color\"\n             let-disabled=\"disabled\"\n             let-ariaLabel=\"ariaLabel\">\n  <button class=\"dds-colorpicker__color-view\"\n          [attr.disabled]=\"disabled\"\n          [attr.data-color]=\"disabled ? '' : color | lowercase\"\n          [attr.title]=\"color\"\n          [attr.aria-label]=\"ariaLabel\"\n          [ddsTooltip]=\"color\"\n          [tooltipIsInverse]=\"isInverse\"\n          [tooltipIsDisabled]=\"!color?.length\"\n          (click)=\"selectColor(color, colorItem)\"\n          (blur)=\"tooltipDir.hide()\"\n          #tooltipDir=\"dds-tooltip\"\n          ddsFocus\n          #colorItem>\n    <span [ngClass]=\"{\n            'dds-colorpicker__color_light': isLightColor(color),\n            'dds-colorpicker__color_dark': isDarkColor(color)\n          }\"\n          [ngStyle]=\"{backgroundColor: color}\"\n          class=\"dds-colorpicker__color\"></span>\n    <svg width=\"100%\"\n         height=\"100%\"\n         viewBox=\"0 0 16 16\"\n         fill=\"none\"\n         xmlns=\"http://www.w3.org/2000/svg\"\n         class=\"dds-colorpicker__empty-color\">\n      <rect x=\"0.5\"\n            y=\"0.5\"\n            width=\"15\"\n            height=\"15\"\n            stroke=\"black\" />\n      <path d=\"M15 0H16V1L1 16H0V15L15 0Z\"\n            fill=\"#DA291C\" />\n    </svg>\n  </button>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { ColorpickerComponent } from './colorpicker/colorpicker.component';\n\n@NgModule({\n  declarations: [],\n  imports: [ColorpickerComponent],\n  exports: [ColorpickerComponent],\n})\nexport class ColorpickerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,MAAM,eAAe,GAAG;IAC7B,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;;AAEJ,MAAM,uBAAuB,GAAG;AAChC,MAAM,yBAAyB,GAAG;AAClC,MAAM,uBAAuB,GAAG;AAChC,MAAM,cAAc,GAAG;AACvB,MAAM,eAAe,GAAG;AAExB,MAAM,eAAe,GAAoB;AAC9C,IAAA,CAAC,YAAY,CAAC,IAAI,GAAG;AACnB,QAAA,CAAC,IAAI,CAAC,EAAE,GAAG,oBAAoB;AAC/B,QAAA,CAAC,IAAI,CAAC,EAAE,GAAG,oBAAoB;AAChC,KAAA;;;ACnDG,SAAU,YAAY,CAAC,QAAgB,EAAA;AAC3C,IAAA,IAAI,CAAC,QAAQ;QAAE;AAEf,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC;IAC/C,MAAM,SAAS,GAAG,eAAe;IAEjC,OAAO,UAAU,GAAG,SAAS;AAC/B;AAEM,SAAU,WAAW,CAAC,QAAgB,EAAA;AAC1C,IAAA,IAAI,CAAC,QAAQ;QAAE;AAEf,IAAA,MAA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