@spectrum-web-components/color-handle 0.3.12-devmode.0 → 0.4.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/package.json +4 -4
- package/sp-color-handle.js +1 -2
- package/sp-color-handle.js.map +1 -1
- package/src/ColorHandle.js +3 -66
- package/src/ColorHandle.js.map +1 -1
- package/src/color-handle.css.js +2 -4
- package/src/color-handle.css.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-color-handle.css.js +2 -4
- package/src/spectrum-color-handle.css.js.map +1 -1
- package/stories/color-handle.stories.js +3 -17
- package/stories/color-handle.stories.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -4
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/color-handle.test-vrt.js +1 -3
- package/test/color-handle.test-vrt.js.map +1 -1
- package/test/color-handle.test.js +5 -54
- package/test/color-handle.test.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/color-handle",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -57,8 +57,8 @@
|
|
57
57
|
"lit-html"
|
58
58
|
],
|
59
59
|
"dependencies": {
|
60
|
-
"@spectrum-web-components/base": "^0.
|
61
|
-
"@spectrum-web-components/color-loupe": "^0.
|
60
|
+
"@spectrum-web-components/base": "^0.7.0",
|
61
|
+
"@spectrum-web-components/color-loupe": "^0.4.0",
|
62
62
|
"tslib": "^2.0.0"
|
63
63
|
},
|
64
64
|
"devDependencies": {
|
@@ -70,5 +70,5 @@
|
|
70
70
|
"./sp-*.js",
|
71
71
|
"./**/*.dev.js"
|
72
72
|
],
|
73
|
-
"gitHead": "
|
73
|
+
"gitHead": "05c81318844160db3f8156144106e643507fef97"
|
74
74
|
}
|
package/sp-color-handle.js
CHANGED
package/sp-color-handle.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["sp-color-handle.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 { ColorHandle } from './src/ColorHandle.js';\n\ncustomElements.define('sp-color-handle', ColorHandle);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-color-handle': ColorHandle;\n }\n}\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,mDAEA,eAAe,OAAO,kBAAmB,CAAW",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/ColorHandle.js
CHANGED
@@ -1,71 +1,8 @@
|
|
1
|
-
var
|
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
|
-
SpectrumElement
|
15
|
-
} from "@spectrum-web-components/base";
|
16
|
-
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
17
|
-
import "@spectrum-web-components/color-loupe/sp-color-loupe.js";
|
18
|
-
import styles from "./color-handle.css.js";
|
19
|
-
export const extractHueAndSaturationRegExp = /^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/;
|
20
|
-
export const replaceHueAndSaturationRegExp = /(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/;
|
21
|
-
export const replaceHueRegExp = /(^hs[v|l]a?\()\d{1,3}/;
|
22
|
-
export class ColorHandle extends SpectrumElement {
|
23
|
-
constructor() {
|
24
|
-
super(...arguments);
|
25
|
-
this.disabled = false;
|
26
|
-
this.focused = false;
|
27
|
-
this.open = false;
|
28
|
-
this.color = "rgba(255, 0, 0, 0.5)";
|
29
|
-
}
|
30
|
-
static get styles() {
|
31
|
-
return [styles];
|
32
|
-
}
|
33
|
-
handlePointerdown(event) {
|
34
|
-
if (event.pointerType === "touch") {
|
35
|
-
this.open = true;
|
36
|
-
}
|
37
|
-
this.setPointerCapture(event.pointerId);
|
38
|
-
}
|
39
|
-
handlePointerup(event) {
|
40
|
-
this.open = false;
|
41
|
-
this.releasePointerCapture(event.pointerId);
|
42
|
-
}
|
43
|
-
render() {
|
44
|
-
return html`
|
1
|
+
var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var r=(p,e,s,o)=>{for(var t=o>1?void 0:o?d(e,s):e,n=p.length-1,l;n>=0;n--)(l=p[n])&&(t=(o?l(e,s,t):l(t))||t);return o&&t&&a(e,s,t),t};import{html as u,SpectrumElement as c}from"@spectrum-web-components/base";import{property as i}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/color-loupe/sp-color-loupe.js";import h from"./color-handle.css.js";export const extractHueAndSaturationRegExp=/^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/,replaceHueAndSaturationRegExp=/(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/,replaceHueRegExp=/(^hs[v|l]a?\()\d{1,3}/;export class ColorHandle extends c{constructor(){super(...arguments);this.disabled=!1;this.focused=!1;this.open=!1;this.color="rgba(255, 0, 0, 0.5)"}static get styles(){return[h]}handlePointerdown(e){e.pointerType==="touch"&&(this.open=!0),this.setPointerCapture(e.pointerId)}handlePointerup(e){this.open=!1,this.releasePointerCapture(e.pointerId)}render(){return u`
|
45
2
|
<div class="color" style="background-color: ${this.color}"></div>
|
46
3
|
<sp-color-loupe
|
47
4
|
color=${this.color}
|
48
|
-
?open=${this.open
|
5
|
+
?open=${this.open&&!this.disabled}
|
49
6
|
></sp-color-loupe>
|
50
|
-
|
51
|
-
}
|
52
|
-
firstUpdated(changed) {
|
53
|
-
super.firstUpdated(changed);
|
54
|
-
this.addEventListener("pointerdown", this.handlePointerdown);
|
55
|
-
this.addEventListener("pointerup", this.handlePointerup);
|
56
|
-
this.addEventListener("pointercancel", this.handlePointerup);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
__decorateClass([
|
60
|
-
property({ type: Boolean, reflect: true })
|
61
|
-
], ColorHandle.prototype, "disabled", 2);
|
62
|
-
__decorateClass([
|
63
|
-
property({ type: Boolean, reflect: true })
|
64
|
-
], ColorHandle.prototype, "focused", 2);
|
65
|
-
__decorateClass([
|
66
|
-
property({ type: Boolean, reflect: true })
|
67
|
-
], ColorHandle.prototype, "open", 2);
|
68
|
-
__decorateClass([
|
69
|
-
property({ type: String })
|
70
|
-
], ColorHandle.prototype, "color", 2);
|
7
|
+
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("pointerdown",this.handlePointerdown),this.addEventListener("pointerup",this.handlePointerup),this.addEventListener("pointercancel",this.handlePointerup)}}r([i({type:Boolean,reflect:!0})],ColorHandle.prototype,"disabled",2),r([i({type:Boolean,reflect:!0})],ColorHandle.prototype,"focused",2),r([i({type:Boolean,reflect:!0})],ColorHandle.prototype,"open",2),r([i({type:String})],ColorHandle.prototype,"color",2);
|
71
8
|
//# sourceMappingURL=ColorHandle.js.map
|
package/src/ColorHandle.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["ColorHandle.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 {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/color-loupe/sp-color-loupe.js';\nimport { HSL, HSLA, HSV, HSVA, RGB, RGBA, TinyColor } from '@ctrl/tinycolor';\nimport styles from './color-handle.css.js';\n\nexport type ColorValue =\n | string\n | number\n | TinyColor\n | HSVA\n | HSV\n | RGB\n | RGBA\n | HSL\n | HSLA;\n\nexport const extractHueAndSaturationRegExp =\n /^hs[v|l]a?\\s?\\((\\d{1,3}\\.?\\d*?),?\\s?(\\d{1,3})/;\nexport const replaceHueAndSaturationRegExp =\n /(^hs[v|l]a?\\s?\\()\\d{1,3}\\.?\\d*?(,?\\s?)\\d{1,3}/;\nexport const replaceHueRegExp = /(^hs[v|l]a?\\()\\d{1,3}/;\n\n/**\n * @element sp-color-handle\n */\nexport class ColorHandle extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String })\n public color = 'rgba(255, 0, 0, 0.5)';\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.open = true;\n }\n this.setPointerCapture(event.pointerId);\n }\n\n private handlePointerup(event: PointerEvent): void {\n this.open = false;\n this.releasePointerCapture(event.pointerId);\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"color\" style=\"background-color: ${this.color}\"></div>\n <sp-color-loupe\n color=${this.color}\n ?open=${this.open && !this.disabled}\n ></sp-color-loupe>\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.addEventListener('pointerdown', this.handlePointerdown);\n this.addEventListener('pointerup', this.handlePointerup);\n this.addEventListener('pointercancel', this.handlePointerup);\n }\n}\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": "wMAYA,0EAOA,2EAEA,+DAEA,qCAaO,YAAM,+BACT,gDACS,8BACT,gDACS,iBAAmB,wBAKzB,aAAM,mBAAoB,EAAgB,CAA1C,kCAMI,cAAW,GAGX,aAAU,GAGV,UAAO,GAGP,WAAQ,iCAdY,SAAyB,CAChD,MAAO,CAAC,CAAM,CAClB,CAcQ,kBAAkB,EAA2B,CACjD,AAAI,EAAM,cAAgB,SACtB,MAAK,KAAO,IAEhB,KAAK,kBAAkB,EAAM,SAAS,CAC1C,CAEQ,gBAAgB,EAA2B,CAC/C,KAAK,KAAO,GACZ,KAAK,sBAAsB,EAAM,SAAS,CAC9C,CAEmB,QAAyB,CACxC,MAAO;AAAA,0DAC2C,KAAK;AAAA;AAAA,wBAEvC,KAAK;AAAA,wBACL,KAAK,MAAQ,CAAC,KAAK;AAAA;AAAA,SAGvC,CAEmB,aAAa,EAA+B,CAC3D,MAAM,aAAa,CAAO,EAC1B,KAAK,iBAAiB,cAAe,KAAK,iBAAiB,EAC3D,KAAK,iBAAiB,YAAa,KAAK,eAAe,EACvD,KAAK,iBAAiB,gBAAiB,KAAK,eAAe,CAC/D,CACJ,CAvCW,GADP,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GACnC,AANJ,YAMI,wBAGA,GADP,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GACnC,AATJ,YASI,uBAGA,GADP,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GACnC,AAZJ,YAYI,oBAGA,GADP,AAAC,EAAS,CAAE,KAAM,MAAO,CAAC,GACnB,AAfJ,YAeI",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/color-handle.css.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import
|
2
|
-
const styles = css`
|
1
|
+
import{css as r}from"@spectrum-web-components/base";const o=r`
|
3
2
|
:host{--spectrum-colorhandle-checkerboard-size:var(
|
4
3
|
--spectrum-global-dimension-static-size-100,8px
|
5
4
|
);--spectrum-colorhandle-animation-duration:var(
|
@@ -83,6 +82,5 @@ var(--spectrum-global-dimension-size-200)
|
|
83
82
|
) var(
|
84
83
|
--spectrum-colorhandle-inner-shadow-color,var(--spectrum-colorhandle-outer-shadow-color)
|
85
84
|
)}@media (forced-colors:active){:host{--spectrum-colorhandle-inner-border-color-disabled:GrayText;--spectrum-colorhandle-fill-color-disabled:Canvas;--spectrum-colorhandle-inner-border-color:CanvasText}:host([disabled]){forced-color-adjust:none}}:host{touch-action:none}:host(:focus){outline:none}
|
86
|
-
`;
|
87
|
-
export default styles;
|
85
|
+
`;export default o;
|
88
86
|
//# sourceMappingURL=color-handle.css.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["color-handle.css.ts"],
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorhandle-checkerboard-size:var(\n--spectrum-global-dimension-static-size-100,8px\n);--spectrum-colorhandle-animation-duration:var(\n--spectrum-global-animation-duration-100,130ms\n);--spectrum-colorhandle-animation-easing:ease-in-out;--spectrum-colorhandle-hitarea-size:var(\n--spectrum-global-dimension-size-300\n)}:host(.focus-visible),:host([focused]){height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host(:focus-visible),:host([focused]){height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host{background-position:var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n) var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n),var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n) calc(var(--spectrum-colorhandle-checkerboard-size) + var(\n--spectrum-colorhandle-background-offset,\ncalc(-1 * var(--spectrum-global-dimension-static-size-25))\n)),calc(var(--spectrum-colorhandle-checkerboard-size) + var(\n--spectrum-colorhandle-background-offset,\ncalc(-1 * var(--spectrum-global-dimension-static-size-25))\n)) calc(-1 * var(--spectrum-colorhandle-checkerboard-size) + var(--spectrum-colorhandle-background-offset, calc(-1 * var(\n--spectrum-global-dimension-static-size-25\n)))),calc(-1 * var(--spectrum-colorhandle-checkerboard-size) + var(--spectrum-colorhandle-background-offset, calc(-1 * var(\n--spectrum-global-dimension-static-size-25\n)))) var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n);background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px);border-style:solid;border-width:var(\n--spectrum-colorhandle-inner-border-size,var(--spectrum-global-dimension-static-size-25)\n);box-sizing:border-box;display:block;height:var(\n--spectrum-colorhandle-size,var(--spectrum-global-dimension-size-200)\n);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1/2);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1/2);position:absolute;transition:width var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),height var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),border-width var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),margin-left var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),margin-top var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing);width:var(\n--spectrum-colorhandle-size,var(--spectrum-global-dimension-size-200)\n);z-index:1}:host,:host:after{border-radius:100%}:host:after{content:\"\";display:block;height:var(--spectrum-colorhandle-hitarea-size);left:calc(50% - var(--spectrum-colorhandle-hitarea-size)/2);position:absolute;top:calc(50% - var(--spectrum-colorhandle-hitarea-size)/2);width:var(--spectrum-colorhandle-hitarea-size)}:host([disabled]){pointer-events:none}.color{border-radius:100%;height:100%;width:100%}:host{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%);border-color:var(\n--spectrum-colorhandle-inner-border-color,var(--spectrum-global-color-static-white)\n);box-shadow:0 0 var(--spectrum-colorhandle-outer-shadow-blur,0) var(\n--spectrum-colorhandle-outer-shadow-spread,var(--spectrum-alias-border-size-thin)\n) var(--spectrum-colorhandle-outer-shadow-color,rgba(0,0,0,.42))}:host([disabled]){background:var(\n--spectrum-colorhandle-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n);border-color:var(\n--spectrum-colorhandle-inner-border-color-disabled,var(--spectrum-global-color-gray-400)\n);box-shadow:none}:host([disabled]) .color{display:none}.color{background-color:var(--spectrum-picked-color);box-shadow:inset 0 0 0 var(\n--spectrum-colorhandle-outer-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorhandle-inner-shadow-color,var(--spectrum-colorhandle-outer-shadow-color)\n)}@media (forced-colors:active){:host{--spectrum-colorhandle-inner-border-color-disabled:GrayText;--spectrum-colorhandle-fill-color-disabled:Canvas;--spectrum-colorhandle-inner-border-color:CanvasText}:host([disabled]){forced-color-adjust:none}}:host{touch-action:none}:host(:focus){outline:none}\n`;\nexport default styles;"],
|
5
|
-
"mappings": "AAWA
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqFf,cAAe",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export
|
1
|
+
export*from"./ColorHandle.js";
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["index.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\nexport * from './ColorHandle.js';\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import
|
2
|
-
const styles = css`
|
1
|
+
import{css as r}from"@spectrum-web-components/base";const o=r`
|
3
2
|
:host{--spectrum-colorhandle-checkerboard-size:var(
|
4
3
|
--spectrum-global-dimension-static-size-100,8px
|
5
4
|
);--spectrum-colorhandle-animation-duration:var(
|
@@ -83,6 +82,5 @@ var(--spectrum-global-dimension-size-200)
|
|
83
82
|
) var(
|
84
83
|
--spectrum-colorhandle-inner-shadow-color,var(--spectrum-colorhandle-outer-shadow-color)
|
85
84
|
)}@media (forced-colors:active){:host{--spectrum-colorhandle-inner-border-color-disabled:GrayText;--spectrum-colorhandle-fill-color-disabled:Canvas;--spectrum-colorhandle-inner-border-color:CanvasText}:host([disabled]){forced-color-adjust:none}}
|
86
|
-
`;
|
87
|
-
export default styles;
|
85
|
+
`;export default o;
|
88
86
|
//# sourceMappingURL=spectrum-color-handle.css.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["spectrum-color-handle.css.ts"],
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorhandle-checkerboard-size:var(\n--spectrum-global-dimension-static-size-100,8px\n);--spectrum-colorhandle-animation-duration:var(\n--spectrum-global-animation-duration-100,130ms\n);--spectrum-colorhandle-animation-easing:ease-in-out;--spectrum-colorhandle-hitarea-size:var(\n--spectrum-global-dimension-size-300\n)}:host(.focus-visible),:host([focused]){height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host(:focus-visible),:host([focused]){height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}:host{background-position:var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n) var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n),var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n) calc(var(--spectrum-colorhandle-checkerboard-size) + var(\n--spectrum-colorhandle-background-offset,\ncalc(-1 * var(--spectrum-global-dimension-static-size-25))\n)),calc(var(--spectrum-colorhandle-checkerboard-size) + var(\n--spectrum-colorhandle-background-offset,\ncalc(-1 * var(--spectrum-global-dimension-static-size-25))\n)) calc(-1 * var(--spectrum-colorhandle-checkerboard-size) + var(--spectrum-colorhandle-background-offset, calc(-1 * var(\n--spectrum-global-dimension-static-size-25\n)))),calc(-1 * var(--spectrum-colorhandle-checkerboard-size) + var(--spectrum-colorhandle-background-offset, calc(-1 * var(\n--spectrum-global-dimension-static-size-25\n)))) var(\n--spectrum-colorhandle-background-offset,calc(-1 * var(--spectrum-global-dimension-static-size-25))\n);background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px);border-style:solid;border-width:var(\n--spectrum-colorhandle-inner-border-size,var(--spectrum-global-dimension-static-size-25)\n);box-sizing:border-box;display:block;height:var(\n--spectrum-colorhandle-size,var(--spectrum-global-dimension-size-200)\n);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1/2);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1/2);position:absolute;transition:width var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),height var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),border-width var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),margin-left var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing),margin-top var(--spectrum-colorhandle-animation-duration) var(--spectrum-colorhandle-animation-easing);width:var(\n--spectrum-colorhandle-size,var(--spectrum-global-dimension-size-200)\n);z-index:1}:host,:host:after{border-radius:100%}:host:after{content:\"\";display:block;height:var(--spectrum-colorhandle-hitarea-size);left:calc(50% - var(--spectrum-colorhandle-hitarea-size)/2);position:absolute;top:calc(50% - var(--spectrum-colorhandle-hitarea-size)/2);width:var(--spectrum-colorhandle-hitarea-size)}:host([disabled]){pointer-events:none}.color{border-radius:100%;height:100%;width:100%}:host{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%);border-color:var(\n--spectrum-colorhandle-inner-border-color,var(--spectrum-global-color-static-white)\n);box-shadow:0 0 var(--spectrum-colorhandle-outer-shadow-blur,0) var(\n--spectrum-colorhandle-outer-shadow-spread,var(--spectrum-alias-border-size-thin)\n) var(--spectrum-colorhandle-outer-shadow-color,rgba(0,0,0,.42))}:host([disabled]){background:var(\n--spectrum-colorhandle-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n);border-color:var(\n--spectrum-colorhandle-inner-border-color-disabled,var(--spectrum-global-color-gray-400)\n);box-shadow:none}:host([disabled]) .color{display:none}.color{background-color:var(--spectrum-picked-color);box-shadow:inset 0 0 0 var(\n--spectrum-colorhandle-outer-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorhandle-inner-shadow-color,var(--spectrum-colorhandle-outer-shadow-color)\n)}@media (forced-colors:active){:host{--spectrum-colorhandle-inner-border-color-disabled:GrayText;--spectrum-colorhandle-fill-color-disabled:Canvas;--spectrum-colorhandle-inner-border-color:CanvasText}:host([disabled]){forced-color-adjust:none}}\n`;\nexport default styles;"],
|
5
|
-
"mappings": "AAWA
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqFf,cAAe",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,30 +1,16 @@
|
|
1
|
-
import
|
2
|
-
import "@spectrum-web-components/color-handle/sp-color-handle.js";
|
3
|
-
export default {
|
4
|
-
title: "Color/Handle",
|
5
|
-
component: "sp-color-handle"
|
6
|
-
};
|
7
|
-
export const Default = () => {
|
8
|
-
return html`
|
1
|
+
import{html as e}from"@spectrum-web-components/base";import"@spectrum-web-components/color-handle/sp-color-handle.js";export default{title:"Color/Handle",component:"sp-color-handle"};export const Default=()=>e`
|
9
2
|
<sp-color-handle
|
10
3
|
style="left: 50%; top: 50%; transform: translate(-50%, -50%);"
|
11
4
|
></sp-color-handle>
|
12
|
-
|
13
|
-
};
|
14
|
-
export const disabled = () => {
|
15
|
-
return html`
|
5
|
+
`,disabled=()=>e`
|
16
6
|
<sp-color-handle
|
17
7
|
disabled
|
18
8
|
style="left: 50%; top: 50%; transform: translate(-50%, -50%);"
|
19
9
|
></sp-color-handle>
|
20
|
-
|
21
|
-
};
|
22
|
-
export const open = () => {
|
23
|
-
return html`
|
10
|
+
`,open=()=>e`
|
24
11
|
<sp-color-handle
|
25
12
|
open
|
26
13
|
style="left: 50%; top: 50%; transform: translate(-50%, -50%);"
|
27
14
|
></sp-color-handle>
|
28
15
|
`;
|
29
|
-
};
|
30
16
|
//# sourceMappingURL=color-handle.stories.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["color-handle.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\n\nexport default {\n title: 'Color/Handle',\n component: 'sp-color-handle',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-color-handle\n style=\"left: 50%; top: 50%; transform: translate(-50%, -50%);\"\n ></sp-color-handle>\n `;\n};\n\nexport const disabled = (): TemplateResult => {\n return html`\n <sp-color-handle\n disabled\n style=\"left: 50%; top: 50%; transform: translate(-50%, -50%);\"\n ></sp-color-handle>\n `;\n};\n\nexport const open = (): TemplateResult => {\n return html`\n <sp-color-handle\n open\n style=\"left: 50%; top: 50%; transform: translate(-50%, -50%);\"\n ></sp-color-handle>\n `;\n};\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,qDAEA,iEAEA,cAAe,CACX,MAAO,eACP,UAAW,iBACf,EAEO,YAAM,SAAU,IACZ;AAAA;AAAA;AAAA;AAAA,MAOE,SAAW,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,MAQE,KAAO,IACT;AAAA;AAAA;AAAA;AAAA;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,7 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import { html } from "lit";
|
3
|
-
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
4
|
-
measureFixtureCreation(html`
|
1
|
+
import"@spectrum-web-components/color-handle/sp-color-handle.js";import{html as o}from"lit";import{measureFixtureCreation as r}from"../../../../test/benchmark/helpers.js";r(o`
|
5
2
|
<sp-color-handle open></sp-color-handle>
|
6
3
|
`);
|
7
4
|
//# sourceMappingURL=basic-test.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["basic-test.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 '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-color-handle open></sp-color-handle>\n`);\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,iEACA,2BACA,+EAEA,EAAuB;AAAA;AAAA,CAEtB",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,4 +1,2 @@
|
|
1
|
-
import
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
3
|
-
regressVisuals("ColorHandleStories", stories);
|
1
|
+
import*as r from"../stories/color-handle.stories.js";import{regressVisuals as o}from"../../../test/visual/test.js";o("ColorHandleStories",r);
|
4
2
|
//# sourceMappingURL=color-handle.test-vrt.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["color-handle.test-vrt.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 * as stories from '../stories/color-handle.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ColorHandleStories', stories);\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,qDACA,8DAEA,EAAe,qBAAsB,CAAO",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,59 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import "@spectrum-web-components/color-handle/sp-color-handle.js";
|
3
|
-
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
4
|
-
describe("ColorHandle", () => {
|
5
|
-
testForLitDevWarnings(async () => await fixture(html`
|
1
|
+
import{elementUpdated as o,expect as t,fixture as n,html as a}from"@open-wc/testing";import"@spectrum-web-components/color-handle/sp-color-handle.js";import{testForLitDevWarnings as r}from"../../../test/testing-helpers.js";describe("ColorHandle",()=>{r(async()=>await n(a`
|
6
2
|
<sp-color-handle></sp-color-handle>
|
7
|
-
`))
|
8
|
-
it("loads default color-handle accessibly", async () => {
|
9
|
-
const el = await fixture(html`
|
3
|
+
`)),it("loads default color-handle accessibly",async()=>{const e=await n(a`
|
10
4
|
<sp-color-handle></sp-color-handle>
|
11
|
-
`);
|
12
|
-
await elementUpdated(el);
|
13
|
-
await expect(el).to.be.accessible();
|
14
|
-
});
|
15
|
-
it("loads [open] color-handle accessibly", async () => {
|
16
|
-
const el = await fixture(html`
|
5
|
+
`);await o(e),await t(e).to.be.accessible()}),it("loads [open] color-handle accessibly",async()=>{const e=await n(a`
|
17
6
|
<sp-color-handle open></sp-color-handle>
|
18
|
-
`);
|
19
|
-
await elementUpdated(el);
|
20
|
-
await expect(el).to.be.accessible();
|
21
|
-
});
|
22
|
-
it("opens/closes on pointerdown/up/cancel", async () => {
|
23
|
-
const el = await fixture(html`
|
7
|
+
`);await o(e),await t(e).to.be.accessible()}),it("opens/closes on pointerdown/up/cancel",async()=>{const e=await n(a`
|
24
8
|
<sp-color-handle></sp-color-handle>
|
25
|
-
`);
|
26
|
-
await elementUpdated(el);
|
27
|
-
el.setPointerCapture = () => {
|
28
|
-
return;
|
29
|
-
};
|
30
|
-
el.releasePointerCapture = () => {
|
31
|
-
return;
|
32
|
-
};
|
33
|
-
el.dispatchEvent(new PointerEvent("pointerdown", {
|
34
|
-
pointerId: 1,
|
35
|
-
pointerType: "touch"
|
36
|
-
}));
|
37
|
-
await elementUpdated(el);
|
38
|
-
expect(el.open).to.be.true;
|
39
|
-
el.dispatchEvent(new PointerEvent("pointerup", {
|
40
|
-
pointerId: 1,
|
41
|
-
pointerType: "touch"
|
42
|
-
}));
|
43
|
-
await elementUpdated(el);
|
44
|
-
expect(el.open).to.be.false;
|
45
|
-
el.dispatchEvent(new PointerEvent("pointerdown", {
|
46
|
-
pointerId: 1,
|
47
|
-
pointerType: "touch"
|
48
|
-
}));
|
49
|
-
await elementUpdated(el);
|
50
|
-
expect(el.open).to.be.true;
|
51
|
-
el.dispatchEvent(new PointerEvent("pointercancel", {
|
52
|
-
pointerId: 1,
|
53
|
-
pointerType: "touch"
|
54
|
-
}));
|
55
|
-
await elementUpdated(el);
|
56
|
-
expect(el.open).to.be.false;
|
57
|
-
});
|
58
|
-
});
|
9
|
+
`);await o(e),e.setPointerCapture=()=>{},e.releasePointerCapture=()=>{},e.dispatchEvent(new PointerEvent("pointerdown",{pointerId:1,pointerType:"touch"})),await o(e),t(e.open).to.be.true,e.dispatchEvent(new PointerEvent("pointerup",{pointerId:1,pointerType:"touch"})),await o(e),t(e.open).to.be.false,e.dispatchEvent(new PointerEvent("pointerdown",{pointerId:1,pointerType:"touch"})),await o(e),t(e.open).to.be.true,e.dispatchEvent(new PointerEvent("pointercancel",{pointerId:1,pointerType:"touch"})),await o(e),t(e.open).to.be.false})});
|
59
10
|
//# sourceMappingURL=color-handle.test.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["color-handle.test.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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport { ColorHandle } from '@spectrum-web-components/color-handle';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('ColorHandle', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<ColorHandle>(\n html`\n <sp-color-handle></sp-color-handle>\n `\n )\n );\n it('loads default color-handle accessibly', async () => {\n const el = await fixture<ColorHandle>(\n html`\n <sp-color-handle></sp-color-handle>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads [open] color-handle accessibly', async () => {\n const el = await fixture<ColorHandle>(\n html`\n <sp-color-handle open></sp-color-handle>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('opens/closes on pointerdown/up/cancel', async () => {\n const el = await fixture<ColorHandle>(\n html`\n <sp-color-handle></sp-color-handle>\n `\n );\n\n await elementUpdated(el);\n el.setPointerCapture = () => {\n return;\n };\n el.releasePointerCapture = () => {\n return;\n };\n\n el.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n pointerType: 'touch',\n })\n );\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n\n el.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n pointerType: 'touch',\n })\n );\n\n await elementUpdated(el);\n\n expect(el.open).to.be.false;\n\n el.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n pointerType: 'touch',\n })\n );\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n\n el.dispatchEvent(\n new PointerEvent('pointercancel', {\n pointerId: 1,\n pointerType: 'touch',\n })\n );\n\n await elementUpdated(el);\n\n expect(el.open).to.be.false;\n });\n});\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,qFAEA,iEAEA,yEAEA,SAAS,cAAe,IAAM,CAC1B,EACI,SACI,KAAM,GACF;AAAA;AAAA,iBAGJ,CACR,EACA,GAAG,wCAAyC,SAAY,CACpD,KAAM,GAAK,KAAM,GACb;AAAA;AAAA,aAGJ,EAEA,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,uCAAwC,SAAY,CACnD,KAAM,GAAK,KAAM,GACb;AAAA;AAAA,aAGJ,EAEA,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,wCAAyC,SAAY,CACpD,KAAM,GAAK,KAAM,GACb;AAAA;AAAA,aAGJ,EAEA,KAAM,GAAe,CAAE,EACvB,EAAG,kBAAoB,IAAM,CAE7B,EACA,EAAG,sBAAwB,IAAM,CAEjC,EAEA,EAAG,cACC,GAAI,cAAa,cAAe,CAC5B,UAAW,EACX,YAAa,OACjB,CAAC,CACL,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KAEtB,EAAG,cACC,GAAI,cAAa,YAAa,CAC1B,UAAW,EACX,YAAa,OACjB,CAAC,CACL,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,MAEtB,EAAG,cACC,GAAI,cAAa,cAAe,CAC5B,UAAW,EACX,YAAa,OACjB,CAAC,CACL,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KAEtB,EAAG,cACC,GAAI,cAAa,gBAAiB,CAC9B,UAAW,EACX,YAAa,OACjB,CAAC,CACL,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KAC1B,CAAC,CACL,CAAC",
|
6
6
|
"names": []
|
7
7
|
}
|