@skyux/colorpicker 7.4.2 → 7.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.
- package/documentation.json +70 -70
- package/esm2020/lib/modules/colorpicker/colorpicker-classes.mjs +1 -2
- package/esm2020/lib/modules/colorpicker/colorpicker-input.directive.mjs +7 -7
- package/esm2020/lib/modules/colorpicker/colorpicker-slider.directive.mjs +1 -2
- package/esm2020/lib/modules/colorpicker/colorpicker-text.directive.mjs +1 -2
- package/esm2020/lib/modules/colorpicker/colorpicker.component.mjs +5 -5
- package/esm2020/lib/modules/colorpicker/colorpicker.service.mjs +1 -2
- package/esm2020/lib/modules/colorpicker/types/colorpicker-axis.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-cmyk.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-color.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-hsla.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-hsva.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-message-type.mjs +2 -2
- package/esm2020/lib/modules/colorpicker/types/colorpicker-message.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-output.mjs +1 -1
- package/esm2020/lib/modules/colorpicker/types/colorpicker-rgba.mjs +1 -1
- package/esm2020/testing/colorpicker-fixture.mjs +2 -2
- package/fesm2015/skyux-colorpicker-testing.mjs +1 -1
- package/fesm2015/skyux-colorpicker-testing.mjs.map +1 -1
- package/fesm2015/skyux-colorpicker.mjs +11 -13
- package/fesm2015/skyux-colorpicker.mjs.map +1 -1
- package/fesm2020/skyux-colorpicker-testing.mjs +1 -1
- package/fesm2020/skyux-colorpicker-testing.mjs.map +1 -1
- package/fesm2020/skyux-colorpicker.mjs +11 -13
- package/fesm2020/skyux-colorpicker.mjs.map +1 -1
- package/lib/modules/colorpicker/colorpicker-input.directive.d.ts +6 -6
- package/lib/modules/colorpicker/colorpicker.component.d.ts +7 -7
- package/lib/modules/colorpicker/types/colorpicker-cmyk.d.ts +5 -5
- package/lib/modules/colorpicker/types/colorpicker-hsla.d.ts +6 -6
- package/lib/modules/colorpicker/types/colorpicker-hsva.d.ts +8 -8
- package/lib/modules/colorpicker/types/colorpicker-message-type.d.ts +1 -1
- package/lib/modules/colorpicker/types/colorpicker-message.d.ts +1 -1
- package/lib/modules/colorpicker/types/colorpicker-output.d.ts +8 -8
- package/lib/modules/colorpicker/types/colorpicker-rgba.d.ts +6 -6
- package/package.json +7 -7
- package/testing/colorpicker-fixture.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-colorpicker-testing.mjs","sources":["../../../../../libs/components/colorpicker/testing/src/colorpicker-fixture.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 * @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
|
|
1
|
+
{"version":3,"file":"skyux-colorpicker-testing.mjs","sources":["../../../../../libs/components/colorpicker/testing/src/colorpicker-fixture.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 * @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\n return 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 return 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 return 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 return 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 return this.#fixture.whenStable();\n }\n\n #getColorpickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('sky-colorpicker input'));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;;AAGG;MACU,qBAAqB,CAAA;IAIhC,WAAY,CAAA,OAAkC,EAAE,SAAiB,EAAA;;QAHjE,8BAAuB,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;QACvB,8BAAoC,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGlC,QAAA,sBAAA,CAAA,IAAI,EAAA,8BAAA,EAAY,OAAO,EAAA,GAAA,CAAA,CAAC;AACxB,QAAA,sBAAA,CAAA,IAAI,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AC,CAAC;AAC9D,CAAC;;AC5IH;;AAEG;;;;"}
|
|
@@ -439,25 +439,25 @@ class SkyColorpickerInputDirective {
|
|
|
439
439
|
*/
|
|
440
440
|
this.returnFormat = 'rgba';
|
|
441
441
|
/**
|
|
442
|
-
*
|
|
442
|
+
* The format for the color when the colorpicker uses a native input
|
|
443
443
|
* element such as a standard text input or a button. This property accepts `rgba`, `hex`,
|
|
444
444
|
* or `hsla`, but we do not recommend using it because users never see or use its value.
|
|
445
445
|
* Instead, if you need to access this format value, see the demo for an example.
|
|
446
|
-
|
|
446
|
+
* @default "rgba"
|
|
447
447
|
*/
|
|
448
448
|
this.outputFormat = 'rgba';
|
|
449
449
|
/**
|
|
450
|
-
*
|
|
450
|
+
* The array of colors to load as preset choices. The colorpicker displays the
|
|
451
451
|
* colors in a series of 12 boxes for users to select.
|
|
452
452
|
*/
|
|
453
453
|
this.presetColors = ['#333', '#888', '#EFEFEF', '#FFF'];
|
|
454
454
|
/**
|
|
455
|
-
*
|
|
455
|
+
* The type of transparency in the transparency slider.
|
|
456
456
|
*@default "hex6"
|
|
457
457
|
*/
|
|
458
458
|
this.alphaChannel = 'hex6';
|
|
459
459
|
/**
|
|
460
|
-
*
|
|
460
|
+
* Whether to display a transparency slider for users to select transparency
|
|
461
461
|
* levels.
|
|
462
462
|
*/
|
|
463
463
|
this.allowTransparency = true;
|
|
@@ -477,7 +477,7 @@ class SkyColorpickerInputDirective {
|
|
|
477
477
|
__classPrivateFieldSet(this, _SkyColorpickerInputDirective_injector, injector, "f");
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
|
-
*
|
|
480
|
+
* The initial color to load in the colorpicker. Use a reactive or
|
|
481
481
|
* template-driven form to set this value. This property is deprecated. As an alternative,
|
|
482
482
|
* we recommend the `formControlName` property on reactive forms or `ngModel` on
|
|
483
483
|
* template-driven forms. See the demo for examples.
|
|
@@ -766,7 +766,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
766
766
|
args: ['mousedown', ['$event']]
|
|
767
767
|
}] } });
|
|
768
768
|
|
|
769
|
-
// spell-checker:ignore Colorpicker
|
|
770
769
|
/**
|
|
771
770
|
* @internal
|
|
772
771
|
*/
|
|
@@ -818,7 +817,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
818
817
|
args: ['input', ['$event']]
|
|
819
818
|
}] } });
|
|
820
819
|
|
|
821
|
-
// spell-checker:ignore colorpicker
|
|
822
820
|
/**
|
|
823
821
|
* @internal
|
|
824
822
|
*/
|
|
@@ -843,7 +841,7 @@ class SliderDimension {
|
|
|
843
841
|
}
|
|
844
842
|
|
|
845
843
|
/**
|
|
846
|
-
*
|
|
844
|
+
* The commands to provide the colorpicker.
|
|
847
845
|
*/
|
|
848
846
|
var SkyColorpickerMessageType;
|
|
849
847
|
(function (SkyColorpickerMessageType) {
|
|
@@ -868,7 +866,7 @@ var SkyColorpickerMessageType;
|
|
|
868
866
|
var _SkyColorpickerComponent_instances, _SkyColorpickerComponent_idIndex, _SkyColorpickerComponent_alphaChannel, _SkyColorpickerComponent_format, _SkyColorpickerComponent_outputFormat, _SkyColorpickerComponent_hsva, _SkyColorpickerComponent_sliderDimMax, _SkyColorpickerComponent_ngUnsubscribe, _SkyColorpickerComponent_affixer, _SkyColorpickerComponent_overlay, _SkyColorpickerComponent_pickerUnsubscribe, _SkyColorpickerComponent_affixSvc, _SkyColorpickerComponent_changeDetector, _SkyColorpickerComponent_coreAdapter, _SkyColorpickerComponent_overlaySvc, _SkyColorpickerComponent_svc, _SkyColorpickerComponent_themeSvc, _SkyColorpickerComponent__backgroundColorForDisplay, _SkyColorpickerComponent__colorpickerRef, _SkyColorpickerComponent__disabled, _SkyColorpickerComponent_update, _SkyColorpickerComponent_updateSlider, _SkyColorpickerComponent_openPicker, _SkyColorpickerComponent_sendMessage, _SkyColorpickerComponent_handleIncomingMessages, _SkyColorpickerComponent_createAffixer, _SkyColorpickerComponent_destroyAffixer, _SkyColorpickerComponent_createOverlay, _SkyColorpickerComponent_destroyOverlay, _SkyColorpickerComponent_addTriggerButtonEventListeners, _SkyColorpickerComponent_removePickerEventListeners, _SkyColorpickerComponent_getHsvaValue, _SkyColorpickerComponent_getAccessibleIconColor;
|
|
869
867
|
let componentIdIndex = 0;
|
|
870
868
|
/**
|
|
871
|
-
*
|
|
869
|
+
* The SKY UX-themed replacement for the HTML `input` element with `type="color"`.
|
|
872
870
|
* The value that users select is driven through the `ngModel` attribute specified on
|
|
873
871
|
* the `input` element.
|
|
874
872
|
*/
|
|
@@ -876,7 +874,7 @@ class SkyColorpickerComponent {
|
|
|
876
874
|
constructor(affixSvc, changeDetector, coreAdapter, overlaySvc, svc, themeSvc) {
|
|
877
875
|
_SkyColorpickerComponent_instances.add(this);
|
|
878
876
|
/**
|
|
879
|
-
*
|
|
877
|
+
* 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.
|
|
880
878
|
* @internal
|
|
881
879
|
*/
|
|
882
880
|
this.pickerButtonIconType = 'fa';
|
|
@@ -889,12 +887,12 @@ class SkyColorpickerComponent {
|
|
|
889
887
|
*/
|
|
890
888
|
this.selectedColorApplied = new EventEmitter();
|
|
891
889
|
/**
|
|
892
|
-
*
|
|
890
|
+
* The observable to send commands to the colorpicker. The commands should
|
|
893
891
|
* respect the `SkyColorPickerMessage` type.
|
|
894
892
|
*/
|
|
895
893
|
this.messageStream = new Subject();
|
|
896
894
|
/**
|
|
897
|
-
*
|
|
895
|
+
* Whether to display a reset button to let users return to the default color.
|
|
898
896
|
*/
|
|
899
897
|
this.showResetButton = true;
|
|
900
898
|
this.isVisible = true;
|