@skyux/colorpicker 7.1.0 → 7.1.2
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/esm2020/lib/modules/colorpicker/colorpicker-slider.directive.mjs +9 -8
- package/esm2020/lib/modules/colorpicker/colorpicker.component.mjs +22 -24
- package/esm2020/testing/colorpicker-fixture.mjs +32 -30
- package/fesm2015/skyux-colorpicker-testing.mjs +35 -34
- package/fesm2015/skyux-colorpicker-testing.mjs.map +1 -1
- package/fesm2015/skyux-colorpicker.mjs +29 -30
- package/fesm2015/skyux-colorpicker.mjs.map +1 -1
- package/fesm2020/skyux-colorpicker-testing.mjs +31 -29
- package/fesm2020/skyux-colorpicker-testing.mjs.map +1 -1
- package/fesm2020/skyux-colorpicker.mjs +29 -30
- package/fesm2020/skyux-colorpicker.mjs.map +1 -1
- package/lib/modules/colorpicker/colorpicker-slider.directive.d.ts +0 -1
- package/lib/modules/colorpicker/colorpicker.component.d.ts +0 -2
- package/package.json +7 -7
- package/testing/colorpicker-fixture.d.ts +1 -6
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet, __awaiter } from 'tslib';
|
|
2
2
|
import { By } from '@angular/platform-browser';
|
|
3
3
|
import { SkyAppTestUtility } from '@skyux-sdk/testing';
|
|
4
4
|
|
|
5
|
+
var _SkyColorpickerFixture_instances, _SkyColorpickerFixture_debugEl, _SkyColorpickerFixture_fixture, _SkyColorpickerFixture_clickColorpickerButtonEl, _SkyColorpickerFixture_clickColorpickerApplyButtonEl, _SkyColorpickerFixture_getColorpickerInputEl;
|
|
5
6
|
/**
|
|
6
7
|
* Allows interaction with a SKY UX colorpicker component.
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
9
10
|
class SkyColorpickerFixture {
|
|
10
11
|
constructor(fixture, skyTestId) {
|
|
11
|
-
this
|
|
12
|
-
this
|
|
13
|
-
|
|
12
|
+
_SkyColorpickerFixture_instances.add(this);
|
|
13
|
+
_SkyColorpickerFixture_debugEl.set(this, void 0);
|
|
14
|
+
_SkyColorpickerFixture_fixture.set(this, void 0);
|
|
15
|
+
__classPrivateFieldSet(this, _SkyColorpickerFixture_fixture, fixture, "f");
|
|
16
|
+
__classPrivateFieldSet(this, _SkyColorpickerFixture_debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-colorpicker'), "f");
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* The colorpicker's currently selected color formatted to the `outputFormat`.
|
|
17
20
|
*/
|
|
18
21
|
get value() {
|
|
19
|
-
return this.
|
|
22
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_getColorpickerInputEl).call(this).nativeElement.value;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Set the colorpicker's color hex code.
|
|
@@ -24,12 +27,12 @@ class SkyColorpickerFixture {
|
|
|
24
27
|
*/
|
|
25
28
|
setValueFromHex(hexValue) {
|
|
26
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
yield this.
|
|
30
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerButtonEl).call(this);
|
|
28
31
|
const hexInput = document.querySelector('input[id^=sky-colorpicker-hex-]');
|
|
29
32
|
hexInput.value = hexValue;
|
|
30
33
|
SkyAppTestUtility.fireDomEvent(hexInput, 'input');
|
|
31
|
-
yield this.
|
|
32
|
-
return this.
|
|
34
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerApplyButtonEl).call(this);
|
|
35
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").whenStable();
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
@@ -41,7 +44,7 @@ class SkyColorpickerFixture {
|
|
|
41
44
|
*/
|
|
42
45
|
setValueFromRGBA(red, green, blue, alpha) {
|
|
43
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
yield this.
|
|
47
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerButtonEl).call(this);
|
|
45
48
|
const rInput = document.querySelector('input[id^=sky-colorpicker-red-]');
|
|
46
49
|
const gInput = document.querySelector('input[id^=sky-colorpicker-green-]');
|
|
47
50
|
const bInput = document.querySelector('input[id^=sky-colorpicker-blue-]');
|
|
@@ -54,8 +57,8 @@ class SkyColorpickerFixture {
|
|
|
54
57
|
SkyAppTestUtility.fireDomEvent(gInput, 'input');
|
|
55
58
|
SkyAppTestUtility.fireDomEvent(bInput, 'input');
|
|
56
59
|
SkyAppTestUtility.fireDomEvent(aInput, 'input');
|
|
57
|
-
yield this.
|
|
58
|
-
return this.
|
|
60
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerApplyButtonEl).call(this);
|
|
61
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").whenStable();
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
@@ -64,37 +67,35 @@ class SkyColorpickerFixture {
|
|
|
64
67
|
*/
|
|
65
68
|
setValueFromPresets(presetIndex) {
|
|
66
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
yield this.
|
|
70
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerButtonEl).call(this);
|
|
68
71
|
const presetColors = document.querySelectorAll('.sky-colorpicker-preset-color-area button');
|
|
69
72
|
const presetColor = presetColors && presetColors[presetIndex];
|
|
70
73
|
if (presetColor) {
|
|
71
74
|
presetColor.click();
|
|
72
|
-
this.
|
|
75
|
+
__classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").detectChanges();
|
|
73
76
|
}
|
|
74
|
-
yield this.
|
|
75
|
-
return this.
|
|
77
|
+
yield __classPrivateFieldGet(this, _SkyColorpickerFixture_instances, "m", _SkyColorpickerFixture_clickColorpickerApplyButtonEl).call(this);
|
|
78
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").whenStable();
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
|
-
clickColorpickerButtonEl() {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const colorpickerButton = this.debugEl.query(By.css('sky-colorpicker button')).nativeElement;
|
|
81
|
-
colorpickerButton.click();
|
|
82
|
-
this.fixture.detectChanges();
|
|
83
|
-
return this.fixture.whenStable();
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
clickColorpickerApplyButtonEl() {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const applyButton = document.querySelector('.sky-btn-colorpicker-apply');
|
|
89
|
-
applyButton.click();
|
|
90
|
-
this.fixture.detectChanges();
|
|
91
|
-
return this.fixture.whenStable();
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
getColorpickerInputEl() {
|
|
95
|
-
return this.debugEl.query(By.css('sky-colorpicker input'));
|
|
96
|
-
}
|
|
97
81
|
}
|
|
82
|
+
_SkyColorpickerFixture_debugEl = new WeakMap(), _SkyColorpickerFixture_fixture = new WeakMap(), _SkyColorpickerFixture_instances = new WeakSet(), _SkyColorpickerFixture_clickColorpickerButtonEl = function _SkyColorpickerFixture_clickColorpickerButtonEl() {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const colorpickerButton = __classPrivateFieldGet(this, _SkyColorpickerFixture_debugEl, "f").query(By.css('sky-colorpicker button')).nativeElement;
|
|
85
|
+
colorpickerButton.click();
|
|
86
|
+
__classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").detectChanges();
|
|
87
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").whenStable();
|
|
88
|
+
});
|
|
89
|
+
}, _SkyColorpickerFixture_clickColorpickerApplyButtonEl = function _SkyColorpickerFixture_clickColorpickerApplyButtonEl() {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const applyButton = document.querySelector('.sky-btn-colorpicker-apply');
|
|
92
|
+
applyButton.click();
|
|
93
|
+
__classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").detectChanges();
|
|
94
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_fixture, "f").whenStable();
|
|
95
|
+
});
|
|
96
|
+
}, _SkyColorpickerFixture_getColorpickerInputEl = function _SkyColorpickerFixture_getColorpickerInputEl() {
|
|
97
|
+
return __classPrivateFieldGet(this, _SkyColorpickerFixture_debugEl, "f").query(By.css('sky-colorpicker input'));
|
|
98
|
+
};
|
|
98
99
|
|
|
99
100
|
/**
|
|
100
101
|
* Generated bundle index. Do not edit.
|
|
@@ -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
|
|
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 inculde '#'.\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;QAGlC,sBAAA,CAAA,IAAI,EAAA,8BAAA,EAAY,OAAO,EAAA,GAAA,CAAA,CAAC;AACxB,QAAA,sBAAA,CAAA,IAAI,EAAA,8BAAA,EAAY,iBAAiB,CAAC,uBAAuB,CACvD,OAAO,EACP,SAAS,EACT,iBAAiB,CAClB,MAAA,CAAC;KACH;AAED;;AAEG;AACH,IAAA,IA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i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
667
667
|
args: ['change']
|
|
668
668
|
}] } });
|
|
669
669
|
|
|
670
|
-
var _SkyColorpickerSliderDirective_instances, _SkyColorpickerSliderDirective_listenerMove, _SkyColorpickerSliderDirective_listenerStop, _SkyColorpickerSliderDirective_setCursor;
|
|
670
|
+
var _SkyColorpickerSliderDirective_instances, _SkyColorpickerSliderDirective_listenerMove, _SkyColorpickerSliderDirective_listenerStop, _SkyColorpickerSliderDirective_el, _SkyColorpickerSliderDirective_setCursor;
|
|
671
671
|
/**
|
|
672
672
|
* @internal
|
|
673
673
|
*/
|
|
674
674
|
class SkyColorpickerSliderDirective {
|
|
675
675
|
constructor(el) {
|
|
676
|
-
this.el = el;
|
|
677
676
|
_SkyColorpickerSliderDirective_instances.add(this);
|
|
678
677
|
this.newColorContrast = new EventEmitter();
|
|
679
678
|
_SkyColorpickerSliderDirective_listenerMove.set(this, void 0);
|
|
680
679
|
_SkyColorpickerSliderDirective_listenerStop.set(this, void 0);
|
|
680
|
+
_SkyColorpickerSliderDirective_el.set(this, void 0);
|
|
681
|
+
__classPrivateFieldSet(this, _SkyColorpickerSliderDirective_el, el, "f");
|
|
681
682
|
__classPrivateFieldSet(this, _SkyColorpickerSliderDirective_listenerMove, (event) => {
|
|
682
683
|
this.move(event);
|
|
683
684
|
}, "f");
|
|
@@ -706,20 +707,20 @@ class SkyColorpickerSliderDirective {
|
|
|
706
707
|
/* Ignoring event.touches as tests are not run on a touch device. */
|
|
707
708
|
/* istanbul ignore next */
|
|
708
709
|
return (('pageX' in event ? event.pageX : event.touches[0].pageX) -
|
|
709
|
-
this.
|
|
710
|
+
__classPrivateFieldGet(this, _SkyColorpickerSliderDirective_el, "f").nativeElement.getBoundingClientRect().left -
|
|
710
711
|
window.pageXOffset);
|
|
711
712
|
}
|
|
712
713
|
getY(event) {
|
|
713
714
|
/* Ignoring event.touches as tests are not run on a touch device. */
|
|
714
715
|
/* istanbul ignore next */
|
|
715
716
|
return (('pageY' in event ? event.pageY : event.touches[0].pageY) -
|
|
716
|
-
this.
|
|
717
|
+
__classPrivateFieldGet(this, _SkyColorpickerSliderDirective_el, "f").nativeElement.getBoundingClientRect().top -
|
|
717
718
|
window.pageYOffset);
|
|
718
719
|
}
|
|
719
720
|
}
|
|
720
|
-
_SkyColorpickerSliderDirective_listenerMove = new WeakMap(), _SkyColorpickerSliderDirective_listenerStop = new WeakMap(), _SkyColorpickerSliderDirective_instances = new WeakSet(), _SkyColorpickerSliderDirective_setCursor = function _SkyColorpickerSliderDirective_setCursor(event) {
|
|
721
|
-
const height = this.
|
|
722
|
-
const width = this.
|
|
721
|
+
_SkyColorpickerSliderDirective_listenerMove = new WeakMap(), _SkyColorpickerSliderDirective_listenerStop = new WeakMap(), _SkyColorpickerSliderDirective_el = new WeakMap(), _SkyColorpickerSliderDirective_instances = new WeakSet(), _SkyColorpickerSliderDirective_setCursor = function _SkyColorpickerSliderDirective_setCursor(event) {
|
|
722
|
+
const height = __classPrivateFieldGet(this, _SkyColorpickerSliderDirective_el, "f").nativeElement.offsetHeight;
|
|
723
|
+
const width = __classPrivateFieldGet(this, _SkyColorpickerSliderDirective_el, "f").nativeElement.offsetWidth;
|
|
723
724
|
const xAxis = Math.max(0, Math.min(this.getX(event), width));
|
|
724
725
|
const yAxis = Math.max(0, Math.min(this.getY(event), height));
|
|
725
726
|
if (this.xAxis !== undefined && this.yAxis !== undefined) {
|
|
@@ -865,7 +866,7 @@ var SkyColorpickerMessageType;
|
|
|
865
866
|
SkyColorpickerMessageType[SkyColorpickerMessageType["Close"] = 3] = "Close";
|
|
866
867
|
})(SkyColorpickerMessageType || (SkyColorpickerMessageType = {}));
|
|
867
868
|
|
|
868
|
-
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_addTriggerButtonEventListeners, _SkyColorpickerComponent_removePickerEventListeners, _SkyColorpickerComponent_getHsvaValue, _SkyColorpickerComponent_getAccessibleIconColor;
|
|
869
|
+
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
870
|
let componentIdIndex = 0;
|
|
870
871
|
/**
|
|
871
872
|
* Provides a SKY UX-themed replacement for the HTML `input` element with `type="color"`.
|
|
@@ -1089,7 +1090,7 @@ class SkyColorpickerComponent {
|
|
|
1089
1090
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_ngUnsubscribe, "f").complete();
|
|
1090
1091
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_removePickerEventListeners).call(this);
|
|
1091
1092
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_destroyAffixer).call(this);
|
|
1092
|
-
this.
|
|
1093
|
+
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_destroyOverlay).call(this);
|
|
1093
1094
|
}
|
|
1094
1095
|
onTriggerButtonClick() {
|
|
1095
1096
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_sendMessage).call(this, SkyColorpickerMessageType.Open);
|
|
@@ -1097,7 +1098,7 @@ class SkyColorpickerComponent {
|
|
|
1097
1098
|
closePicker() {
|
|
1098
1099
|
var _b;
|
|
1099
1100
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_destroyAffixer).call(this);
|
|
1100
|
-
this.
|
|
1101
|
+
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_destroyOverlay).call(this);
|
|
1101
1102
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_removePickerEventListeners).call(this);
|
|
1102
1103
|
(_b = this.triggerButtonRef) === null || _b === void 0 ? void 0 : _b.nativeElement.focus();
|
|
1103
1104
|
this.isOpen = false;
|
|
@@ -1130,24 +1131,6 @@ class SkyColorpickerComponent {
|
|
|
1130
1131
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_update).call(this);
|
|
1131
1132
|
}
|
|
1132
1133
|
}
|
|
1133
|
-
createOverlay() {
|
|
1134
|
-
if (this.colorpickerTemplateRef) {
|
|
1135
|
-
const overlay = __classPrivateFieldGet(this, _SkyColorpickerComponent_overlaySvc, "f").create({
|
|
1136
|
-
enableClose: false,
|
|
1137
|
-
enablePointerEvents: false,
|
|
1138
|
-
enableScroll: true,
|
|
1139
|
-
});
|
|
1140
|
-
overlay.attachTemplate(this.colorpickerTemplateRef);
|
|
1141
|
-
__classPrivateFieldSet(this, _SkyColorpickerComponent_overlay, overlay, "f");
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
destroyOverlay() {
|
|
1145
|
-
/*istanbul ignore else*/
|
|
1146
|
-
if (__classPrivateFieldGet(this, _SkyColorpickerComponent_overlay, "f")) {
|
|
1147
|
-
__classPrivateFieldGet(this, _SkyColorpickerComponent_overlaySvc, "f").close(__classPrivateFieldGet(this, _SkyColorpickerComponent_overlay, "f"));
|
|
1148
|
-
__classPrivateFieldSet(this, _SkyColorpickerComponent_overlay, undefined, "f");
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
1134
|
}
|
|
1152
1135
|
_SkyColorpickerComponent_idIndex = new WeakMap(), _SkyColorpickerComponent_alphaChannel = new WeakMap(), _SkyColorpickerComponent_format = new WeakMap(), _SkyColorpickerComponent_outputFormat = new WeakMap(), _SkyColorpickerComponent_hsva = new WeakMap(), _SkyColorpickerComponent_sliderDimMax = new WeakMap(), _SkyColorpickerComponent_ngUnsubscribe = new WeakMap(), _SkyColorpickerComponent_affixer = new WeakMap(), _SkyColorpickerComponent_overlay = new WeakMap(), _SkyColorpickerComponent_pickerUnsubscribe = new WeakMap(), _SkyColorpickerComponent_affixSvc = new WeakMap(), _SkyColorpickerComponent_changeDetector = new WeakMap(), _SkyColorpickerComponent_coreAdapter = new WeakMap(), _SkyColorpickerComponent_overlaySvc = new WeakMap(), _SkyColorpickerComponent_svc = new WeakMap(), _SkyColorpickerComponent_themeSvc = new WeakMap(), _SkyColorpickerComponent__backgroundColorForDisplay = new WeakMap(), _SkyColorpickerComponent__colorpickerRef = new WeakMap(), _SkyColorpickerComponent__disabled = new WeakMap(), _SkyColorpickerComponent_instances = new WeakSet(), _SkyColorpickerComponent_update = function _SkyColorpickerComponent_update() {
|
|
1153
1136
|
var _a;
|
|
@@ -1180,8 +1163,8 @@ _SkyColorpickerComponent_idIndex = new WeakMap(), _SkyColorpickerComponent_alpha
|
|
|
1180
1163
|
}, _SkyColorpickerComponent_openPicker = function _SkyColorpickerComponent_openPicker() {
|
|
1181
1164
|
this.isPickerVisible = false;
|
|
1182
1165
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_removePickerEventListeners).call(this);
|
|
1183
|
-
this.
|
|
1184
|
-
this.
|
|
1166
|
+
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_destroyOverlay).call(this);
|
|
1167
|
+
__classPrivateFieldGet(this, _SkyColorpickerComponent_instances, "m", _SkyColorpickerComponent_createOverlay).call(this);
|
|
1185
1168
|
this.isOpen = true;
|
|
1186
1169
|
}, _SkyColorpickerComponent_sendMessage = function _SkyColorpickerComponent_sendMessage(type) {
|
|
1187
1170
|
this.messageStream.next({ type });
|
|
@@ -1234,6 +1217,22 @@ _SkyColorpickerComponent_idIndex = new WeakMap(), _SkyColorpickerComponent_alpha
|
|
|
1234
1217
|
__classPrivateFieldGet(this, _SkyColorpickerComponent_affixer, "f").destroy();
|
|
1235
1218
|
__classPrivateFieldSet(this, _SkyColorpickerComponent_affixer, undefined, "f");
|
|
1236
1219
|
}
|
|
1220
|
+
}, _SkyColorpickerComponent_createOverlay = function _SkyColorpickerComponent_createOverlay() {
|
|
1221
|
+
if (this.colorpickerTemplateRef) {
|
|
1222
|
+
const overlay = __classPrivateFieldGet(this, _SkyColorpickerComponent_overlaySvc, "f").create({
|
|
1223
|
+
enableClose: false,
|
|
1224
|
+
enablePointerEvents: false,
|
|
1225
|
+
enableScroll: true,
|
|
1226
|
+
});
|
|
1227
|
+
overlay.attachTemplate(this.colorpickerTemplateRef);
|
|
1228
|
+
__classPrivateFieldSet(this, _SkyColorpickerComponent_overlay, overlay, "f");
|
|
1229
|
+
}
|
|
1230
|
+
}, _SkyColorpickerComponent_destroyOverlay = function _SkyColorpickerComponent_destroyOverlay() {
|
|
1231
|
+
/*istanbul ignore else*/
|
|
1232
|
+
if (__classPrivateFieldGet(this, _SkyColorpickerComponent_overlay, "f")) {
|
|
1233
|
+
__classPrivateFieldGet(this, _SkyColorpickerComponent_overlaySvc, "f").close(__classPrivateFieldGet(this, _SkyColorpickerComponent_overlay, "f"));
|
|
1234
|
+
__classPrivateFieldSet(this, _SkyColorpickerComponent_overlay, undefined, "f");
|
|
1235
|
+
}
|
|
1237
1236
|
}, _SkyColorpickerComponent_addTriggerButtonEventListeners = function _SkyColorpickerComponent_addTriggerButtonEventListeners() {
|
|
1238
1237
|
fromEvent(window.document, 'keydown')
|
|
1239
1238
|
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyColorpickerComponent_ngUnsubscribe, "f")))
|