@spectrum-web-components/color-slider 0.4.0-devmode.0 → 0.4.1
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/custom-elements.json +6 -38
- package/package.json +6 -5
- package/sp-color-slider.dev.js +1 -0
- package/sp-color-slider.dev.js.map +1 -1
- package/sp-color-slider.js +1 -2
- package/sp-color-slider.js.map +2 -2
- package/src/ColorSlider.d.ts +2 -6
- package/src/ColorSlider.dev.js +62 -119
- package/src/ColorSlider.dev.js.map +3 -3
- package/src/ColorSlider.js +5 -324
- package/src/ColorSlider.js.map +3 -3
- package/src/color-slider.css.dev.js +1 -0
- package/src/color-slider.css.dev.js.map +1 -1
- package/src/color-slider.css.js +2 -4
- package/src/color-slider.css.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-color-slider.css.dev.js +1 -0
- package/src/spectrum-color-slider.css.dev.js.map +1 -1
- package/src/spectrum-color-slider.css.js +2 -4
- package/src/spectrum-color-slider.css.js.map +2 -2
- package/src/types.dev.js +1 -0
- package/src/types.js +1 -0
- package/stories/color-slider.stories.js +10 -2
- package/stories/color-slider.stories.js.map +2 -2
- package/stories/images.js +1 -0
- package/stories/images.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -0
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/color-slider.test-vrt.js +1 -0
- package/test/color-slider.test-vrt.js.map +1 -1
- package/test/color-slider.test.js +266 -138
- package/test/color-slider.test.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -85,21 +85,18 @@
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"kind": "field",
|
|
88
|
-
"name": "
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
"privacy": "public",
|
|
93
|
-
"attribute": "value"
|
|
88
|
+
"name": "colorController",
|
|
89
|
+
"privacy": "private",
|
|
90
|
+
"default": "new ColorController(this, {\n /* c8 ignore next 3 */\n applyColorToState: () => {\n this.sliderHandlePosition = 100 * (this.colorController.hue / 360);\n },\n extractColorFromState: (controller) => ({\n ...(controller.getColor('hsl') as HSL),\n h: this.value,\n }),\n maintains: 'saturation',\n })"
|
|
94
91
|
},
|
|
95
92
|
{
|
|
96
93
|
"kind": "field",
|
|
97
|
-
"name": "
|
|
94
|
+
"name": "value",
|
|
98
95
|
"type": {
|
|
99
96
|
"text": "number"
|
|
100
97
|
},
|
|
101
|
-
"privacy": "
|
|
102
|
-
"
|
|
98
|
+
"privacy": "public",
|
|
99
|
+
"attribute": "value"
|
|
103
100
|
},
|
|
104
101
|
{
|
|
105
102
|
"kind": "field",
|
|
@@ -121,35 +118,6 @@
|
|
|
121
118
|
"privacy": "public",
|
|
122
119
|
"attribute": "color"
|
|
123
120
|
},
|
|
124
|
-
{
|
|
125
|
-
"kind": "field",
|
|
126
|
-
"name": "_color",
|
|
127
|
-
"privacy": "private",
|
|
128
|
-
"default": "new TinyColor({ h: 0, s: 1, v: 1 })"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"kind": "field",
|
|
132
|
-
"name": "_previousColor",
|
|
133
|
-
"privacy": "private",
|
|
134
|
-
"default": "new TinyColor({ h: 0, s: 1, v: 1 })"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"kind": "field",
|
|
138
|
-
"name": "_saturation",
|
|
139
|
-
"type": {
|
|
140
|
-
"text": "number"
|
|
141
|
-
},
|
|
142
|
-
"privacy": "private"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"kind": "field",
|
|
146
|
-
"name": "_format",
|
|
147
|
-
"type": {
|
|
148
|
-
"text": "{ format: string; isString: boolean }"
|
|
149
|
-
},
|
|
150
|
-
"privacy": "private",
|
|
151
|
-
"default": "{\n format: '',\n isString: false,\n }"
|
|
152
|
-
},
|
|
153
121
|
{
|
|
154
122
|
"kind": "field",
|
|
155
123
|
"name": "step",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/color-slider",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -62,9 +62,10 @@
|
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@ctrl/tinycolor": "^3.3.3",
|
|
65
|
-
"@spectrum-web-components/base": "^0.
|
|
66
|
-
"@spectrum-web-components/color-handle": "^0.4.
|
|
67
|
-
"@spectrum-web-components/
|
|
65
|
+
"@spectrum-web-components/base": "^0.7.0",
|
|
66
|
+
"@spectrum-web-components/color-handle": "^0.4.1",
|
|
67
|
+
"@spectrum-web-components/reactive-controllers": "^0.3.1",
|
|
68
|
+
"@spectrum-web-components/shared": "^0.15.0",
|
|
68
69
|
"tslib": "^2.0.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"./sp-*.js",
|
|
77
78
|
"./**/*.dev.js"
|
|
78
79
|
],
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "15588c72c774b17cfac605b20ac52a27d123bd03"
|
|
80
81
|
}
|
package/sp-color-slider.dev.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-color-slider.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ColorSlider } from './src/ColorSlider.dev.js'\n\ncustomElements.define('sp-color-slider', ColorSlider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-color-slider': ColorSlider;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,SAAS,mBAAmB;AAE5B,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-color-slider.js
CHANGED
package/sp-color-slider.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-color-slider.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ColorSlider } from './src/ColorSlider.js';\n\ncustomElements.define('sp-color-slider', ColorSlider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-color-slider': ColorSlider;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,OAAS,eAAAA,MAAmB,uBAE5B,eAAe,OAAO,kBAAmBA,CAAW",
|
|
6
|
+
"names": ["ColorSlider"]
|
|
7
7
|
}
|
package/src/ColorSlider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import { Focusable } from '@spectrum-web-components/shared/src/focusable.js';
|
|
3
3
|
import '@spectrum-web-components/color-handle/sp-color-handle.js';
|
|
4
|
-
import { ColorValue } from '@spectrum-web-components/
|
|
4
|
+
import { ColorValue } from '@spectrum-web-components/reactive-controllers/src/Color.js';
|
|
5
5
|
/**
|
|
6
6
|
* @element sp-color-slider
|
|
7
7
|
* @slot gradient - a custom gradient visually outlining the available color values
|
|
@@ -15,16 +15,12 @@ export declare class ColorSlider extends Focusable {
|
|
|
15
15
|
private handle;
|
|
16
16
|
label: string;
|
|
17
17
|
vertical: boolean;
|
|
18
|
+
private colorController;
|
|
18
19
|
get value(): number;
|
|
19
20
|
set value(hue: number);
|
|
20
|
-
private _value;
|
|
21
21
|
sliderHandlePosition: number;
|
|
22
22
|
get color(): ColorValue;
|
|
23
23
|
set color(color: ColorValue);
|
|
24
|
-
private _color;
|
|
25
|
-
private _previousColor;
|
|
26
|
-
private _saturation;
|
|
27
|
-
private _format;
|
|
28
24
|
step: number;
|
|
29
25
|
private get altered();
|
|
30
26
|
private set altered(value);
|
package/src/ColorSlider.dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -20,12 +21,10 @@ import {
|
|
|
20
21
|
import { streamingListener } from "@spectrum-web-components/base/src/streaming-listener.js";
|
|
21
22
|
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
22
23
|
import "@spectrum-web-components/color-handle/sp-color-handle.js";
|
|
23
|
-
import styles from "./color-slider.css.js";
|
|
24
24
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import { TinyColor } from "@ctrl/tinycolor";
|
|
25
|
+
ColorController
|
|
26
|
+
} from "@spectrum-web-components/reactive-controllers/src/Color.js";
|
|
27
|
+
import styles from "./color-slider.css.js";
|
|
29
28
|
export class ColorSlider extends Focusable {
|
|
30
29
|
constructor() {
|
|
31
30
|
super(...arguments);
|
|
@@ -33,14 +32,17 @@ export class ColorSlider extends Focusable {
|
|
|
33
32
|
this.focused = false;
|
|
34
33
|
this.label = "hue";
|
|
35
34
|
this.vertical = false;
|
|
36
|
-
this.
|
|
35
|
+
this.colorController = new ColorController(this, {
|
|
36
|
+
applyColorToState: () => {
|
|
37
|
+
this.sliderHandlePosition = 100 * (this.colorController.hue / 360);
|
|
38
|
+
},
|
|
39
|
+
extractColorFromState: (controller) => ({
|
|
40
|
+
...controller.getColor("hsl"),
|
|
41
|
+
h: this.value
|
|
42
|
+
}),
|
|
43
|
+
maintains: "saturation"
|
|
44
|
+
});
|
|
37
45
|
this.sliderHandlePosition = 0;
|
|
38
|
-
this._color = new TinyColor({ h: 0, s: 1, v: 1 });
|
|
39
|
-
this._previousColor = new TinyColor({ h: 0, s: 1, v: 1 });
|
|
40
|
-
this._format = {
|
|
41
|
-
format: "",
|
|
42
|
-
isString: false
|
|
43
|
-
};
|
|
44
46
|
this.step = 1;
|
|
45
47
|
this._altered = 0;
|
|
46
48
|
this._pointerDown = false;
|
|
@@ -49,90 +51,16 @@ export class ColorSlider extends Focusable {
|
|
|
49
51
|
return [styles];
|
|
50
52
|
}
|
|
51
53
|
get value() {
|
|
52
|
-
return this.
|
|
54
|
+
return this.colorController.hue;
|
|
53
55
|
}
|
|
54
56
|
set value(hue) {
|
|
55
|
-
|
|
56
|
-
if (value === this.value) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const oldValue = this.value;
|
|
60
|
-
const { s, v } = this._color.toHsv();
|
|
61
|
-
this._color = new TinyColor({ h: value, s, v });
|
|
62
|
-
this._value = value;
|
|
63
|
-
if (value !== this.sliderHandlePosition) {
|
|
64
|
-
this.sliderHandlePosition = 100 * (value / 360);
|
|
65
|
-
}
|
|
66
|
-
this.requestUpdate("value", oldValue);
|
|
57
|
+
this.colorController.hue = hue;
|
|
67
58
|
}
|
|
68
59
|
get color() {
|
|
69
|
-
|
|
70
|
-
case "rgb":
|
|
71
|
-
return this._format.isString ? this._color.toRgbString() : this._color.toRgb();
|
|
72
|
-
case "prgb":
|
|
73
|
-
return this._format.isString ? this._color.toPercentageRgbString() : this._color.toPercentageRgb();
|
|
74
|
-
case "hex":
|
|
75
|
-
case "hex3":
|
|
76
|
-
case "hex4":
|
|
77
|
-
case "hex6":
|
|
78
|
-
return this._format.isString ? this._color.toHexString() : this._color.toHex();
|
|
79
|
-
case "hex8":
|
|
80
|
-
return this._format.isString ? this._color.toHex8String() : this._color.toHex8();
|
|
81
|
-
case "name":
|
|
82
|
-
return this._color.toName() || this._color.toRgbString();
|
|
83
|
-
case "hsl":
|
|
84
|
-
if (this._format.isString) {
|
|
85
|
-
const hslString = this._color.toHslString();
|
|
86
|
-
return hslString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
|
|
87
|
-
} else {
|
|
88
|
-
const { s, l, a } = this._color.toHsl();
|
|
89
|
-
return { h: this.value, s, l, a };
|
|
90
|
-
}
|
|
91
|
-
case "hsv":
|
|
92
|
-
if (this._format.isString) {
|
|
93
|
-
const hsvString = this._color.toHsvString();
|
|
94
|
-
return hsvString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
|
|
95
|
-
} else {
|
|
96
|
-
const { s, v, a } = this._color.toHsv();
|
|
97
|
-
return { h: this.value, s, v, a };
|
|
98
|
-
}
|
|
99
|
-
default:
|
|
100
|
-
return "No color format applied.";
|
|
101
|
-
}
|
|
60
|
+
return this.colorController.color;
|
|
102
61
|
}
|
|
103
62
|
set color(color) {
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const oldValue = this._color;
|
|
108
|
-
this._color = new TinyColor(color);
|
|
109
|
-
const format = this._color.format;
|
|
110
|
-
let isString = typeof color === "string" || color instanceof String;
|
|
111
|
-
if (format.startsWith("hex")) {
|
|
112
|
-
isString = color.startsWith("#");
|
|
113
|
-
}
|
|
114
|
-
this._format = {
|
|
115
|
-
format,
|
|
116
|
-
isString
|
|
117
|
-
};
|
|
118
|
-
if (isString && format.startsWith("hs")) {
|
|
119
|
-
const values = extractHueAndSaturationRegExp.exec(color);
|
|
120
|
-
if (values !== null) {
|
|
121
|
-
const [, h, s] = values;
|
|
122
|
-
this.value = Number(h);
|
|
123
|
-
this._saturation = Number(s);
|
|
124
|
-
}
|
|
125
|
-
} else if (!isString && format.startsWith("hs")) {
|
|
126
|
-
const colorInput = this._color.originalInput;
|
|
127
|
-
const colorValues = Object.values(colorInput);
|
|
128
|
-
this.value = colorValues[0];
|
|
129
|
-
this._saturation = colorValues[1];
|
|
130
|
-
} else {
|
|
131
|
-
const { h } = this._color.toHsv();
|
|
132
|
-
this.value = h;
|
|
133
|
-
}
|
|
134
|
-
this._previousColor = oldValue;
|
|
135
|
-
this.requestUpdate("color", oldValue);
|
|
63
|
+
this.colorController.color = color;
|
|
136
64
|
}
|
|
137
65
|
get altered() {
|
|
138
66
|
return this._altered;
|
|
@@ -147,7 +75,9 @@ export class ColorSlider extends Focusable {
|
|
|
147
75
|
handleKeydown(event) {
|
|
148
76
|
const { key } = event;
|
|
149
77
|
this.focused = true;
|
|
150
|
-
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
78
|
+
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
79
|
+
(key2) => !!key2
|
|
80
|
+
).length;
|
|
151
81
|
let delta = 0;
|
|
152
82
|
switch (key) {
|
|
153
83
|
case "ArrowUp":
|
|
@@ -166,32 +96,41 @@ export class ColorSlider extends Focusable {
|
|
|
166
96
|
return;
|
|
167
97
|
}
|
|
168
98
|
event.preventDefault();
|
|
169
|
-
this.sliderHandlePosition = Math.min(
|
|
99
|
+
this.sliderHandlePosition = Math.min(
|
|
100
|
+
100,
|
|
101
|
+
Math.max(0, this.sliderHandlePosition + delta)
|
|
102
|
+
);
|
|
170
103
|
this.value = 360 * (this.sliderHandlePosition / 100);
|
|
171
|
-
this.
|
|
104
|
+
this.colorController.applyColorFromState();
|
|
172
105
|
if (delta != 0) {
|
|
173
|
-
this.dispatchEvent(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
106
|
+
this.dispatchEvent(
|
|
107
|
+
new Event("input", {
|
|
108
|
+
bubbles: true,
|
|
109
|
+
composed: true
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
this.dispatchEvent(
|
|
113
|
+
new Event("change", {
|
|
114
|
+
bubbles: true,
|
|
115
|
+
composed: true
|
|
116
|
+
})
|
|
117
|
+
);
|
|
181
118
|
}
|
|
182
119
|
}
|
|
183
120
|
handleInput(event) {
|
|
184
121
|
const { valueAsNumber } = event.target;
|
|
185
122
|
this.value = valueAsNumber;
|
|
186
123
|
this.sliderHandlePosition = 100 * (this.value / 360);
|
|
187
|
-
this.
|
|
124
|
+
this.colorController.applyColorFromState();
|
|
188
125
|
}
|
|
189
126
|
handleChange(event) {
|
|
190
127
|
this.handleInput(event);
|
|
191
|
-
this.dispatchEvent(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
128
|
+
this.dispatchEvent(
|
|
129
|
+
new Event("change", {
|
|
130
|
+
bubbles: true,
|
|
131
|
+
composed: true
|
|
132
|
+
})
|
|
133
|
+
);
|
|
195
134
|
}
|
|
196
135
|
focus(focusOptions = {}) {
|
|
197
136
|
super.focus(focusOptions);
|
|
@@ -217,7 +156,7 @@ export class ColorSlider extends Focusable {
|
|
|
217
156
|
return;
|
|
218
157
|
}
|
|
219
158
|
this._pointerDown = true;
|
|
220
|
-
this.
|
|
159
|
+
this.colorController.savePreviousColor();
|
|
221
160
|
this.boundingClientRect = this.getBoundingClientRect();
|
|
222
161
|
event.target.setPointerCapture(event.pointerId);
|
|
223
162
|
if (event.pointerType === "mouse") {
|
|
@@ -227,23 +166,27 @@ export class ColorSlider extends Focusable {
|
|
|
227
166
|
handlePointermove(event) {
|
|
228
167
|
this.sliderHandlePosition = this.calculateHandlePosition(event);
|
|
229
168
|
this.value = 360 * (this.sliderHandlePosition / 100);
|
|
230
|
-
this.
|
|
231
|
-
this.dispatchEvent(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
169
|
+
this.colorController.applyColorFromState();
|
|
170
|
+
this.dispatchEvent(
|
|
171
|
+
new Event("input", {
|
|
172
|
+
bubbles: true,
|
|
173
|
+
composed: true,
|
|
174
|
+
cancelable: true
|
|
175
|
+
})
|
|
176
|
+
);
|
|
236
177
|
}
|
|
237
178
|
handlePointerup(event) {
|
|
238
179
|
this._pointerDown = false;
|
|
239
180
|
event.target.releasePointerCapture(event.pointerId);
|
|
240
|
-
const applyDefault = this.dispatchEvent(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
181
|
+
const applyDefault = this.dispatchEvent(
|
|
182
|
+
new Event("change", {
|
|
183
|
+
bubbles: true,
|
|
184
|
+
composed: true,
|
|
185
|
+
cancelable: true
|
|
186
|
+
})
|
|
187
|
+
);
|
|
245
188
|
if (!applyDefault) {
|
|
246
|
-
this.
|
|
189
|
+
this.colorController.restorePreviousColor();
|
|
247
190
|
}
|
|
248
191
|
this.focus();
|
|
249
192
|
if (event.pointerType === "mouse") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ColorSlider.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport styles from './color-slider.css.js';\nimport {\n ColorHandle,\n ColorValue,\n extractHueAndSaturationRegExp,\n replaceHueAndSaturationRegExp,\n} from '@spectrum-web-components/color-handle';\nimport { TinyColor } from '@ctrl/tinycolor';\n\n/**\n * @element sp-color-slider\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Slider has changed.\n * @fires change - An alteration to the value of the Color Slider has been committed by the user.\n */\nexport class ColorSlider extends Focusable {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: Number })\n public get value(): number {\n return this._value;\n }\n\n public set value(hue: number) {\n const value = Math.min(360, Math.max(0, hue));\n if (value === this.value) {\n return;\n }\n const oldValue = this.value;\n const { s, v } = this._color.toHsv();\n this._color = new TinyColor({ h: value, s, v });\n this._value = value;\n\n if (value !== this.sliderHandlePosition) {\n this.sliderHandlePosition = 100 * (value / 360);\n }\n\n this.requestUpdate('value', oldValue);\n }\n\n private _value = 0;\n\n @property({ type: Number, reflect: true })\n public sliderHandlePosition = 0;\n\n @property({ type: String })\n public get color(): ColorValue {\n switch (this._format.format) {\n case 'rgb':\n return this._format.isString\n ? this._color.toRgbString()\n : this._color.toRgb();\n case 'prgb':\n return this._format.isString\n ? this._color.toPercentageRgbString()\n : this._color.toPercentageRgb();\n case 'hex':\n case 'hex3':\n case 'hex4':\n case 'hex6':\n return this._format.isString\n ? this._color.toHexString()\n : this._color.toHex();\n case 'hex8':\n return this._format.isString\n ? this._color.toHex8String()\n : this._color.toHex8();\n case 'name':\n return this._color.toName() || this._color.toRgbString();\n case 'hsl':\n if (this._format.isString) {\n const hslString = this._color.toHslString();\n return hslString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, l, a } = this._color.toHsl();\n return { h: this.value, s, l, a };\n }\n case 'hsv':\n if (this._format.isString) {\n const hsvString = this._color.toHsvString();\n return hsvString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, v, a } = this._color.toHsv();\n return { h: this.value, s, v, a };\n }\n default:\n return 'No color format applied.';\n }\n }\n\n public set color(color: ColorValue) {\n if (color === this.color) {\n return;\n }\n const oldValue = this._color;\n this._color = new TinyColor(color);\n const format = this._color.format;\n let isString = typeof color === 'string' || color instanceof String;\n\n if (format.startsWith('hex')) {\n isString = (color as string).startsWith('#');\n }\n\n this._format = {\n format,\n isString,\n };\n\n if (isString && format.startsWith('hs')) {\n const values = extractHueAndSaturationRegExp.exec(color as string);\n if (values !== null) {\n const [, h, s] = values;\n this.value = Number(h);\n this._saturation = Number(s);\n }\n } else if (!isString && format.startsWith('hs')) {\n const colorInput = this._color.originalInput;\n const colorValues = Object.values(colorInput);\n this.value = colorValues[0];\n this._saturation = colorValues[1];\n } else {\n const { h } = this._color.toHsv();\n this.value = h;\n }\n this._previousColor = oldValue;\n this.requestUpdate('color', oldValue);\n }\n\n private _color = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _previousColor = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _saturation!: number;\n\n private _format: { format: string; isString: boolean } = {\n format: '',\n isString: false,\n };\n\n @property({ type: Number })\n public step = 1;\n\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public override get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n\n this.sliderHandlePosition = Math.min(\n 100,\n Math.max(0, this.sliderHandlePosition + delta)\n );\n this.value = 360 * (this.sliderHandlePosition / 100);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n if (delta != 0) {\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this.sliderHandlePosition = 100 * (this.value / 360);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this._previousColor = this._color.clone();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.sliderHandlePosition = this.calculateHandlePosition(event);\n this.value = 360 * (this.sliderHandlePosition / 100);\n\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this._color = this._previousColor;\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.sliderHandlePosition;\n }\n const rect = this.boundingClientRect;\n const minOffset = this.vertical ? rect.top : rect.left;\n const offset = this.vertical ? event.clientY : event.clientX;\n const size = this.vertical ? rect.height : rect.width;\n\n const percent = Math.max(0, Math.min(1, (offset - minOffset) / size));\n const sliderHandlePosition = 100 * percent;\n\n return sliderHandlePosition;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.handle.dispatchEvent(new PointerEvent('pointerdown', event));\n this.handlePointermove(event);\n }\n\n private get handlePositionStyles(): string {\n return `${this.vertical ? 'top' : 'left'}: ${\n this.sliderHandlePosition\n }%`;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div\n class=\"checkerboard\"\n role=\"presentation\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div\n class=\"gradient\"\n role=\"presentation\"\n style=\"background: linear-gradient(to ${this.vertical\n ? 'bottom'\n : 'right'}, var(--sp-color-slider-gradient, var(--sp-color-slider-gradient-fallback)));\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n </div>\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${this.handlePositionStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n <input\n type=\"range\"\n class=\"slider\"\n min=\"0\"\n max=\"360\"\n step=${this.step}\n aria-label=${this.label}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport {\n ColorController,\n ColorValue,\n HSL,\n} from '@spectrum-web-components/reactive-controllers/src/Color.js';\n\nimport styles from './color-slider.css.js';\n\n/**\n * @element sp-color-slider\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Slider has changed.\n * @fires change - An alteration to the value of the Color Slider has been committed by the user.\n */\nexport class ColorSlider extends Focusable {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n private colorController = new ColorController(this, {\n /* c8 ignore next 3 */\n applyColorToState: () => {\n this.sliderHandlePosition = 100 * (this.colorController.hue / 360);\n },\n extractColorFromState: (controller) => ({\n ...(controller.getColor('hsl') as HSL),\n h: this.value,\n }),\n maintains: 'saturation',\n });\n\n @property({ type: Number })\n public get value(): number {\n return this.colorController.hue;\n }\n\n public set value(hue: number) {\n this.colorController.hue = hue;\n }\n\n @property({ type: Number, reflect: true })\n public sliderHandlePosition = 0;\n\n @property({ type: String })\n public get color(): ColorValue {\n return this.colorController.color;\n }\n\n public set color(color: ColorValue) {\n this.colorController.color = color;\n }\n\n @property({ type: Number })\n public step = 1;\n\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public override get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n\n this.sliderHandlePosition = Math.min(\n 100,\n Math.max(0, this.sliderHandlePosition + delta)\n );\n this.value = 360 * (this.sliderHandlePosition / 100);\n this.colorController.applyColorFromState();\n\n if (delta != 0) {\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this.sliderHandlePosition = 100 * (this.value / 360);\n this.colorController.applyColorFromState();\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this.colorController.savePreviousColor();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.sliderHandlePosition = this.calculateHandlePosition(event);\n this.value = 360 * (this.sliderHandlePosition / 100);\n\n this.colorController.applyColorFromState();\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.sliderHandlePosition;\n }\n const rect = this.boundingClientRect;\n const minOffset = this.vertical ? rect.top : rect.left;\n const offset = this.vertical ? event.clientY : event.clientX;\n const size = this.vertical ? rect.height : rect.width;\n\n const percent = Math.max(0, Math.min(1, (offset - minOffset) / size));\n const sliderHandlePosition = 100 * percent;\n\n return sliderHandlePosition;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.handle.dispatchEvent(new PointerEvent('pointerdown', event));\n this.handlePointermove(event);\n }\n\n private get handlePositionStyles(): string {\n return `${this.vertical ? 'top' : 'left'}: ${\n this.sliderHandlePosition\n }%`;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div\n class=\"checkerboard\"\n role=\"presentation\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div\n class=\"gradient\"\n role=\"presentation\"\n style=\"background: linear-gradient(to ${this.vertical\n ? 'bottom'\n : 'right'}, var(--sp-color-slider-gradient, var(--sp-color-slider-gradient-fallback)));\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n </div>\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${this.handlePositionStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n <input\n type=\"range\"\n class=\"slider\"\n min=\"0\"\n max=\"360\"\n step=${this.step}\n aria-label=${this.label}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,iBAAiB;AAC1B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAE1B,OAAO;AACP;AAAA,EACI;AAAA,OAGG;AAEP,OAAO,YAAY;AAQZ,aAAM,oBAAoB,UAAU;AAAA,EAApC;AAAA;AAMH,SAAgB,WAAW;AAG3B,SAAO,UAAU;AAMjB,SAAO,QAAQ;AAGf,SAAO,WAAW;AAElB,SAAQ,kBAAkB,IAAI,gBAAgB,MAAM;AAAA,MAEhD,mBAAmB,MAAM;AACrB,aAAK,uBAAuB,OAAO,KAAK,gBAAgB,MAAM;AAAA,MAClE;AAAA,MACA,uBAAuB,CAAC,gBAAgB;AAAA,QACpC,GAAI,WAAW,SAAS,KAAK;AAAA,QAC7B,GAAG,KAAK;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,IACf,CAAC;AAYD,SAAO,uBAAuB;AAY9B,SAAO,OAAO;AAWd,SAAQ,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