@spectrum-web-components/color-wheel 0.3.12 → 0.3.13-devmode.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/src/ColorWheel.js CHANGED
@@ -1,299 +1,280 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { __decorate } from "tslib";
13
- import { html, } from '@spectrum-web-components/base';
14
- import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
15
- import { property, query, } from '@spectrum-web-components/base/src/decorators.js';
16
- import { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';
17
- import { Focusable } from '@spectrum-web-components/shared/src/focusable.js';
18
- import '@spectrum-web-components/color-handle/sp-color-handle.js';
19
- import styles from './color-wheel.css.js';
20
- import { extractHueAndSaturationRegExp, replaceHueAndSaturationRegExp, } from '@spectrum-web-components/color-handle';
21
- import { TinyColor } from '@ctrl/tinycolor';
22
- /**
23
- * @element sp-color-wheel
24
- * @slot gradient - a custom gradient visually outlining the available color values
25
- * @fires input - The value of the Color Wheel has changed.
26
- * @fires change - An alteration to the value of the Color Wheel has been committed by the user.
27
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html
14
+ } from "@spectrum-web-components/base";
15
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
16
+ import {
17
+ property,
18
+ query
19
+ } from "@spectrum-web-components/base/src/decorators.js";
20
+ import { streamingListener } from "@spectrum-web-components/base/src/streaming-listener.js";
21
+ import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
22
+ import "@spectrum-web-components/color-handle/sp-color-handle.js";
23
+ import styles from "./color-wheel.css.js";
24
+ import {
25
+ extractHueAndSaturationRegExp,
26
+ replaceHueAndSaturationRegExp
27
+ } from "@spectrum-web-components/color-handle";
28
+ import { TinyColor } from "@ctrl/tinycolor";
28
29
  export class ColorWheel extends Focusable {
29
- constructor() {
30
- super(...arguments);
31
- this.disabled = false;
32
- this.focused = false;
33
- this.label = 'hue';
34
- this.step = 1;
35
- this._value = 0;
36
- this._color = new TinyColor({ h: 0, s: 1, v: 1 });
37
- this._previousColor = new TinyColor({ h: 0, s: 1, v: 1 });
38
- this._format = {
39
- format: '',
40
- isString: false,
41
- };
42
- this._altered = 0;
43
- this._pointerDown = false;
44
- }
45
- static get styles() {
46
- return [styles];
30
+ constructor() {
31
+ super(...arguments);
32
+ this.disabled = false;
33
+ this.focused = false;
34
+ this.label = "hue";
35
+ this.step = 1;
36
+ this._value = 0;
37
+ this._color = new TinyColor({ h: 0, s: 1, v: 1 });
38
+ this._previousColor = new TinyColor({ h: 0, s: 1, v: 1 });
39
+ this._format = {
40
+ format: "",
41
+ isString: false
42
+ };
43
+ this._altered = 0;
44
+ this._pointerDown = false;
45
+ }
46
+ static get styles() {
47
+ return [styles];
48
+ }
49
+ get value() {
50
+ return this._value;
51
+ }
52
+ set value(hue) {
53
+ const value = Math.min(360, Math.max(0, hue));
54
+ if (value === this.value) {
55
+ return;
47
56
  }
48
- get value() {
49
- return this._value;
50
- }
51
- set value(hue) {
52
- const value = Math.min(360, Math.max(0, hue));
53
- if (value === this.value) {
54
- return;
57
+ const oldValue = this.value;
58
+ const { s, v } = this._color.toHsv();
59
+ this._color = new TinyColor({ h: value, s, v });
60
+ this._value = value;
61
+ this.requestUpdate("value", oldValue);
62
+ }
63
+ get color() {
64
+ switch (this._format.format) {
65
+ case "rgb":
66
+ return this._format.isString ? this._color.toRgbString() : this._color.toRgb();
67
+ case "prgb":
68
+ return this._format.isString ? this._color.toPercentageRgbString() : this._color.toPercentageRgb();
69
+ case "hex":
70
+ case "hex3":
71
+ case "hex4":
72
+ case "hex6":
73
+ return this._format.isString ? this._color.toHexString() : this._color.toHex();
74
+ case "hex8":
75
+ return this._format.isString ? this._color.toHex8String() : this._color.toHex8();
76
+ case "name":
77
+ return this._color.toName() || this._color.toRgbString();
78
+ case "hsl":
79
+ if (this._format.isString) {
80
+ const hslString = this._color.toHslString();
81
+ return hslString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
82
+ } else {
83
+ const { s, l, a } = this._color.toHsl();
84
+ return { h: this.value, s, l, a };
55
85
  }
56
- const oldValue = this.value;
57
- const { s, v } = this._color.toHsv();
58
- this._color = new TinyColor({ h: value, s, v });
59
- this._value = value;
60
- this.requestUpdate('value', oldValue);
61
- }
62
- get color() {
63
- switch (this._format.format) {
64
- case 'rgb':
65
- return this._format.isString
66
- ? this._color.toRgbString()
67
- : this._color.toRgb();
68
- case 'prgb':
69
- return this._format.isString
70
- ? this._color.toPercentageRgbString()
71
- : this._color.toPercentageRgb();
72
- case 'hex':
73
- case 'hex3':
74
- case 'hex4':
75
- case 'hex6':
76
- return this._format.isString
77
- ? this._color.toHexString()
78
- : this._color.toHex();
79
- case 'hex8':
80
- return this._format.isString
81
- ? this._color.toHex8String()
82
- : this._color.toHex8();
83
- case 'name':
84
- return this._color.toName() || this._color.toRgbString();
85
- case 'hsl':
86
- if (this._format.isString) {
87
- const hslString = this._color.toHslString();
88
- return hslString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
89
- }
90
- else {
91
- const { s, l, a } = this._color.toHsl();
92
- return { h: this.value, s, l, a };
93
- }
94
- case 'hsv':
95
- if (this._format.isString) {
96
- const hsvString = this._color.toHsvString();
97
- return hsvString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
98
- }
99
- else {
100
- const { s, v, a } = this._color.toHsv();
101
- return { h: this.value, s, v, a };
102
- }
103
- default:
104
- return 'No color format applied.';
86
+ case "hsv":
87
+ if (this._format.isString) {
88
+ const hsvString = this._color.toHsvString();
89
+ return hsvString.replace(replaceHueAndSaturationRegExp, `$1${this.value}$2${this._saturation}`);
90
+ } else {
91
+ const { s, v, a } = this._color.toHsv();
92
+ return { h: this.value, s, v, a };
105
93
  }
94
+ default:
95
+ return "No color format applied.";
106
96
  }
107
- set color(color) {
108
- if (color === this.color) {
109
- return;
110
- }
111
- const oldValue = this._color;
112
- this._color = new TinyColor(color);
113
- const format = this._color.format;
114
- let isString = typeof color === 'string' || color instanceof String;
115
- if (format.startsWith('hex')) {
116
- isString = color.startsWith('#');
117
- }
118
- this._format = {
119
- format,
120
- isString,
121
- };
122
- if (isString && format.startsWith('hs')) {
123
- const values = extractHueAndSaturationRegExp.exec(color);
124
- if (values !== null) {
125
- const [, h, s] = values;
126
- this.value = Number(h);
127
- this._saturation = Number(s);
128
- }
129
- }
130
- else if (!isString && format.startsWith('hs')) {
131
- const colorInput = this._color.originalInput;
132
- const colorValues = Object.values(colorInput);
133
- this.value = colorValues[0];
134
- this._saturation = colorValues[1];
135
- }
136
- else {
137
- const { h } = this._color.toHsv();
138
- this.value = h;
139
- }
140
- this.requestUpdate('color', oldValue);
97
+ }
98
+ set color(color) {
99
+ if (color === this.color) {
100
+ return;
141
101
  }
142
- get altered() {
143
- return this._altered;
102
+ const oldValue = this._color;
103
+ this._color = new TinyColor(color);
104
+ const format = this._color.format;
105
+ let isString = typeof color === "string" || color instanceof String;
106
+ if (format.startsWith("hex")) {
107
+ isString = color.startsWith("#");
144
108
  }
145
- set altered(altered) {
146
- this._altered = altered;
147
- this.step = Math.max(1, this.altered * 10);
109
+ this._format = {
110
+ format,
111
+ isString
112
+ };
113
+ if (isString && format.startsWith("hs")) {
114
+ const values = extractHueAndSaturationRegExp.exec(color);
115
+ if (values !== null) {
116
+ const [, h, s] = values;
117
+ this.value = Number(h);
118
+ this._saturation = Number(s);
119
+ }
120
+ } else if (!isString && format.startsWith("hs")) {
121
+ const colorInput = this._color.originalInput;
122
+ const colorValues = Object.values(colorInput);
123
+ this.value = colorValues[0];
124
+ this._saturation = colorValues[1];
125
+ } else {
126
+ const { h } = this._color.toHsv();
127
+ this.value = h;
148
128
  }
149
- get focusElement() {
150
- return this.input;
129
+ this.requestUpdate("color", oldValue);
130
+ }
131
+ get altered() {
132
+ return this._altered;
133
+ }
134
+ set altered(altered) {
135
+ this._altered = altered;
136
+ this.step = Math.max(1, this.altered * 10);
137
+ }
138
+ get focusElement() {
139
+ return this.input;
140
+ }
141
+ handleKeydown(event) {
142
+ const { key } = event;
143
+ this.focused = true;
144
+ this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter((key2) => !!key2).length;
145
+ let delta = 0;
146
+ switch (key) {
147
+ case "ArrowUp":
148
+ delta = this.step;
149
+ break;
150
+ case "ArrowDown":
151
+ delta = -this.step;
152
+ break;
153
+ case "ArrowLeft":
154
+ delta = this.step * (this.isLTR ? -1 : 1);
155
+ break;
156
+ case "ArrowRight":
157
+ delta = this.step * (this.isLTR ? 1 : -1);
158
+ break;
159
+ default:
160
+ return;
151
161
  }
152
- handleKeydown(event) {
153
- const { key } = event;
154
- this.focused = true;
155
- this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter((key) => !!key).length;
156
- let delta = 0;
157
- switch (key) {
158
- case 'ArrowUp':
159
- delta = this.step;
160
- break;
161
- case 'ArrowDown':
162
- delta = -this.step;
163
- break;
164
- case 'ArrowLeft':
165
- delta = this.step * (this.isLTR ? -1 : 1);
166
- break;
167
- case 'ArrowRight':
168
- delta = this.step * (this.isLTR ? 1 : -1);
169
- break;
170
- default:
171
- return;
172
- }
173
- event.preventDefault();
174
- this.value = (360 + this.value + delta) % 360;
175
- this._previousColor = this._color.clone();
176
- this._color = new TinyColor(Object.assign(Object.assign({}, this._color.toHsl()), { h: this.value }));
177
- this.dispatchEvent(new Event('input', {
178
- bubbles: true,
179
- composed: true,
180
- }));
181
- const applyDefault = this.dispatchEvent(new Event('change', {
182
- bubbles: true,
183
- composed: true,
184
- cancelable: true,
185
- }));
186
- if (!applyDefault) {
187
- this._color = this._previousColor;
188
- }
162
+ event.preventDefault();
163
+ this.value = (360 + this.value + delta) % 360;
164
+ this._previousColor = this._color.clone();
165
+ this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });
166
+ this.dispatchEvent(new Event("input", {
167
+ bubbles: true,
168
+ composed: true
169
+ }));
170
+ const applyDefault = this.dispatchEvent(new Event("change", {
171
+ bubbles: true,
172
+ composed: true,
173
+ cancelable: true
174
+ }));
175
+ if (!applyDefault) {
176
+ this._color = this._previousColor;
189
177
  }
190
- handleInput(event) {
191
- const { valueAsNumber } = event.target;
192
- this.value = valueAsNumber;
193
- this._color = new TinyColor(Object.assign(Object.assign({}, this._color.toHsl()), { h: this.value }));
178
+ }
179
+ handleInput(event) {
180
+ const { valueAsNumber } = event.target;
181
+ this.value = valueAsNumber;
182
+ this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });
183
+ }
184
+ handleChange(event) {
185
+ this.handleInput(event);
186
+ this.dispatchEvent(new Event("change", {
187
+ bubbles: true,
188
+ composed: true
189
+ }));
190
+ }
191
+ focus(focusOptions = {}) {
192
+ super.focus(focusOptions);
193
+ this.forwardFocus();
194
+ }
195
+ forwardFocus() {
196
+ this.focused = this.hasVisibleFocusInTree();
197
+ this.input.focus();
198
+ }
199
+ handleFocusin() {
200
+ this.focused = true;
201
+ }
202
+ handleFocusout() {
203
+ if (this._pointerDown) {
204
+ return;
194
205
  }
195
- handleChange(event) {
196
- this.handleInput(event);
197
- this.dispatchEvent(new Event('change', {
198
- bubbles: true,
199
- composed: true,
200
- }));
206
+ this.altered = 0;
207
+ this.focused = false;
208
+ }
209
+ handlePointerdown(event) {
210
+ if (event.button !== 0) {
211
+ event.preventDefault();
212
+ return;
201
213
  }
202
- focus(focusOptions = {}) {
203
- super.focus(focusOptions);
204
- this.forwardFocus();
214
+ this._pointerDown = true;
215
+ this._previousColor = this._color.clone();
216
+ this.boundingClientRect = this.getBoundingClientRect();
217
+ event.target.setPointerCapture(event.pointerId);
218
+ if (event.pointerType === "mouse") {
219
+ this.focused = true;
205
220
  }
206
- forwardFocus() {
207
- this.focused = this.hasVisibleFocusInTree();
208
- this.input.focus();
221
+ }
222
+ handlePointermove(event) {
223
+ this.value = this.calculateHandlePosition(event);
224
+ this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });
225
+ this.dispatchEvent(new Event("input", {
226
+ bubbles: true,
227
+ composed: true,
228
+ cancelable: true
229
+ }));
230
+ }
231
+ handlePointerup(event) {
232
+ this._pointerDown = false;
233
+ event.target.releasePointerCapture(event.pointerId);
234
+ const applyDefault = this.dispatchEvent(new Event("change", {
235
+ bubbles: true,
236
+ composed: true,
237
+ cancelable: true
238
+ }));
239
+ if (!applyDefault) {
240
+ this._color = this._previousColor;
209
241
  }
210
- handleFocusin() {
211
- this.focused = true;
242
+ this.focus();
243
+ if (event.pointerType === "mouse") {
244
+ this.focused = false;
212
245
  }
213
- handleFocusout() {
214
- if (this._pointerDown) {
215
- return;
216
- }
217
- this.altered = 0;
218
- this.focused = false;
246
+ }
247
+ calculateHandlePosition(event) {
248
+ if (!this.boundingClientRect) {
249
+ return this.value;
219
250
  }
220
- handlePointerdown(event) {
221
- if (event.button !== 0) {
222
- event.preventDefault();
223
- return;
224
- }
225
- this._pointerDown = true;
226
- this._previousColor = this._color.clone();
227
- this.boundingClientRect = this.getBoundingClientRect();
228
- event.target.setPointerCapture(event.pointerId);
229
- if (event.pointerType === 'mouse') {
230
- this.focused = true;
231
- }
232
- }
233
- handlePointermove(event) {
234
- this.value = this.calculateHandlePosition(event);
235
- this._color = new TinyColor(Object.assign(Object.assign({}, this._color.toHsl()), { h: this.value }));
236
- this.dispatchEvent(new Event('input', {
237
- bubbles: true,
238
- composed: true,
239
- cancelable: true,
240
- }));
241
- }
242
- handlePointerup(event) {
243
- this._pointerDown = false;
244
- event.target.releasePointerCapture(event.pointerId);
245
- const applyDefault = this.dispatchEvent(new Event('change', {
246
- bubbles: true,
247
- composed: true,
248
- cancelable: true,
249
- }));
250
- if (!applyDefault) {
251
- this._color = this._previousColor;
252
- }
253
- // Retain focus on input element after mouse up to enable keyboard interactions
254
- this.focus();
255
- if (event.pointerType === 'mouse') {
256
- this.focused = false;
257
- }
258
- }
259
- /**
260
- * Returns the value under the cursor
261
- * @param: PointerEvent on slider
262
- * @return: Slider value that correlates to the position under the pointer
263
- */
264
- calculateHandlePosition(event) {
265
- /* c8 ignore next 3 */
266
- if (!this.boundingClientRect) {
267
- return this.value;
268
- }
269
- const rect = this.boundingClientRect;
270
- const { width, height, left, top } = rect;
271
- const centerX = left + width / 2;
272
- const centerY = top + height / 2;
273
- const pointX = event.clientX - centerX;
274
- const pointY = event.clientY - centerY;
275
- const value = (Math.atan2(pointY, pointX) * 180) / Math.PI;
276
- return (360 + (360 + value)) % 360;
277
- }
278
- handleGradientPointerdown(event) {
279
- if (event.button !== 0 ||
280
- event.target.classList.contains('innerCircle')) {
281
- return;
282
- }
283
- event.stopPropagation();
284
- event.preventDefault();
285
- this.handle.dispatchEvent(new PointerEvent('pointerdown', event));
286
- this.handlePointermove(event);
251
+ const rect = this.boundingClientRect;
252
+ const { width, height, left, top } = rect;
253
+ const centerX = left + width / 2;
254
+ const centerY = top + height / 2;
255
+ const pointX = event.clientX - centerX;
256
+ const pointY = event.clientY - centerY;
257
+ const value = Math.atan2(pointY, pointX) * 180 / Math.PI;
258
+ return (360 + (360 + value)) % 360;
259
+ }
260
+ handleGradientPointerdown(event) {
261
+ if (event.button !== 0 || event.target.classList.contains("innerCircle")) {
262
+ return;
287
263
  }
288
- render() {
289
- const { width: diameter = 160 } = this.boundingClientRect || {};
290
- const radius = diameter / 2;
291
- const trackWidth = 24;
292
- const innerRadius = radius - trackWidth;
293
- const innerDiameter = innerRadius * 2;
294
- const clipPath = `path(evenodd, "M ${radius} ${radius} m -${radius} 0 a ${radius} ${radius} 0 1 0 ${diameter} 0 a ${radius} ${radius} 0 1 0 -${diameter} 0 M ${radius} ${radius} m -${innerRadius} 0 a ${innerRadius} ${innerRadius} 0 1 0 ${innerDiameter} 0 a ${innerRadius} ${innerRadius} 0 1 0 -${innerDiameter} 0")`;
295
- const handleLocationStyles = `transform: translate(${(radius - 12.5) * Math.cos((this.value * Math.PI) / 180)}px, ${(radius - 12.5) * Math.sin((this.value * Math.PI) / 180)}px);`;
296
- return html `
264
+ event.stopPropagation();
265
+ event.preventDefault();
266
+ this.handle.dispatchEvent(new PointerEvent("pointerdown", event));
267
+ this.handlePointermove(event);
268
+ }
269
+ render() {
270
+ const { width: diameter = 160 } = this.boundingClientRect || {};
271
+ const radius = diameter / 2;
272
+ const trackWidth = 24;
273
+ const innerRadius = radius - trackWidth;
274
+ const innerDiameter = innerRadius * 2;
275
+ const clipPath = `path(evenodd, "M ${radius} ${radius} m -${radius} 0 a ${radius} ${radius} 0 1 0 ${diameter} 0 a ${radius} ${radius} 0 1 0 -${diameter} 0 M ${radius} ${radius} m -${innerRadius} 0 a ${innerRadius} ${innerRadius} 0 1 0 ${innerDiameter} 0 a ${innerRadius} ${innerRadius} 0 1 0 -${innerDiameter} 0")`;
276
+ const handleLocationStyles = `transform: translate(${(radius - 12.5) * Math.cos(this.value * Math.PI / 180)}px, ${(radius - 12.5) * Math.sin(this.value * Math.PI / 180)}px);`;
277
+ return html`
297
278
  <slot
298
279
  name="gradient"
299
280
  @pointerdown=${this.handleGradientPointerdown}
@@ -302,7 +283,7 @@ export class ColorWheel extends Focusable {
302
283
  </slot>
303
284
 
304
285
  <sp-color-handle
305
- tabindex=${ifDefined(this.focused ? undefined : '0')}
286
+ tabindex=${ifDefined(this.focused ? void 0 : "0")}
306
287
  @focus=${this.forwardFocus}
307
288
  ?focused=${this.focused}
308
289
  class="handle"
@@ -310,10 +291,10 @@ export class ColorWheel extends Focusable {
310
291
  ?disabled=${this.disabled}
311
292
  style=${handleLocationStyles}
312
293
  ${streamingListener({
313
- start: ['pointerdown', this.handlePointerdown],
314
- streamInside: ['pointermove', this.handlePointermove],
315
- end: [['pointerup', 'pointercancel'], this.handlePointerup],
316
- })}
294
+ start: ["pointerdown", this.handlePointerdown],
295
+ streamInside: ["pointermove", this.handlePointermove],
296
+ end: [["pointerup", "pointercancel"], this.handlePointerup]
297
+ })}
317
298
  ></sp-color-handle>
318
299
 
319
300
  <input
@@ -329,55 +310,54 @@ export class ColorWheel extends Focusable {
329
310
  @keydown=${this.handleKeydown}
330
311
  />
331
312
  `;
332
- }
333
- firstUpdated(changed) {
334
- super.firstUpdated(changed);
335
- this.boundingClientRect = this.getBoundingClientRect();
336
- this.addEventListener('focusin', this.handleFocusin);
337
- this.addEventListener('focusout', this.handleFocusout);
338
- }
339
- connectedCallback() {
340
- var _a;
341
- super.connectedCallback();
342
- if (!this.observer &&
343
- window.ResizeObserver) {
344
- this.observer = new window.ResizeObserver((entries) => {
345
- for (const entry of entries) {
346
- this.boundingClientRect = entry.contentRect;
347
- }
348
- this.requestUpdate();
349
- });
313
+ }
314
+ firstUpdated(changed) {
315
+ super.firstUpdated(changed);
316
+ this.boundingClientRect = this.getBoundingClientRect();
317
+ this.addEventListener("focusin", this.handleFocusin);
318
+ this.addEventListener("focusout", this.handleFocusout);
319
+ }
320
+ connectedCallback() {
321
+ var _a;
322
+ super.connectedCallback();
323
+ if (!this.observer && window.ResizeObserver) {
324
+ this.observer = new window.ResizeObserver((entries) => {
325
+ for (const entry of entries) {
326
+ this.boundingClientRect = entry.contentRect;
350
327
  }
351
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.observe(this);
352
- }
353
- disconnectedCallback() {
354
- var _a;
355
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.unobserve(this);
356
- super.disconnectedCallback();
328
+ this.requestUpdate();
329
+ });
357
330
  }
331
+ (_a = this.observer) == null ? void 0 : _a.observe(this);
332
+ }
333
+ disconnectedCallback() {
334
+ var _a;
335
+ (_a = this.observer) == null ? void 0 : _a.unobserve(this);
336
+ super.disconnectedCallback();
337
+ }
358
338
  }
359
- __decorate([
360
- property({ type: Boolean, reflect: true })
361
- ], ColorWheel.prototype, "disabled", void 0);
362
- __decorate([
363
- property({ type: Boolean, reflect: true })
364
- ], ColorWheel.prototype, "focused", void 0);
365
- __decorate([
366
- query('.handle')
367
- ], ColorWheel.prototype, "handle", void 0);
368
- __decorate([
369
- property({ type: String })
370
- ], ColorWheel.prototype, "label", void 0);
371
- __decorate([
372
- property({ type: Number })
373
- ], ColorWheel.prototype, "step", void 0);
374
- __decorate([
375
- property({ type: Number })
376
- ], ColorWheel.prototype, "value", null);
377
- __decorate([
378
- property({ type: String })
379
- ], ColorWheel.prototype, "color", null);
380
- __decorate([
381
- query('input')
382
- ], ColorWheel.prototype, "input", void 0);
383
- //# sourceMappingURL=ColorWheel.js.map
339
+ __decorateClass([
340
+ property({ type: Boolean, reflect: true })
341
+ ], ColorWheel.prototype, "disabled", 2);
342
+ __decorateClass([
343
+ property({ type: Boolean, reflect: true })
344
+ ], ColorWheel.prototype, "focused", 2);
345
+ __decorateClass([
346
+ query(".handle")
347
+ ], ColorWheel.prototype, "handle", 2);
348
+ __decorateClass([
349
+ property({ type: String })
350
+ ], ColorWheel.prototype, "label", 2);
351
+ __decorateClass([
352
+ property({ type: Number })
353
+ ], ColorWheel.prototype, "step", 2);
354
+ __decorateClass([
355
+ property({ type: Number })
356
+ ], ColorWheel.prototype, "value", 1);
357
+ __decorateClass([
358
+ property({ type: String })
359
+ ], ColorWheel.prototype, "color", 1);
360
+ __decorateClass([
361
+ query("input")
362
+ ], ColorWheel.prototype, "input", 2);
363
+ //# sourceMappingURL=ColorWheel.js.map