@skyux/colorpicker 12.22.0 → 12.24.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-colorpicker-testing.mjs","sources":["../../../../../libs/components/colorpicker/testing/src/legacy/colorpicker-fixture.ts","../../../../../libs/components/colorpicker/testing/src/modules/colorpicker/colorpicker-dropdown-harness.ts","../../../../../libs/components/colorpicker/testing/src/modules/colorpicker/colorpicker-harness.ts","../../../../../libs/components/colorpicker/testing/src/skyux-colorpicker-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX colorpicker component.\n * @deprecated Use `SkyColorpickerHarness` instead.\n * @internal\n */\nexport class SkyColorpickerFixture {\n #debugEl: DebugElement;\n #fixture: ComponentFixture<unknown>;\n\n constructor(fixture: ComponentFixture<unknown>, skyTestId: string) {\n this.#fixture = fixture;\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-colorpicker',\n );\n }\n\n /**\n * The colorpicker's currently selected color formatted to the `outputFormat`.\n */\n public get value(): string {\n return this.#getColorpickerInputEl().nativeElement.value;\n }\n\n /**\n * Set the colorpicker's color hex code.\n * @param hexValue The new color hex code. Must include '#'.\n */\n public async setValueFromHex(hexValue: string): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const hexInput = document.querySelector(\n 'input[id^=sky-colorpicker-hex-]',\n ) as HTMLInputElement;\n\n hexInput.value = hexValue;\n SkyAppTestUtility.fireDomEvent(hexInput, 'input');\n\n await this.#clickColorpickerApplyButtonEl();\n await this.#fixture.whenStable();\n }\n\n /**\n * Set the colorpicker's color RGB values.\n * @param red The red color value.\n * @param green The green color value.\n * @param blue The blue color value.\n * @param alpha The alpha channel value.\n */\n public async setValueFromRGBA(\n red: number,\n green: number,\n blue: number,\n alpha: number,\n ): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const rInput = document.querySelector(\n 'input[id^=sky-colorpicker-red-]',\n ) as HTMLInputElement;\n const gInput = document.querySelector(\n 'input[id^=sky-colorpicker-green-]',\n ) as HTMLInputElement;\n const bInput = document.querySelector(\n 'input[id^=sky-colorpicker-blue-]',\n ) as HTMLInputElement;\n const aInput = document.querySelector(\n 'input[id^=sky-colorpicker-alpha-]',\n ) as HTMLInputElement;\n\n rInput.value = red.toString();\n gInput.value = green.toString();\n bInput.value = blue.toString();\n aInput.value = alpha.toString();\n\n SkyAppTestUtility.fireDomEvent(rInput, 'input');\n SkyAppTestUtility.fireDomEvent(gInput, 'input');\n SkyAppTestUtility.fireDomEvent(bInput, 'input');\n SkyAppTestUtility.fireDomEvent(aInput, 'input');\n\n await this.#clickColorpickerApplyButtonEl();\n\n await this.#fixture.whenStable();\n }\n\n /**\n * Set the colorpicker's color to the provided preset color at the given index.\n * @param presetIndex The index of the color in the `presetColors` list to select.\n */\n public async setValueFromPresets(presetIndex: number): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const presetColors = document.querySelectorAll(\n '.sky-colorpicker-preset-color-area button',\n );\n const presetColor =\n presetColors && (presetColors[presetIndex] as HTMLButtonElement);\n\n if (presetColor) {\n presetColor.click();\n this.#fixture.detectChanges();\n }\n\n await this.#clickColorpickerApplyButtonEl();\n\n await this.#fixture.whenStable();\n }\n\n async #clickColorpickerButtonEl(): Promise<void> {\n const colorpickerButton = this.#debugEl.query(\n By.css('sky-colorpicker button'),\n ).nativeElement;\n\n colorpickerButton.click();\n\n this.#fixture.detectChanges();\n\n await this.#fixture.whenStable();\n }\n\n async #clickColorpickerApplyButtonEl(): Promise<void> {\n const applyButton = document.querySelector(\n '.sky-btn-colorpicker-apply',\n ) as HTMLButtonElement;\n\n applyButton.click();\n\n this.#fixture.detectChanges();\n\n await this.#fixture.whenStable();\n }\n\n #getColorpickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('sky-colorpicker input'));\n }\n}\n","import { HarnessPredicate, TestElement } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyColorpickerDropdownHarnessFilters } from './colorpicker-dropdown-harness.filters';\n\n/**\n * Harness for interacting with colorpicker dropdown in tests.\n */\nexport class SkyColorpickerDropdownHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = '.sky-colorpicker-container';\n\n #getApplyButton = this.locatorFor('.sky-btn-colorpicker-apply');\n #getCancelButton = this.locatorFor('.sky-btn-colorpicker-close');\n #getInputs = this.locatorForAll('input.sky-form-control');\n #getSwatches = this.locatorForAll('button.sky-preset-color');\n\n public static with(\n filters: SkyColorpickerDropdownHarnessFilters,\n ): HarnessPredicate<SkyColorpickerDropdownHarness> {\n return new HarnessPredicate(SkyColorpickerDropdownHarness, filters);\n }\n\n /**\n * Whether transparency is allowed.\n */\n public async allowsTransparency(): Promise<boolean> {\n return !!(await this.#getAlphaInput());\n }\n\n /**\n * Clicks the colorpicker dropdown apply button.\n */\n public async clickApplyButton(): Promise<void> {\n await (await this.#getApplyButton()).click();\n }\n\n /**\n * Clicks the colorpicker dropdown cancel button.\n */\n public async clickCancelButton(): Promise<void> {\n await (await this.#getCancelButton()).click();\n }\n\n /**\n * Clicks a specified swatch in the color preset section.\n * @param swatchHex Hex code of the swatch to click.\n */\n public async clickPresetColorSwatch(swatchHex: string): Promise<void> {\n const swatches = await this.#getSwatchButtons();\n const ariaLabel = `Preset Color: ${swatchHex}`;\n\n for (const swatch of swatches) {\n if ((await swatch.getAttribute('aria-label')) === ariaLabel) {\n return await swatch.click();\n }\n }\n }\n\n /**\n * Gets an array of the hex codes of the preset color swatches.\n */\n public async getPresetColorSwatches(): Promise<string[]> {\n const swatches = await this.#getSwatchButtons();\n\n return await Promise.all(\n swatches.map(async (swatch): Promise<string> => {\n const swatchHex = (await swatch.getAttribute('aria-label'))\n ?.split(':')[1]\n .trim();\n if (!swatchHex) {\n throw new Error('Preset swatch is undefined.');\n }\n return swatchHex;\n }),\n );\n }\n\n /**\n * Enters a value into the alpha input box.\n * @param value A decimal value from 0-1.\n */\n public async setAlphaValue(value: string): Promise<void> {\n const input = await this.#getAlphaInput();\n\n if (!input) {\n throw new Error('Alpha input cannot be found.');\n }\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the blue input box.\n * @param value A value from 0-255\n */\n public async setBlueValue(value: string): Promise<void> {\n const input = await this.#getBlueInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the green input box.\n * @param value A value from 0-255\n */\n public async setGreenValue(value: string): Promise<void> {\n const input = await this.#getGreenInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the hex input box.\n * @param value A hex value\n */\n public async setHexValue(value: string): Promise<void> {\n const input = await this.#getHexInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the red input box.\n * @param value A value from 0-255\n */\n public async setRedValue(value: string): Promise<void> {\n const input = await this.#getRedInput();\n\n await this.#setInputValue(input, value);\n }\n\n async #getAlphaInput(): Promise<TestElement | null> {\n return (await this.#getInputs())[4];\n }\n\n async #getBlueInput(): Promise<TestElement> {\n return (await this.#getInputs())[3];\n }\n\n async #getGreenInput(): Promise<TestElement> {\n return (await this.#getInputs())[2];\n }\n\n async #getHexInput(): Promise<TestElement> {\n return (await this.#getInputs())[0];\n }\n\n async #getRedInput(): Promise<TestElement> {\n return (await this.#getInputs())[1];\n }\n\n async #getSwatchButtons(): Promise<TestElement[]> {\n const swatches = await this.#getSwatches();\n\n if (swatches.length > 0) {\n return swatches;\n } else {\n throw new Error('No swatches found.');\n }\n }\n\n async #setInputValue(input: TestElement, value: string): Promise<void> {\n await input.setInputValue(value);\n await input.dispatchEvent('input');\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\nimport { SkyFormErrorsHarness } from '@skyux/forms/testing';\nimport { SkyHelpInlineHarness } from '@skyux/help-inline/testing';\nimport { SkyIconHarness } from '@skyux/icon/testing';\n\nimport { SkyColorpickerDropdownHarness } from './colorpicker-dropdown-harness';\nimport { SkyColorpickerHarnessFilters } from './colorpicker-harness.filters';\n\n/**\n * Harness for interacting with colorpicker components in tests.\n */\nexport class SkyColorpickerHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-colorpicker';\n\n #documentRootLocator = this.documentRootLocatorFactory();\n\n #getButton = this.locatorFor('button.sky-colorpicker-button');\n #getHintText = this.locatorFor('.sky-colorpicker-hint-text');\n #getLabel = this.locatorFor('label.sky-control-label');\n #resetButtonDefault = this.locatorForOptional(\n 'button.sky-colorpicker-reset-button',\n );\n #resetButtonModern = this.locatorForOptional(\n 'button.sky-colorpicker-reset-button-modern',\n );\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyColorpickerHarness` that meets certain criteria\n */\n public static with(\n filters: SkyColorpickerHarnessFilters,\n ): HarnessPredicate<SkyColorpickerHarness> {\n return SkyColorpickerHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Clicks the colorpicker button.\n */\n public async clickColorpickerButton(): Promise<void> {\n const button = await this.#getButton();\n return await button.click();\n }\n\n /**\n * Clicks the help inline button.\n */\n public async clickHelpInline(): Promise<void> {\n await (await this.#getHelpInline()).click();\n }\n\n /**\n * Clicks the reset button. Throws an error if the reset button is hidden.\n */\n public async clickResetButton(): Promise<void> {\n const defaultButton = (await this.#resetButtonDefault()) ?? null;\n const modernButton = (await this.#resetButtonModern()) ?? null;\n\n if (!defaultButton && !modernButton) {\n throw new Error('No reset button found.');\n }\n if (defaultButton) {\n return await defaultButton?.click();\n } else if (modernButton) {\n return await modernButton?.click();\n }\n }\n\n /**\n * Gets the colorpicker button's `aria-label`.\n */\n public async getAriaLabel(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-label');\n }\n\n /**\n * Gets the colorpicker button's `aria-labelledby`\n */\n public async getAriaLabelledby(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-labelledby');\n }\n\n /**\n * Gets the `SkyColorpickerDropdownHarness` for the colorpicker dropdown controlled by\n * the colorpicker button. Throws an error if the dropdown is not open.\n */\n public async getColorpickerDropdown(): Promise<SkyColorpickerDropdownHarness> {\n const overlayId = await this.#getOverlayId();\n\n if (!overlayId) {\n throw new Error(\n 'Unable to get colorpicker dropdown because dropdown is closed',\n );\n }\n\n return await this.#documentRootLocator.locatorFor(\n SkyColorpickerDropdownHarness.with({ selector: `#${overlayId}` }),\n )();\n }\n\n /**\n * Gets the `SkyIconHarness` for the colorpicker icon.\n * @internal\n */\n public async getColorpickerIcon(): Promise<SkyIconHarness> {\n return await this.locatorFor(SkyIconHarness)();\n }\n\n /**\n * Gets the help inline popover content.\n */\n public async getHelpPopoverContent(): Promise<string | undefined> {\n return await (await this.#getHelpInline()).getPopoverContent();\n }\n\n /**\n * Gets the help inline popover title.\n */\n public async getHelpPopoverTitle(): Promise<string | undefined> {\n return await (await this.#getHelpInline()).getPopoverTitle();\n }\n\n /**\n * Gets the colorpicker component's hint text.\n */\n public async getHintText(): Promise<string> {\n return (await (await this.#getHintText()).text()).trim();\n }\n\n /**\n * Whether the colorpicker component's label is hidden.\n */\n public async getLabelHidden(): Promise<boolean> {\n return await (await this.#getLabel()).hasClass('sky-screen-reader-only');\n }\n\n /**\n * Gets the colorpicker component's label text.\n */\n public async getLabelText(): Promise<string> {\n return (await (await this.#getLabel()).text()).trim();\n }\n\n /**\n * Whether the custom error has fired.\n * @param errorName `errorName` of the custom error.\n */\n public async hasError(errorName: string): Promise<boolean> {\n return await (await this.#getFormErrors())?.hasError(errorName);\n }\n\n /**\n * Whether the required error has fired.\n */\n public async hasRequiredError(): Promise<boolean> {\n return await (await this.#getFormErrors())?.hasError('required');\n }\n\n /**\n * Whether the reset button is shown.\n */\n public async hasResetButton(): Promise<boolean> {\n const defaultButton = (await this.#resetButtonDefault()) ?? null;\n const modernButton = (await this.#resetButtonModern()) ?? null;\n\n return !!defaultButton || !!modernButton;\n }\n\n /**\n * Whether the colorpicker component is open.\n */\n public async isColorpickerOpen(): Promise<boolean> {\n try {\n await this.getColorpickerDropdown();\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Whether the colorpicker component is stacked.\n */\n public async isStacked(): Promise<boolean> {\n return await (await this.host()).hasClass('sky-form-field-stacked');\n }\n\n async #getFormErrors(): Promise<SkyFormErrorsHarness> {\n return await this.locatorFor(SkyFormErrorsHarness)();\n }\n\n async #getHelpInline(): Promise<SkyHelpInlineHarness> {\n const harness = await this.locatorForOptional(SkyHelpInlineHarness)();\n\n if (harness) {\n return harness;\n }\n\n throw Error('No help inline found.');\n }\n\n async #getOverlayId(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-controls');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAKA;;;;AAIG;MACU,qBAAqB,CAAA;AAChC,IAAA,QAAQ;AACR,IAAA,QAAQ;IAER,WAAY,CAAA,OAAkC,EAAE,SAAiB,EAAA;AAC/D,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,uBAAuB,CACvD,OAAO,EACP,SAAS,EACT,iBAAiB,CAClB;;AAGH;;AAEG;AACH,IAAA,IAAW,KAAK,GAAA;QACd,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,aAAa,CAAC,KAAK;;AAG1D;;;AAGG;IACI,MAAM,eAAe,CAAC,QAAgB,EAAA;AAC3C,QAAA,MAAM,IAAI,CAAC,yBAAyB,EAAE;QAEtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CACrC,iCAAiC,CACd;AAErB,QAAA,QAAQ,CAAC,KAAK,GAAG,QAAQ;AACzB,QAAA,iBAAiB,CAAC,YAAY,CAAC,QAA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AAM,gBAAgB,GAAA;AAC3B,QAAA,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC;;AAGlE;;AAEG;AACI,IAAA,MAAM,cAAc,GAAA;QACzB,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI;QAChE,MAAM,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,KAAK,IAAI;AAE9D,QAAA,OAAO,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,YAAY;;AAG1C;;AAEG;AACI,IAAA,MAAM,iBAAiB,GAAA;AAC5B,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,CAAC,sBAAsB,EAAE;AACnC,YAAA,OAAO,IAAI;;AACX,QAAA,MAAM;AACN,YAAA,OAAO,KAAK;;;AAIhB;;AAEG;AACI,IAAA,MAAM,SAAS,GAAA;AACpB,QAAA,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,wBAAwB,CAAC;;AAGrE,IAAA,MAAM,cAAc,GAAA;QAClB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE;;AAGtD,IAAA,MAAM,cAAc,GAAA;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,EAAE;QAErE,IAAI,OAAO,EAAE;AACX,YAAA,OAAO,OAAO;;AAGhB,QAAA,MAAM,KAAK,CAAC,uBAAuB,CAAC;;AAGtC,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC;;;;AC9MxE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"skyux-colorpicker-testing.mjs","sources":["../../../../../libs/components/colorpicker/testing/src/legacy/colorpicker-fixture.ts","../../../../../libs/components/colorpicker/testing/src/modules/colorpicker/colorpicker-dropdown-harness.ts","../../../../../libs/components/colorpicker/testing/src/modules/colorpicker/colorpicker-harness.ts","../../../../../libs/components/colorpicker/testing/src/skyux-colorpicker-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX colorpicker component.\n * @deprecated Use `SkyColorpickerHarness` instead.\n * @internal\n */\nexport class SkyColorpickerFixture {\n #debugEl: DebugElement;\n #fixture: ComponentFixture<unknown>;\n\n constructor(fixture: ComponentFixture<unknown>, skyTestId: string) {\n this.#fixture = fixture;\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-colorpicker',\n );\n }\n\n /**\n * The colorpicker's currently selected color formatted to the `outputFormat`.\n */\n public get value(): string {\n return this.#getColorpickerInputEl().nativeElement.value;\n }\n\n /**\n * Set the colorpicker's color hex code.\n * @param hexValue The new color hex code. Must include '#'.\n */\n public async setValueFromHex(hexValue: string): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const hexInput = document.querySelector(\n 'input[id^=sky-colorpicker-hex-]',\n ) as HTMLInputElement;\n\n hexInput.value = hexValue;\n SkyAppTestUtility.fireDomEvent(hexInput, 'input');\n\n await this.#clickColorpickerApplyButtonEl();\n await this.#fixture.whenStable();\n }\n\n /**\n * Set the colorpicker's color RGB values.\n * @param red The red color value.\n * @param green The green color value.\n * @param blue The blue color value.\n * @param alpha The alpha channel value.\n */\n public async setValueFromRGBA(\n red: number,\n green: number,\n blue: number,\n alpha: number,\n ): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const rInput = document.querySelector(\n 'input[id^=sky-colorpicker-red-]',\n ) as HTMLInputElement;\n const gInput = document.querySelector(\n 'input[id^=sky-colorpicker-green-]',\n ) as HTMLInputElement;\n const bInput = document.querySelector(\n 'input[id^=sky-colorpicker-blue-]',\n ) as HTMLInputElement;\n const aInput = document.querySelector(\n 'input[id^=sky-colorpicker-alpha-]',\n ) as HTMLInputElement;\n\n rInput.value = red.toString();\n gInput.value = green.toString();\n bInput.value = blue.toString();\n aInput.value = alpha.toString();\n\n SkyAppTestUtility.fireDomEvent(rInput, 'input');\n SkyAppTestUtility.fireDomEvent(gInput, 'input');\n SkyAppTestUtility.fireDomEvent(bInput, 'input');\n SkyAppTestUtility.fireDomEvent(aInput, 'input');\n\n await this.#clickColorpickerApplyButtonEl();\n\n await this.#fixture.whenStable();\n }\n\n /**\n * Set the colorpicker's color to the provided preset color at the given index.\n * @param presetIndex The index of the color in the `presetColors` list to select.\n */\n public async setValueFromPresets(presetIndex: number): Promise<void> {\n await this.#clickColorpickerButtonEl();\n\n const presetColors = document.querySelectorAll(\n '.sky-colorpicker-preset-color-area button',\n );\n const presetColor =\n presetColors && (presetColors[presetIndex] as HTMLButtonElement);\n\n if (presetColor) {\n presetColor.click();\n this.#fixture.detectChanges();\n }\n\n await this.#clickColorpickerApplyButtonEl();\n\n await this.#fixture.whenStable();\n }\n\n async #clickColorpickerButtonEl(): Promise<void> {\n const colorpickerButton = this.#debugEl.query(\n By.css('sky-colorpicker button'),\n ).nativeElement;\n\n colorpickerButton.click();\n\n this.#fixture.detectChanges();\n\n await this.#fixture.whenStable();\n }\n\n async #clickColorpickerApplyButtonEl(): Promise<void> {\n const applyButton = document.querySelector(\n '.sky-btn-colorpicker-apply',\n ) as HTMLButtonElement;\n\n applyButton.click();\n\n this.#fixture.detectChanges();\n\n await this.#fixture.whenStable();\n }\n\n #getColorpickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('sky-colorpicker input'));\n }\n}\n","import { HarnessPredicate, TestElement } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyColorpickerDropdownHarnessFilters } from './colorpicker-dropdown-harness.filters';\n\n/**\n * Harness for interacting with colorpicker dropdown in tests.\n */\nexport class SkyColorpickerDropdownHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = '.sky-colorpicker-container';\n\n #getApplyButton = this.locatorFor('.sky-btn-colorpicker-apply');\n #getCancelButton = this.locatorFor('.sky-btn-colorpicker-close');\n #getInputs = this.locatorForAll('input.sky-form-control');\n #getSwatches = this.locatorForAll('button.sky-preset-color');\n\n public static with(\n filters: SkyColorpickerDropdownHarnessFilters,\n ): HarnessPredicate<SkyColorpickerDropdownHarness> {\n return new HarnessPredicate(SkyColorpickerDropdownHarness, filters);\n }\n\n /**\n * Whether transparency is allowed.\n */\n public async allowsTransparency(): Promise<boolean> {\n return !!(await this.#getAlphaInput());\n }\n\n /**\n * Clicks the colorpicker dropdown apply button.\n */\n public async clickApplyButton(): Promise<void> {\n await (await this.#getApplyButton()).click();\n }\n\n /**\n * Clicks the colorpicker dropdown cancel button.\n */\n public async clickCancelButton(): Promise<void> {\n await (await this.#getCancelButton()).click();\n }\n\n /**\n * Clicks a specified swatch in the color preset section.\n * @param swatchHex Hex code of the swatch to click.\n */\n public async clickPresetColorSwatch(swatchHex: string): Promise<void> {\n const swatches = await this.#getSwatchButtons();\n const ariaLabel = `Preset Color: ${swatchHex}`;\n\n for (const swatch of swatches) {\n if ((await swatch.getAttribute('aria-label')) === ariaLabel) {\n return await swatch.click();\n }\n }\n }\n\n /**\n * Gets an array of the hex codes of the preset color swatches.\n */\n public async getPresetColorSwatches(): Promise<string[]> {\n const swatches = await this.#getSwatchButtons();\n\n return await Promise.all(\n swatches.map(async (swatch): Promise<string> => {\n const swatchHex = (await swatch.getAttribute('aria-label'))\n ?.split(':')[1]\n .trim();\n if (!swatchHex) {\n throw new Error('Preset swatch is undefined.');\n }\n return swatchHex;\n }),\n );\n }\n\n /**\n * Enters a value into the alpha input box.\n * @param value A decimal value from 0-1.\n */\n public async setAlphaValue(value: string): Promise<void> {\n const input = await this.#getAlphaInput();\n\n if (!input) {\n throw new Error('Alpha input cannot be found.');\n }\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the blue input box.\n * @param value A value from 0-255\n */\n public async setBlueValue(value: string): Promise<void> {\n const input = await this.#getBlueInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the green input box.\n * @param value A value from 0-255\n */\n public async setGreenValue(value: string): Promise<void> {\n const input = await this.#getGreenInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the hex input box.\n * @param value A hex value\n */\n public async setHexValue(value: string): Promise<void> {\n const input = await this.#getHexInput();\n\n await this.#setInputValue(input, value);\n }\n\n /**\n * Enters a value into the red input box.\n * @param value A value from 0-255\n */\n public async setRedValue(value: string): Promise<void> {\n const input = await this.#getRedInput();\n\n await this.#setInputValue(input, value);\n }\n\n async #getAlphaInput(): Promise<TestElement | null> {\n return (await this.#getInputs())[4];\n }\n\n async #getBlueInput(): Promise<TestElement> {\n return (await this.#getInputs())[3];\n }\n\n async #getGreenInput(): Promise<TestElement> {\n return (await this.#getInputs())[2];\n }\n\n async #getHexInput(): Promise<TestElement> {\n return (await this.#getInputs())[0];\n }\n\n async #getRedInput(): Promise<TestElement> {\n return (await this.#getInputs())[1];\n }\n\n async #getSwatchButtons(): Promise<TestElement[]> {\n const swatches = await this.#getSwatches();\n\n if (swatches.length > 0) {\n return swatches;\n } else {\n throw new Error('No swatches found.');\n }\n }\n\n async #setInputValue(input: TestElement, value: string): Promise<void> {\n await input.setInputValue(value);\n await input.dispatchEvent('input');\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\nimport { SkyFormErrorsHarness } from '@skyux/forms/testing';\nimport { SkyHelpInlineHarness } from '@skyux/help-inline/testing';\nimport { SkyIconHarness } from '@skyux/icon/testing';\n\nimport { SkyColorpickerDropdownHarness } from './colorpicker-dropdown-harness';\nimport { SkyColorpickerHarnessFilters } from './colorpicker-harness.filters';\n\n/**\n * Harness for interacting with colorpicker components in tests.\n */\nexport class SkyColorpickerHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-colorpicker';\n\n #documentRootLocator = this.documentRootLocatorFactory();\n\n #getButton = this.locatorFor('button.sky-colorpicker-button');\n #getHintText = this.locatorFor('.sky-colorpicker-hint-text');\n #getLabel = this.locatorFor('label.sky-control-label');\n #resetButtonDefault = this.locatorForOptional(\n 'button.sky-colorpicker-reset-button',\n );\n #resetButtonModern = this.locatorForOptional(\n 'button.sky-colorpicker-reset-button-modern',\n );\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyColorpickerHarness` that meets certain criteria\n */\n public static with(\n filters: SkyColorpickerHarnessFilters,\n ): HarnessPredicate<SkyColorpickerHarness> {\n return SkyColorpickerHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Clicks the colorpicker button.\n */\n public async clickColorpickerButton(): Promise<void> {\n const button = await this.#getButton();\n return await button.click();\n }\n\n /**\n * Clicks the help inline button.\n */\n public async clickHelpInline(): Promise<void> {\n await (await this.#getHelpInline()).click();\n }\n\n /**\n * Clicks the reset button. Throws an error if the reset button is hidden.\n */\n public async clickResetButton(): Promise<void> {\n const defaultButton = (await this.#resetButtonDefault()) ?? null;\n const modernButton = (await this.#resetButtonModern()) ?? null;\n\n if (!defaultButton && !modernButton) {\n throw new Error('No reset button found.');\n }\n if (defaultButton) {\n return await defaultButton?.click();\n } else if (modernButton) {\n return await modernButton?.click();\n }\n }\n\n /**\n * Gets the colorpicker button's `aria-label`.\n */\n public async getAriaLabel(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-label');\n }\n\n /**\n * Gets the colorpicker button's `aria-labelledby`\n */\n public async getAriaLabelledby(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-labelledby');\n }\n\n /**\n * Gets the `SkyColorpickerDropdownHarness` for the colorpicker dropdown controlled by\n * the colorpicker button. Throws an error if the dropdown is not open.\n */\n public async getColorpickerDropdown(): Promise<SkyColorpickerDropdownHarness> {\n const overlayId = await this.#getOverlayId();\n\n if (!overlayId) {\n throw new Error(\n 'Unable to get colorpicker dropdown because dropdown is closed',\n );\n }\n\n return await this.#documentRootLocator.locatorFor(\n SkyColorpickerDropdownHarness.with({ selector: `#${overlayId}` }),\n )();\n }\n\n /**\n * Gets the `SkyIconHarness` for the colorpicker icon.\n * @internal\n */\n public async getColorpickerIcon(): Promise<SkyIconHarness> {\n return await this.locatorFor(SkyIconHarness)();\n }\n\n /**\n * Gets the help inline popover content.\n */\n public async getHelpPopoverContent(): Promise<string | undefined> {\n return await (await this.#getHelpInline()).getPopoverContent();\n }\n\n /**\n * Gets the help inline popover title.\n */\n public async getHelpPopoverTitle(): Promise<string | undefined> {\n return await (await this.#getHelpInline()).getPopoverTitle();\n }\n\n /**\n * Gets the colorpicker component's hint text.\n */\n public async getHintText(): Promise<string> {\n return (await (await this.#getHintText()).text()).trim();\n }\n\n /**\n * Whether the colorpicker component's label is hidden.\n */\n public async getLabelHidden(): Promise<boolean> {\n return await (await this.#getLabel()).hasClass('sky-screen-reader-only');\n }\n\n /**\n * Gets the colorpicker component's label text.\n */\n public async getLabelText(): Promise<string> {\n return (await (await this.#getLabel()).text()).trim();\n }\n\n /**\n * Whether the custom error has fired.\n * @param errorName `errorName` of the custom error.\n */\n public async hasError(errorName: string): Promise<boolean> {\n return await (await this.#getFormErrors())?.hasError(errorName);\n }\n\n /**\n * Whether the required error has fired.\n */\n public async hasRequiredError(): Promise<boolean> {\n return await (await this.#getFormErrors())?.hasError('required');\n }\n\n /**\n * Whether the reset button is shown.\n */\n public async hasResetButton(): Promise<boolean> {\n const defaultButton = (await this.#resetButtonDefault()) ?? null;\n const modernButton = (await this.#resetButtonModern()) ?? null;\n\n return !!defaultButton || !!modernButton;\n }\n\n /**\n * Whether the colorpicker component is open.\n */\n public async isColorpickerOpen(): Promise<boolean> {\n try {\n await this.getColorpickerDropdown();\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Whether the colorpicker component is stacked.\n */\n public async isStacked(): Promise<boolean> {\n return await (await this.host()).hasClass('sky-form-field-stacked');\n }\n\n async #getFormErrors(): Promise<SkyFormErrorsHarness> {\n return await this.locatorFor(SkyFormErrorsHarness)();\n }\n\n async #getHelpInline(): Promise<SkyHelpInlineHarness> {\n const harness = await this.locatorForOptional(SkyHelpInlineHarness)();\n\n if (harness) {\n return harness;\n }\n\n throw Error('No help inline found.');\n }\n\n async #getOverlayId(): Promise<string | null> {\n return await (await this.#getButton()).getAttribute('aria-controls');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAKA;;;;AAIG;MACU,qBAAqB,CAAA;AAChC,IAAA,QAAQ;AACR,IAAA,QAAQ;IAER,WAAA,CAAY,OAAkC,EAAE,SAAiB,EAAA;AAC/D,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,uBAAuB,CACvD,OAAO,EACP,SAAS,EACT,iBAAiB,CAClB;;AAGH;;AAEG;AACH,IAAA,IAAW,KAAK,GAAA;QACd,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,aAAa,CAAC,KAAK;;AAG1D;;;AAGG;IACI,MAAM,eAAe,CAAC,QAAgB,EAAA;AAC3C,QAAA,MAAM,IAAI,CAAC,yBAAyB,EAAE;QAEtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CACrC,iCAAiC,CACd;AAErB,QAAA,QAAQ,CAAC,KAAK,GAAG,QAAQ;AACzB,QAAA,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;AAEjD,QAAA,MAAM,IAAI,CAAC,8BAA8B,EAAE;AAC3C,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGlC;;;;;;AAMG;IACI,MAAM,gBAAgB,CAC3B,GAAW,EACX,KAAa,EACb,IAAY,EACZ,KAAa,EAAA;AAEb,QAAA,MAAM,I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